fix: build.sh password_key sync preserves config; add tmpl processor
This commit is contained in:
parent
3270e4b1c9
commit
1fedd68a52
6
build.sh
6
build.sh
@ -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
|
find wwwroot -name '*.dspy' -exec sed -i "s/ns\['created_by'\] = ''/ns['created_by'] = userorgid/" {} \; 2>/dev/null || true
|
||||||
fi
|
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
|
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'])")
|
sage_key=$(python3 -c "import json; print(json.load(open('/d/apitest/sage/conf/config.json'))['password_key'])")
|
||||||
python3 -c "
|
python3 -c "
|
||||||
import json
|
import json
|
||||||
c = json.load(open('$cdir/conf/config.json'))
|
c = json.load(open('$cdir/conf/config.json'))
|
||||||
c['password_key'] = '$sage_key'
|
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"
|
echo "password_key synced from Sage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user