#!/bin/sh set -eu export SILLYHOME_HA_URL="${SILLYHOME_HA_URL:-http://supervisor/core}" export SILLYHOME_HA_TOKEN="${SILLYHOME_HA_TOKEN:-${SUPERVISOR_TOKEN:-}}" export SILLYHOME_MODEL_STORE=/data/models export SILLYHOME_AUTOMATION_STORE=/data/automations export SILLYHOME_ACTUATOR_STORE=/data/actuators if [ -f /data/options.json ]; then export SILLYHOME_HISTORY_DAYS="$(python -c 'import json; print(json.load(open("/data/options.json")).get("history_days", 14))')" export SILLYHOME_MIN_TRAINING_POINTS="$(python -c 'import json; print(json.load(open("/data/options.json")).get("min_training_points", 24))')" export SILLYHOME_RETRAIN_STALE_HOURS="$(python -c 'import json; print(json.load(open("/data/options.json")).get("retrain_stale_hours", 24))')" export SILLYHOME_RECONCILE_INTERVAL_SECONDS="$(python -c 'import json; print(json.load(open("/data/options.json")).get("reconcile_interval_seconds", 900))')" fi mkdir -p "$SILLYHOME_MODEL_STORE" "$SILLYHOME_AUTOMATION_STORE" "$SILLYHOME_ACTUATOR_STORE" exec uvicorn app.main:app --app-dir /app --host 0.0.0.0 --port 8000 \ --proxy-headers --forwarded-allow-ips='*'