mirror of
https://github.com/linuxserver/docker-swag.git
synced 2025-11-08 17:02:39 +09:00
make the env proxy confs their own isolated folder to include
This commit is contained in:
@@ -5,7 +5,7 @@ from jinja2 import Environment, FileSystemLoader
|
|||||||
|
|
||||||
# --- Configuration ---
|
# --- Configuration ---
|
||||||
TEMPLATE_DIR = '/app/config-generator/templates'
|
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'
|
DEFAULT_CONF_OUTPUT = '/config/nginx/site-confs/default.conf'
|
||||||
HTPASSWD_FILE = '/config/nginx/.htpasswd'
|
HTPASSWD_FILE = '/config/nginx/.htpasswd'
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|||||||
@@ -100,4 +100,6 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# enable subdomain method reverse proxy confs
|
# 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;
|
||||||
|
|||||||
@@ -82,3 +82,5 @@ server {
|
|||||||
|
|
||||||
# enable subdomain method reverse proxy confs
|
# enable subdomain method reverse proxy confs
|
||||||
include /config/nginx/proxy-confs/*.subdomain.conf;
|
include /config/nginx/proxy-confs/*.subdomain.conf;
|
||||||
|
# enable env var subdomain method reverse proxy confs
|
||||||
|
include /config/nginx/env-proxy-confs/*.subdomain.conf;
|
||||||
|
|||||||
@@ -43,12 +43,11 @@ if [[ ! -f /config/nginx/ldap-server.conf ]]; then
|
|||||||
cp /defaults/nginx/ldap-server.conf.sample /config/nginx/ldap-server.conf
|
cp /defaults/nginx/ldap-server.conf.sample /config/nginx/ldap-server.conf
|
||||||
fi
|
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
|
# check if any PROXY_CONFIG environment variables are set
|
||||||
if env | grep -q "^PROXY_CONFIG_"; then
|
if env | grep -q "^PROXY_CONFIG_"; then
|
||||||
echo "INFO: Found PROXY_CONFIG environment variables. Generating Nginx configs from environment..."
|
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
|
# run the Python generator script
|
||||||
echo "INFO: Running python config generator..."
|
echo "INFO: Running python config generator..."
|
||||||
if ! python3 /app/config-generator/generate_configs.py; then
|
if ! python3 /app/config-generator/generate_configs.py; then
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ mkdir -p \
|
|||||||
/config/{fail2ban,dns-conf} \
|
/config/{fail2ban,dns-conf} \
|
||||||
/config/etc/letsencrypt/renewal-hooks \
|
/config/etc/letsencrypt/renewal-hooks \
|
||||||
/config/log/{fail2ban,letsencrypt,nginx} \
|
/config/log/{fail2ban,letsencrypt,nginx} \
|
||||||
|
/config/nginx/env-proxy-confs \
|
||||||
/config/nginx/proxy-confs \
|
/config/nginx/proxy-confs \
|
||||||
/run/fail2ban \
|
/run/fail2ban \
|
||||||
/tmp/letsencrypt
|
/tmp/letsencrypt
|
||||||
|
|||||||
Reference in New Issue
Block a user