From b7ac6612beb2f7d43f48ee571b4154dded830607 Mon Sep 17 00:00:00 2001 From: wang <842355358@qq.com> Date: Tue, 2 Jul 2024 13:02:37 +0800 Subject: [PATCH] ok --- .../dependencies.d/legacy-services | 0 .../s6-overlay/s6-rc.d/ci-service-check/type | 1 + .../s6-overlay/s6-rc.d/ci-service-check/up | 1 + .../s6-overlay/s6-rc.d/init-adduser/branding | 12 +++++++ .../dependencies.d/init-migrations | 0 .../etc/s6-overlay/s6-rc.d/init-adduser/run | 32 ++++++++++++++++++ .../etc/s6-overlay/s6-rc.d/init-adduser/type | 1 + .../etc/s6-overlay/s6-rc.d/init-adduser/up | 1 + .../dependencies.d/init-config | 0 .../s6-overlay/s6-rc.d/init-config-end/type | 1 + .../etc/s6-overlay/s6-rc.d/init-config-end/up | 1 + .../init-config/dependencies.d/init-os-end | 0 .../etc/s6-overlay/s6-rc.d/init-config/type | 1 + .../etc/s6-overlay/s6-rc.d/init-config/up | 1 + .../dependencies.d/init-os-end | 0 .../s6-rc.d/init-crontab-config/run | 31 +++++++++++++++++ .../s6-rc.d/init-crontab-config/type | 1 + .../s6-overlay/s6-rc.d/init-crontab-config/up | 1 + .../dependencies.d/init-mods-end | 0 .../s6-overlay/s6-rc.d/init-custom-files/run | 22 +++++++++++++ .../s6-overlay/s6-rc.d/init-custom-files/type | 1 + .../s6-overlay/s6-rc.d/init-custom-files/up | 1 + .../etc/s6-overlay/s6-rc.d/init-envfile/run | 19 +++++++++++ .../etc/s6-overlay/s6-rc.d/init-envfile/type | 1 + .../etc/s6-overlay/s6-rc.d/init-envfile/up | 1 + .../s6-overlay/s6-rc.d/init-migrations/run | 33 +++++++++++++++++++ .../s6-overlay/s6-rc.d/init-migrations/type | 1 + .../etc/s6-overlay/s6-rc.d/init-migrations/up | 1 + .../init-mods-end/dependencies.d/init-mods | 0 .../dependencies.d/init-mods-package-install | 0 .../etc/s6-overlay/s6-rc.d/init-mods-end/type | 1 + .../etc/s6-overlay/s6-rc.d/init-mods-end/up | 1 + .../dependencies.d/init-mods | 0 .../s6-rc.d/init-mods-package-install/type | 1 + .../s6-rc.d/init-mods-package-install/up | 1 + .../s6-rc.d/init-mods/dependencies.d/base | 0 .../init-mods/dependencies.d/init-config-end | 0 .../etc/s6-overlay/s6-rc.d/init-mods/type | 1 + .../root/etc/s6-overlay/s6-rc.d/init-mods/up | 1 + .../s6-rc.d/init-os-end/dependencies.d/base | 0 .../init-os-end/dependencies.d/init-adduser | 0 .../init-os-end/dependencies.d/init-envfile | 0 .../dependencies.d/init-migrations | 0 .../etc/s6-overlay/s6-rc.d/init-os-end/type | 1 + .../etc/s6-overlay/s6-rc.d/init-os-end/up | 1 + .../dependencies.d/init-custom-files | 0 .../dependencies.d/init-mods-end | 0 .../etc/s6-overlay/s6-rc.d/init-services/type | 1 + .../etc/s6-overlay/s6-rc.d/init-services/up | 1 + .../svc-cron/dependencies.d/init-services | 0 .../root/etc/s6-overlay/s6-rc.d/svc-cron/run | 15 +++++++++ .../root/etc/s6-overlay/s6-rc.d/svc-cron/type | 1 + .../s6-rc.d/user/contents.d/init-adduser | 0 .../s6-rc.d/user/contents.d/init-config | 0 .../s6-rc.d/user/contents.d/init-config-end | 0 .../user/contents.d/init-crontab-config | 0 .../s6-rc.d/user/contents.d/init-custom-files | 0 .../s6-rc.d/user/contents.d/init-envfile | 0 .../s6-rc.d/user/contents.d/init-migrations | 0 .../s6-rc.d/user/contents.d/init-mods | 0 .../s6-rc.d/user/contents.d/init-mods-end | 0 .../user/contents.d/init-mods-package-install | 0 .../s6-rc.d/user/contents.d/init-os-end | 0 .../s6-rc.d/user/contents.d/init-services | 0 .../s6-rc.d/user/contents.d/svc-cron | 0 .../s6-rc.d/user2/contents.d/ci-service-check | 0 66 files changed, 191 insertions(+) create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/dependencies.d/legacy-services create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/branding create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/dependencies.d/init-migrations create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-config create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/dependencies.d/init-os-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/dependencies.d/init-mods-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods-package-install create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mods create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/base create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/init-config-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/base create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-adduser create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-envfile create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-migrations create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-custom-files create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-mods-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/up create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/run create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/type create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-adduser create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-crontab-config create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-custom-files create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-envfile create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-migrations create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-package-install create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-os-end create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-services create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron create mode 100644 docker/code-server/root/etc/s6-overlay/s6-rc.d/user2/contents.d/ci-service-check diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/dependencies.d/legacy-services b/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/dependencies.d/legacy-services new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/up new file mode 100644 index 0000000..e0f9488 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/ci-service-check/up @@ -0,0 +1 @@ +echo "[ls.io-init] done." \ No newline at end of file diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/branding b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/branding new file mode 100644 index 0000000..99077a5 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/branding @@ -0,0 +1,12 @@ +─────────────────────────────────────── + _____ __ __ _____ _____ _____ _____ + | | | | __|_ _| | | + | --| | |__ | | | | | | | | | + |_____|_____|_____| |_| |_____|_|_|_| + _____ __ __ _ __ ____ + | __ | | | | | | \ + | __ -| | | | |__| | | + |_____|_____|_|_____|____/ + + Based on images from linuxserver.io +─────────────────────────────────────── diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/dependencies.d/init-migrations b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/dependencies.d/init-migrations new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/run new file mode 100644 index 0000000..a03a3e9 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -0,0 +1,32 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +PUID=${PUID:-911} +PGID=${PGID:-911} + +groupmod -o -g "$PGID" abc +usermod -o -u "$PUID" abc + +cat /etc/s6-overlay/s6-rc.d/init-adduser/branding + +if [[ -f /donate.txt ]]; then + echo ' +To support the app dev(s) visit:' + cat /donate.txt +fi +echo ' +To support LSIO projects visit: +https://www.linuxserver.io/donate/ + +─────────────────────────────────────── +GID/UID +───────────────────────────────────────' +echo " +User UID: $(id -u abc) +User GID: $(id -g abc) +─────────────────────────────────────── +" + +lsiown abc:abc /app +lsiown abc:abc /config +lsiown abc:abc /defaults diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/up new file mode 100644 index 0000000..b8522da --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-adduser/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-adduser/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-config b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/up new file mode 100644 index 0000000..c329423 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config-end/up @@ -0,0 +1 @@ +# This file doesn't do anything, it's just the end of the downstream image init process diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/dependencies.d/init-os-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/dependencies.d/init-os-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/up new file mode 100644 index 0000000..e80acfe --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-config/up @@ -0,0 +1 @@ +# This file doesn't do anything, it's just the start of the downstream image init process diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run new file mode 100644 index 0000000..3b51d5a --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run @@ -0,0 +1,31 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +for cron_user in abc root; do + if [[ -f "/etc/crontabs/${cron_user}" ]]; then + lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" + crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" + fi + + if [[ -f "/defaults/crontabs/${cron_user}" ]]; then + # make folders + mkdir -p \ + /config/crontabs + + # if crontabs do not exist in config + if [[ ! -f "/config/crontabs/${cron_user}" ]]; then + # copy crontab from system + if crontab -l -u "${cron_user}" >/dev/null 2>&1; then + crontab -l -u "${cron_user}" >"/config/crontabs/${cron_user}" + fi + + # if crontabs still do not exist in config (were not copied from system) + # copy crontab from image defaults (using -n, do not overwrite an existing file) + cp -n "/defaults/crontabs/${cron_user}" /config/crontabs/ + fi + + # set permissions and import user crontabs + lsiown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}" + crontab -u "${cron_user}" "/config/crontabs/${cron_user}" + fi +done diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up new file mode 100644 index 0000000..d354111 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-crontab-config/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/dependencies.d/init-mods-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/dependencies.d/init-mods-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/run new file mode 100644 index 0000000..3d8a17e --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/run @@ -0,0 +1,22 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# Directories +SCRIPTS_DIR="/custom-cont-init.d" + +# Make sure custom init directory exists and has files in it +if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then + echo "[custom-init] Files found, executing" + for SCRIPT in "${SCRIPTS_DIR}"/*; do + NAME="$(basename "${SCRIPT}")" + if [[ -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: executing..." + /bin/bash "${SCRIPT}" + echo "[custom-init] ${NAME}: exited $?" + elif [[ ! -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: is not a file" + fi + done +else + echo "[custom-init] No custom files found, skipping..." +fi diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/up new file mode 100644 index 0000000..28bf318 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-custom-files/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-custom-files/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/run new file mode 100644 index 0000000..592df52 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/run @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then + for FILENAME in /run/s6/container_environment/FILE__*; do + SECRETFILE=$(cat "${FILENAME}") + if [[ -f ${SECRETFILE} ]]; then + FILESTRIP=${FILENAME//FILE__/} + if [[ $(tail -n1 "${SECRETFILE}" | wc -l) != 0 ]]; then + echo "[env-init] Your secret: ${FILENAME##*/}" + echo " contains a trailing newline and may not work as expected" + fi + cat "${SECRETFILE}" >"${FILESTRIP}" + echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" + else + echo "[env-init] cannot find secret in ${FILENAME##*/}" + fi + done +fi diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/up new file mode 100644 index 0000000..b2b4fb8 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-envfile/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-envfile/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/run new file mode 100644 index 0000000..37f5b78 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/run @@ -0,0 +1,33 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +MIGRATIONS_DIR="/migrations" +MIGRATIONS_HISTORY="/config/.migrations" + +echo "[migrations] started" + +if [[ ! -d ${MIGRATIONS_DIR} ]]; then + echo "[migrations] no migrations found" + exit +fi + +for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do + NAME="$(basename "${MIGRATION}")" + if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then + echo "[migrations] ${NAME}: skipped" + continue + fi + echo "[migrations] ${NAME}: executing..." + chmod +x "${MIGRATION}" + # Execute migration script in a subshell to prevent it from modifying the current environment + ("${MIGRATION}") + EXIT_CODE=$? + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" + exit "${EXIT_CODE}" + fi + echo "${NAME}" >>${MIGRATIONS_HISTORY} + echo "[migrations] ${NAME}: succeeded" +done + +echo "[migrations] done" diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/up new file mode 100644 index 0000000..7c4cbcf --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-migrations/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-migrations/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods-package-install b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods-package-install new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/up new file mode 100644 index 0000000..092149d --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-end/up @@ -0,0 +1 @@ +# This file doesn't do anything, it's just the end of the mod init process diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mods b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mods new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/up new file mode 100644 index 0000000..fb63301 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-mods-package-install/run diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/base b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/base new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/init-config-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/dependencies.d/init-config-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/up new file mode 100644 index 0000000..040d801 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-mods/up @@ -0,0 +1 @@ +# This file doesn't do anything, it's just the start of the mod init process diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/base b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/base new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-adduser b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-adduser new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-envfile b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-envfile new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-migrations b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/dependencies.d/init-migrations new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/up new file mode 100644 index 0000000..092149d --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-os-end/up @@ -0,0 +1 @@ +# This file doesn't do anything, it's just the end of the mod init process diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-custom-files b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-custom-files new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-mods-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-mods-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/up b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/up new file mode 100644 index 0000000..a7c3905 --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/init-services/up @@ -0,0 +1 @@ +# This file doesn't do anything, it just signals that services can start diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services b/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/run b/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/run new file mode 100644 index 0000000..87e4fdb --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/run @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc 2>/dev/null || true)" || -n "$(crontab -l -u root 2>/dev/null || true)" ]]; then + if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox || true) =~ [[:space:]](crond)([,]|$) ]]; then + exec busybox crond -f -S -l 5 + elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then + exec /usr/sbin/cron -f -L 5 + else + echo "**** cron not found ****" + sleep infinity + fi +else + sleep infinity +fi diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/type b/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/docker/code-server/root/etc/s6-overlay/s6-rc.d/svc-cron/type @@ -0,0 +1 @@ +longrun diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-adduser b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-adduser new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-config-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-crontab-config b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-crontab-config new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-custom-files b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-custom-files new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-envfile b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-envfile new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-migrations b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-migrations new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-package-install b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-package-install new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-os-end b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-os-end new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-services b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron new file mode 100644 index 0000000..e69de29 diff --git a/docker/code-server/root/etc/s6-overlay/s6-rc.d/user2/contents.d/ci-service-check b/docker/code-server/root/etc/s6-overlay/s6-rc.d/user2/contents.d/ci-service-check new file mode 100644 index 0000000..e69de29