From 7d81724e14f8dd9a0d70248e2afe8e0a19ff6b82 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 18 Aug 2026 17:16:27 +0200 Subject: [PATCH] Update flask_server.py --- AppImage/scripts/flask_server.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/AppImage/scripts/flask_server.py b/AppImage/scripts/flask_server.py index 51cc606c..43fd1c6b 100644 --- a/AppImage/scripts/flask_server.py +++ b/AppImage/scripts/flask_server.py @@ -20372,7 +20372,27 @@ def api_system_pve_update_cancel(): # Runs inside a systemd unit so it survives the proxmenux-monitor # service restart the installer performs mid-way. -_PROXMENUX_INSTALLER_URL = 'https://raw.githubusercontent.com/MacRimi/ProxMenux/main/install_proxmenux.sh' +_PROXMENUX_STABLE_INSTALLER_URL = 'https://raw.githubusercontent.com/MacRimi/ProxMenux/main/install_proxmenux.sh' +_PROXMENUX_BETA_INSTALLER_URL = 'https://raw.githubusercontent.com/MacRimi/ProxMenux/develop/install_proxmenux_beta.sh' +_PROXMENUX_CONFIG_FILE = '/usr/local/share/proxmenux/config.json' + + +def _proxmenux_self_update_installer_url(): + """Pick stable vs beta installer based on the host's release channel. + + A host with `beta_program.status == active` in config.json must be + updated with the beta installer so it stays on the beta channel. + Falling back to the stable installer would clone main, wipe + beta_version.txt, and silently drop the user off the beta program. + """ + try: + with open(_PROXMENUX_CONFIG_FILE, 'r') as f: + cfg = json.load(f) + if (cfg.get('beta_program') or {}).get('status') == 'active': + return _PROXMENUX_BETA_INSTALLER_URL + except (OSError, ValueError, TypeError): + pass + return _PROXMENUX_STABLE_INSTALLER_URL @app.route('/api/proxmenux/self-update/run', methods=['POST']) @@ -20386,9 +20406,10 @@ def api_proxmenux_self_update_run(): process that accepted the call dies during the restart. Clients can poll `.../status` to observe completion. """ + installer_url = _proxmenux_self_update_installer_url() ok, err = _action_run( 'proxmenux-action-self-update', - ['/bin/bash', '-c', f'wget -qLO - {_PROXMENUX_INSTALLER_URL} | bash'], + ['/bin/bash', '-c', f'wget -qLO - {installer_url} | bash'], description='ProxMenux action: self-update', ) if not ok: