mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
swag-auto-reload: initial release
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# Determine if setup is needed
|
||||
if [ ! -f /usr/local/lib/python***/dist-packages/sshuttle ] && \
|
||||
[ -f /usr/bin/apt ]; then
|
||||
## Ubuntu
|
||||
apt-get update
|
||||
apt-get install --no-install-recommends -y \
|
||||
iptables \
|
||||
openssh-client \
|
||||
python3 \
|
||||
python3-pip
|
||||
pip3 install sshuttle
|
||||
fi
|
||||
if [ ! -f /usr/lib/python***/site-packages/sshuttle ] && \
|
||||
[ -f /sbin/apk ]; then
|
||||
# Alpine
|
||||
apk add --no-cache \
|
||||
iptables \
|
||||
openssh \
|
||||
py3-pip \
|
||||
python3
|
||||
pip3 install sshuttle
|
||||
fi
|
||||
|
||||
chown -R root:root /root
|
||||
chmod -R 600 /root/.ssh
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
DEFAULT_WATCH=( \
|
||||
/config/nginx/authelia-location.conf \
|
||||
/config/nginx/authelia-server.conf \
|
||||
/config/nginx/geoip2.conf \
|
||||
/config/nginx/ldap.conf \
|
||||
/config/nginx/nginx.conf \
|
||||
/config/nginx/proxy-confs \
|
||||
/config/nginx/proxy.conf \
|
||||
/config/nginx/site-confs \
|
||||
/config/nginx/ssl.conf \
|
||||
)
|
||||
|
||||
echo "MOD Auto-reload: Watching the following files/folders for changes"
|
||||
for i in ${DEFAULT_WATCH[@]}; do
|
||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
||||
echo "${i}"
|
||||
ACTIVE_WATCH="${ACTIVE_WATCH} ${i}"
|
||||
fi
|
||||
done
|
||||
for i in $(echo "$WATCHLIST" | tr "|" " "); do
|
||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
||||
echo "${i}"
|
||||
ACTIVE_WATCH="${ACTIVE_WATCH} ${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
function wait_for_changes {
|
||||
inotifywait -rq \
|
||||
--event modify,move,create,delete \
|
||||
${ACTIVE_WATCH}
|
||||
}
|
||||
|
||||
while wait_for_changes; do
|
||||
if /usr/sbin/nginx -c /config/nginx/nginx.conf -t; then
|
||||
echo "Changes to nginx config detected and the changes are valid, reloading nginx"
|
||||
/usr/sbin/nginx -c /config/nginx/nginx.conf -s reload
|
||||
else
|
||||
echo "Changes to nginx config detected but the changes are not valid, skipping nginx reload. Please fix your config."
|
||||
fi
|
||||
done
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
sshuttle --dns --remote root@${HOST}:${PORT} 0/0 -x 172.17.0.0/16
|
||||
Reference in New Issue
Block a user