scripts: check-config-sync — compare repo librechat.yaml to the live mounted config

This commit is contained in:
inference-admin committed 2026-11-18 17:01:10 +00:00
1 parent f8cf3f2c9e
commit fa4f841fe6
1 file changed
+12
+12
View File
@@ -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"