The SECRET_KEY env var is generated and added to local_settings.py or if set then that value is added to local_settings.py.
If it was generated by the container it should not be replaced when REGENERATE_SETTINGS=True unless it is set to something different in the docker-compose.yml file or docker run command.
Current Behavior
The SECRET_KEY env var is never added to the local_settings.py file and I can't tell if it is even generated.
Steps to Reproduce
docker-compose up -d with SECRET_KEY env var set
check website
see debug banner (pasted below as a screenshot)
Environment
OS: Ubuntu Server 20.04.3 LTS (Focal Fossa)
CPU architecture: x86_64
How docker service was installed: from the distro repo
Command used to create docker container (run/create/compose/screenshot)
docker-compose up -d
Docker logs
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 1000
User gid: 1000
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
New container detected. Setting up app folder and fixing permissions.
Operations to perform:
Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions
Running migrations:
No migrations to apply.
Superuser creation skipped. Already exists.
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[uWSGI] getting INI configuration from uwsgi.ini
[uwsgi-static] added mapping for /static => static-collected
*** Starting uWSGI 2.0.19.1 (64bit) on [Wed Nov 3 18:04:23 2021] ***
compiled with version: 10.3.1 20210424 on 05 April 2021 18:18:03
os: Linux-5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021
nodename: f2efc190f26a
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /app/healthchecks
detected binary path: /usr/sbin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
building mime-types dictionary from file /etc/mime.types...1311 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :8000 fd 3
Python version: 3.9.5 (default, May 12 2021, 20:44:22) [GCC 10.3.1 20210424]
Python main interpreter initialized at 0x7fc72837f7e0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 203184 bytes (198 KB) for 1 cores
*** Operational MODE: single process ***
running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...
318 static files copied to '/app/healthchecks/static-collected'.
running "exec:/usr/bin/python3 ./manage.py compress" (pre app)...
CommandError: Compressor is disabled. Set the COMPRESS_ENABLED setting or use --force to override.
command "/usr/bin/python3 ./manage.py compress" exited with non-zero code: 1
Wed Nov 3 18:04:25 2021 - FATAL hook failed, destroying instance
SIGINT/SIGQUIT received...killing workers...
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x7fc72837f7e0 pid: 299 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 299)
spawned uWSGI worker 1 (pid: 316, cores: 1)
[uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py sendalerts" (uid: 1000 gid: 1000)
Expected Behavior
The
SECRET_KEY
env var is generated and added tolocal_settings.py
or if set then that value is added tolocal_settings.py
. If it was generated by the container it should not be replaced whenREGENERATE_SETTINGS=True
unless it is set to something different in thedocker-compose.yml
file ordocker run
command.Current Behavior
The
SECRET_KEY
env var is never added to thelocal_settings.py
file and I can't tell if it is even generated.Steps to Reproduce
SECRET_KEY
env var setEnvironment
OS: Ubuntu Server 20.04.3 LTS (Focal Fossa) CPU architecture: x86_64 How docker service was installed: from the distro repo
Command used to create docker container (run/create/compose/screenshot)
docker-compose up -d
Docker logs
Screenshot