Configure shop app, admin sidebar, media routing, and Stripe dependencies
This commit is contained in:
commit
93d83a0d63
188 files changed
+9220
No files matched your search
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd /opt/slump-x-land-studio
|
||||
|
||||
grep -q '^stripe' requirements.txt || { echo "ERROR: stripe missing from requirements.txt"; exit 1; }
|
||||
grep -q "include('shop.urls')" siteconfig/urls.py || { echo "ERROR: shop.urls missing from siteconfig/urls.py"; exit 1; }
|
||||
|
||||
sudo docker compose up -d --build
|
||||
sudo docker compose ps
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
install -d -m 0755 -o slump -g slump /data/media /data/static
|
||||
gosu slump python manage.py migrate --noinput
|
||||
gosu slump python manage.py collectstatic --noinput
|
||||
web=(gosu slump gunicorn siteconfig.wsgi:application --bind 0.0.0.0:8000 --workers 2 --timeout 120 --access-logfile - --error-logfile -)
|
||||
if [[ ${SLX_NEWSLETTER_ENABLED:-0} != 1 ]]; then
|
||||
exec "${web[@]}"
|
||||
fi
|
||||
"${web[@]}" &
|
||||
web_pid=$!
|
||||
gosu slump python manage.py newsletter_worker &
|
||||
worker_pid=$!
|
||||
trap 'kill -TERM "$web_pid" "$worker_pid" 2>/dev/null || true; wait "$web_pid" "$worker_pid" || true; exit 0' TERM INT
|
||||
# Let Docker restart the service if one of the managed processes stops.
|
||||
wait -n "$web_pid" "$worker_pid" || true
|
||||
kill -TERM "$web_pid" "$worker_pid" 2>/dev/null || true
|
||||
wait "$web_pid" "$worker_pid" || true
|
||||
exit 1
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
host=${1:-stage.slumpxland-official.com}
|
||||
port=${2:-8093}
|
||||
if [ "$#" -gt 2 ] || ! printf '%s\n' "$host" | grep -Eq '^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$' || ! printf '%s\n' "$port" | grep -Eq '^[1-9][0-9]{0,4}$' || [ "$port" -gt 65535 ] || [ "$port" -lt 1024 ]; then
|
||||
printf 'Usage: sh scripts/setup.sh [hostname] [port 1024-65535]\n' >&2
|
||||
exit 2
|
||||
fi
|
||||
if [ -e .env ] || [ -e secrets ]; then
|
||||
printf 'Setup already exists. Edit .env to change hostname or port; keep the existing secrets.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
umask 077
|
||||
db_password=$(openssl rand -hex 32)
|
||||
django_secret=$(openssl rand -hex 48)
|
||||
mkdir -m 0700 secrets
|
||||
printf '%s\n' "$db_password" > secrets/db_password
|
||||
printf '%s\n' "$django_secret" > secrets/django_secret
|
||||
chmod 0644 secrets/db_password secrets/django_secret
|
||||
cat > .env <<CONFIG
|
||||
SLX_ALLOWED_HOSTS=$host,localhost
|
||||
SLX_CSRF_ORIGINS=https://$host
|
||||
SLX_PORT=$port
|
||||
SLX_BEHIND_CADDY=1
|
||||
SLX_HTTPS=1
|
||||
CONFIG
|
||||
printf 'Configured %s on local port %s. Next: docker compose up -d --build\n' "$host" "$port"
|
||||
Reference in new issue
Block a user