Skip to content

Commit 21b5a79

Browse files
committed
Switch to include, document watchlist functionality
1 parent 02ed03a commit 21b5a79

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ services:
191191
- STAGING=false #optional
192192
- DISABLE_F2B= #optional
193193
- SWAG_AUTORELOAD= #optional
194+
- SWAG_AUTORELOAD_WATCHLIST= #optional
194195
volumes:
195196
- /path/to/swag/config:/config
196197
ports:
@@ -220,6 +221,7 @@ docker run -d \
220221
-e STAGING=false `#optional` \
221222
-e DISABLE_F2B= `#optional` \
222223
-e SWAG_AUTORELOAD= `#optional` \
224+
-e SWAG_AUTORELOAD_WATCHLIST= `#optional` \
223225
-p 443:443 \
224226
-p 80:80 `#optional` \
225227
-v /path/to/swag/config:/config \
@@ -249,7 +251,8 @@ Containers are configured using parameters passed at runtime (such as those abov
249251
| `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org` |
250252
| `-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. |
251253
| `-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. |
252-
| `-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). |
254+
| `-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). |
255+
| `-e SWAG_AUTORELOAD_WATCHLIST=` | A `|`-separated list of additional folders for auto reload to watch in addition to `/config/nginx` |
253256
| `-v /config` | Persistent config files |
254257
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
255258
| `--cap-add=NET_ADMIN` | Required for fail2Ban to be able to modify iptables rules. |

readme-vars.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ opt_param_env_vars:
3838
- {env_var: "EXTRA_DOMAINS", env_value: "", desc: "Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org`"}
3939
- {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."}
4040
- {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."}
41-
- {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)."}
41+
- {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)."}
42+
- {env_var: "SWAG_AUTORELOAD_WATCHLIST", env_value: "", desc: "A `|`-separated list of additional folders for auto reload to watch in addition to `/config/nginx`"}
4243
opt_param_usage_include_ports: true
4344
opt_param_ports:
4445
- {external_port: "80", internal_port: "80", port_desc: "HTTP port (required for HTTP validation and HTTP -> HTTPS redirect)"}

root/etc/s6-overlay/s6-rc.d/svc-swag-auto-reload/run

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then
99
echo "Auto-reload: Watching the following files/folders for changes (excluding .sample, .swp, and .md files):"
1010
echo "/config/nginx"
1111
ACTIVE_WATCH=("/config/nginx")
12-
for i in $(echo "${WATCHLIST}" | tr "|" " "); do
12+
for i in $(echo "${SWAG_AUTORELOAD_WATCHLIST}" | tr "|" " "); do
1313
if [ -f "${i}" ] || [ -d "${i}" ]; then
1414
echo "${i}"
1515
ACTIVE_WATCH+=("${i}")
@@ -19,7 +19,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then
1919
function wait_for_changes {
2020
inotifywait -rq \
2121
--event modify,move,create,delete \
22-
--excludei '\.(sample|md|swp)' \
22+
--include '\.(conf)' \
2323
"${ACTIVE_WATCH[@]}"
2424
}
2525

0 commit comments

Comments
 (0)