initial env var ingestion for rev proxy configs

This commit is contained in:
thelamer
2025-09-02 15:16:05 -04:00
parent fb4ba0deb0
commit 5942cc2253
8 changed files with 584 additions and 0 deletions

View File

@@ -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