diff --git a/assets/config/inventory.toml b/assets/config/inventory.toml index 9c44998d123448b2765a84b9c81c814d9e9d1bb1..a00512da776982e981021e19fd1ea8fcfd5f15ca 100644 --- a/assets/config/inventory.toml +++ b/assets/config/inventory.toml @@ -158,10 +158,13 @@ border_color = "#6c2e1f" hover_color = "#d0513a" ## The about us text is a small blurb about freva within the project about_us_text = "" +## Set the path to the institution logo, this should be the path to the logo +## as seen by the target system +institution_logo = "/path/to/logo/on/target/machine" ## Set a list of email addresses for contacts -contacts = "" +contacts = [""] ## Now set postal address -address = "Project name, German Climate Computing Centre (DKRZ), Bundesstr. 45a, 20146 Hamburg, Germany." +imprint = "Project name, German Climate Computing Centre (DKRZ), Bundesstr. 45a, 20146 Hamburg, Germany." ## Here you can set a lengthy project description. ## You can also set a path to a filename that contains the information. ## Instead of text you can set a path to a file containing the text, like a html file. diff --git a/assets/playbooks/web-server-playbook.yml b/assets/playbooks/web-server-playbook.yml index 85dba531034423fe3fbdca58ac8e1b1ec215e4db..64e6ea30dbd52613db12a2dd9d8b7b322ffdc1ef 100644 --- a/assets/playbooks/web-server-playbook.yml +++ b/assets/playbooks/web-server-playbook.yml @@ -36,20 +36,19 @@ - docker_web_cmd: > -p 8000:8000 -v {{ core_root_dir }}:{{ core_root_dir }}:ro - -v {{ core_preview_path }}:/opt/freva_web/static/preview:ro -v {{ core_scheduler_output_dir}}:{{ core_scheduler_output_dir }}:ro -v /opt/freva/{{project_name}}/web_service/static:/opt/freva_web/static:z + -v {{core_base_dir_location}}:{{core_base_dir_location}}:ro -e EVALUATION_SYSTEM_CONFIG_FILE={{core_root_dir}}/freva/evaluation_system.conf --name {{web_name}} - -t registry.gitlab.dkrz.de/freva/freva_web/freva_web:main + -t registry.gitlab.dkrz.de/freva/freva_web/freva_web:update_urls - docker_apache_cmd: > -v /opt/freva/{{project_name}}/web_service/freva_web.conf:/usr/local/apache2/conf/httpd.conf:z -v /opt/freva/{{project_name}}/web_service/server-cert.crt:/etc/ssl/certs/server-cert.crt:z -v /opt/freva/{{project_name}}/web_service/server-key.key:/etc/ssl/private/server-key.key:z -v /opt/freva/{{project_name}}/web_service/cacert.pem:/etc/ssl/certs/cacert.pem:z - -v {{ core_scheduler_output_dir }}:{{ core_scheduler_output_dir }}:ro -v /opt/freva/{{project_name}}/web_service/static:/srv/static:z - -v {{ core_preview_path }}:/srv/preview:ro + -v {{ core_preview_path }}:/srv/static/preview:ro -e SCHEDULER_DIR={{core_scheduler_output_dir}} -e FREVA_HOST={{web_server_name}} -p 80:80 -p 443:443 httpd:latest - redis_name: "{{ project_name }}-redis" diff --git a/docs/TuiHowto.md b/docs/TuiHowto.md index b9cf550f155e4a7bb96f06a2ffe4c6da8e825a44..c5a14264a344fde58f3b05f50574178c3520563f 100644 --- a/docs/TuiHowto.md +++ b/docs/TuiHowto.md @@ -61,7 +61,9 @@ essential setup steps: 6. Set the preview path mentioned in the [basic configuration section](Folders.html#configuring-the-evaluation-system-section). 7. Set the workload manager system from the dropdown menu. -8. Set the output directory of the stdout of the workload manger. +8. Set the output directory of the stdout of the workload manger. Note: + the workload manager type, like pbs, will be automatically appended to this + directory. 9. Set the user names (comma separated) of the Freva admins of this project. 10. If you have a special user group for Freva admins you can set this this key here. This will cause the creation of folders with permissions suitable @@ -110,32 +112,41 @@ essential setup steps: 3. Main html color scheme. 4. Html color for borders. 5. Html color for hover mode boxes. -6. A short text about the Freva admin team/group. This text will go to the +6. Set the path to the institution logo. This should be the path to the logo + on the machine that runs the web. +7. A short text about the Freva admin team/group. This text will go to the header of the web page. -7. Contact email address of the admin(s). -8. Address of the institute, will be appearing in the footer of the website. -9. Detailed overview over the project, this text will go into the left central +8. Contact email address of the admin(s). +9. Address of the institute, will be appearing in the footer of the website. +10. Detailed overview over the project, this text will go into the left central box in the Freva main page. It should describe the purpose of this project -10. The header for the detailed overview mentioned in 9. -11. Host name(s) - usually HPC login node(s) - the web backend code submits +11. The header for the detailed overview mentioned in 9. +12. Host name(s) - usually HPC login node(s) - the web backend code submits plugin jobs from. The backend will logon to this host name and submit a plugin job. -12. String of ldap server uri(s) (comma separated). The ldap server uris are +13. String of ldap server uri(s) (comma separated). The ldap server uris are used to make authentication requests via the web side. -13. Tick this box (`<SPACE>`) to enable TLS encrypted connection from the django +14. Tick this box (`<SPACE>`) to enable TLS encrypted connection from the django web application to the ldap server. [See also django ldap tls config](https://django-auth-ldap.readthedocs.io/en/latest/authentication.html#notes) -14. Set the user group name that is allowed to logon to the web ui. -15. Set the ldap user base filters. See also the +15. Set the user group name that is allowed to logon to the web ui. +16. Set the ldap user base filters. See also the [djanog ldap authentication for user](https://django-auth-ldap.readthedocs.io/en/latest/users.html) -16. Set the ldap group base filters. See also the +17. Set the ldap group base filters. See also the [django ldap authentication for groups](https://django-auth-ldap.readthedocs.io/en/latest/groups.html#finding-groups) -17. Set the distinguished name of the ldap user. This setting is used to make +18. Set the distinguished name of the ldap user. This setting is used to make queries to the ldap server. TODO: [this might not be necessary](https://django-auth-ldap.readthedocs.io/en/latest/authentication.html#search-bind) -18. Set the password for the ldap user. -19. Set the path to the `python3.4+` binary, this should be set if the python +19. Set the password for the ldap user. +20. Set the ldap search key for finding the first name entries +21. Set the ldap search key for finding the last name entries +22. Set the ldap search key for finding email addresses +23. Set the type of ldap object class name +24. Set the type of ldap group type (nested or posix). Note: This is a + dropdown menu, hit enter to select the options. +25. Set the evaluation_system ldap class that handles the ldap connections +26. Set the path to the `python3.4+` binary, this should be set if the python binary is not part of the `$PATH` variable. -20. Set the login user name for the remote machine. +27. Set the login user name for the remote machine. ### Notes on the web ui setup Currently there are ties between the core running on the HPC machine and diff --git a/src/freva_deployment/deploy.py b/src/freva_deployment/deploy.py index ccebdc53968f25ee69c7fdbc77a611c0f5f30917..4dc75332e91bde0ac4e47ffa08038a548740c044 100644 --- a/src/freva_deployment/deploy.py +++ b/src/freva_deployment/deploy.py @@ -216,7 +216,7 @@ class DeployFactory: if web_host == "127.0.0.1": web_host = "localhost" self.cfg["web"]["config"]["host"] = web_host - _webserver_items["INSTITUTION_LOGO"] = "/path/to/your/logo" + # _webserver_items["INSTITUTION_LOGO"] = "/path/to/your/logo" trusted_origin = urlparse(server_name) if trusted_origin.scheme: _webserver_items["CSRF_TRUSTED_ORIGINS"] = [ @@ -235,7 +235,7 @@ class DeployFactory: except (FileNotFoundError, IOError, KeyError): pass try: - _webserver_items["IMPRINT"] = _webserver_items["ADDRESS"].split(",") + _webserver_items["IMPRINT"] = _webserver_items["IMPRINT"].split(",") except AttributeError: pass with self.web_conf_file.open("w") as f_obj: diff --git a/src/freva_deployment/ui/deployment_tui/deploy_forms.py b/src/freva_deployment/ui/deployment_tui/deploy_forms.py index dcb40500d378179fc213adf14ab84da65f0c57b3..55a17385ae2561d0e040fadc6d9b89b46929500b 100644 --- a/src/freva_deployment/ui/deployment_tui/deploy_forms.py +++ b/src/freva_deployment/ui/deployment_tui/deploy_forms.py @@ -228,7 +228,7 @@ class WebScreen(BaseForm): def _add_widgets(self) -> None: """Add widgets to the screen.""" - self.list_keys = "contacts", "address", "scheduler_host" + self.list_keys = "contacts", "imprint", "scheduler_host" cfg = self.get_config(self.step) for key in self.list_keys: if key in cfg and isinstance(cfg[key], str): @@ -276,11 +276,21 @@ class WebScreen(BaseForm): ), True, ), + institution_logo=( + self.add_widget_intelligent( + npyscreen.TitleText, + name=f"{self.num}Path to the institution logo.", + value=cfg.get( + "institution_logo", "/path/to/logo/on/target/machine" + ), + ), + True, + ), about_us_text=( self.add_widget_intelligent( npyscreen.TitleText, name=f"{self.num}About us text - short blurb about Freva:", - value=cfg.get("about_us_test", "Testing"), + value=cfg.get("about_us_text", "Testing"), ), True, ), @@ -288,11 +298,13 @@ class WebScreen(BaseForm): self.add_widget_intelligent( npyscreen.TitleText, name=f"{self.num}Contact email address:", - value=cfg.get("contatcs", "admin@freva.dkrz.de"), + value=",".join( + cast(List[str], cfg.get("contacts", "admin@freva.dkrz.de")) + ), ), True, ), - address=( + imprint=( self.add_widget_intelligent( npyscreen.TitleText, name=f"{self.num}Institution address - comma separated:", @@ -300,7 +312,7 @@ class WebScreen(BaseForm): cast( List[str], cfg.get( - "address", + "imprint", [ "freva", "German Climate Computing Centre (DKRZ)",