fix: build.sh password_key sync preserves config; add tmpl processor

This commit is contained in:
yumoqing 2026-07-21 18:32:52 +08:00
parent 3270e4b1c9
commit 1fedd68a52

View File

@ -74,15 +74,15 @@ if [ -d wwwroot/knowledge_bases_list ]; then
find wwwroot -name '*.dspy' -exec sed -i "s/ns\['created_by'\] = ''/ns['created_by'] = userorgid/" {} \; 2>/dev/null || true
fi
# Sync password_key from Sage if available
# Sync password_key from Sage if available (only update key, preserve rest)
if [ -f /d/apitest/sage/conf/config.json ]; then
sage_key=$(python3 -c "import json; print(json.load(open('/d/apitest/sage/conf/config.json'))['password_key'])")
python3 -c "
import json
c = json.load(open('$cdir/conf/config.json'))
c['password_key'] = '$sage_key'
json.dump(c, open('$cdir/conf/config.json', 'w'), indent=4)
"
json.dump(c, open('$cdir/conf/config.json', 'w'), indent=4, ensure_ascii=False)
" 2>/dev/null
echo "password_key synced from Sage"
fi