4ab08ca7bd
Root cause: Admin server's DB_PATH defaulted to its own assets.db (local copy with 7,560 assets) instead of the main app's DB (10,148 assets). Machine ID 68026 didn't exist in the stale copy. Fix: - Copied main app's assets.db over (now synced) - Set CANTEEN_DB_PATH in run.sh to default to ../canteen-asset-tracker/assets.db (env var can still override for custom setups)
17 lines
420 B
Bash
17 lines
420 B
Bash
#!/usr/bin/env bash
|
|
# Run the admin server — MUST use same DB as main canteen-asset-tracker
|
|
set -euo pipefail
|
|
|
|
PORT="${PORT:-8090}"
|
|
HOST="${HOST:-0.0.0.0}"
|
|
APP_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
CANTEEN_DB_PATH="${CANTEEN_DB_PATH:-${APP_DIR}/../canteen-asset-tracker/assets.db}"
|
|
|
|
export CANTEEN_DB_PATH
|
|
|
|
exec python -m uvicorn admin_server:app \
|
|
--host "$HOST" \
|
|
--port "$PORT" \
|
|
--reload \
|
|
--log-level info
|