Merge pull request #1081 from linuxserver/swag-auto-proxy-support-ondemand

Add support for swag-ondemand
This commit is contained in:
quietsy 2025-11-23 15:33:00 +02:00 committed by GitHub
commit 401e4ae93f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,12 @@
#!/usr/bin/with-contenv bash
AUTO_GEN=""
ENABLED_CONTAINERS=$(docker ps -f "label=swag=enable" --format "{{.Names}}" && docker ps -a -f "status=exited" -f "label=swag=enable" -f "label=swag_ondemand=enable" --format "{{.Names}}")
# figure out which containers to generate confs for or which confs to remove
if [ ! -f /auto-proxy/enabled_containers ]; then
docker ps --filter "label=swag=enable" --format "{{.Names}}" > /auto-proxy/enabled_containers
echo "${ENABLED_CONTAINERS}" > /auto-proxy/enabled_containers
AUTO_GEN=$(cat /auto-proxy/enabled_containers)
else
ENABLED_CONTAINERS=$(docker ps --filter "label=swag=enable" --format "{{.Names}}")
for CONTAINER in ${ENABLED_CONTAINERS}; do
if [ ! -f "/auto-proxy/${CONTAINER}.conf" ]; then
echo "**** New container ${CONTAINER} detected, will generate new conf. ****"