diff --git a/README.md b/README.md index f06b429d..b28de8be 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,7 @@ services: - STAGING=false #optional - DISABLE_F2B= #optional - SWAG_AUTORELOAD= #optional + - SWAG_AUTORELOAD_WATCHLIST= #optional volumes: - /path/to/swag/config:/config ports: @@ -220,6 +221,7 @@ docker run -d \ -e STAGING=false `#optional` \ -e DISABLE_F2B= `#optional` \ -e SWAG_AUTORELOAD= `#optional` \ + -e SWAG_AUTORELOAD_WATCHLIST= `#optional` \ -p 443:443 \ -p 80:80 `#optional` \ -v /path/to/swag/config:/config \ @@ -249,7 +251,8 @@ Containers are configured using parameters passed at runtime (such as those abov | `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org` | | `-e STAGING=false` | Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes. | | `-e DISABLE_F2B=` | Set to `true` to disable the Fail2ban service in the container, if you're already running it elsewhere or using a different IPS. | -| `-e SWAG_AUTORELOAD=` | Set to `true` to enable automatic reloading of nginx configs on change. Your filesystem must support inotify. This functionality was previous offered [via mod](https://github.com/linuxserver/docker-mods/tree/swag-auto-reload). | +| `-e SWAG_AUTORELOAD=` | Set to `true` to enable automatic reloading of nginx confs on change. Your filesystem must support inotify. This functionality was previous offered [via mod](https://github.com/linuxserver/docker-mods/tree/swag-auto-reload). | +| `-e SWAG_AUTORELOAD_WATCHLIST=` | A `|`-separated list of additional folders for auto reload to watch in addition to `/config/nginx` | | `-v /config` | Persistent config files | | `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). | | `--cap-add=NET_ADMIN` | Required for fail2Ban to be able to modify iptables rules. | diff --git a/readme-vars.yml b/readme-vars.yml index 103e507b..5a6f94fc 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -38,7 +38,8 @@ opt_param_env_vars: - {env_var: "EXTRA_DOMAINS", env_value: "", desc: "Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org`"} - {env_var: "STAGING", env_value: "false", desc: "Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes."} - {env_var: "DISABLE_F2B", env_value: "", desc: "Set to `true` to disable the Fail2ban service in the container, if you're already running it elsewhere or using a different IPS."} - - {env_var: "SWAG_AUTORELOAD", env_value: "", desc: "Set to `true` to enable automatic reloading of nginx configs on change. Your filesystem must support inotify. This functionality was previous offered [via mod](https://github.com/linuxserver/docker-mods/tree/swag-auto-reload)."} + - {env_var: "SWAG_AUTORELOAD", env_value: "", desc: "Set to `true` to enable automatic reloading of nginx confs on change. Your filesystem must support inotify. This functionality was previous offered [via mod](https://github.com/linuxserver/docker-mods/tree/swag-auto-reload)."} + - {env_var: "SWAG_AUTORELOAD_WATCHLIST", env_value: "", desc: "A `|`-separated list of additional folders for auto reload to watch in addition to `/config/nginx`"} opt_param_usage_include_ports: true opt_param_ports: - {external_port: "80", internal_port: "80", port_desc: "HTTP port (required for HTTP validation and HTTP -> HTTPS redirect)"} diff --git a/root/etc/s6-overlay/s6-rc.d/svc-swag-auto-reload/run b/root/etc/s6-overlay/s6-rc.d/svc-swag-auto-reload/run index 92cc7e25..2b291dc8 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-swag-auto-reload/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-swag-auto-reload/run @@ -9,7 +9,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then echo "Auto-reload: Watching the following files/folders for changes (excluding .sample, .swp, and .md files):" echo "/config/nginx" ACTIVE_WATCH=("/config/nginx") - for i in $(echo "${WATCHLIST}" | tr "|" " "); do + for i in $(echo "${SWAG_AUTORELOAD_WATCHLIST}" | tr "|" " "); do if [ -f "${i}" ] || [ -d "${i}" ]; then echo "${i}" ACTIVE_WATCH+=("${i}") @@ -19,7 +19,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then function wait_for_changes { inotifywait -rq \ --event modify,move,create,delete \ - --excludei '\.(sample|md|swp)' \ + --include '\.(conf)' \ "${ACTIVE_WATCH[@]}" }