rename user to cronicle

This commit is contained in:
MrMeeb 2023-05-27 18:46:23 +00:00
parent bfbc0e22d7
commit f1f322d58a
4 changed files with 10 additions and 13 deletions

View File

@ -27,8 +27,8 @@ RUN apk update && apk add tzdata curl shadow bash xz git procps nodejs npm
RUN mkdir /config && \ RUN mkdir /config && \
mkdir /app && \ mkdir /app && \
#Create default user #Create default user
useradd -u 1000 -U -d /config -s /bin/false mrmeeb && \ useradd -u 1000 -U -d /config -s /bin/false cronicle && \
usermod -G users mrmeeb usermod -G users cronicle
#Install s6-overlay #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 / && \ 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 node bin/build dist
RUN rm -rf /app/cronicle/Docker* .vscode 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/ / COPY root/ /
RUN chmod +x /cronicle-prepare.sh && \ RUN chmod +x /cronicle-prepare.sh && \
chmod +x /container-init.sh chmod +x /container-init.sh

View File

@ -28,11 +28,11 @@ MODE=${MODE}
if [[ ! "${PUID}" -eq 0 ]] && [[ ! "${PGID}" -eq 0 ]]; then if [[ ! "${PUID}" -eq 0 ]] && [[ ! "${PGID}" -eq 0 ]]; then
echo "Executing usermod..." echo "Executing usermod..."
mkdir "/tmp/temphome" mkdir "/tmp/temphome"
usermod -d "/tmp/temphome" mrmeeb usermod -d "/tmp/temphome" cronicle
usermod -o -u "${PUID}" mrmeeb usermod -o -u "${PUID}" cronicle
usermod -d /config mrmeeb usermod -d /config cronicle
rm -rf "/tmp/temphome" rm -rf "/tmp/temphome"
groupmod -o -g "${PGID}" mrmeeb groupmod -o -g "${PGID}" cronicle
else else
echo "Running as root is not supported, please fix your PUID and PGID!" echo "Running as root is not supported, please fix your PUID and PGID!"
exit 1 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}" ] if [ ! "$(stat -c %u /app)" -eq "${PUID}" ] || [ ! "$(stat -c %g /app)" -eq "${PGID}" ]
then then
echo "Fixing permissions for /app." echo "Fixing permissions for /app."
chown -R mrmeeb:mrmeeb /app chown -R cronicle:cronicle /app
fi fi
if [ ! "$(stat -c %u /config)" -eq "${PUID}" ] || [ ! "$(stat -c %g /config)" -eq "${PGID}" ] if [ ! "$(stat -c %u /config)" -eq "${PUID}" ] || [ ! "$(stat -c %g /config)" -eq "${PGID}" ]
then then
echo "Fixing permissions for /config." echo "Fixing permissions for /config."
chown -R mrmeeb:mrmeeb /config chown -R cronicle:cronicle /config
fi fi

View File

@ -1 +1 @@
exec s6-setuidgid mrmeeb /cronicle-prepare.sh exec s6-setuidgid cronicle /cronicle-prepare.sh

View File

@ -1,3 +1,3 @@
#!/command/with-contenv bash #!/command/with-contenv bash
# shellcheck shell=bash # shellcheck shell=bash
exec s6-setuidgid mrmeeb node /app/cronicle/lib/main.js --color 1 exec s6-setuidgid cronicle node /app/cronicle/lib/main.js --color 1