make the env proxy confs their own isolated folder to include

This commit is contained in:
thelamer
2025-09-04 15:28:25 -04:00
parent 5942cc2253
commit 8c28cb7a40
5 changed files with 9 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ from jinja2 import Environment, FileSystemLoader
# --- Configuration ---
TEMPLATE_DIR = '/app/config-generator/templates'
PROXY_OUTPUT_DIR = '/config/nginx/proxy-confs'
PROXY_OUTPUT_DIR = '/config/nginx/env-proxy-confs'
DEFAULT_CONF_OUTPUT = '/config/nginx/site-confs/default.conf'
HTPASSWD_FILE = '/config/nginx/.htpasswd'
# ---------------------

View File

@@ -100,4 +100,6 @@ server {
}
# enable subdomain method reverse proxy confs
include /config/nginx/proxy-confs/*.conf;
include /config/nginx/proxy-confs/*.subdomain.conf;
# enable env var subdomain method reverse proxy confs
include /config/nginx/env-proxy-confs/*.subdomain.conf;

View File

@@ -82,3 +82,5 @@ server {
# enable subdomain method reverse proxy confs
include /config/nginx/proxy-confs/*.subdomain.conf;
# enable env var subdomain method reverse proxy confs
include /config/nginx/env-proxy-confs/*.subdomain.conf;

View File

@@ -43,12 +43,11 @@ if [[ ! -f /config/nginx/ldap-server.conf ]]; then
cp /defaults/nginx/ldap-server.conf.sample /config/nginx/ldap-server.conf
fi
# clean the env target directory to ensure a fresh start
rm -f /config/nginx/env-proxy-confs/*
# 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

View File

@@ -6,6 +6,7 @@ mkdir -p \
/config/{fail2ban,dns-conf} \
/config/etc/letsencrypt/renewal-hooks \
/config/log/{fail2ban,letsencrypt,nginx} \
/config/nginx/env-proxy-confs \
/config/nginx/proxy-confs \
/run/fail2ban \
/tmp/letsencrypt