mirror of
https://github.com/linuxserver/docker-swag.git
synced 2025-02-13 21:31:21 -05:00
Switch to include, document watchlist functionality
This commit is contained in:
parent
02ed03a455
commit
21b5a79e06
@ -191,6 +191,7 @@ services:
|
|||||||
- STAGING=false #optional
|
- STAGING=false #optional
|
||||||
- DISABLE_F2B= #optional
|
- DISABLE_F2B= #optional
|
||||||
- SWAG_AUTORELOAD= #optional
|
- SWAG_AUTORELOAD= #optional
|
||||||
|
- SWAG_AUTORELOAD_WATCHLIST= #optional
|
||||||
volumes:
|
volumes:
|
||||||
- /path/to/swag/config:/config
|
- /path/to/swag/config:/config
|
||||||
ports:
|
ports:
|
||||||
@ -220,6 +221,7 @@ docker run -d \
|
|||||||
-e STAGING=false `#optional` \
|
-e STAGING=false `#optional` \
|
||||||
-e DISABLE_F2B= `#optional` \
|
-e DISABLE_F2B= `#optional` \
|
||||||
-e SWAG_AUTORELOAD= `#optional` \
|
-e SWAG_AUTORELOAD= `#optional` \
|
||||||
|
-e SWAG_AUTORELOAD_WATCHLIST= `#optional` \
|
||||||
-p 443:443 \
|
-p 443:443 \
|
||||||
-p 80:80 `#optional` \
|
-p 80:80 `#optional` \
|
||||||
-v /path/to/swag/config:/config \
|
-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 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 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 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 |
|
| `-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/). |
|
| `--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. |
|
| `--cap-add=NET_ADMIN` | Required for fail2Ban to be able to modify iptables rules. |
|
||||||
|
@ -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: "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: "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: "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_usage_include_ports: true
|
||||||
opt_param_ports:
|
opt_param_ports:
|
||||||
- {external_port: "80", internal_port: "80", port_desc: "HTTP port (required for HTTP validation and HTTP -> HTTPS redirect)"}
|
- {external_port: "80", internal_port: "80", port_desc: "HTTP port (required for HTTP validation and HTTP -> HTTPS redirect)"}
|
||||||
|
@ -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 "Auto-reload: Watching the following files/folders for changes (excluding .sample, .swp, and .md files):"
|
||||||
echo "/config/nginx"
|
echo "/config/nginx"
|
||||||
ACTIVE_WATCH=("/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
|
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
||||||
echo "${i}"
|
echo "${i}"
|
||||||
ACTIVE_WATCH+=("${i}")
|
ACTIVE_WATCH+=("${i}")
|
||||||
@ -19,7 +19,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then
|
|||||||
function wait_for_changes {
|
function wait_for_changes {
|
||||||
inotifywait -rq \
|
inotifywait -rq \
|
||||||
--event modify,move,create,delete \
|
--event modify,move,create,delete \
|
||||||
--excludei '\.(sample|md|swp)' \
|
--include '\.(conf)' \
|
||||||
"${ACTIVE_WATCH[@]}"
|
"${ACTIVE_WATCH[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user