mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 17:06:09 +00:00
feat: an installation's own settings in data/local_settings.py; settings.py is part of the code
Every update rebuilt settings.py from the template, and the operator put back their own values by reading a diff: a forgotten DATABASES started the panel on a new, empty sqlite database. Docker users who needed an option only settings.py has (LDAP, OTP_ENABLED, LOGIN_TRUSTED_PROXIES) mounted their own copy and kept it up to date by hand. webvirtcloud/settings.py is now the tracked file (no template, no copy in the installer, the image, the container's start or CI), and it runs data/local_settings.py last: the installation's own values, which an update does not touch, kept in Docker's data volume, in the panel's backups and readable by the panel's user only. The installer writes the time zone, the noVNC port (now checked to be a number), ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS there instead of editing settings.py with sed. LDAP is set up there too; settings.py keeps only python-ldap's timeouts. The README's update steps move an older version's own settings.py into the backup before git pull and have its values moved into the local file once.
This commit is contained in:
parent
0fb0b61a1a
commit
29a1cbcace
15 changed files with 221 additions and 180 deletions
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/bash
|
||||
# Installs the panel with install.sh in a systemd container of one distribution
|
||||
# and checks that it answers: its services run, it has a secret key and an
|
||||
# admin password, and the login page loads. It installs the committed HEAD.
|
||||
# and checks that it answers: its services run, it has a secret key, an admin
|
||||
# password and its local settings, and the login page loads. It installs the
|
||||
# committed HEAD.
|
||||
#
|
||||
# Usage, from the repository root (needs docker):
|
||||
# dev/test-installer.sh IMAGE e.g. debian:13, almalinux:10, opensuse/leap:15.6
|
||||
|
|
@ -55,6 +56,7 @@ docker exec "$name" bash -c '
|
|||
docker exec "$name" bash -e -c '
|
||||
test -s /srv/webvirtcloud/data/secret_key || { echo "No secret key"; exit 1; }
|
||||
test -s /srv/webvirtcloud/data/admin_password || { echo "No admin password"; exit 1; }
|
||||
test -s /srv/webvirtcloud/data/local_settings.py || { echo "No local settings"; exit 1; }
|
||||
# curl is not on every distribution; the panel'"'"'s Python is
|
||||
/srv/webvirtcloud/venv/bin/python3 - <<PY
|
||||
import re, time, urllib.request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue