A kind of initial commit

This commit is contained in:
heboba
2026-02-26 19:33:05 +00:00
commit 9ab125b1a6
37 changed files with 3053 additions and 0 deletions

10
scripts/run_nightly.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
set -eu
: "${INTERNAL_JOB_TOKEN:?INTERNAL_JOB_TOKEN is required}"
: "${APP_INTERNAL_URL:=http://app:8000}"
curl --fail --silent --show-error \
-X POST \
-H "Authorization: Bearer ${INTERNAL_JOB_TOKEN}" \
"${APP_INTERNAL_URL}/internal/jobs/nightly"

4
scripts/start_app.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
set -eu
exec uvicorn app.main:create_app --factory --host 0.0.0.0 --port 8000

13
scripts/start_cron.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
: "${CRON_SCHEDULE:=15 2 * * *}"
: "${APP_TIMEZONE:=UTC}"
export TZ="${TZ:-$APP_TIMEZONE}"
cat > /tmp/crontab <<EOF
${CRON_SCHEDULE} /app/scripts/run_nightly.sh
EOF
exec /usr/local/bin/supercronic /tmp/crontab