Release v120 and sync renamed routers in update queues

This commit is contained in:
kzolotarev95 committed 2026-11-03 21:07:34 +04:00
1 parent 927181dd54
commit 41ab4387fc
83 files changed
+472 -209

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-dashboard-layout-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-dashboard-layout-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -106,7 +106,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nDASHBOARD_LAYOUT_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nDASHBOARD_LAYOUT_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-dashboard-menu-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-dashboard-menu-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -108,7 +108,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nDASHBOARD_MENU_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nDASHBOARD_MENU_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-global-logs-ui-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-global-logs-ui-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -107,7 +107,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nGLOBAL_LOGS_VPS_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nGLOBAL_LOGS_VPS_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -13,7 +13,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-global-logs-stop-v119
backup=/root/owrt-remote-backup-before-global-logs-stop-v120
items='cgi agent init logs.sh logs-init luci'
changed=0
phase=preflight
@@ -104,7 +104,7 @@ if [ '__ACTION__' = Install ]; then
command -v base64 >/dev/null
command -v jsonfilter >/dev/null
grep -F -q 'globalLogsToggle' "$stage/cgi"
for item in cgi luci; do grep -F -q 'v119' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v120' "$stage/$item"; done
grep -F -q 'LOG_KEEP_SECONDS=86400' "$stage/logs.sh"
grep -F -q 'log_sync_loop' "$stage/logs.sh"
grep -F -q 'sync_global_logs' "$stage/agent"
+4 -4
View File
@@ -6,7 +6,7 @@ param(
$ErrorActionPreference = 'Stop'
$RepoRoot = Split-Path -Parent $PSScriptRoot
$UploadName = 'owrt-group-colors-v119-' + [guid]::NewGuid().ToString('N')
$UploadName = 'owrt-group-colors-v120-' + [guid]::NewGuid().ToString('N')
$StageRoot = Join-Path ([System.IO.Path]::GetTempPath()) $UploadName
$Utf8 = [System.Text.UTF8Encoding]::new($false)
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-group-colors-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-group-colors-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -57,7 +57,7 @@ if [ '__ACTION__' = Install ]; then
from pathlib import Path
import sys
source = Path(sys.argv[1]).read_text(encoding='utf-8')
required = ('v119', '#routerForm select option,#routerGroupFilter option', 'background-color:#221a34', 'id="backupDownload"', 'id="backupRestore"')
required = ('v120', '#routerForm select option,#routerGroupFilter option', 'background-color:#221a34', 'id="backupDownload"', 'id="backupRestore"')
if 'class="backupCmds"' in source:
print('Old backup command instructions remain in candidate', file=sys.stderr)
raise SystemExit(1)
@@ -106,7 +106,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nGROUP_COLORS_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nGROUP_COLORS_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+1 -1
View File
@@ -13,7 +13,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-heartbeat-redirect-v119
backup=/root/owrt-remote-backup-before-heartbeat-redirect-v120
agent=/usr/sbin/owrt-remote
wan=/usr/lib/owrt-remote/wan.sh
changed=0
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-heartbeat-transport-v119
backup_dir=/root/owrt-remote-backup-before-heartbeat-transport-v120
changed=0
phase=preflight
item_path() {
+9 -9
View File
@@ -5,7 +5,7 @@ param(
[string]$PinnedVpsHost = '193.233.82.38',
[ValidatePattern('^[a-zA-Z0-9_-]+$')][string]$WanInterface = 'wan',
[switch]$PreserveConnectionSettings,
[ValidatePattern('^[a-zA-Z0-9_-]+$')][string]$BackupName = 'host-policy-v119',
[ValidatePattern('^[a-zA-Z0-9_-]+$')][string]$BackupName = 'host-policy-v120',
[switch]$PrepareOnly
)
@@ -90,7 +90,7 @@ test -s "$config"
if [ '__ACTION__' = Install ]; then
for item in agent wan.sh cgi init; do test -s "$stage/$item"; sh -n "$stage/$item"; done
test -s "$stage/luci"
for item in cgi luci; do grep -F -q 'v119' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v120' "$stage/$item"; done
# curl is needed to preserve HTTPS SNI and bypass the local DNS/proxy.
if ! command -v curl >/dev/null 2>&1; then
if command -v opkg >/dev/null 2>&1; then opkg update && opkg install curl ca-bundle
@@ -156,16 +156,16 @@ if [ '__ACTION__' = Install ]; then
exit 1
fi
/usr/sbin/owrt-remote status
grep -F -q 'v119' /www/cgi-bin/owrt-remote
grep -F -q 'v119' /www/luci-static/resources/view/owrt_remote.js
echo HOST_POLICY_ROUTER_V119_OK
grep -F -q 'v120' /www/cgi-bin/owrt-remote
grep -F -q 'v120' /www/luci-static/resources/view/owrt_remote.js
echo HOST_POLICY_ROUTER_V120_OK
else
test -f "$backup/complete"
save_files "$stage/previous"
changed=1
restore_files "$backup"
/usr/sbin/owrt-remote status
echo HOST_POLICY_ROUTER_V119_ROLLBACK_OK
echo HOST_POLICY_ROUTER_V120_ROLLBACK_OK
fi
'@
} else {
@@ -180,7 +180,7 @@ fi
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-host-policy-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-host-policy-v120
changed=0
cleanup() {
code=$?
@@ -200,7 +200,7 @@ test -s "$target"
python_bin=/opt/owrt-remote/venv/bin/python
[ -x "$python_bin" ] || python_bin=python3
if [ '__ACTION__' = Install ]; then
grep -F -q 'v119' "$stage/hub.py"
grep -F -q 'v120' "$stage/hub.py"
"$python_bin" -m py_compile "$stage/hub.py"
OWRT_HOST_POLICY_HUB_SOURCE="$stage/hub.py" "$python_bin" "$stage/test_host_policy.py" HostPolicyTests -v
OWRT_RESOURCE_HUB_SOURCE="$stage/hub.py" "$python_bin" "$stage/resources.py" -v
@@ -226,7 +226,7 @@ for attempt in 1 2 3 4 5 6 7 8 9 10; do
done
test "$healthy" = 1
cmp "$candidate" "$target"
printf '\nHOST_POLICY_VPS_V119_%s_OK\n' '__ACTION__'
printf '\nHOST_POLICY_VPS_V120_%s_OK\n' '__ACTION__'
'@
}
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-hub-self-update-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-hub-self-update-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -107,7 +107,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nHUB_SELF_UPDATE_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nHUB_SELF_UPDATE_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+6 -6
View File
@@ -34,7 +34,7 @@ if ($Target -eq 'Router') {
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-hub-url-v119
backup=/root/owrt-remote-backup-before-hub-url-v120
chmod 700 "$stage"
config=/etc/config/owrtremote
changed=0
@@ -99,7 +99,7 @@ if [ '__ACTION__' = Install ]; then
grep -F -q 'heartbeat_set_url_if_changed()' "$stage/agent"
grep -F -q 'reason=https-downgrade' "$stage/agent"
for item in agent wan.sh; do grep -F -q -- '--post301' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v119' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v120' "$stage/$item"; done
if [ ! -e "$backup" ]; then
save_files "$stage/retained-backup"
mv "$stage/retained-backup" "$backup"
@@ -138,7 +138,7 @@ else
changed=1
restore_files "$backup"
fi
printf '\nBackup: %s\nHUB_URL_ROUTER_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nHUB_URL_ROUTER_V120_%s_OK\n' "$backup" '__ACTION__'
'@
} else {
$Payloads = @{
@@ -152,7 +152,7 @@ set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
chmod 700 "$stage"
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-hub-url-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-hub-url-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
cleanup() {
@@ -174,7 +174,7 @@ python_bin=/opt/owrt-remote/venv/bin/python
[ -x "$python_bin" ] || python_bin=python3
if [ '__ACTION__' = Install ]; then
grep -F -q 'def router_hub_origins(' "$stage/hub.py"
grep -F -q 'v119' "$stage/hub.py"
grep -F -q 'v120' "$stage/hub.py"
"$python_bin" -m py_compile "$stage/hub.py"
OWRT_HOST_POLICY_HUB_SOURCE="$stage/hub.py" "$python_bin" "$stage/host_policy.py" HostPolicyTests -v
OWRT_RESOURCE_HUB_SOURCE="$stage/hub.py" "$python_bin" "$stage/resources.py" IntegrationTests -v
@@ -198,7 +198,7 @@ for attempt in 1 2 3 4 5 6 7 8 9 10; do
done
test "$healthy" = 1
cmp "$source_file" "$target"
printf '\nBackup: %s\nHUB_URL_VPS_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nHUB_URL_VPS_V120_%s_OK\n' "$backup" '__ACTION__'
'@
}
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action).Replace('__HUB_URL__', $HubUrl)
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-log-collector-v119
backup_dir=/root/owrt-remote-backup-before-log-collector-v120
changed=0
phase=preflight
items='logs.sh logs-init'
+2 -2
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-online-status-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-online-status-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
cleanup() {
@@ -59,7 +59,7 @@ for attempt in 1 2 3 4 5 6 7 8 9 10; do
done
test "$healthy" = 1
cmp "$source_file" "$target"
printf '\nBackup: %s\nONLINE_STATUS_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nONLINE_STATUS_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
try {
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-password-logout-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-password-logout-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -105,7 +105,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nPASSWORD_LOGOUT_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nPASSWORD_LOGOUT_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-persistent-logs-sync-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-persistent-logs-sync-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -144,7 +144,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nPERSISTENT_LOGS_VPS_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nPERSISTENT_LOGS_VPS_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -13,7 +13,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-persistent-logs-v119
backup=/root/owrt-remote-backup-before-persistent-logs-v120
items='cgi agent logs.sh logs-init luci'
changed=0
phase=preflight
@@ -106,7 +106,7 @@ if [ '__ACTION__' = Install ]; then
exit 1
fi
grep -F -q 'globalLogsToggle' "$stage/cgi"
for item in cgi luci; do grep -F -q 'v119' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v120' "$stage/$item"; done
grep -F -q 'LOG_BUFFER_LIMIT=16384' "$stage/logs.sh"
grep -F -q 'LOG_KEEP_SECONDS=86400' "$stage/logs.sh"
grep -F -q 'log_sync_loop' "$stage/logs.sh"
+6 -6
View File
@@ -17,8 +17,8 @@ if ($Action -eq 'Install') {
set -Eeuo pipefail
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v119
captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v119.json
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v120
captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v120.json
candidate=$target.new-__UPLOAD_NAME__
changed=0
cleanup() {
@@ -45,7 +45,7 @@ if [ ! -x "$python_bin" ]; then python_bin=python3; fi
import ast, pathlib, sys
source = pathlib.Path(sys.argv[1]).read_text(encoding='utf-8')
tree = ast.parse(source)
assert 'v119' in source
assert 'v120' in source
assert 'v108' not in source
assert 'CAPTCHA_MODE_RECAPTCHA_V3' in source
assert 'prepareLoginRecaptcha' in source
@@ -88,7 +88,7 @@ pid=$(systemctl show owrt-remote -p MainPID --value)
test "$pid" -gt 0
printf 'PID=%s FD=%s\n' "$pid" "$(find /proc/$pid/fd -maxdepth 1 -type l | wc -l)"
systemctl --no-pager --full status owrt-remote | sed -n '1,16p'
echo RECAPTCHA_V3_V119_OK
echo RECAPTCHA_V3_V120_OK
'@
} elseif ($Action -eq 'Rollback') {
$RemoteScript = @'
@@ -96,8 +96,8 @@ echo RECAPTCHA_V3_V119_OK
set -Eeuo pipefail
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v119
captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v119.json
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v120
captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v120.json
candidate=$target.rollback-__UPLOAD_NAME__
changed=0
restore_captcha() {
+2 -2
View File
@@ -15,7 +15,7 @@ set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/root/owrt-remote-backup-before-request-load-v119
backup=/root/owrt-remote-backup-before-request-load-v120
policy=/etc/nginx/conf.d/owrt-remote-log-policy.conf
journal=/etc/systemd/journald.conf.d/owrt-remote-limits.conf
logrotate=/etc/logrotate.d/owrt-remote
@@ -184,7 +184,7 @@ PY
done
[ "$healthy" = 1 ]
printf '\nBackup: %s\nREQUEST_LOAD_FIX_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nREQUEST_LOAD_FIX_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+4 -4
View File
@@ -18,7 +18,7 @@ if ($Action -eq 'Install') {
set -Eeuo pipefail
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
cleanup() {
@@ -45,7 +45,7 @@ if [ ! -x "$python_bin" ]; then python_bin=python3; fi
import ast, pathlib, sys
source = pathlib.Path(sys.argv[1]).read_text(encoding='utf-8')
tree = ast.parse(source)
assert 'v119' in source
assert 'v120' in source
assert 'v108' not in source
factory = next(node for node in tree.body if isinstance(node, ast.FunctionDef) and node.name == 'connect')
assert any(isinstance(item, ast.Name) and item.id == 'contextmanager' for item in factory.decorator_list)
@@ -78,7 +78,7 @@ pid=$(systemctl show owrt-remote -p MainPID --value)
test "$pid" -gt 0
printf 'PID=%s FD=%s\n' "$pid" "$(find /proc/$pid/fd -maxdepth 1 -type l | wc -l)"
systemctl --no-pager --full status owrt-remote | sed -n '1,16p'
echo RESOURCE_FIX_V119_OK
echo RESOURCE_FIX_V120_OK
'@
} elseif ($Action -eq 'Rollback') {
$RemoteScript = @'
@@ -86,7 +86,7 @@ echo RESOURCE_FIX_V119_OK
set -Eeuo pipefail
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v120
candidate=$target.rollback-__UPLOAD_NAME__
changed=0
cleanup() {
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-card-ui-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-card-ui-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -106,7 +106,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nROUTER_CARD_UI_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nROUTER_CARD_UI_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+182
View File
@@ -0,0 +1,182 @@
param(
[Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$Vps,
[ValidateSet('Install', 'Rollback')][string]$Action = 'Install',
[switch]$PrepareOnly
)
$ErrorActionPreference = 'Stop'
$RepoRoot = Split-Path -Parent $PSScriptRoot
$UploadName = 'owrt-router-name-fix-' + [guid]::NewGuid().ToString('N')
$StageRoot = Join-Path ([System.IO.Path]::GetTempPath()) $UploadName
$Utf8 = [System.Text.UTF8Encoding]::new($false)
$RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-name-fix-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
show_failure() {
echo '--- owrt-remote status ---' >&2
systemctl --no-pager -l status owrt-remote >&2 || true
echo '--- owrt-remote journal ---' >&2
journalctl -u owrt-remote -n 80 --no-pager -l >&2 || true
}
cleanup() {
code=$?
trap - EXIT
if [ "$code" -ne 0 ]; then
echo "Remote step failed with rc=$code" >&2
show_failure
fi
if [ "$code" -ne 0 ] && [ "$changed" = 1 ] && [ -s "$stage/previous.py" ]; then
echo 'Restoring the previous Hub file...' >&2
cp -p "$stage/previous.py" "$candidate"
mv -f "$candidate" "$target"
systemctl restart owrt-remote || true
fi
rm -f "$candidate"
rm -rf "$stage"
exit "$code"
}
trap cleanup EXIT
test -s "$target"
python_bin=/opt/owrt-remote/venv/bin/python
[ -x "$python_bin" ] || python_bin=python3
if [ '__ACTION__' = Install ]; then
test -s "$stage/hub.py"
echo 'Validating candidate...'
"$python_bin" -m py_compile "$stage/hub.py"
"$python_bin" - "$stage/hub.py" <<'PY'
import ast
import json
from pathlib import Path
import re
import sys
source = Path(sys.argv[1]).read_text(encoding='utf-8')
module = ast.parse(source)
function = next(node for node in module.body
if isinstance(node, ast.FunctionDef) and node.name == 'router_update_name')
namespace = {'json': json, 're': re}
exec(compile(ast.Module(body=[function], type_ignores=[]), '<name-check>', 'exec'), namespace)
row = {'id': 'main', 'custom_name': 'Renamed in Hub', 'status_json': '{"name":"Old heartbeat name"}'}
if namespace['router_update_name'](row, 'Old SSH name') != row['custom_name']:
raise SystemExit('Candidate does not prioritize Hub router names')
if "custom_names = {row['id']: router_update_name(row)" not in source:
raise SystemExit('Candidate does not refresh names in existing queues')
print('Candidate validation OK')
PY
if [ ! -e "$backup" ]; then
cp -p "$target" "$backup"
fi
source_file="$stage/hub.py"
else
test -s "$backup"
"$python_bin" -m py_compile "$backup"
source_file="$backup"
fi
expected_revision=$("$python_bin" - "$source_file" <<'PY'
import hashlib
from pathlib import Path
import sys
print(hashlib.sha256(Path(sys.argv[1]).read_bytes()).hexdigest())
PY
)
cp -p "$target" "$stage/previous.py"
cp "$source_file" "$candidate"
chmod 0755 "$candidate"
changed=1
mv -f "$candidate" "$target"
echo 'Restarting owrt-remote...'
if ! systemctl restart owrt-remote; then
show_failure
exit 1
fi
healthy=0
for attempt in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
if systemctl is-active --quiet owrt-remote && "$python_bin" - "$expected_revision" > "$stage/health-check" 2>&1 <<'PY'
import json
import sys
import urllib.request
try:
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
with opener.open('http://127.0.0.1:8088/health?panel-update=1', timeout=3) as response:
data = json.loads(response.read(4096))
revision = data.get('revision', '')
if not data.get('ok') or revision != sys.argv[1]:
raise RuntimeError('Running Hub revision does not match the uploaded file: '
+ (revision or '(not reported)') + '; expected ' + sys.argv[1])
print('Running Hub revision verified: ' + revision)
except Exception as error:
print('Health verification failed: ' + str(error), file=sys.stderr)
raise SystemExit(1)
PY
then
healthy=1
break
fi
sleep 2
done
if [ "$healthy" -ne 1 ]; then
echo 'The uploaded Hub build did not become ready; installation was not confirmed.' >&2
cat "$stage/health-check" >&2 2>/dev/null || true
show_failure
exit 1
fi
cat "$stage/health-check"
cmp "$source_file" "$target"
printf '\nBackup: %s\nROUTER_NAME_FIX_V120_%s_OK\n' "$backup" '__ACTION__'
if [ '__ACTION__' = Install ]; then
echo 'Refresh the Hub and router updates tabs to check the renamed routers.'
echo 'This fix is LOCAL. The panel update button can replace it with the published repository build.'
fi
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
try {
[System.IO.Directory]::CreateDirectory($StageRoot) | Out-Null
[System.IO.File]::WriteAllText(
(Join-Path $StageRoot 'run.sh'),
$RemoteScript.Replace("`r`n", "`n") + "`n",
$Utf8
)
if ($Action -eq 'Install') {
$Content = [System.IO.File]::ReadAllText((Join-Path $RepoRoot 'vps\owrt-remote-hub.py')).Replace("`r`n", "`n")
[System.IO.File]::WriteAllText((Join-Path $StageRoot 'hub.py'), $Content, $Utf8)
}
if ($PrepareOnly) {
Write-Host "Prepared only: $StageRoot"
return
}
& scp -O -r -- $StageRoot "${Vps}:/tmp/"
if ($LASTEXITCODE -ne 0) { throw 'Upload failed. VPS was not changed.' }
& ssh -T -o ConnectTimeout=10 $Vps "sh /tmp/$UploadName/run.sh"
if ($LASTEXITCODE -ne 0) { throw "$Action failed. See the output above; success was not confirmed." }
Write-Host "Router name fix $Action finished successfully."
}
finally {
if (-not $PrepareOnly) {
$Resolved = [System.IO.Path]::GetFullPath($StageRoot)
$Expected = [System.IO.Path]::GetFullPath((Join-Path ([System.IO.Path]::GetTempPath()) $UploadName))
if ($Resolved -ne $Expected -or (Split-Path -Leaf $Resolved) -ne $UploadName) {
throw 'Unsafe staging cleanup path.'
}
if (Test-Path -LiteralPath $Resolved) {
Remove-Item -LiteralPath $Resolved -Recurse -Force
}
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-reboot-all-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-reboot-all-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -125,7 +125,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nROUTER_UPDATES_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nROUTER_UPDATES_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-update-status-ui-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-update-status-ui-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -139,7 +139,7 @@ if [ "$healthy" -ne 1 ]; then
fi
cat "$stage/health-check"
cmp "$source_file" "$target"
printf '\nBackup: %s\nUPDATE_STATUS_UI_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nUPDATE_STATUS_UI_V120_%s_OK\n' "$backup" '__ACTION__'
if [ '__ACTION__' = Install ]; then
echo 'Reload the Hub page (Ctrl+F5) to load the new UI.'
echo 'This fix is LOCAL. The panel update button can replace it with the published repository build.'
@@ -7,7 +7,7 @@ param(
$ErrorActionPreference = 'Stop'
$RepoRoot = Split-Path -Parent $PSScriptRoot
$UploadName = 'owrt-version-v119-' + [guid]::NewGuid().ToString('N')
$UploadName = 'owrt-version-v120-' + [guid]::NewGuid().ToString('N')
$StageRoot = Join-Path ([System.IO.Path]::GetTempPath()) $UploadName
$Utf8 = [System.Text.UTF8Encoding]::new($false)
@@ -16,7 +16,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -58,9 +58,9 @@ if [ '__ACTION__' = Install ]; then
from pathlib import Path
import sys
source = Path(sys.argv[1]).read_text(encoding='utf-8')
required = ('v119', 'def hub_update_require_version(', 'def hub_update_older_version(',
required = ('v120', 'def hub_update_require_version(', 'def hub_update_older_version(',
"else if (state.checked && !state.checking) message('');")
if 'v' + '118' in source:
if 'v' + str(120 - 1) in source:
print('Old UI version remains in candidate', file=sys.stderr)
raise SystemExit(1)
missing = [marker for marker in required if marker not in source]
@@ -133,14 +133,14 @@ if [ "$healthy" -ne 1 ]; then
fi
cat "$stage/health-check"
cmp "$source_file" "$target"
printf '\nBackup: %s\nHUB_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nHUB_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RouterScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-v119
backup=/root/owrt-remote-backup-before-v120
cgi=/www/cgi-bin/owrt-remote
luci=/www/luci-static/resources/view/owrt_remote.js
changed=0
@@ -164,9 +164,9 @@ test -s "$cgi"
test -s "$luci"
if [ '__ACTION__' = Install ]; then
sh -n "$stage/cgi"
grep -F -q 'v119' "$stage/cgi"
grep -F -q 'v119' "$stage/luci"
if grep -F -q 'v''118' "$stage/cgi" "$stage/luci"; then
grep -F -q 'v120' "$stage/cgi"
grep -F -q 'v120' "$stage/luci"
if grep -F -q "v$((120 - 1))" "$stage/cgi" "$stage/luci"; then
echo 'Old UI version remains in candidate.' >&2
exit 1
fi
@@ -199,7 +199,7 @@ cmp "$source_dir/cgi" "$cgi"
cmp "$source_dir/luci" "$luci"
[ ! -x /etc/init.d/rpcd ] || /etc/init.d/rpcd restart || true
[ ! -x /etc/init.d/uhttpd ] || /etc/init.d/uhttpd reload || true
printf '\nBackup: %s\nROUTER_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nROUTER_V120_%s_OK\n' "$backup" '__ACTION__'
'@
if ($PSCmdlet.ParameterSetName -eq 'Router') {
@@ -240,7 +240,7 @@ try {
if ($LASTEXITCODE -ne 0) { throw 'Upload failed. Target was not changed.' }
& ssh -T -o ConnectTimeout=10 $TargetMachine "sh /tmp/$UploadName/run.sh"
if ($LASTEXITCODE -ne 0) { throw "$Action failed. See the output above; success was not confirmed." }
Write-Host "Version v119 $Action finished successfully. Refresh the panel."
Write-Host "Version v120 $Action finished successfully. Refresh the panel."
}
finally {
if (-not $PrepareOnly) {
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-vps-resources-live-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-vps-resources-live-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -107,7 +107,7 @@ if [ "$healthy" -ne 1 ]; then
exit 1
fi
cmp "$source_file" "$target"
printf '\nBackup: %s\nVPS_RESOURCES_LIVE_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nVPS_RESOURCES_LIVE_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+3 -3
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-vps-widgets-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-vps-widgets-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
cleanup() {
@@ -37,7 +37,7 @@ python_bin=/opt/owrt-remote/venv/bin/python
[ -x "$python_bin" ] || python_bin=python3
if [ '__ACTION__' = Install ]; then
test -s "$stage/hub.py"
grep -F -q 'v119' "$stage/hub.py"
grep -F -q 'v120' "$stage/hub.py"
"$python_bin" -m py_compile "$stage/hub.py"
OWRT_VPS_WIDGETS_HUB_SOURCE="$stage/hub.py" "$python_bin" "$stage/tests.py" -v
if [ ! -e "$backup" ]; then cp -p "$target" "$backup"; fi
@@ -67,7 +67,7 @@ if [ '__ACTION__' = Install ]; then
code=$(curl -sS --max-time 5 -o "$stage/response.json" -w '%{http_code}' http://127.0.0.1:8088/api/vps/resources)
test "$code" = 401
fi
printf '\nVPS_WIDGETS_V119_%s_OK\n' '__ACTION__'
printf '\nVPS_WIDGETS_V120_%s_OK\n' '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
try {
+1 -1
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/usr/lib/owrt-remote/wan.sh
backup_dir=/root/owrt-remote-backup-before-wan-dns-v119
backup_dir=/root/owrt-remote-backup-before-wan-dns-v120
changed=0
phase=preflight
heartbeat_pid() {
+2 -2
View File
@@ -20,7 +20,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-wan-multi-v119
backup=/root/owrt-remote-backup-before-wan-multi-v120
config=/etc/config/owrtremote
changed=0
item_path() {
@@ -81,7 +81,7 @@ test -s "$config"
if [ '__ACTION__' = Install ]; then
for item in agent wan.sh cgi hotplug; do test -s "$stage/$item"; sh -n "$stage/$item"; done
test -s "$stage/luci"
for item in cgi luci; do grep -F -q 'v119' "$stage/$item"; done
for item in cgi luci; do grep -F -q 'v120' "$stage/$item"; done
grep -F -q 'wan_interface_picker' "$stage/cgi"
grep -F -q 'wan_select_interface()' "$stage/wan.sh"
grep -F -q 'wan_reconcile_xray()' "$stage/agent"
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-wan-recovery-v119
backup_dir=/root/owrt-remote-backup-before-wan-recovery-v120
changed=0
phase=preflight
item_path() {
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup=/root/owrt-remote-backup-before-wan-stability-v119
backup=/root/owrt-remote-backup-before-wan-stability-v120
config=/etc/config/owrtremote
changed=0
fail() {
+2 -2
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-web-push-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-web-push-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
@@ -72,7 +72,7 @@ for attempt in 1 2 3 4 5 6 7 8 9 10; do
done
test "$healthy" = 1
cmp "$source_file" "$target"
printf '\nBackup: %s\nWEB_PUSH_V119_%s_OK\n' "$backup" '__ACTION__'
printf '\nBackup: %s\nWEB_PUSH_V120_%s_OK\n' "$backup" '__ACTION__'
'@
$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action)
+1 -1
View File
@@ -16,7 +16,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-xray-apk-v119
backup_dir=/root/owrt-remote-backup-before-xray-apk-v120
key_file=/etc/owrt-remote/web.key
key_candidate=$key_file.new-__UPLOAD_NAME__
changed=0
+1 -1
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/www/cgi-bin/owrt-remote
backup_dir=/root/owrt-remote-backup-before-xray-apply-v119
backup_dir=/root/owrt-remote-backup-before-xray-apply-v120
backup=$backup_dir/owrt-remote
candidate=$target.new-__UPLOAD_NAME__
changed=0
+1 -1
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/usr/sbin/owrt-remote
backup_dir=/root/owrt-remote-backup-before-xray-boot-v119
backup_dir=/root/owrt-remote-backup-before-xray-boot-v120
changed=0
phase=preflight
heartbeat_pid() {
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-xray-compat-v119
backup_dir=/root/owrt-remote-backup-before-xray-compat-v120
changed=0
phase=preflight
item_path() {
+1 -1
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/www/cgi-bin/owrt-remote
backup_dir=/root/owrt-remote-backup-before-xray-mobile-v119
backup_dir=/root/owrt-remote-backup-before-xray-mobile-v120
backup=$backup_dir/owrt-remote
candidate=$target.new-__UPLOAD_NAME__
changed=0
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-xray-reverse-v119
backup_dir=/root/owrt-remote-backup-before-xray-reverse-v120
changed=0
restart_attempted=0
phase=preflight
+1 -1
View File
@@ -15,7 +15,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/opt/owrt-remote/owrt-remote-hub.py
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-xray-reverse-v119
backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-xray-reverse-v120
candidate=$target.new-__UPLOAD_NAME__
changed=0
+1 -1
View File
@@ -14,7 +14,7 @@ $RemoteScript = @'
set -eu
stage=/tmp/__UPLOAD_NAME__
target=/usr/sbin/owrt-remote
backup_dir=/root/owrt-remote-backup-before-xray-source-v119
backup_dir=/root/owrt-remote-backup-before-xray-source-v120
runtime=/tmp/owrt-xray/xray
changed=0
phase=preflight
+1 -1
View File
@@ -17,7 +17,7 @@ $RemoteScript = @'
#!/bin/sh
set -eu
stage=/tmp/__UPLOAD_NAME__
backup_dir=/root/owrt-remote-backup-before-xray-validation-v119
backup_dir=/root/owrt-remote-backup-before-xray-validation-v120
changed=0
phase=preflight
item_path() {
+15 -7
View File
@@ -5198,7 +5198,7 @@ input,select{{min-width:0;border:1px solid var(--line);border-radius:8px;padding
<div class="brand">
<div class="desktopHeader">
<div class="desktopHeaderTop">
<h1 class="appBanner"><span>OpenWrt Remote Hub <span class="appBannerVersion">v119</span></span></h1>
<h1 class="appBanner"><span>OpenWrt Remote Hub <span class="appBannerVersion">v120</span></span></h1>
<button class="badge hubUpdateButton" data-hub-update type="button" {'hidden' if not is_owner else ''}>Проверить обновление панели</button>
<div class="routerSearchDock" id="routerSearchDock">
<button class="routerSearchToggle" id="routerSearchToggle" type="button" aria-expanded="false" aria-controls="routerSearchPanel" data-active="false">
@@ -5536,7 +5536,7 @@ input,select{{min-width:0;border:1px solid var(--line);border-radius:8px;padding
</div>
{vps_resource_widgets_html(mobile=True, resources=vps_resources)}
<div class="mobileSearchDock" id="mobileHubUpdateDock">
<span class="mobileSearchVersion">v119</span>
<span class="mobileSearchVersion">v120</span>
<button class="badge hubUpdateButton" data-hub-update type="button" {'hidden' if not is_owner else ''}>Проверить обновление панели</button>
</div>
<div class="mobileSearchDock" id="mobileSeasonDock" aria-label="Зимние эффекты">
@@ -13283,7 +13283,7 @@ button:hover{{filter:brightness(1.06)}}
<form class="login" method="post" action="/login">
{error_html}
<span class="brand">
<h1 class="appBanner"><span>OpenWrt Remote Hub <span class="appBannerVersion">v119</span></span></h1>
<h1 class="appBanner"><span>OpenWrt Remote Hub <span class="appBannerVersion">v120</span></span></h1>
</span>
<label for="hubUsername">Логин</label>
<input id="hubUsername" name="username" autocomplete="off" autofocus required>
@@ -13755,7 +13755,7 @@ body::after{{content:"";position:fixed;inset:0;pointer-events:none;background:li
<circle cx="65" cy="59" r="3" fill="#E5F2FF"/>
</svg>
</div>
<h2 class="brandTitle">OpenWrt Remote Hub <span class="brandVersion">v119</span></h2>
<h2 class="brandTitle">OpenWrt Remote Hub <span class="brandVersion">v120</span></h2>
</div>
</div>
<div class="brandBottom">
@@ -14797,12 +14797,12 @@ echo 'Скрипт загружен; запуск установки…'
def router_update_name(row, reported_name=''):
"""Prefer UCI's router_name; keep the stable router ID a separate field."""
"""Honor the Hub rename before UCI names; keep the stable ID separate."""
try:
cached_name = json.loads(row.get('status_json') or '{}').get('name')
except (ValueError, AttributeError):
cached_name = ''
for value in (reported_name, cached_name, row.get('custom_name')):
for value in (row.get('custom_name'), reported_name, cached_name):
name = re.sub(r'[\x00-\x1f\x7f]', ' ', str(value or '')).strip()[:200]
if name:
return name
@@ -17548,7 +17548,15 @@ a{{display:inline-flex;margin-top:18px;color:#93c5fd}}
return
job = manager.snapshot()
with self.app.conn() as conn:
routers = [router_update_status(dict(row)) for row in list_router_rows(conn)]
rows = [dict(row) for row in list_router_rows(conn)]
routers = [router_update_status(row) for row in rows]
if job:
# A queue may predate a rename, including an in-flight SSH probe.
# Overlay current Hub names on the copy without altering its results.
custom_names = {row['id']: router_update_name(row) for row in rows if row.get('custom_name')}
for item in job['items']:
if item['id'] in custom_names:
item['name'] = custom_names[item['id']]
self.send_json(200, {'ok': True, 'job': job, 'routers': routers})
def ssh_ws(self):