Add permission fixing cmd

Since we run karrot as karrot user now, the uploads need to be
owned by that user.
This commit is contained in:
Nick Sellen 2024-03-25 22:36:03 +00:00
parent 83e1c78b6a
commit 1f46da81a0
Signed by: nicksellen
GPG Key ID: 7C3A275C0DC2EFA1
1 changed files with 16 additions and 2 deletions

18
abra.sh
View File

@ -1,2 +1,16 @@
export NGINX_CONFIG_VERSION=v23
export GEOIP_CONFIG_VERSION=v1
fix-permissions() {
if [ "$(whoami)" != "root" ]; then
echo "error: you must be root to fix permissions"
echo "Try adding '--user root'"
exit 1
fi
if [ ! -d /app/uploads ]; then
echo "error: no uploads dir!"
echo "Make sure to run it on the 'app' service"
exit 1
fi
echo "Fixing upload permissions"
echo "Making karrot the owner of uploads"
chown -R karrot:karrot /app/uploads
echo "Done"
}