feat: add PUID PGID UMASK settings to image

This commit is contained in:
DDSRem 2023-06-16 11:41:29 +08:00
parent 77b030199e
commit e6715081dd
2 changed files with 48 additions and 7 deletions

36
entrypoint.sh Normal file
View file

@ -0,0 +1,36 @@
#!/bin/bash
UMASK=${UMASK:-022}
PUID=${PUID:-1000}
PGID=${PGID:-1000}
umask ${UMASK}
if [ ! -d /config ]; then
mkdir /config
fi
if [ ! -d /metadata ]; then
mkdir /metadata
fi
if [ ! -d /audiobooks ]; then
mkdir /audiobooks
fi
if [ ! -d /podcasts ]; then
mkdir /podcasts
fi
echo "Change owner to user AudioBookShelf..."
echo "PUID=${PUID}"
echo "PGID=${PGID}"
groupmod -o -g ${PGID} node
usermod -o -u ${PUID} node
chown -R node:node \
/config \
/metadata
chown node:node \
/audiobooks \
/podcasts
exec su-exec node:node dumb-init $*