From 4ceb3d031ab4e16824d33bdee6ea7af6ff661148 Mon Sep 17 00:00:00 2001 From: kzolotarev95 Date: Wed, 14 Oct 2026 03:39:33 +0400 Subject: [PATCH] Release v115 with router global logs and mobile header layout --- README.md | 8 + files/etc/init.d/owrt-remote | 5 + files/etc/init.d/owrt-remote-logs | 14 ++ files/usr/lib/owrt-remote/logs.sh | 143 +++++++++++++ files/usr/sbin/owrt-remote | 25 ++- files/www/cgi-bin/owrt-remote | 181 ++++++++++++++++- .../luci-static/resources/view/owrt_remote.js | 4 +- install.sh | 7 + tests/HOST_POLICY.md | 24 +-- tests/RECAPTCHA_V3.md | 6 +- tests/RESOURCE_AUDIT.md | 6 +- tests/VPS_WIDGETS.md | 8 +- tests/WAN_INTERFACE_PICKER.md | 4 +- tests/WAN_STABILITY.md | 6 +- tests/XRAY_APPLY.md | 8 +- tests/test_global_logs.py | 156 ++++++++++++++ tests/test_global_logs_deploy.py | 132 ++++++++++++ tests/test_global_logs_ui.cjs | 93 +++++++++ tests/test_resource_lifecycle.py | 2 +- tests/test_wan_stability_deploy.py | 2 +- tests/test_xray_mobile_deploy.py | 2 +- uninstall.sh | 8 + vps/deploy-global-logs.ps1 | 192 ++++++++++++++++++ vps/deploy-heartbeat-redirect.ps1 | 2 +- vps/deploy-host-policy.ps1 | 18 +- vps/deploy-hub-url-fix.ps1 | 12 +- vps/deploy-online-status-fix.ps1 | 4 +- vps/deploy-password-logout-fix.ps1 | 4 +- vps/deploy-recaptcha-v3.ps1 | 12 +- vps/deploy-resource-fix.ps1 | 8 +- vps/deploy-router-card-ui-fix.ps1 | 4 +- vps/deploy-version-v115.ps1 | 146 +++++++++++++ vps/deploy-vps-widgets.ps1 | 6 +- vps/deploy-wan-multi.ps1 | 4 +- vps/deploy-wan-stability-fix.ps1 | 2 +- vps/deploy-web-push-fix.ps1 | 4 +- vps/deploy-xray-apply-fix.ps1 | 2 +- vps/deploy-xray-mobile-fix.ps1 | 2 +- vps/owrt-remote-hub.py | 8 +- 39 files changed, 1181 insertions(+), 93 deletions(-) create mode 100644 files/etc/init.d/owrt-remote-logs create mode 100644 files/usr/lib/owrt-remote/logs.sh create mode 100644 tests/test_global_logs.py create mode 100644 tests/test_global_logs_deploy.py create mode 100644 tests/test_global_logs_ui.cjs create mode 100644 vps/deploy-global-logs.ps1 create mode 100644 vps/deploy-version-v115.ps1 diff --git a/README.md b/README.md index 8b22394..2d444bd 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,14 @@ hub.example.com wget -O - "https://raw.githubusercontent.com/kzolotarev95/luci-app-owrt-remote/main/install.sh?v=$(date +%s)" | sh ``` +В панели самого роутера рядом с NetHaven VPN есть кнопка **Глобал логи**: +при открытии блока сразу загружаются сохранённые записи. Журнал можно скачать, +включить просмотр с обновлением каждые 3 секунды или очистить. +Записываются действия панели, Heartbeat, WAN и сообщения Xray. +Журнал хранится в `/tmp/owrt-remote-logs/`, занимает около 2 МБ максимум, +очищается каждые 24 часа и исчезает после перезагрузки. Сбор работает отдельно +от туннеля; остановка Xray не останавливает журнал. Ключи и пароли скрываются. + Проверка на роутере: ```sh diff --git a/files/etc/init.d/owrt-remote b/files/etc/init.d/owrt-remote index d2e22de..f30dc06 100644 --- a/files/etc/init.d/owrt-remote +++ b/files/etc/init.d/owrt-remote @@ -54,6 +54,10 @@ stop_xray_processes() { start_service() { mkdir -p /var/lock /var/run /tmp/owrt-xray + if [ -x /etc/init.d/owrt-remote-logs ]; then + /etc/init.d/owrt-remote-logs start >/dev/null 2>&1 || true + fi + logger -t owrt-remote 'Сервис: запуск' 2>/dev/null || true if ! config_enabled; then echo "owrt-remote disabled in /etc/config/owrtremote" @@ -81,6 +85,7 @@ reload_service() { } stop_service() { + logger -t owrt-remote 'Сервис: остановка туннеля' 2>/dev/null || true stop_xray_processes /usr/sbin/owrt-remote wan-cleanup >/dev/null 2>&1 || true } diff --git a/files/etc/init.d/owrt-remote-logs b/files/etc/init.d/owrt-remote-logs new file mode 100644 index 0000000..cdad7e2 --- /dev/null +++ b/files/etc/init.d/owrt-remote-logs @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=98 +STOP=11 + +start_service() { + procd_open_instance journal + procd_set_param command /bin/sh /usr/lib/owrt-remote/logs.sh collect + procd_set_param respawn 3600 5 5 + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/files/usr/lib/owrt-remote/logs.sh b/files/usr/lib/owrt-remote/logs.sh new file mode 100644 index 0000000..4c1b553 --- /dev/null +++ b/files/usr/lib/owrt-remote/logs.sh @@ -0,0 +1,143 @@ +#!/bin/sh +# The private Remote journal lives in RAM. It never changes the system logd. +LOG_DIR="${OWRT_REMOTE_LOG_DIR:-/tmp/owrt-remote-logs}" +LOG_LIMIT=1048576 +LOG_KEEP_SECONDS=86400 + +log_clock() { cut -d. -f1 /proc/uptime; } +log_init() { + umask 077 + mkdir -p "$LOG_DIR" || return 1 + chmod 700 "$LOG_DIR" +} +log_lock() { + local attempt owner + log_init || return 1 + attempt=0 + while ! mkdir "$LOG_DIR/lock" 2>/dev/null; do + owner="$(cat "$LOG_DIR/lock/pid" 2>/dev/null)" + case "$owner" in + ''|*[!0-9]*) + # Recover a writer killed between mkdir and writing its PID. + if [ "$attempt" -ge 20 ]; then + rm -f "$LOG_DIR/lock/pid" + rmdir "$LOG_DIR/lock" 2>/dev/null || true + fi ;; + *) if ! kill -0 "$owner" 2>/dev/null; then + rm -f "$LOG_DIR/lock/pid" + rmdir "$LOG_DIR/lock" 2>/dev/null || true + fi ;; + esac + attempt=$((attempt + 1)) + [ "$attempt" -lt 100 ] || return 1 + sleep 0.1 + done + printf '%s\n' "$$" >"$LOG_DIR/lock/pid" +} +log_unlock() { + rm -f "$LOG_DIR/lock/pid" + rmdir "$LOG_DIR/lock" 2>/dev/null || true +} +log_reset_locked() { + : >"$LOG_DIR/current.log" + rm -f "$LOG_DIR/previous.log" + log_clock >"$LOG_DIR/age" +} +log_maintain_locked() { + local now age + now="$(log_clock)" + age="$(cat "$LOG_DIR/age" 2>/dev/null)" + case "$age" in ''|*[!0-9]*) log_reset_locked; return ;; esac + if [ "$now" -lt "$age" ] || [ "$((now - age))" -ge "$LOG_KEEP_SECONDS" ]; then + log_reset_locked + fi +} +log_redact() { + # Never retain command blocks containing credentials or authenticated URLs. + LC_ALL=C awk ' + { + line = substr($0, 1, 4096); lower = tolower(line) + if (lower ~ /(authorization|hub_token|vless_uuid|ssh_vless_uuid|password|passwd|web[._ -]?key|[?&]key=|[?&]token=|"uuid"|"privatekey"|"password")/ || + lower ~ /[0-9a-f][0-9a-f][0-9a-f][0-9a-f]-[0-9a-f-]+-[0-9a-f-]+-[0-9a-f-]+/) + print "[строка с ключом или паролем скрыта]" + else print line + }' +} +log_append() { + local line size + # Process one bounded line at a time and release the lock between writes. + log_redact | while IFS= read -r line; do + log_lock || exit 1 + trap 'log_unlock' EXIT + trap 'exit 0' INT TERM + log_maintain_locked + size="$(wc -c <"$LOG_DIR/current.log")" + if [ "$size" -ge "$LOG_LIMIT" ]; then + mv -f "$LOG_DIR/current.log" "$LOG_DIR/previous.log" + : >"$LOG_DIR/current.log" + fi + printf '%s\n' "$line" >>"$LOG_DIR/current.log" + log_unlock + trap - EXIT INT TERM + done +} +log_read() { + local previous_size current_size + log_lock || return 1 + log_maintain_locked + # Open the retained files under the lock, then release it before streaming + # to a slow phone. Downloads must not prevent the collector from writing. + previous_size=0 + if [ -f "$LOG_DIR/previous.log" ]; then + previous_size="$(wc -c <"$LOG_DIR/previous.log")" + exec 3<"$LOG_DIR/previous.log" + else + exec 3/dev/null || true; done; wait; rm -f "$fifo"' EXIT + trap 'exit 0' INT TERM + # Follow only new Remote/Xray service records: a clear must not reload history. + logread -f -e 'owrt-remote\(\[[0-9][0-9]*\]\)\{0,1\}:' >"$fifo" 2>/dev/null & + reader=$! + while IFS= read -r line; do printf '%s\n' "$line" | log_append; done <"$fifo" & + writer=$! + while :; do + log_lock || return 1 + log_maintain_locked + log_unlock + sleep 60 & timer=$! + wait "$timer" || return 0 + kill -0 "$reader" 2>/dev/null && kill -0 "$writer" 2>/dev/null || return 1 + done +} + +case "${1:-}" in + collect) log_collect ;; + read) log_read "${2:-}" ;; + clear) log_clear ;; + append) log_append ;; + event) { printf '%s owrt-remote: %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$2"; cat; } | log_append ;; + *) printf 'Usage: logs.sh collect|read [live]|clear|append|event MESSAGE\n' >&2; exit 2 ;; +esac diff --git a/files/usr/sbin/owrt-remote b/files/usr/sbin/owrt-remote index a5e3eb3..f29f851 100644 --- a/files/usr/sbin/owrt-remote +++ b/files/usr/sbin/owrt-remote @@ -12,7 +12,7 @@ log() { } die() { - printf 'ОШИБКА: %s\n' "$*" >&2 + log "ОШИБКА: $*" exit 1 } @@ -559,7 +559,7 @@ render_client_config() { cat >"$out" </dev/null 2>&1 || die "WAN helper missing: $WAN_HELPER" - wan_prepare || return 1 + wan_prepare || { log 'Heartbeat: не удалось подготовить прямой WAN'; return 1; } wan_reconcile_xray fi endpoint="${hub_url%/}/api/heartbeat" tmp="${TMPDIR:-/tmp}/owrt-remote-heartbeat.$$" response="${TMPDIR:-/tmp}/owrt-remote-heartbeat.response.$$" + errors="$response.error" heartbeat_json "$event" >"$tmp" used=0 for endpoint in $(heartbeat_candidate_endpoints); do used=1 - if post_json "$endpoint" "$token" "$tmp" >"$response" \ - && grep -Eq '"ok"[[:space:]]*:[[:space:]]*true' "$response"; then + rc=0 + post_json "$endpoint" "$token" "$tmp" >"$response" 2>"$errors" || rc=$? + if [ "$rc" = 0 ] && grep -Eq '"ok"[[:space:]]*:[[:space:]]*true' "$response"; then fallback_base="$(heartbeat_base_from_endpoint "$endpoint")" if ! heartbeat_apply_hub_update "$response" "$fallback_base"; then - rm -f "$tmp" "$response" + log 'Heartbeat: Hub ответил, но обновление настроек не применилось' + rm -f "$tmp" "$response" "$errors" return 1 fi cat "$response" - rm -f "$tmp" "$response" + log "Heartbeat: OK; Hub=$fallback_base; WAN_direct=$(uci_get wan_direct 0); WAN_active=$(cat "$WAN_STATE/active-interface" 2>/dev/null)" + rm -f "$tmp" "$response" "$errors" return 0 fi + log "Heartbeat: ошибка; endpoint=$endpoint; rc=$rc; $(head -c 1024 "$errors"); ответ=$(head -c 1024 "$response")" done - rm -f "$tmp" "$response" + rm -f "$tmp" "$response" "$errors" [ "$used" = "1" ] || die "hub_url/public_url/vps_host пустые" return 1 } @@ -969,6 +974,7 @@ heartbeat_loop() { local interval interval="$(safe_num "$(uci_get heartbeat_interval 30)" 30)" [ "$interval" -lt 10 ] && interval=10 + log "Heartbeat: цикл запущен; интервал=${interval}s" while :; do if send_heartbeat >/dev/null 2>&1; then heartbeat_mark_ok @@ -1227,6 +1233,7 @@ run_xray() { xray_config="$(render_client_config)" || die "cannot create Xray configuration" [ -n "$xray_config" ] && [ -s "$xray_config" ] || die "Xray configuration is missing or empty" [ -x "$xray_bin" ] || die "xray not found or not executable: $xray_bin" + log "Xray: запуск туннеля; config=$xray_config; VPS=$(uci_get vps_host ''):$(uci_get vps_port 8443); WAN_direct=$(uci_get wan_direct 0); WAN_selected=$(uci_get wan_interface wan)" if "$xray_bin" help 2>/dev/null | grep -q 'run'; then exec "$xray_bin" run -config "$xray_config" diff --git a/files/www/cgi-bin/owrt-remote b/files/www/cgi-bin/owrt-remote index 67641ad..d42eee2 100644 --- a/files/www/cgi-bin/owrt-remote +++ b/files/www/cgi-bin/owrt-remote @@ -2,6 +2,7 @@ KEY_FILE="${KEY_FILE:-/etc/owrt-remote/web.key}" AGENT="${AGENT:-/usr/sbin/owrt-remote}" +LOG_HELPER="${OWRT_REMOTE_LOG_HELPER:-/usr/lib/owrt-remote/logs.sh}" OWRT_REMOTE_UI_VERSION="2026-07-02-mobile-terminal-batch-v25" PARAMS_FILE="${TMPDIR:-/tmp}/owrt-remote-cgi.$$" RESULT_TITLE="" @@ -131,6 +132,39 @@ set_result() { RESULT_TITLE="$1" RESULT_BODY="$2" RESULT_KIND="${3:-info}" + if [ -r "$LOG_HELPER" ]; then + printf '%s\n' "$RESULT_BODY" | sh "$LOG_HELPER" event "Панель: $RESULT_TITLE; результат=$RESULT_KIND" >/dev/null 2>&1 || true + fi +} + +logs_response() { + local mode + mode="$1" + if [ ! -r "$LOG_HELPER" ]; then + printf 'Status: 503 Service Unavailable\r\nContent-Type: text/plain; charset=utf-8\r\nCache-Control: no-store\r\n\r\n' + printf 'Сборщик логов не установлен. Установи локальный фикс целиком.\n' + return + fi + if [ "$mode" = clear ]; then + if [ "${REQUEST_METHOD:-GET}" != POST ]; then + printf 'Status: 405 Method Not Allowed\r\nAllow: POST\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n' + return + fi + if sh "$LOG_HELPER" clear; then + printf 'Content-Type: text/plain; charset=utf-8\r\nCache-Control: no-store\r\n\r\n' + printf 'Логи Remote очищены.\n' + else + printf 'Status: 503 Service Unavailable\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n' + printf 'Не удалось очистить логи. Повтори через несколько секунд.\n' + fi + return + fi + printf 'Content-Type: text/plain; charset=utf-8\r\nCache-Control: no-store\r\nX-Content-Type-Options: nosniff\r\n' + if [ "$mode" = download ]; then + printf 'Content-Disposition: attachment; filename="owrt-remote-global-%s.log"\r\n' "$(date '+%Y%m%d-%H%M%S')" + fi + printf '\r\n' + sh "$LOG_HELPER" read "$mode" } save_config() { @@ -161,6 +195,9 @@ save_config() { uci_set wan_interface "$wan_interfaces" uci_set wan_dns "$(param wan_dns)" uci commit owrtremote + if [ -r "$LOG_HELPER" ]; then + printf '' | sh "$LOG_HELPER" event "Панель: сохранены настройки; enabled=$enabled; Hub=$(uci_get hub_url ''); VPS=$(uci_get vps_host ''):$(uci_get vps_port 8443); WAN_direct=$(uci_get wan_direct 0); WAN_selected=$wan_interfaces" >/dev/null 2>&1 || true + fi set_result "Настройки сохранены" "Если менял Xray или VPS-поля, перезапусти сервис." "ok" } @@ -437,7 +474,7 @@ render_page() { -OpenWrt Remote Hub v114 +OpenWrt Remote Hub v115 @@ -468,7 +508,7 @@ form{margin:0}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr
-

OpenWrt Remote Hub v114

+

OpenWrt Remote Hub v115

+
+ +

Состояние

@@ -594,6 +647,118 @@ EOF
\n') + self.helper_call('append', text) + stored = self.helper_call('read') + self.assertNotIn('SECRET_', stored) + self.assertNotIn('abcdef12-abcd-1234-abcd-abcdef123456', stored) + self.assertIn('Heartbeat OK', stored) + self.assertIn('', stored) + self.assertIn('Content-Type: text/plain', self.cgi_call('logs_live')) + + def test_parallel_events_do_not_corrupt_or_drop_lines(self): + with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool: + list(pool.map(lambda i: self.helper_call('append', f'event-{i}\n'), range(12))) + self.assertEqual(set(self.helper_call('read').splitlines()), {f'event-{i}' for i in range(12)}) + self.assertFalse((self.log_dir / 'lock').exists()) + + def test_stale_lock_recovers(self): + self.helper_call('clear') + lock = self.log_dir / 'lock' + lock.mkdir() + (lock / 'pid').write_text('99999999') + self.helper_call('append', 'recovered\n') + self.assertEqual(self.helper_call('read'), 'recovered\n') + + def test_missing_collector_is_reported(self): + self.helper.unlink() + self.assertIn('503 Service Unavailable', self.cgi_call('logs_live')) + + def test_empty_lock_left_by_killed_writer_recovers(self): + self.helper_call('clear') + (self.log_dir / 'lock').mkdir() + self.helper_call('append', 'after empty lock\n') + self.assertEqual(self.helper_call('read'), 'after empty lock\n') + + def test_collector_failure_cleans_both_children_and_fifo(self): + source = self.helper.read_text(encoding='utf-8') + mocks = ''' +log_init() { return 0; } +mkfifo() { return 0; } +logread() { return 0; } +log_lock() { return 1; } +kill() { printf 'KILL=%s\\n' "$*"; } +wait() { return 0; } +rm() { printf 'REMOVE=%s\\n' "$*"; } +''' + self.helper.write_text(source.replace('case "${1:-}" in', mocks + '\ncase "${1:-}" in', 1), + encoding='utf-8', newline='\n') + result = subprocess.run([SH, self.helper.as_posix(), 'collect'], capture_output=True, + encoding='utf-8', env=self.env, timeout=10) + self.assertNotEqual(result.returncode, 0) + self.assertEqual(result.stdout.count('KILL='), 2) + self.assertIn('REMOVE=-f ' + self.log_dir.as_posix() + '/stream.', result.stdout) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_global_logs_deploy.py b/tests/test_global_logs_deploy.py new file mode 100644 index 0000000..3ff72d6 --- /dev/null +++ b/tests/test_global_logs_deploy.py @@ -0,0 +1,132 @@ +"""Install/rollback journal files against a sandbox, never a real router.""" +import os +import re +from pathlib import Path +import shlex +import shutil +import subprocess +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] +GIT_BIN = Path(os.environ.get('ProgramFiles', 'C:/Program Files')) / 'Git/usr/bin' +SH = str(GIT_BIN / 'sh.exe') if os.name == 'nt' else shutil.which('sh') + + +@unittest.skipUnless(SH, 'POSIX shell required') +class GlobalLogsDeploymentTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory(prefix='global-log-deploy-') + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + self.targets = { + 'cgi': '/www/cgi-bin/owrt-remote', 'agent': '/usr/sbin/owrt-remote', + 'init': '/etc/init.d/owrt-remote', 'logs.sh': '/usr/lib/owrt-remote/logs.sh', + 'logs-init': '/etc/init.d/owrt-remote-logs', + 'luci': '/www/luci-static/resources/view/owrt_remote.js', + } + self.initial = {} + for item in ('cgi', 'agent', 'init', 'luci'): + path = self.root / self.targets[item].lstrip('/') + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text('#!/bin/sh\necho previous-' + item + '\n', encoding='utf-8', newline='\n') + self.initial[item] = path.read_bytes() + self.backup = self.root / 'backup' + source = (ROOT / 'vps/deploy-global-logs.ps1').read_text(encoding='utf-8') + self.script = source.split("$RemoteScript = @'\n", 1)[1].split("\n'@", 1)[0] + # Absolute paths are replaced only in this disposable test copy. + mappings = {target: (self.root / target.lstrip('/')).as_posix() for target in self.targets.values()} + mappings['/usr/lib/owrt-remote'] = (self.root / 'usr/lib/owrt-remote').as_posix() + mappings['/www/luci-static/resources/view'] = (self.root / 'www/luci-static/resources/view').as_posix() + mappings['/tmp/luci-indexcache'] = (self.root / 'luci-indexcache').as_posix() + mappings['/tmp/luci-modulecache'] = (self.root / 'luci-modulecache').as_posix() + mappings['/etc/init.d/rpcd'] = (self.root / 'etc/init.d/rpcd').as_posix() + mappings['/etc/init.d/uhttpd'] = (self.root / 'etc/init.d/uhttpd').as_posix() + mappings['/tmp/owrt-remote-logs'] = (self.root / 'journal').as_posix() + mappings['/root/owrt-remote-backup-before-global-logs-v115'] = self.backup.as_posix() + pattern = '|'.join(re.escape(target) for target in sorted(mappings, key=len, reverse=True)) + self.script = re.sub(pattern, lambda match: mappings[match.group()], self.script) + # Existing sandbox service scripts only print markers. Mock readiness. + mocks = ''' +logread() { return 0; } +ubus() { printf '{"running": true}\\n'; } +mkfifo() { return 0; } +logger() { printf '%s\\n' "$3" | sh "$TEST_LOG_HELPER" append; } +''' + self.script = self.script.replace('for item in cgi agent init;', mocks + '\nfor item in cgi agent init;', 1) + self.env = {**os.environ, 'OWRT_REMOTE_LOG_DIR': (self.root / 'journal').as_posix()} + self.env['TEST_LOG_HELPER'] = (self.root / 'usr/lib/owrt-remote/logs.sh').as_posix() + if os.name == 'nt': + self.env['PATH'] = str(GIT_BIN) + os.pathsep + self.env['PATH'] + + def deploy(self, action, bad=False, fail_verify=False): + stage = self.root / 'stage' + stage.mkdir() + candidates = { + 'cgi': 'files/www/cgi-bin/owrt-remote', 'agent': 'files/usr/sbin/owrt-remote', + 'init': 'files/etc/init.d/owrt-remote', 'logs.sh': 'files/usr/lib/owrt-remote/logs.sh', + 'logs-init': 'files/etc/init.d/owrt-remote-logs', + 'luci': 'files/www/luci-static/resources/view/owrt_remote.js', + } + if action == 'Install': + for item, source in candidates.items(): + text = (ROOT / source).read_text(encoding='utf-8') + if item == 'logs.sh': + text = text.replace('log_clock() { cut -d. -f1 /proc/uptime; }', 'log_clock() { echo 1000; }') + if item == 'logs-init': + text = '#!/bin/sh\necho logs-service-$1\n' + if bad and item == 'cgi': + text = '#!/bin/sh\nif true; then\n' + stage.joinpath(item).write_text(text, encoding='utf-8', newline='\n') + script = self.script.replace('stage=/tmp/__UPLOAD_NAME__', 'stage=' + shlex.quote(stage.as_posix())) + script = script.replace('__UPLOAD_NAME__', 'sandbox').replace('__ACTION__', action) + if fail_verify: + script = script.replace('cmp "$stage/$item" "$path"', 'false') + result = subprocess.run([SH], input=script, encoding='utf-8', capture_output=True, + env=self.env, timeout=30) + self.assertFalse(stage.exists()) + self.assertFalse(list(self.root.rglob('*.new-sandbox'))) + return result + + def assert_initial(self): + for item, data in self.initial.items(): + self.assertEqual((self.root / self.targets[item].lstrip('/')).read_bytes(), data) + for item in ('logs.sh', 'logs-init'): + self.assertFalse((self.root / self.targets[item].lstrip('/')).exists()) + + def test_install_then_rollback_retains_first_backup(self): + for _ in range(2): + result = self.deploy('Install') + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn('GLOBAL_LOGS_ROUTER_Install_OK', result.stdout) + for item in ('cgi', 'luci'): + installed = self.root / self.targets[item].lstrip('/') + self.assertIn('v115', installed.read_text(encoding='utf-8')) + for item, data in self.initial.items(): + self.assertEqual(self.backup.joinpath(item).read_bytes(), data) + result = self.deploy('Rollback') + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn('GLOBAL_LOGS_ROUTER_Rollback_OK', result.stdout) + self.assert_initial() + + def test_missing_backup_changes_nothing(self): + result = self.deploy('Rollback') + self.assertNotEqual(result.returncode, 0) + self.assertIn('No complete backup:', result.stderr) + self.assert_initial() + + def test_invalid_candidate_rejected_before_backup(self): + result = self.deploy('Install', bad=True) + self.assertNotEqual(result.returncode, 0) + self.assertFalse(self.backup.exists()) + self.assert_initial() + + def test_failed_verification_restores_all_previous_files(self): + result = self.deploy('Install', fail_verify=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('Restoring files from this attempt.', result.stderr) + self.assert_initial() + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_global_logs_ui.cjs b/tests/test_global_logs_ui.cjs new file mode 100644 index 0000000..92d6d6d --- /dev/null +++ b/tests/test_global_logs_ui.cjs @@ -0,0 +1,93 @@ +// Real desktop/mobile browser: literal log text, scrolling, clear and polling. +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const http = require('node:http'); +const path = require('node:path'); +const { chromium } = require('playwright'); +const root = path.resolve('.test-output/global-logs'); +let text = Array.from({length: 150}, (_, i) => `Heartbeat ${i}: OK`).join('\n'); +let reads = 0, clears = 0; +const server = http.createServer((req, res) => { + const url = new URL(req.url, 'http://localhost'); + if (url.searchParams.get('action') === 'logs_live') { + reads++; + res.setHeader('Content-Type', 'text/plain; charset=utf-8'); + return res.end(text); + } + if (url.searchParams.get('action') === 'logs_clear') { + assert.equal(req.method, 'POST'); + clears++; + text = ''; + res.setHeader('Content-Type', 'text/plain; charset=utf-8'); + return res.end('Логи Remote очищены.'); + } + res.setHeader('Content-Type', 'text/html; charset=utf-8'); + res.end(fs.readFileSync(path.join(root, 'router.html'))); +}); +(async () => { + await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); + const browser = await chromium.launch({headless: true, channel: 'chrome'}); + try { + for (const mobile of [false, true]) { + text = Array.from({length: 150}, (_, i) => `Heartbeat ${i}: OK`).join('\n'); + const page = await browser.newPage({viewport: mobile ? {width: 390, height: 844} : {width: 1280, height: 900}}); + const errors = []; + page.on('pageerror', error => errors.push(error.message)); + await page.goto(`http://127.0.0.1:${server.address().port}/cgi-bin/owrt-remote?key=preview-key`); + assert.equal(await page.locator('#globalLogsPanel').isVisible(), false); + const vpn = await page.getByRole('link', {name: 'NetHaven VPN'}).boundingBox(); + const toggle = await page.locator('#globalLogsToggle').boundingBox(); + assert(Math.abs(toggle.y - vpn.y) < 3, 'logs button stays alongside VPN'); + assert(Math.abs(toggle.width - vpn.width) < 1, 'same pill width'); + assert.equal(await page.locator('#globalLogsToggle').evaluate(el => getComputedStyle(el).backgroundColor), 'rgb(34, 197, 94)'); + if (mobile) { + const telegram = await page.getByRole('link', {name: 'Telegram', exact: true}).boundingBox(); + const github = await page.getByRole('link', {name: 'GitHub', exact: true}).boundingBox(); + const banner = await page.locator('.appBanner').boundingBox(); + const back = await page.getByRole('link', {name: 'Вернуться в службы OpenWrt'}).boundingBox(); + assert.equal(telegram.y, github.y, 'social links occupy one row'); + assert.equal(telegram.width, toggle.width, 'all paired buttons have equal width'); + assert.equal(telegram.x, vpn.x, 'left column aligns across header'); + assert.equal(github.x, toggle.x, 'right column aligns across header'); + assert.equal(banner.width, back.width, 'title and return span same width'); + assert.equal(telegram.height, toggle.height, 'header buttons have equal height'); + assert(vpn.y >= telegram.y + telegram.height + 8, 'header rows have spacing'); + assert(back.y >= toggle.y + toggle.height + 8, 'return follows paired buttons'); + } + assert(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)); + const beforeOpen = reads; + await page.locator('#globalLogsToggle').click(); + assert.equal(await page.locator('#globalLogsPanel').isVisible(), true); + await page.waitForFunction(() => document.querySelector('#globalLogsText').textContent.includes('Heartbeat 149')); + assert.equal(reads, beforeOpen + 1, 'opening displays existing records immediately'); + assert.equal(await page.locator('#globalLogsLive').textContent(), 'Запустить в реальном времени'); + await page.waitForTimeout(3300); + assert.equal(reads, beforeOpen + 1, 'snapshot does not start automatic polling'); + await page.locator('#globalLogsLive').click(); + await page.waitForFunction(() => document.querySelector('#globalLogsText').textContent.includes('Heartbeat 149')); + assert.equal(await page.locator('#globalLogsLive').textContent(), 'Остановить просмотр'); + await page.locator('#globalLogsText').evaluate(el => {el.scrollTop = 40;}); + text += '\nnew event\n'; + await page.waitForFunction(() => document.querySelector('#globalLogsText').textContent.includes('new event')); + assert.equal(await page.locator('#globalLogsText').evaluate(el => el.scrollTop), 40); + assert.equal(await page.evaluate(() => window.bad), undefined); + assert.equal(await page.locator('#globalLogsText script').count(), 0); + await page.screenshot({path: path.join(root, mobile ? 'mobile.png' : 'desktop.png'), fullPage: true}); + const before = clears; + await page.locator('#globalLogsClear').click(); + await page.waitForFunction(() => document.querySelector('#globalLogsText').textContent.includes('пуст')); + assert.equal(clears, before + 1); + await page.locator('#globalLogsClose').click(); + assert.equal(await page.locator('#globalLogsPanel').isVisible(), false); + const stoppedAt = reads; + await page.waitForTimeout(3300); + assert.equal(reads, stoppedAt, 'closing panel stops polling'); + assert.deepEqual(errors, []); + await page.close(); + console.log('GLOBAL_LOGS_UI_OK', mobile ? 'mobile' : 'desktop'); + } + } finally { + await browser.close(); + server.close(); + } +})().catch(error => {console.error(error); server.close(); process.exitCode = 1;}); diff --git a/tests/test_resource_lifecycle.py b/tests/test_resource_lifecycle.py index 2b7f792..46e42c8 100644 --- a/tests/test_resource_lifecycle.py +++ b/tests/test_resource_lifecycle.py @@ -131,7 +131,7 @@ class HubFixture: assert "groups" in json.loads(self.request("/api/router-groups")) assert "notifications" in json.loads(self.request("/api/notifications")) assert self.request("/access/test-router/") == b"router proxy fixture" - assert b"v114" in self.request("/") + assert b"v115" in self.request("/") self.app.snapshot_router_states() def __exit__(self, *args): diff --git a/tests/test_wan_stability_deploy.py b/tests/test_wan_stability_deploy.py index 8a72904..6cfd7ba 100644 --- a/tests/test_wan_stability_deploy.py +++ b/tests/test_wan_stability_deploy.py @@ -31,7 +31,7 @@ class WanStabilityRollbackTests(unittest.TestCase): source = (ROOT / "vps/deploy-wan-stability-fix.ps1").read_text(encoding="utf-8") script = source.split("$RemoteScript = @'\n", 1)[1].split("\n'@", 1)[0] script = script.replace('stage=/tmp/__UPLOAD_NAME__', 'stage=' + shlex.quote(self.stage.as_posix())) - script = script.replace('backup=/root/owrt-remote-backup-before-wan-stability-v114', 'backup=' + shlex.quote(self.backup.as_posix())) + script = script.replace('backup=/root/owrt-remote-backup-before-wan-stability-v115', 'backup=' + shlex.quote(self.backup.as_posix())) script = script.replace('config=/etc/config/owrtremote', 'config=' + shlex.quote(self.files["config"].as_posix())) for name, original in (("agent", "/usr/sbin/owrt-remote"), ("wan.sh", "/usr/lib/owrt-remote/wan.sh")): script = script.replace('printf ' + original + ' ;;', "printf '%s' " + shlex.quote(self.files[name].as_posix()) + ' ;;') diff --git a/tests/test_xray_mobile_deploy.py b/tests/test_xray_mobile_deploy.py index 502ea89..f3dad51 100644 --- a/tests/test_xray_mobile_deploy.py +++ b/tests/test_xray_mobile_deploy.py @@ -29,7 +29,7 @@ class XrayMobileDeploymentTests(unittest.TestCase): source = (ROOT / "vps/deploy-xray-mobile-fix.ps1").read_text(encoding="utf-8") self.script = source.split("$RemoteScript = @'\n", 1)[1].split("\n'@", 1)[0] self.script = self.script.replace("target=/www/cgi-bin/owrt-remote", "target=" + shlex.quote(self.target.as_posix())) - self.script = self.script.replace("backup_dir=/root/owrt-remote-backup-before-xray-mobile-v114", + self.script = self.script.replace("backup_dir=/root/owrt-remote-backup-before-xray-mobile-v115", "backup_dir=" + shlex.quote(self.backup_dir.as_posix())) def deploy(self, action, content=None, fail_verify=False): diff --git a/uninstall.sh b/uninstall.sh index 3874282..68eef2a 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -18,8 +18,16 @@ if [ -x "$(target_path etc/init.d/owrt-remote)" ]; then "$(target_path etc/init.d/owrt-remote)" disable >/dev/null 2>&1 || true fi +if [ -x "$(target_path etc/init.d/owrt-remote-logs)" ]; then + "$(target_path etc/init.d/owrt-remote-logs)" stop >/dev/null 2>&1 || true + "$(target_path etc/init.d/owrt-remote-logs)" disable >/dev/null 2>&1 || true +fi + rmf usr/sbin/owrt-remote rmf usr/lib/owrt-remote/wan.sh +rmf usr/lib/owrt-remote/logs.sh +rmf etc/init.d/owrt-remote-logs +rm -rf "$(target_path tmp/owrt-remote-logs)" rmdir "$(target_path usr/lib/owrt-remote)" 2>/dev/null || true rmf etc/init.d/owrt-remote rmf www/cgi-bin/owrt-remote diff --git a/vps/deploy-global-logs.ps1 b/vps/deploy-global-logs.ps1 new file mode 100644 index 0000000..940dc6c --- /dev/null +++ b/vps/deploy-global-logs.ps1 @@ -0,0 +1,192 @@ +param( + [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$Router, + [ValidateSet('Install', 'Rollback')][string]$Action = 'Install', + [switch]$PrepareOnly +) + +$ErrorActionPreference = 'Stop' +$RepoRoot = Split-Path -Parent $PSScriptRoot +$UploadName = 'owrt-global-logs-' + [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__ +backup=/root/owrt-remote-backup-before-global-logs-v115 +items='cgi agent init logs.sh logs-init luci' +changed=0 +phase=preflight +item_path() { + case "$1" in + cgi) echo /www/cgi-bin/owrt-remote ;; + agent) echo /usr/sbin/owrt-remote ;; + init) echo /etc/init.d/owrt-remote ;; + logs.sh) echo /usr/lib/owrt-remote/logs.sh ;; + logs-init) echo /etc/init.d/owrt-remote-logs ;; + luci) echo /www/luci-static/resources/view/owrt_remote.js ;; + esac +} +refresh_router_ui() { + rm -rf /tmp/luci-indexcache /tmp/luci-modulecache + if [ -x /etc/init.d/rpcd ]; then /etc/init.d/rpcd restart || true; fi + if [ -x /etc/init.d/uhttpd ]; then /etc/init.d/uhttpd reload || true; fi +} +save_files() { + local dir item path + dir=$1 + mkdir -p "$dir" + chmod 700 "$dir" + for item in $items; do + path=$(item_path "$item") + if [ -e "$path" ]; then cp -p "$path" "$dir/$item"; else : >"$dir/$item.absent"; fi + done + if [ -x /etc/init.d/owrt-remote-logs ] && /etc/init.d/owrt-remote-logs enabled; then : >"$dir/logs-enabled"; fi + if ubus call service list '{"name":"owrt-remote-logs"}' 2>/dev/null | grep -q '"running": true'; then : >"$dir/logs-running"; fi + if /usr/sbin/owrt-remote status 2>/dev/null | grep -q '^xray_state: running'; then : >"$dir/tunnel-running"; fi + : >"$dir/complete" +} +validate_backup() { + local dir item + dir=$1 + [ -f "$dir/complete" ] || return 1 + for item in $items; do + [ -s "$dir/$item" ] || [ -f "$dir/$item.absent" ] || return 1 + done +} +restore_files() { + local dir item path + dir=$1 + validate_backup "$dir" || { echo "Incomplete backup: $dir" >&2; return 1; } + if [ -x /etc/init.d/owrt-remote-logs ]; then + /etc/init.d/owrt-remote-logs stop || true + /etc/init.d/owrt-remote-logs disable || true + fi + for item in $items; do + path=$(item_path "$item") + if [ -f "$dir/$item.absent" ]; then + rm -f "$path" || return 1 + else + cp -p "$dir/$item" "$path" || return 1 + fi + done + if [ -x /etc/init.d/owrt-remote-logs ]; then + [ ! -f "$dir/logs-enabled" ] || /etc/init.d/owrt-remote-logs enable + [ ! -f "$dir/logs-running" ] || /etc/init.d/owrt-remote-logs start + else + rm -rf /tmp/owrt-remote-logs + fi + if [ -f "$stage/previous/tunnel-running" ]; then /etc/init.d/owrt-remote restart; fi + refresh_router_ui +} +cleanup() { + code=$? + trap - EXIT + if [ "$code" -ne 0 ]; then + printf 'Failed during %s (rc=%s).\n' "$phase" "$code" >&2 + if [ "$changed" = 1 ]; then + echo 'Restoring files from this attempt.' >&2 + restore_files "$stage/previous" || echo 'Restore failed; retained backup is available.' >&2 + fi + fi + for item in $items; do path=$(item_path "$item"); rm -f "$path.new-__UPLOAD_NAME__"; done + rm -rf "$stage" + exit "$code" +} +trap cleanup EXIT +for item in cgi agent init; do path=$(item_path "$item"); test -s "$path"; done +if [ '__ACTION__' = Install ]; then + for item in $items; do test -s "$stage/$item"; done + for item in cgi agent init logs.sh logs-init; do sh -n "$stage/$item"; done + command -v logread >/dev/null + command -v ubus >/dev/null + command -v mkfifo >/dev/null + grep -F -q 'globalLogsToggle' "$stage/cgi" + for item in cgi luci; do grep -F -q 'v115' "$stage/$item"; done + grep -F -q 'LOG_KEEP_SECONDS=86400' "$stage/logs.sh" + phase=backup + if [ ! -e "$backup" ]; then save_files "$stage/retained"; mv "$stage/retained" "$backup"; fi + validate_backup "$backup" || { echo "Incomplete backup: $backup. Nothing changed." >&2; exit 1; } + save_files "$stage/previous" + phase=install + changed=1 + if [ -x /etc/init.d/owrt-remote-logs ]; then /etc/init.d/owrt-remote-logs stop; fi + mkdir -p /usr/lib/owrt-remote /www/luci-static/resources/view + for item in $items; do + path=$(item_path "$item") + cp "$stage/$item" "$path.new-__UPLOAD_NAME__" + case "$item" in logs.sh|luci) chmod 644 "$path.new-__UPLOAD_NAME__" ;; *) chmod 755 "$path.new-__UPLOAD_NAME__" ;; esac + mv -f "$path.new-__UPLOAD_NAME__" "$path" + done + /etc/init.d/owrt-remote-logs enable + /etc/init.d/owrt-remote-logs start + phase=verify + ready=0 + for attempt in 1 2 3 4 5; do + if ubus call service list '{"name":"owrt-remote-logs"}' | grep -q '"running": true'; then ready=1; break; fi + sleep 1 + done + if [ "$ready" != 1 ]; then echo 'Log collector did not start.' >&2; logread -e owrt-remote | tail -n 30 >&2; exit 1; fi + marker='Глобал логи: collector-__UPLOAD_NAME__' + ready=0 + for attempt in 1 2 3 4 5; do + logger -t owrt-remote "$marker" + sleep 1 + if sh /usr/lib/owrt-remote/logs.sh read | grep -F -q "$marker"; then ready=1; break; fi + done + if [ "$ready" != 1 ]; then echo 'Log collector is running but did not capture the test event.' >&2; exit 1; fi + for item in $items; do path=$(item_path "$item"); cmp "$stage/$item" "$path"; done + if [ -f "$stage/previous/tunnel-running" ]; then + phase=tunnel-restart + /etc/init.d/owrt-remote restart + ready=0 + for attempt in 1 2 3 4 5 6 7 8 9 10; do + if /usr/sbin/owrt-remote status | grep -q '^xray_state: running'; then ready=1; break; fi + sleep 1 + done + if [ "$ready" != 1 ]; then echo 'Tunnel did not restart.' >&2; logread -e owrt-remote | tail -n 30 >&2; exit 1; fi + fi + refresh_router_ui + echo 'Log collector: running. Router settings preserved.' +else + validate_backup "$backup" || { echo "No complete backup: $backup. Nothing changed." >&2; exit 1; } + save_files "$stage/previous" + changed=1 + phase=rollback + restore_files "$backup" +fi +printf 'Backup: %s\n' "$backup" +printf '\nGLOBAL_LOGS_ROUTER_%s_OK\n' '__ACTION__' +'@ +$RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) +$Files = @{ + 'cgi' = 'files\www\cgi-bin\owrt-remote' + 'agent' = 'files\usr\sbin\owrt-remote' + 'init' = 'files\etc\init.d\owrt-remote' + 'logs.sh' = 'files\usr\lib\owrt-remote\logs.sh' + 'logs-init' = 'files\etc\init.d\owrt-remote-logs' + 'luci' = 'files\www\luci-static\resources\view\owrt_remote.js' +} +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') { + foreach ($Item in $Files.GetEnumerator()) { + $Content = [System.IO.File]::ReadAllText((Join-Path $RepoRoot $Item.Value)).Replace("`r`n", "`n") + [System.IO.File]::WriteAllText((Join-Path $StageRoot $Item.Key), $Content, $Utf8) + } + } + if ($PrepareOnly) { Write-Host "Prepared only: $StageRoot"; return } + & scp -O -r -- $StageRoot "${Router}:/tmp/" + if ($LASTEXITCODE -ne 0) { throw 'Upload failed. The installation has not started.' } + & ssh -T -o ConnectTimeout=10 $Router "sh /tmp/$UploadName/run.sh" + if ($LASTEXITCODE -ne 0) { throw "$Action failed. See the output above; success was not confirmed." } + Write-Host "Global logs $Action finished successfully. Refresh the router panel with Ctrl+F5." +} 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 } + } +} diff --git a/vps/deploy-heartbeat-redirect.ps1 b/vps/deploy-heartbeat-redirect.ps1 index 4043b93..7d2da5f 100644 --- a/vps/deploy-heartbeat-redirect.ps1 +++ b/vps/deploy-heartbeat-redirect.ps1 @@ -13,7 +13,7 @@ $RemoteScript = @' #!/bin/sh set -eu stage=/tmp/__UPLOAD_NAME__ -backup=/root/owrt-remote-backup-before-heartbeat-redirect-v114 +backup=/root/owrt-remote-backup-before-heartbeat-redirect-v115 agent=/usr/sbin/owrt-remote wan=/usr/lib/owrt-remote/wan.sh changed=0 diff --git a/vps/deploy-host-policy.ps1 b/vps/deploy-host-policy.ps1 index 93c222e..70800b0 100644 --- a/vps/deploy-host-policy.ps1 +++ b/vps/deploy-host-policy.ps1 @@ -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-v114', + [ValidatePattern('^[a-zA-Z0-9_-]+$')][string]$BackupName = 'host-policy-v115', [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 'v114' "$stage/$item"; done + for item in cgi luci; do grep -F -q 'v115' "$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 'v114' /www/cgi-bin/owrt-remote - grep -F -q 'v114' /www/luci-static/resources/view/owrt_remote.js - echo HOST_POLICY_ROUTER_V114_OK + grep -F -q 'v115' /www/cgi-bin/owrt-remote + grep -F -q 'v115' /www/luci-static/resources/view/owrt_remote.js + echo HOST_POLICY_ROUTER_V115_OK else test -f "$backup/complete" save_files "$stage/previous" changed=1 restore_files "$backup" /usr/sbin/owrt-remote status - echo HOST_POLICY_ROUTER_V114_ROLLBACK_OK + echo HOST_POLICY_ROUTER_V115_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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-host-policy-v115 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 'v114' "$stage/hub.py" + grep -F -q 'v115' "$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_V114_%s_OK\n' '__ACTION__' +printf '\nHOST_POLICY_VPS_V115_%s_OK\n' '__ACTION__' '@ } diff --git a/vps/deploy-hub-url-fix.ps1 b/vps/deploy-hub-url-fix.ps1 index 8b9a06b..51099f0 100644 --- a/vps/deploy-hub-url-fix.ps1 +++ b/vps/deploy-hub-url-fix.ps1 @@ -34,7 +34,7 @@ if ($Target -eq 'Router') { #!/bin/sh set -eu stage=/tmp/__UPLOAD_NAME__ -backup=/root/owrt-remote-backup-before-hub-url-v114 +backup=/root/owrt-remote-backup-before-hub-url-v115 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 'v114' "$stage/$item"; done + for item in cgi luci; do grep -F -q 'v115' "$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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nHUB_URL_ROUTER_V115_%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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-hub-url-v115 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 'v114' "$stage/hub.py" + grep -F -q 'v115' "$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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nHUB_URL_VPS_V115_%s_OK\n' "$backup" '__ACTION__' '@ } $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action).Replace('__HUB_URL__', $HubUrl) diff --git a/vps/deploy-online-status-fix.ps1 b/vps/deploy-online-status-fix.ps1 index d6c730b..8c8e7b6 100644 --- a/vps/deploy-online-status-fix.ps1 +++ b/vps/deploy-online-status-fix.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-online-status-v115 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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nONLINE_STATUS_V115_%s_OK\n' "$backup" '__ACTION__' '@ $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) try { diff --git a/vps/deploy-password-logout-fix.ps1 b/vps/deploy-password-logout-fix.ps1 index bc05a25..d00a089 100644 --- a/vps/deploy-password-logout-fix.ps1 +++ b/vps/deploy-password-logout-fix.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-password-logout-v115 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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nPASSWORD_LOGOUT_V115_%s_OK\n' "$backup" '__ACTION__' '@ $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) diff --git a/vps/deploy-recaptcha-v3.ps1 b/vps/deploy-recaptcha-v3.ps1 index a0e0c0a..1a82e13 100644 --- a/vps/deploy-recaptcha-v3.ps1 +++ b/vps/deploy-recaptcha-v3.ps1 @@ -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-v114 -captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v114.json +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v115 +captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v115.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 'v114' in source +assert 'v115' 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_V114_OK +echo RECAPTCHA_V3_V115_OK '@ } elseif ($Action -eq 'Rollback') { $RemoteScript = @' @@ -96,8 +96,8 @@ echo RECAPTCHA_V3_V114_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-v114 -captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v114.json +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-recaptcha-v3-v115 +captcha_backup=/opt/owrt-remote/captcha-before-recaptcha-v3-v115.json candidate=$target.rollback-__UPLOAD_NAME__ changed=0 restore_captcha() { diff --git a/vps/deploy-resource-fix.ps1 b/vps/deploy-resource-fix.ps1 index 0224bc7..4081365 100644 --- a/vps/deploy-resource-fix.ps1 +++ b/vps/deploy-resource-fix.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v115 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 'v114' in source +assert 'v115' 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_V114_OK +echo RESOURCE_FIX_V115_OK '@ } elseif ($Action -eq 'Rollback') { $RemoteScript = @' @@ -86,7 +86,7 @@ echo RESOURCE_FIX_V114_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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-resource-fix-v115 candidate=$target.rollback-__UPLOAD_NAME__ changed=0 cleanup() { diff --git a/vps/deploy-router-card-ui-fix.ps1 b/vps/deploy-router-card-ui-fix.ps1 index a2a4bb3..016476b 100644 --- a/vps/deploy-router-card-ui-fix.ps1 +++ b/vps/deploy-router-card-ui-fix.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-card-ui-v115 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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nROUTER_CARD_UI_V115_%s_OK\n' "$backup" '__ACTION__' '@ $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) diff --git a/vps/deploy-version-v115.ps1 b/vps/deploy-version-v115.ps1 new file mode 100644 index 0000000..e4620f2 --- /dev/null +++ b/vps/deploy-version-v115.ps1 @@ -0,0 +1,146 @@ +param( + [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$Vps, + [ValidateSet('Install', 'Rollback')][string]$Action = 'Install', + [switch]$PrepareOnly +) + +$ErrorActionPreference = 'Stop' +$RepoRoot = Split-Path -Parent $PSScriptRoot +$UploadName = 'owrt-version-v115-' + [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-v115 +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' +from pathlib import Path +import sys +source = Path(sys.argv[1]).read_text(encoding='utf-8') +required = ('v115',) +if 'v' + '114' 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] +if missing: + for marker in missing: + print('Missing marker:', repr(marker), file=sys.stderr) + raise SystemExit(1) +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 + +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 && curl -fsS --max-time 5 http://127.0.0.1:8088/health; then + healthy=1 + break + fi + sleep 2 +done +if [ "$healthy" -ne 1 ]; then + echo 'Health check did not become ready.' >&2 + show_failure + exit 1 +fi +cmp "$source_file" "$target" +printf '\nBackup: %s\nHUB_V115_%s_OK\n' "$backup" '__ACTION__' +'@ + +$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 "Hub v115 $Action finished successfully. Refresh the Hub panel." +} +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 + } + } +} diff --git a/vps/deploy-vps-widgets.ps1 b/vps/deploy-vps-widgets.ps1 index 0c05716..389505f 100644 --- a/vps/deploy-vps-widgets.ps1 +++ b/vps/deploy-vps-widgets.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-vps-widgets-v115 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 'v114' "$stage/hub.py" + grep -F -q 'v115' "$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_V114_%s_OK\n' '__ACTION__' +printf '\nVPS_WIDGETS_V115_%s_OK\n' '__ACTION__' '@ $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) try { diff --git a/vps/deploy-wan-multi.ps1 b/vps/deploy-wan-multi.ps1 index 4fb68ba..8a13aff 100644 --- a/vps/deploy-wan-multi.ps1 +++ b/vps/deploy-wan-multi.ps1 @@ -20,7 +20,7 @@ $RemoteScript = @' #!/bin/sh set -eu stage=/tmp/__UPLOAD_NAME__ -backup=/root/owrt-remote-backup-before-wan-multi-v114 +backup=/root/owrt-remote-backup-before-wan-multi-v115 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 'v114' "$stage/$item"; done + for item in cgi luci; do grep -F -q 'v115' "$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" diff --git a/vps/deploy-wan-stability-fix.ps1 b/vps/deploy-wan-stability-fix.ps1 index ded6533..7379a8c 100644 --- a/vps/deploy-wan-stability-fix.ps1 +++ b/vps/deploy-wan-stability-fix.ps1 @@ -17,7 +17,7 @@ $RemoteScript = @' #!/bin/sh set -eu stage=/tmp/__UPLOAD_NAME__ -backup=/root/owrt-remote-backup-before-wan-stability-v114 +backup=/root/owrt-remote-backup-before-wan-stability-v115 config=/etc/config/owrtremote changed=0 fail() { diff --git a/vps/deploy-web-push-fix.ps1 b/vps/deploy-web-push-fix.ps1 index 71578b9..c4f2da8 100644 --- a/vps/deploy-web-push-fix.ps1 +++ b/vps/deploy-web-push-fix.ps1 @@ -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-v114 +backup=/opt/owrt-remote/owrt-remote-hub.py.bak-before-web-push-v115 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_V114_%s_OK\n' "$backup" '__ACTION__' +printf '\nBackup: %s\nWEB_PUSH_V115_%s_OK\n' "$backup" '__ACTION__' '@ $RemoteScript = $RemoteScript.Replace('__UPLOAD_NAME__', $UploadName).Replace('__ACTION__', $Action) diff --git a/vps/deploy-xray-apply-fix.ps1 b/vps/deploy-xray-apply-fix.ps1 index 0bcf8f0..10f957e 100644 --- a/vps/deploy-xray-apply-fix.ps1 +++ b/vps/deploy-xray-apply-fix.ps1 @@ -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-v114 +backup_dir=/root/owrt-remote-backup-before-xray-apply-v115 backup=$backup_dir/owrt-remote candidate=$target.new-__UPLOAD_NAME__ changed=0 diff --git a/vps/deploy-xray-mobile-fix.ps1 b/vps/deploy-xray-mobile-fix.ps1 index 0fc2d98..774ff05 100644 --- a/vps/deploy-xray-mobile-fix.ps1 +++ b/vps/deploy-xray-mobile-fix.ps1 @@ -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-v114 +backup_dir=/root/owrt-remote-backup-before-xray-mobile-v115 backup=$backup_dir/owrt-remote candidate=$target.new-__UPLOAD_NAME__ changed=0 diff --git a/vps/owrt-remote-hub.py b/vps/owrt-remote-hub.py index f9d8c56..4a38145 100644 --- a/vps/owrt-remote-hub.py +++ b/vps/owrt-remote-hub.py @@ -4861,7 +4861,7 @@ input,select{{min-width:0;border:1px solid var(--line);border-radius:8px;padding
-

OpenWrt Remote Hub v114

+

OpenWrt Remote Hub v115

- v114 + v115 @@ -12578,7 +12578,7 @@ button:hover{{filter:brightness(1.06)}}
-

OpenWrt Remote Hub v114

+

OpenWrt Remote Hub v115