From c56c67969b235ffb3bdcca887b4a7772b28800a1 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Wed, 22 Nov 2023 10:23:30 +0000 Subject: [PATCH] Run makemigrations as root, move chown. --- .../s6-rc.d/init-healthchecks-config/run | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-healthchecks-config/run b/root/etc/s6-overlay/s6-rc.d/init-healthchecks-config/run index 90863231..5dee528d 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-healthchecks-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-healthchecks-config/run @@ -106,7 +106,7 @@ fi if [[ -z "$SECRET_KEY" ]] && ! grep "SECRET_KEY" /config/local_settings.py &> /dev/null; then insert_config "SECRET_KEY" "\"$(tr -dc A-Za-z0-9 /dev/null 2>&1 +cp /defaults/uwsgi.ini /app/healthchecks/uwsgi.ini + +cd /app/healthchecks || exit + +python3 ./manage.py makemigrations # permissions lsiown -R abc:abc \ /config -cd /app/healthchecks || exit - -s6-setuidgid abc python3 ./manage.py makemigrations s6-setuidgid abc python3 ./manage.py migrate if [[ -n "$SUPERUSER_EMAIL" ]] && [[ -n "$SUPERUSER_PASSWORD" ]]; then cat << EOF | s6-setuidgid abc python3 /app/healthchecks/manage.py shell from django.contrib.auth.models import User; -from hc.accounts.views import _make_user; +from hc.accounts.views import _make_user; password = '$SUPERUSER_PASSWORD'; email = '$SUPERUSER_EMAIL'; if User.objects.filter(email=email).count()==0: user = _make_user(email); - user.set_password(password); + user.set_password(password); user.is_staff = True; user.is_superuser = True; user.save();