45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
export NGINX_CONFIG_VERSION=v2
|
|
export APP_ENTRYPOINT_VERSION=v1
|
|
|
|
secrets() {
|
|
docker context use default > /dev/null 2>&1
|
|
|
|
DJANGO_SECRET_KEY=$(openssl rand -base64 45)
|
|
abra app secret insert "$APP_NAME" django_secret_key v1 "$DJANGO_SECRET_KEY"
|
|
|
|
echo "DJANGO_SECRET_KEY = $DJANGO_SECRET_KEY"
|
|
}
|
|
|
|
migrate(){
|
|
# run against the "api" service
|
|
|
|
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
|
|
|
|
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
|
|
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
|
|
|
|
python manage.py migrate
|
|
}
|
|
|
|
admin() {
|
|
# run against the "api" service
|
|
|
|
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
|
|
|
|
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
|
|
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
|
|
|
|
python manage.py createsuperuser
|
|
}
|
|
|
|
static() {
|
|
# run against the "api" service
|
|
|
|
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
|
|
|
|
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
|
|
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
|
|
|
|
python manage.py collectstatic --no-input
|
|
}
|