diff --git a/scripts/check-config-sync.sh b/scripts/check-config-sync.sh new file mode 100755 index 0000000..9d22c1d --- /dev/null +++ b/scripts/check-config-sync.sh @@ -0,0 +1,12 @@ +# Fail if the live chat config differs from this repo's librechat.yaml. +# Config is data (/app/data/librechat.yaml), so the image tag may lag main — this is +# the check that actually matters. +set -euo pipefail +APP="${CHAT_APP:-4023ccbf-d57a-4500-97df-14de9cf3516e}" +REPO_HASH=$(sha256sum librechat.yaml | cut -c1-16) +LIVE_HASH=$(printf 'import hashlib;print(hashlib.sha256(open("/app/data/librechat.yaml","rb").read()).hexdigest()[:16])' > /tmp/_h.py + cloudron --server "${CLOUDRON_SERVER:-my.inference.coop}" --token "$CLOUDRON_TOKEN" push --app "$APP" /tmp/_h.py /tmp/_h.py >/dev/null + cloudron --server "${CLOUDRON_SERVER:-my.inference.coop}" --token "$CLOUDRON_TOKEN" exec --app "$APP" python3 /tmp/_h.py | tr -d '\r') +echo "repo=$REPO_HASH live=$LIVE_HASH" +[ "$REPO_HASH" = "$LIVE_HASH" ] || { echo "DRIFT: deploy librechat.yaml (push to /app/data) before assuming main is live"; exit 1; } +echo "OK: live config matches repo main"