From f1f322d58a6bd9e689486efb2f917794e8aa9240 Mon Sep 17 00:00:00 2001 From: MrMeeb Date: Sat, 27 May 2023 18:46:23 +0000 Subject: [PATCH] rename user to cronicle --- Dockerfile | 7 ++----- root/container-init.sh | 12 ++++++------ root/etc/s6-overlay/s6-rc.d/cronicle-prepare/up | 2 +- root/etc/s6-overlay/s6-rc.d/cronicle/run | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffb34cf..8c2366b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,8 @@ RUN apk update && apk add tzdata curl shadow bash xz git procps nodejs npm RUN mkdir /config && \ mkdir /app && \ #Create default user - useradd -u 1000 -U -d /config -s /bin/false mrmeeb && \ - usermod -G users mrmeeb + useradd -u 1000 -U -d /config -s /bin/false cronicle && \ + usermod -G users cronicle #Install s6-overlay RUN curl -fsSL "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jpxf - -C / && \ @@ -44,9 +44,6 @@ RUN npm install && \ node bin/build dist RUN rm -rf /app/cronicle/Docker* .vscode -#Create Cronicle user, necessary for SSH plugin with default settings -RUN adduser --disabled-password --no-create-home cronicle - COPY root/ / RUN chmod +x /cronicle-prepare.sh && \ chmod +x /container-init.sh diff --git a/root/container-init.sh b/root/container-init.sh index c6e6821..ff45c08 100644 --- a/root/container-init.sh +++ b/root/container-init.sh @@ -28,11 +28,11 @@ MODE=${MODE} if [[ ! "${PUID}" -eq 0 ]] && [[ ! "${PGID}" -eq 0 ]]; then echo "Executing usermod..." mkdir "/tmp/temphome" - usermod -d "/tmp/temphome" mrmeeb - usermod -o -u "${PUID}" mrmeeb - usermod -d /config mrmeeb + usermod -d "/tmp/temphome" cronicle + usermod -o -u "${PUID}" cronicle + usermod -d /config cronicle rm -rf "/tmp/temphome" - groupmod -o -g "${PGID}" mrmeeb + groupmod -o -g "${PGID}" cronicle else echo "Running as root is not supported, please fix your PUID and PGID!" exit 1 @@ -43,11 +43,11 @@ echo "Checking permissions in /config and /app (this can take some time)." if [ ! "$(stat -c %u /app)" -eq "${PUID}" ] || [ ! "$(stat -c %g /app)" -eq "${PGID}" ] then echo "Fixing permissions for /app." - chown -R mrmeeb:mrmeeb /app + chown -R cronicle:cronicle /app fi if [ ! "$(stat -c %u /config)" -eq "${PUID}" ] || [ ! "$(stat -c %g /config)" -eq "${PGID}" ] then echo "Fixing permissions for /config." - chown -R mrmeeb:mrmeeb /config + chown -R cronicle:cronicle /config fi \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/cronicle-prepare/up b/root/etc/s6-overlay/s6-rc.d/cronicle-prepare/up index 5c021c4..c4512f8 100644 --- a/root/etc/s6-overlay/s6-rc.d/cronicle-prepare/up +++ b/root/etc/s6-overlay/s6-rc.d/cronicle-prepare/up @@ -1 +1 @@ -exec s6-setuidgid mrmeeb /cronicle-prepare.sh \ No newline at end of file +exec s6-setuidgid cronicle /cronicle-prepare.sh \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/cronicle/run b/root/etc/s6-overlay/s6-rc.d/cronicle/run index d41cf93..ffe517e 100644 --- a/root/etc/s6-overlay/s6-rc.d/cronicle/run +++ b/root/etc/s6-overlay/s6-rc.d/cronicle/run @@ -1,3 +1,3 @@ #!/command/with-contenv bash # shellcheck shell=bash -exec s6-setuidgid mrmeeb node /app/cronicle/lib/main.js --color 1 \ No newline at end of file +exec s6-setuidgid cronicle node /app/cronicle/lib/main.js --color 1 \ No newline at end of file