mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
Refactor wger config to use .env and environment variables
Replaces the custom settings directory with a .env file for configuration. Updates backup and restore logic to handle .env instead of settings, and sets required Django environment variables explicitly. Simplifies installation and update scripts for better maintainability and security.
This commit is contained in:
11
ct/wger.sh
11
ct/wger.sh
@@ -37,7 +37,7 @@ function update_script() {
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/wger/db /opt/wger_db_backup
|
||||
cp -r /opt/wger/media /opt/wger_media_backup
|
||||
cp -r /opt/wger/settings /opt/wger_settings_backup
|
||||
cp /opt/wger/.env /opt/wger_env_backup
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wger" "wger-project/wger" "tarball" "latest" "/opt/wger"
|
||||
@@ -45,15 +45,16 @@ function update_script() {
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/wger_db_backup/. /opt/wger/db
|
||||
cp -r /opt/wger_media_backup/. /opt/wger/media
|
||||
cp -r /opt/wger_settings_backup/. /opt/wger/settings
|
||||
rm -rf /opt/wger_db_backup /opt/wger_media_backup /opt/wger_settings_backup
|
||||
cp /opt/wger_env_backup /opt/wger/.env
|
||||
rm -rf /opt/wger_db_backup /opt/wger_media_backup /opt/wger_env_backup
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Updating wger"
|
||||
cd /opt/wger
|
||||
$STD uv pip install .
|
||||
source /opt/wger/.env
|
||||
export DJANGO_SETTINGS_MODULE=settings.main
|
||||
export PYTHONPATH=/opt/wger
|
||||
export DJANGO_DB_DATABASE DJANGO_MEDIA_ROOT DJANGO_STATIC_ROOT SECRET_KEY
|
||||
$STD uv pip install .
|
||||
$STD uv run python manage.py migrate
|
||||
$STD uv run python manage.py collectstatic --no-input
|
||||
msg_ok "Updated wger"
|
||||
|
||||
Reference in New Issue
Block a user