diff --git a/.gitignore b/.gitignore index 077b275e..5b3498a2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ logs .vscode .pytest_cache .apphub/swagger-ui -.apphub/apphub.egg-info \ No newline at end of file +.apphub/apphub.egg-info +cli/__pycache__ \ No newline at end of file diff --git a/docker/proxy/Dockerfile b/docker/proxy/Dockerfile index c1fa2f53..34fd5c43 100644 --- a/docker/proxy/Dockerfile +++ b/docker/proxy/Dockerfile @@ -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" 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"] \ No newline at end of file +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"] \ No newline at end of file diff --git a/docker/proxy/s6/README.md b/docker/proxy/s6/README.md new file mode 100644 index 00000000..f559b64f --- /dev/null +++ b/docker/proxy/s6/README.md @@ -0,0 +1,3 @@ +# S6 + +S6 is a mulitply process management tools at Nginx Proxy Manager. diff --git a/docker/proxy/s6/init_user/run b/docker/proxy/s6/init_user/run deleted file mode 100644 index 2dbcf83d..00000000 --- a/docker/proxy/s6/init_user/run +++ /dev/null @@ -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 diff --git a/docker/proxy/s6/init_user/type b/docker/proxy/s6/init_user/type deleted file mode 100644 index 3d92b15f..00000000 --- a/docker/proxy/s6/init_user/type +++ /dev/null @@ -1 +0,0 @@ -oneshot \ No newline at end of file diff --git a/docker/proxy/s6/init_user/up b/docker/proxy/s6/init_user/up deleted file mode 100644 index e69de29b..00000000 diff --git a/docker/proxy/s6/w9init/migration.sh b/docker/proxy/s6/w9init/migration.sh new file mode 100644 index 00000000..4ae0f96d --- /dev/null +++ b/docker/proxy/s6/w9init/migration.sh @@ -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 \ No newline at end of file diff --git a/docker/proxy/s6/init_user/init_user.sh b/docker/proxy/s6/w9init/setuser.sh similarity index 100% rename from docker/proxy/s6/init_user/init_user.sh rename to docker/proxy/s6/w9init/setuser.sh