Commit a8edddc8 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-s/3698-persistent-web2py-password' into 'dev'

Feature s/3698 persistent web2py password

Closes #3698

See merge request !548
parents c6140f53 633da063
Pipeline #105782 passed with stages
in 6 minutes and 19 seconds
......@@ -177,7 +177,7 @@ forget to make a backup of any file you replace.)
## First configuration and first launch
- Set the SSL certificates (see above)
- Change the mysql root password in `docker-compose.yml`
- Change the mysql root password and the web2py admin password in `docker-compose.yml`
- Change the mysql vidjil password in `mysql/create_db.sql` and sets it also in `DB_ADDRESS` in `vidjil-server/conf/defs.py`
- Comment backup/reporter services in `docker-compose.yml`
......@@ -309,6 +309,20 @@ cd /usr/share/vidjil/server
sh backup.sh vidjil /mnt/backup >> /var/log/cron.log 2>&1
```
## I can't connect to the web2py administration site
The URL to this site is https://mywebsite/admin/default/.
The password should be given in the `docker-compose.yml` file.
Otherwise a random password is generated. You can still modify
this password by connecting to the server (in the `uwsgi` container).
Go in the the `/usr/share/vidjil/server/web2py` directory and then
launch Python.
```python
from gluon.main import save_password
save_password(PASSWORD, 443)
```
This password will not persist when the container will be restarted.
For a persistent password, please use the environment variable.
# Docker -- Updating a Docker installation
## Before the update
......
......@@ -3,6 +3,9 @@ This CHANGELOG concerns the Docker images of vidjil.
We publish here notes to help to update these images.
See <http://www.vidjil.org/doc/server>
vidjil/server:2019-11-27-XXXXXXX
- The web2py password is now provided through an environment
variable in the docker-compos.yml file.
vidjil/server:2018-10-19-3a690203
vidjil/client:2018-10-18-f959661a
- Tag initialization while creating the database
......
......@@ -9,6 +9,8 @@ services:
- /opt/vidjil/mysql:/var/lib/mysql
uwsgi:
image: vidjil/server:latest
environment:
- WEB2PY_ADMIN_PASSWORD=''
command: bash /entrypoints/uwsgi-entrypoint.sh
volumes_from:
- fuse
......@@ -30,6 +32,7 @@ services:
- /opt/vidjil/log/uwsgi:/var/log/uwsgi
- /opt/vidjil/backup:/mnt/backup
- ./vidjil-server/conf:/etc/vidjil
- ./vidjil-server/scripts:/entrypoints
- ../germline:/usr/share/vidjil/germline
nginx:
image: vidjil/client:latest
......
......@@ -44,6 +44,6 @@ copy ./scripts/fuse-entrypoint.sh /entrypoints/fuse-entrypoint.sh
run mkdir /usr/share/vidjil/server/web2py/applications/vidjil/databases && touch /usr/share/vidjil/server/web2py/applications/vidjil/databases/sql.log
run mkdir /var/vidjil
run touch /var/vidjil/vidjil.log && touch /var/vidjil/vidjil-debug.log
run cd /usr/share/vidjil/server/web2py && python -c "from gluon.main import save_password; save_password('default',443)"
run PASSWORD=`openssl rand -base64 10` && cd /usr/share/vidjil/server/web2py && python -c "from gluon.main import save_password; save_password('${PASSWORD}',443)"
run chown -R www-data:www-data /usr/share/vidjil
run useradd -ms /bin/bash vidjil && usermod -aG sudo vidjil
......@@ -8,4 +8,10 @@ else
fi
chown -R $user /var/vidjil/vidjil*
chown -R $user /usr/share/vidjil/server/web2py/applications/vidjil/databases
if [[ -n "$WEB2PY_ADMIN_PASSWORD" ]]; then
cd /usr/share/vidjil/server/web2py
python -c "from gluon.main import save_password; save_password('${WEB2PY_ADMIN_PASSWORD}', 443)"
fi
/usr/local/bin/gosu $user /usr/bin/uwsgi --ini /etc/uwsgi/apps-enabled/web2py.ini
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment