Config-driven environments for seed import tool #2

Closed
opened 2026-05-25 04:30:49 +00:00 by shawn · 0 comments
Owner

Summary

Made the seed import tool config-driven, matching the main app pattern. Both prod and dev clones now pull from the same Gitea repo.

Changes

server.py:

  • DEFAULT_DB_PATH now reads from CANTEEN_IMPORT_DB_PATH env var (fallback: seed-data/assets.db)
  • DEFAULT_SEED_DIR reads from CANTEEN_IMPORT_SEED_DIR env var
  • UPLOAD_DIR reads from CANTEEN_IMPORT_UPLOAD_DIR env var
  • --port default reads from CANTEEN_IMPORT_PORT env var (fallback: 8091)

New scripts (in-repo):

  • start.sh — production (default port 8091, default DB)
  • start-dev.sh — development (port 8093, assets.dev.db)

Infrastructure fix:

  • Dev clone (~/projects/canteen-seed-import-dev) now has Gitea as origin
  • Previously pointed to local prod dir — no Gitea connectivity
  • Now: git pull origin main works from both clones

Workflow

# Prod
cd ~/projects/canteen-seed-import && ./start.sh

# Dev
cd ~/projects/canteen-seed-import-dev && ./start-dev.sh

# Pull latest (either clone)
git pull origin main

Verification

  • Prod :8091 — 1,848 machines, GPS 0% (needs import)
  • Dev :8093 — 1,848 machines, GPS 0% (seeded from prod DB copy)
  • Env vars propagate correctly: CANTEEN_IMPORT_PORT, CANTEEN_IMPORT_DB_PATH
## Summary Made the seed import tool config-driven, matching the main app pattern. Both prod and dev clones now pull from the same Gitea repo. ## Changes **server.py:** - `DEFAULT_DB_PATH` now reads from `CANTEEN_IMPORT_DB_PATH` env var (fallback: seed-data/assets.db) - `DEFAULT_SEED_DIR` reads from `CANTEEN_IMPORT_SEED_DIR` env var - `UPLOAD_DIR` reads from `CANTEEN_IMPORT_UPLOAD_DIR` env var - `--port` default reads from `CANTEEN_IMPORT_PORT` env var (fallback: 8091) **New scripts (in-repo):** - `start.sh` — production (default port 8091, default DB) - `start-dev.sh` — development (port 8093, assets.dev.db) **Infrastructure fix:** - Dev clone (`~/projects/canteen-seed-import-dev`) now has Gitea as origin - Previously pointed to local prod dir — no Gitea connectivity - Now: `git pull origin main` works from both clones ## Workflow ```bash # Prod cd ~/projects/canteen-seed-import && ./start.sh # Dev cd ~/projects/canteen-seed-import-dev && ./start-dev.sh # Pull latest (either clone) git pull origin main ``` ## Verification - Prod :8091 — 1,848 machines, GPS 0% (needs import) - Dev :8093 — 1,848 machines, GPS 0% (seeded from prod DB copy) - Env vars propagate correctly: CANTEEN_IMPORT_PORT, CANTEEN_IMPORT_DB_PATH
shawn closed this issue 2026-05-25 04:30:49 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shawn/canteen-seed-import#2