From ed7c58a4c345a043c3f68ab97986565904a7a142 Mon Sep 17 00:00:00 2001 From: thespad Date: Sat, 16 Nov 2024 15:46:17 +0000 Subject: [PATCH] Tidy up init process --- Dockerfile | 6 ++++-- Dockerfile.aarch64 | 6 ++++-- Jenkinsfile | 4 ++-- README.md | 1 - jenkins-vars.yml | 4 ++-- root/app/le-renew.sh | 0 .../{init-nginx-config => init-swag-config} | 0 .../{init-samples-config => init-swag-samples} | 0 root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run | 12 ++++++------ root/etc/s6-overlay/s6-rc.d/init-folders-config/up | 1 - root/etc/s6-overlay/s6-rc.d/init-nginx-config/up | 1 - .../s6-overlay/s6-rc.d/init-permissions-config/run | 1 - .../dependencies.d/init-config} | 0 root/etc/s6-overlay/s6-rc.d/init-samples-config/up | 1 - .../dependencies.d/init-fail2ban-config | 0 .../{init-nginx-config => init-swag-config}/run | 0 .../{init-folders-config => init-swag-config}/type | 0 root/etc/s6-overlay/s6-rc.d/init-swag-config/up | 1 + .../dependencies.d/init-require-url} | 0 .../{init-folders-config => init-swag-folders}/run | 0 .../{init-nginx-config => init-swag-folders}/type | 0 root/etc/s6-overlay/s6-rc.d/init-swag-folders/up | 1 + .../dependencies.d/init-swag-folders} | 0 .../{init-samples-config => init-swag-samples}/run | 0 .../{init-samples-config => init-swag-samples}/type | 0 root/etc/s6-overlay/s6-rc.d/init-swag-samples/up | 1 + root/etc/s6-overlay/s6-rc.d/init-test-run/run | 7 ------- root/etc/s6-overlay/s6-rc.d/init-test-run/type | 1 - root/etc/s6-overlay/s6-rc.d/init-test-run/up | 1 - .../s6-rc.d/user/contents.d/init-samples-config | 0 .../contents.d/init-swag-config} | 0 .../{init-folders-config => init-swag-folders} | 0 .../{init-nginx-config => init-swag-samples} | 0 .../s6-overlay/s6-rc.d/user/contents.d/init-test-run | 0 34 files changed, 21 insertions(+), 28 deletions(-) mode change 100644 => 100755 root/app/le-renew.sh rename root/etc/s6-overlay/s6-rc.d/init-certbot-config/dependencies.d/{init-nginx-config => init-swag-config} (100%) rename root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/dependencies.d/{init-samples-config => init-swag-samples} (100%) delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-folders-config/up delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-nginx-config/up rename root/etc/s6-overlay/s6-rc.d/{init-folders-config/dependencies.d/init-require-url => init-require-url/dependencies.d/init-config} (100%) delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-samples-config/up rename root/etc/s6-overlay/s6-rc.d/{init-nginx-config => init-swag-config}/dependencies.d/init-fail2ban-config (100%) rename root/etc/s6-overlay/s6-rc.d/{init-nginx-config => init-swag-config}/run (100%) rename root/etc/s6-overlay/s6-rc.d/{init-folders-config => init-swag-config}/type (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-swag-config/up rename root/etc/s6-overlay/s6-rc.d/{init-require-url/dependencies.d/init-test-run => init-swag-folders/dependencies.d/init-require-url} (100%) rename root/etc/s6-overlay/s6-rc.d/{init-folders-config => init-swag-folders}/run (100%) rename root/etc/s6-overlay/s6-rc.d/{init-nginx-config => init-swag-folders}/type (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-swag-folders/up rename root/etc/s6-overlay/s6-rc.d/{init-samples-config/dependencies.d/init-folders-config => init-swag-samples/dependencies.d/init-swag-folders} (100%) rename root/etc/s6-overlay/s6-rc.d/{init-samples-config => init-swag-samples}/run (100%) rename root/etc/s6-overlay/s6-rc.d/{init-samples-config => init-swag-samples}/type (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-swag-samples/up delete mode 100755 root/etc/s6-overlay/s6-rc.d/init-test-run/run delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-test-run/type delete mode 100644 root/etc/s6-overlay/s6-rc.d/init-test-run/up delete mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-samples-config rename root/etc/s6-overlay/s6-rc.d/{init-test-run/dependencies.d/init-nginx-end => user/contents.d/init-swag-config} (100%) rename root/etc/s6-overlay/s6-rc.d/user/contents.d/{init-folders-config => init-swag-folders} (100%) rename root/etc/s6-overlay/s6-rc.d/user/contents.d/{init-nginx-config => init-swag-samples} (100%) delete mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-test-run diff --git a/Dockerfile b/Dockerfile index 1b1d552..16811e7 100755 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,10 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="nemchik" # environment settings -ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini -ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 +ENV DHLEVEL=2048 \ + ONLY_SUBDOMAINS=false \ + AWS_CONFIG_FILE=/config/dns-conf/route53.ini \ + S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ echo "**** install build packages ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1e3c4e1..2aa2823 100755 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -10,8 +10,10 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA LABEL maintainer="nemchik" # environment settings -ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini -ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 +ENV DHLEVEL=2048 \ + ONLY_SUBDOMAINS=false \ + AWS_CONFIG_FILE=/config/dns-conf/route53.ini \ + S6_BEHAVIOUR_IF_STAGE2_FAILS=2 RUN \ echo "**** install build packages ****" && \ diff --git a/Jenkinsfile b/Jenkinsfile index 832f015..79c8b75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,12 +29,12 @@ pipeline { PR_DOCKERHUB_IMAGE = 'lspipepr/swag' DIST_IMAGE = 'alpine' MULTIARCH='true' - CI='true' + CI='false' CI_WEB='false' CI_PORT='80' CI_SSL='false' CI_DELAY='30' - CI_DOCKERENV='TEST_RUN=1' + CI_DOCKERENV='' CI_AUTH='' CI_WEBPATH='' } diff --git a/README.md b/README.md index c96fe97..178c83d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ Find us at: [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/swag.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/swag) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/swag.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/swag) [![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-swag%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-swag/job/master/) -[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fswag%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/swag/latest/index.html) SWAG - Secure Web Application Gateway (formerly known as letsencrypt, no relation to Let's Encryptâ„¢) sets up an Nginx webserver and reverse proxy with php support and a built-in certbot client that automates free SSL server certificate generation and renewal processes (Let's Encrypt and ZeroSSL). It also contains fail2ban for intrusion prevention. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 989b638..155a89a 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -17,12 +17,12 @@ repo_vars: - PR_DOCKERHUB_IMAGE = 'lspipepr/swag' - DIST_IMAGE = 'alpine' - MULTIARCH='true' - - CI='true' + - CI='false' - CI_WEB='false' - CI_PORT='80' - CI_SSL='false' - CI_DELAY='30' - - CI_DOCKERENV='TEST_RUN=1' + - CI_DOCKERENV='' - CI_AUTH='' - CI_WEBPATH='' sponsor_links: diff --git a/root/app/le-renew.sh b/root/app/le-renew.sh old mode 100644 new mode 100755 diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/dependencies.d/init-nginx-config b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/dependencies.d/init-swag-config similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-certbot-config/dependencies.d/init-nginx-config rename to root/etc/s6-overlay/s6-rc.d/init-certbot-config/dependencies.d/init-swag-config diff --git a/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/dependencies.d/init-samples-config b/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/dependencies.d/init-swag-samples similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/dependencies.d/init-samples-config rename to root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/dependencies.d/init-swag-samples diff --git a/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run b/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run index 6022729..968043a 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run @@ -2,12 +2,12 @@ # shellcheck shell=bash if ! iptables -L &> /dev/null; then - ln -sf /sbin/xtables-legacy-multi /sbin/iptables - ln -sf /sbin/xtables-legacy-multi /sbin/iptables-save - ln -sf /sbin/xtables-legacy-multi /sbin/iptables-restore - ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables - ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-save - ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-restore + ln -sf /sbin/xtables-legacy-multi /sbin/iptables + ln -sf /sbin/xtables-legacy-multi /sbin/iptables-save + ln -sf /sbin/xtables-legacy-multi /sbin/iptables-restore + ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables + ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-save + ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-restore fi # copy/update the fail2ban config defaults to/in /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-folders-config/up b/root/etc/s6-overlay/s6-rc.d/init-folders-config/up deleted file mode 100644 index 7607e6f..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-folders-config/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-folders-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/up b/root/etc/s6-overlay/s6-rc.d/init-nginx-config/up deleted file mode 100644 index 9adcea4..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-nginx-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-permissions-config/run b/root/etc/s6-overlay/s6-rc.d/init-permissions-config/run index 3a55fc0..53a9fd3 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-permissions-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-permissions-config/run @@ -6,4 +6,3 @@ lsiown -R abc:abc \ /config chmod -R 0644 /etc/logrotate.d chmod -R +r /config/log -chmod +x /app/le-renew.sh diff --git a/root/etc/s6-overlay/s6-rc.d/init-folders-config/dependencies.d/init-require-url b/root/etc/s6-overlay/s6-rc.d/init-require-url/dependencies.d/init-config similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-folders-config/dependencies.d/init-require-url rename to root/etc/s6-overlay/s6-rc.d/init-require-url/dependencies.d/init-config diff --git a/root/etc/s6-overlay/s6-rc.d/init-samples-config/up b/root/etc/s6-overlay/s6-rc.d/init-samples-config/up deleted file mode 100644 index bc2cbf6..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-samples-config/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-samples-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/dependencies.d/init-fail2ban-config b/root/etc/s6-overlay/s6-rc.d/init-swag-config/dependencies.d/init-fail2ban-config similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-nginx-config/dependencies.d/init-fail2ban-config rename to root/etc/s6-overlay/s6-rc.d/init-swag-config/dependencies.d/init-fail2ban-config diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/run b/root/etc/s6-overlay/s6-rc.d/init-swag-config/run similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-nginx-config/run rename to root/etc/s6-overlay/s6-rc.d/init-swag-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-folders-config/type b/root/etc/s6-overlay/s6-rc.d/init-swag-config/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-folders-config/type rename to root/etc/s6-overlay/s6-rc.d/init-swag-config/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-swag-config/up b/root/etc/s6-overlay/s6-rc.d/init-swag-config/up new file mode 100644 index 0000000..520562e --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-swag-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-swag-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-require-url/dependencies.d/init-test-run b/root/etc/s6-overlay/s6-rc.d/init-swag-folders/dependencies.d/init-require-url similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-require-url/dependencies.d/init-test-run rename to root/etc/s6-overlay/s6-rc.d/init-swag-folders/dependencies.d/init-require-url diff --git a/root/etc/s6-overlay/s6-rc.d/init-folders-config/run b/root/etc/s6-overlay/s6-rc.d/init-swag-folders/run similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-folders-config/run rename to root/etc/s6-overlay/s6-rc.d/init-swag-folders/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx-config/type b/root/etc/s6-overlay/s6-rc.d/init-swag-folders/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-nginx-config/type rename to root/etc/s6-overlay/s6-rc.d/init-swag-folders/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-swag-folders/up b/root/etc/s6-overlay/s6-rc.d/init-swag-folders/up new file mode 100644 index 0000000..407bb1b --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-swag-folders/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-swag-folders/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-samples-config/dependencies.d/init-folders-config b/root/etc/s6-overlay/s6-rc.d/init-swag-samples/dependencies.d/init-swag-folders similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-samples-config/dependencies.d/init-folders-config rename to root/etc/s6-overlay/s6-rc.d/init-swag-samples/dependencies.d/init-swag-folders diff --git a/root/etc/s6-overlay/s6-rc.d/init-samples-config/run b/root/etc/s6-overlay/s6-rc.d/init-swag-samples/run similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-samples-config/run rename to root/etc/s6-overlay/s6-rc.d/init-swag-samples/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-samples-config/type b/root/etc/s6-overlay/s6-rc.d/init-swag-samples/type similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-samples-config/type rename to root/etc/s6-overlay/s6-rc.d/init-swag-samples/type diff --git a/root/etc/s6-overlay/s6-rc.d/init-swag-samples/up b/root/etc/s6-overlay/s6-rc.d/init-swag-samples/up new file mode 100644 index 0000000..89ca3b4 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-swag-samples/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-swag-samples/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-test-run/run b/root/etc/s6-overlay/s6-rc.d/init-test-run/run deleted file mode 100755 index f4b2243..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-test-run/run +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -# Echo init finish for test runs -if [[ -n "${TEST_RUN}" ]]; then - echo '[services.d] done.' -fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-test-run/type b/root/etc/s6-overlay/s6-rc.d/init-test-run/type deleted file mode 100644 index bdd22a1..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-test-run/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-test-run/up b/root/etc/s6-overlay/s6-rc.d/init-test-run/up deleted file mode 100644 index 5f836df..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-test-run/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-test-run/run diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-samples-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-samples-config deleted file mode 100644 index e69de29..0000000 diff --git a/root/etc/s6-overlay/s6-rc.d/init-test-run/dependencies.d/init-nginx-end b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-config similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-test-run/dependencies.d/init-nginx-end rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-config diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-folders-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-folders similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/user/contents.d/init-folders-config rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-folders diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-nginx-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-samples similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/user/contents.d/init-nginx-config rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-swag-samples diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-test-run b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-test-run deleted file mode 100644 index e69de29..0000000