feat(streamlit): Auto-create Gitea repo and push on all uploads

- Add gitea push to upload_app (small files)
- Add gitea push to upload_zip
- Add gitea push to save_source (edit)
- Chunked upload already had gitea push

Every app creation/update now automatically:
1. Creates Gitea repo if not exists (streamlit-<name>)
2. Pushes changes to the repo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-02-12 08:50:12 +01:00
parent fdc7467630
commit 417a572338

View File

@ -562,6 +562,8 @@ upload_app() {
uci set "${CONFIG}.${name}.path=${name}.py"
uci set "${CONFIG}.${name}.enabled=1"
uci commit "$CONFIG"
# Auto-create Gitea repo and push (background)
streamlitctl gitea push "$name" >/dev/null 2>&1 &
json_success "App uploaded: $name"
else
rm -f "$app_file"
@ -993,6 +995,9 @@ upload_zip() {
uci set "${CONFIG}.${name}.enabled=1"
uci commit "$CONFIG"
# Auto-create Gitea repo and push (background)
streamlitctl gitea push "$name" >/dev/null 2>&1 &
json_init_obj
json_add_boolean "success" 1
json_add_string "message" "App deployed: $name"
@ -1222,6 +1227,8 @@ save_source() {
rm -f "$b64file"
if [ $rc -eq 0 ] && [ -s "$app_file" ]; then
# Auto-push to Gitea (background)
streamlitctl gitea push "$name" >/dev/null 2>&1 &
json_success "Source saved: $name"
else
# Restore backup on failure