mirror of
https://github.com/linuxserver/docker-swag.git
synced 2026-04-17 09:41:51 +09:00
initial env var ingestion for rev proxy configs
This commit is contained in:
@@ -42,3 +42,20 @@ fi
|
||||
if [[ ! -f /config/nginx/ldap-server.conf ]]; then
|
||||
cp /defaults/nginx/ldap-server.conf.sample /config/nginx/ldap-server.conf
|
||||
fi
|
||||
|
||||
# check if any PROXY_CONFIG environment variables are set
|
||||
if env | grep -q "^PROXY_CONFIG_"; then
|
||||
echo "INFO: Found PROXY_CONFIG environment variables. Generating Nginx configs from environment..."
|
||||
# clean the target directory to ensure a fresh start
|
||||
echo "INFO: Cleaning /config/nginx/proxy-confs/ of existing files..."
|
||||
rm -f /config/nginx/proxy-confs/*
|
||||
# run the Python generator script
|
||||
echo "INFO: Running python config generator..."
|
||||
if ! python3 /app/config-generator/generate_configs.py; then
|
||||
echo "ERROR: The python config generator script failed. Please check the logs above. Container will not start."
|
||||
exit 1
|
||||
fi
|
||||
echo "INFO: Config generation complete."
|
||||
else
|
||||
echo "INFO: No PROXY_CONFIG variables found. User is expected to manage /config/nginx/proxy-confs/ manually."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user