2021-08-26 02:47:56 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Check if config exists from existing installation (venv or previous docker launch)
|
|
|
|
if [ ! "$(ls -A ./app/config)" ]; then
|
2021-08-30 02:48:36 +00:00
|
|
|
mkdir ./app/config/
|
2021-08-26 02:47:56 +00:00
|
|
|
cp -r ./app/config_original/* ./app/config/
|
|
|
|
fi
|
|
|
|
|
2022-03-01 20:20:17 +00:00
|
|
|
# Set user/group permissions to env or default to image root
|
|
|
|
groupmod -g "${PGID}" -o crafty
|
|
|
|
sed -i -E "s/^(crafty:x):[0-9]+:[0-9]+:(.*)/\\1:$PUID:$PGID:\\2/" /etc/passwd
|
|
|
|
|
|
|
|
# Apply new permissions taken from env over working dirs
|
|
|
|
chown -R crafty:crafty \
|
|
|
|
/commander/ \
|
|
|
|
/commander-venv/
|
|
|
|
|
2022-02-27 18:38:30 +00:00
|
|
|
# Activate our prepared venv and launch crafty with provided args
|
|
|
|
. /commander-venv/bin/activate
|
2021-08-26 02:47:56 +00:00
|
|
|
exec python3 main.py $@
|