From 90c9e4954e03f67a2cff67a86023c07a589a5070 Mon Sep 17 00:00:00 2001 From: Joe Milazzo Date: Fri, 24 Feb 2023 10:26:20 -0600 Subject: [PATCH] Reverted Docker setup for Synology users and bumped to a hotfix number. This will match nightly users but will not share the same codebase. (#1836) --- Kavita.Common/Kavita.Common.csproj | 2 +- entrypoint.sh | 69 +++++++++++++++--------------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj index b6a4b38a6..0217b7037 100644 --- a/Kavita.Common/Kavita.Common.csproj +++ b/Kavita.Common/Kavita.Common.csproj @@ -3,7 +3,7 @@ net6.0 kavitareader.com Kavita - 0.7.1.0 + 0.7.1.4 en true diff --git a/entrypoint.sh b/entrypoint.sh index 33fe57a92..e07ece683 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,18 +1,18 @@ #! /bin/bash -# Set default UID and GID for Kavita but allow overrides -PUID=${PUID:-0} -PGID=${PGID:-0} - -# Add Kavita group if it doesn't already exist -if [[ -z "$(getent group "$PGID" | cut -d':' -f1)" ]]; then - groupadd -o -g "$PGID" kavita -fi - -# Add Kavita user if it doesn't already exist -if [[ -z "$(getent passwd "$PUID" | cut -d':' -f1)" ]]; then - useradd -o -u "$PUID" -g "$PGID" -d /kavita kavita -fi +## Set default UID and GID for Kavita but allow overrides +#PUID=${PUID:-0} +#PGID=${PGID:-0} +# +## Add Kavita group if it doesn't already exist +#if [[ -z "$(getent group "$PGID" | cut -d':' -f1)" ]]; then +# groupadd -o -g "$PGID" kavita +#fi +# +## Add Kavita user if it doesn't already exist +#if [[ -z "$(getent passwd "$PUID" | cut -d':' -f1)" ]]; then +# useradd -o -u "$PUID" -g "$PGID" -d /kavita kavita +#fi if [ ! -f "/kavita/config/appsettings.json" ]; then echo "Kavita configuration file does not exist, creating..." @@ -24,24 +24,25 @@ fi chmod +x Kavita -if [[ "$PUID" -eq 0 ]]; then - # Run as root - ./Kavita -else - # Set ownership on config dir if running non-root and current ownership is different - if [[ ! "$(stat -c %u /kavita/config)" = "$PUID" ]]; then - echo "Specified PUID differs from Kavita config dir ownership, updating permissions now..." - if [[ ! "$(stat -c %g /kavita/config)" = "$PGID" ]]; then - chown -R "$PUID":"$PGID" /kavita/config - else - chown -R "$PUID" /kavita/config - fi - - elif [[ ! "$(stat -c %g /kavita/config)" = "$PGID" ]]; then - echo "Specified PGID differs from Kavita config dir ownership, updating permissions now..." - chgrp -R "$PGID" /kavita/config - fi - - # Run as non-root user - su -l kavita -c ./Kavita -fi +./Kavita +#if [[ "$PUID" -eq 0 ]]; then +# # Run as root +# ./Kavita +#else +# # Set ownership on config dir if running non-root and current ownership is different +# if [[ ! "$(stat -c %u /kavita/config)" = "$PUID" ]]; then +# echo "Specified PUID differs from Kavita config dir ownership, updating permissions now..." +# if [[ ! "$(stat -c %g /kavita/config)" = "$PGID" ]]; then +# chown -R "$PUID":"$PGID" /kavita/config +# else +# chown -R "$PUID" /kavita/config +# fi +# +# elif [[ ! "$(stat -c %g /kavita/config)" = "$PGID" ]]; then +# echo "Specified PGID differs from Kavita config dir ownership, updating permissions now..." +# chgrp -R "$PGID" /kavita/config +# fi +# +# # Run as non-root user +# su -l kavita -c ./Kavita +#fi