Skip to content
Snippets Groups Projects
Commit df7cd2ca authored by Martin Bergemann's avatar Martin Bergemann :speech_balloon:
Browse files

Merge branch 'fixes' into 'master'

Create Django sites on deployment, add more docs

See merge request !50
parents ed73a8c1 d127ed4e
No related branches found
No related tags found
1 merge request!50Create Django sites on deployment, add more docs
Pipeline #22066 passed
......@@ -12,7 +12,7 @@ lint:
- python3 -m pip install .[test]
- mkdir .mypy_cache
script:
- mypy --install-types --non-interactive
# - mypy --install-types --non-interactive
- black --check -t py310 src
pages:
......
......@@ -14,3 +14,6 @@ python manage.py createsuperuser \
--noinput \
--username freva-admin \
--email $DJANGO_SUPERUSER_EMAIL || echo 0
# python manage.py shell -c 'Site.objects.all().delete()'
python manage.py shell -c \
'from django.contrib.sites.models import Site; Site.objects.create(id=1, domain="example.com", name="example.com").save()' || echo 0
......@@ -77,3 +77,88 @@ and terms of usage. Those statements can be added as flat-pages in the django
*admin* panel. All flat-pages starting with the url **/legal** for example
`/legal/privacy/` will be added as a link to the footer of home page. Examples
of the content of such flat-pages can be found in the [Appendix III](LegalNotes.html).
## Amending the already existing containers
Sometimes it might by helpful to change existing containers, such as adding
extra mount points. One way of doing so is
[adjusting the playbook](Configure.html#advanced-adjusting-the-playbook) *before*
deployment. If already existing containers should be amended a different
strategy can be applied:
- Get the container ID of the service that should be changed:
```console
docker ps -aqf "name=<project>-<service>"
```
- Commit this ID to a new name (project-service-old)
```console
docker commit <container_id> <new_container_name>
```
- Stop the service:
```console
systemclt stop <project>-<service>
```
or
```console
docker stop <project>-<service>
```
- The deployment wrapper creating the containers will log all commands that
have been used to create containers. To get the container creation command that
was used check the content of the following file:
```console
cat /root/.freva_container_commands/<project>-<service>.run
```
- Replace the container name in the shown command (`<project>-<service>`) by
(`<new_container_name>`) and add the part that should be amended, like a new
volume or environment variable. Also replace the `-t image` part by
`<new_container_name>`. Then run this command.
- Remove the old container:
```console
docker rm <project>-<service>
```
- Rename the new container name (`<new_container_name>`) to the old name:
```console
docker rename <new_container_name> <project>-<service>
```
- Restart the service: `systemctl restart <project>-<service>`
Below you can find a real example:
```console
$: docker ps -aqf "name=clex-web"
e907fb462deb
$: docker commit e907fb462deb clex-web-old
sha256:b5c71c91e30e6424099218af6b83dbd3b7b8e05eb3bdf1404e4716dcc4e3e86d
$: systemctl stop clex-web
$: cat /root/.freva_container_commands/clex-web.run
container clex-web created at 2022-09-16 09:19:28.868972 using command:
/bin/docker run -d -p 8000:8000
-v /work/freva:/work/freva:ro -v /work/freva/share/slurm:/work/freva/share/slurm:ro
-v /opt/freva/clex/web_service/static:/opt/freva_web/static:z
-v /work/freva/share/work:/work/freva/share/work:ro
-e EVALUATION_SYSTEM_CONFIG_FILE=/work/freva/evaluation_system.conf
--name freva-dev-web -t registry.gitlab.dkrz.de/freva/freva_web/freva_web:main
$: /bin/docker run -d -p 8000:8000 \
-v /work/freva:/work/freva:ro -v /work/freva/share/slurm:/work/freva/share/slurm:ro \
-v /opt/freva/clex/web_service/static:/opt/freva_web/static:z \
-v /opt/freva/clex/web_service/static:/opt/freva_web/static:z \
-v /work/freva/share/work:/work/freva/share/work:ro \
-v /work/new_mount:/work/new_mount:ro \
-e EVALUATION_SYSTEM_CONFIG_FILE=/work/freva/evaluation_system.conf \
--name clex-web-old clex-web-old
991e704b066d3a608504091d243f56cbac67100f54a7a5aeca0c352bbc4f4696
$: docker rm clex-web
clex-web
$: docker rename clex-web-old clex-web
$: systemctl restart clex-web
```
......@@ -2,10 +2,12 @@
This appendix gives examples of flat pages containing privacy and terms of
conditions. Such statements should be added as flat-pages in the [django admin
panel](AfterDeployment.html#the-web-ui-admin-panel). Any flat-page url starting with `/legal/` will
be added as a link to the footer. For example `/legal/privacy/` which could
be a flat-page for a privacy statement. Below you'll find examples of a
privacy statement and terms of use.
panel](AfterDeployment.html#the-web-ui-admin-panel).
[Flat-pages](https://docs.djangoproject.com/en/4.1/ref/contrib/flatpages/)
additional notes that are displayed on the web site. Any flat-page url
starting with `/legal/` will be added as a link to the footer.
For example `/legal/privacy/` which could be a flat-page for a privacy
statement. Below you'll find examples of a privacy statement and terms of use.
### Privacy statement
......
# Appendix I: Usage of the text user interface
# Usage of the text user interface
We have create a simple text user interface (tui) that helps you setting up a
Freva instance at your institution. At this stage the documentation assumes that
you have installed the necessary server infrastructure and pre-requisites.
......@@ -133,7 +133,7 @@ essential setup steps:
[See also django ldap tls config](https://django-auth-ldap.readthedocs.io/en/latest/authentication.html#notes)
16. Set the user group name that is allowed to logon to the web ui.
17. Set the ldap user base filters. See also the
[djanog ldap authentication for user](https://django-auth-ldap.readthedocs.io/en/latest/users.html)
[django ldap authentication for user](https://django-auth-ldap.readthedocs.io/en/latest/users.html)
18. 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)
19. Set the distinguished name of the ldap user. This setting is used to make
......@@ -177,10 +177,12 @@ The httpd configuration for the reverse proxy will be saved
`/opt/freva/<project_name>/web_service/`.
During the deployment process of the web ui you will be ask your login
credentials for the smtp email server. The credentials are needed to connect
to the email server and send emails. Your credentials won't be saved anywhere
on disk but securely stored in the vault service that gets deployed when setting
up the database.
credentials for the smtp email server. An email server is necessary because
the web backend has a email sending functionality. This functionality makes
it easy for users to communicate and share results with other users.
Login credentials are needed to connect to the email server and send emails.
Your credentials won't be saved anywhere on disk but securely stored in the
vault service that gets deployed when setting up the database.
......
......@@ -19,6 +19,9 @@ ignore_missing_imports = True
[mypy-yaml.*]
ignore_missing_imports = True
[mypy-numpy.*]
ignore_missing_imports = True
[mypy-pandas.*]
# This stubs project exists but it's third-party and I'm not sure how reliable it would
# be. Requires further investigation.
......
__version__ = "2208.0.7"
__version__ = "2208.0.8"
AVAILABLE_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
AVAILABLE_CONDA_ARCHS = [
"Linux-x86_64",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment