fix(metablogizer): Auto-republish and Gitea push on file upload
- Add auto-republish to method_upload_file (was only in upload_finalize) - Add Gitea push to cmd_publish when gitea.enabled=1 - Use haproxyctl reload instead of init.d (container-aware) - Uploaded content now triggers full republish flow for emancipated sites This fixes the issue where uploading new HTML content didn't update the live site because republish wasn't triggered. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
629c21a75c
commit
3b32d631cb
@ -3604,3 +3604,20 @@ git checkout HEAD -- index.html
|
|||||||
- **Verified:** test2.gk2.secubox.in emancipation successful with WAF enabled
|
- **Verified:** test2.gk2.secubox.in emancipation successful with WAF enabled
|
||||||
- **Files Modified:**
|
- **Files Modified:**
|
||||||
- `secubox-app-streamlit/files/usr/sbin/streamlitctl`: Added waf_enabled UCI field, use haproxyctl reload
|
- `secubox-app-streamlit/files/usr/sbin/streamlitctl`: Added waf_enabled UCI field, use haproxyctl reload
|
||||||
|
|
||||||
|
34. **Portal Password Change & MetaBlogizer Upload Fix (2026-02-25)**
|
||||||
|
- **Portal Password Change:**
|
||||||
|
- New "Account" section with "Change Password" and "My Services" cards
|
||||||
|
- Password change modal with current/new/confirm fields
|
||||||
|
- RPC method `change_password` verifies current password, syncs to all services
|
||||||
|
- Syncs to: email (mailserver), jabber, nextcloud
|
||||||
|
- Matrix/PeerTube noted as manual update required
|
||||||
|
- **MetaBlogizer Upload Fix:**
|
||||||
|
- `method_upload_file` now auto-republishes emancipated sites (was only in finalize)
|
||||||
|
- `cmd_publish` now auto-pushes to Gitea if enabled
|
||||||
|
- Uses `haproxyctl reload` (container-aware)
|
||||||
|
- **Files Modified:**
|
||||||
|
- `luci-app-secubox-users/root/usr/libexec/rpcd/luci.secubox-users`: New change_password method
|
||||||
|
- `luci-app-secubox-portal/root/www/gk2-hub/portal.html`: Account section + password modal
|
||||||
|
- `luci-app-metablogizer/root/usr/libexec/rpcd/luci.metablogizer`: Auto-republish on upload
|
||||||
|
- `secubox-app-metablogizer/files/usr/sbin/metablogizerctl`: Gitea push on publish
|
||||||
|
|||||||
@ -961,10 +961,19 @@ method_upload_file() {
|
|||||||
if [ $rc -eq 0 ]; then
|
if [ $rc -eq 0 ]; then
|
||||||
# Fix permissions for entire site directory
|
# Fix permissions for entire site directory
|
||||||
fix_permissions "$site_path"
|
fix_permissions "$site_path"
|
||||||
|
|
||||||
|
# Auto-republish if site is emancipated (ensures content is served immediately)
|
||||||
|
local is_emancipated=$(get_uci "$id" emancipated "0")
|
||||||
|
if [ "$is_emancipated" = "1" ]; then
|
||||||
|
# Republish in background to reload HAProxy and push to Gitea if configured
|
||||||
|
metablogizerctl publish "$name" >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
|
|
||||||
json_init
|
json_init
|
||||||
json_add_boolean "success" 1
|
json_add_boolean "success" 1
|
||||||
json_add_string "filename" "$filename"
|
json_add_string "filename" "$filename"
|
||||||
json_add_string "path" "$file_path"
|
json_add_string "path" "$file_path"
|
||||||
|
json_add_string "republished" "$is_emancipated"
|
||||||
json_dump
|
json_dump
|
||||||
else
|
else
|
||||||
json_init
|
json_init
|
||||||
|
|||||||
@ -368,9 +368,9 @@ cmd_publish() {
|
|||||||
|
|
||||||
uci commit haproxy
|
uci commit haproxy
|
||||||
|
|
||||||
# Regenerate HAProxy config
|
# Regenerate HAProxy config and reload container
|
||||||
/usr/sbin/haproxyctl generate 2>/dev/null
|
/usr/sbin/haproxyctl generate 2>/dev/null
|
||||||
/etc/init.d/haproxy reload 2>/dev/null
|
/usr/sbin/haproxyctl reload 2>/dev/null
|
||||||
|
|
||||||
log_info "Site published!"
|
log_info "Site published!"
|
||||||
echo ""
|
echo ""
|
||||||
@ -379,6 +379,13 @@ cmd_publish() {
|
|||||||
echo "To request SSL certificate:"
|
echo "To request SSL certificate:"
|
||||||
echo " haproxyctl cert add $domain"
|
echo " haproxyctl cert add $domain"
|
||||||
|
|
||||||
|
# Auto-push to Gitea if configured
|
||||||
|
local gitea_enabled=$(uci_get gitea.enabled)
|
||||||
|
if [ "$gitea_enabled" = "1" ]; then
|
||||||
|
log_info "Pushing to Gitea repository..."
|
||||||
|
cmd_gitea_push "$name" 2>/dev/null &
|
||||||
|
fi
|
||||||
|
|
||||||
# Auto-package for P2P distribution
|
# Auto-package for P2P distribution
|
||||||
if [ -x /usr/sbin/secubox-content-pkg ]; then
|
if [ -x /usr/sbin/secubox-content-pkg ]; then
|
||||||
log_info "Packaging site for P2P distribution..."
|
log_info "Packaging site for P2P distribution..."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user