proxy migration

This commit is contained in:
Darren 2023-10-25 15:33:30 +08:00 committed by GitHub
parent c31ab23568
commit 2e9b6c1634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 15 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ logs
.pytest_cache
.apphub/swagger-ui
.apphub/apphub.egg-info
cli/__pycache__

View file

@ -1,13 +1,18 @@
# modify time: 202310241700, you can modify here to trigger Docker Build action
# Dockerfile refer to:https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile
# modify time: 202310251532, you can modify here to trigger Docker Build action
# from Dockerfile: https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile
# from image: https://hub.docker.com/r/jc21/nginx-proxy-manager
FROM jc21/nginx-proxy-manager:2.10.4
LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="2.10.4"
RUN apt-get update && apt-get install -y curl jq
COPY ./config/initproxy.conf /data/nginx/proxy_host/
RUN apt-get update && apt-get install --no-install-recommends -y curl jq && rm -rf /var/lib/apt/lists/*
COPY ./config/initproxy.conf /etc/
COPY ./s6/init_user/init_user.sh /app/init_user.sh
RUN chmod +x /app/init_user.sh
CMD ["/bin/sh", "-c", "/app/init_user.sh && tail -f /dev/null"]
COPY ./s6/w9init/setuser.sh /app/setuser.sh
COPY ./s6/w9init/migration.sh /app/migration.sh
RUN chmod +x /app/setuser.sh /app/migration.sh
CMD ["/bin/sh", "-c", "/app/migration.sh && /app/setuser.sh && tail -f /dev/null"]

View file

@ -0,0 +1,3 @@
# S6
S6 is a mulitply process management tools at Nginx Proxy Manager.

View file

@ -1,6 +0,0 @@
#!/bin/bash
[[ -f ./init_user.sh ]] && source ./init_user.sh
pushd /root >/dev/null
exec s6-svc -D /etc/s6-overlay/s6-rc.d/init_user
popd

View file

@ -1 +0,0 @@
oneshot

View file

@ -0,0 +1,17 @@
#!/bin/bash
set +e
nginx_proxy(){
if [ $(stat -c %Y /etc/shadow) -gt $(stat -c %Y /data/nginx/proxy_host/initproxy.conf) ]
then
cp /etc/initproxy.conf /data/nginx/proxy_host/
echo "Update initproxy.conf to Nginx"
else
echo "Don't need to update initproxy.conf to Nginx"
fi
}
nginx_proxy
set -e