Commit Graph
29 Commits
Author SHA1 Message Date
ssongliu a15e77d605 fix: harden terminal session lifecycle (#13736) 2026-09-08 09:29:01 +08:00
HynoR 81b72d9b7d feat: Implement server-side SSH session persistence and recovery (#13707)
* feat(terminal): keep ssh sessions alive server-side with reattach

Split the terminal ws handling into a Session (pty + ssh backend) and an
Attachment (one websocket). A session outlives its websocket: a clean close
(1000) ends the pty, any other disconnect keeps it for a 30-minute grace
period and it can be reattached via `?session=<id>`. Output goes through a
fixed 128KB ring buffer so a reattaching client gets the recent tail, with a
truncation marker if it fell behind. Sessions are owner-scoped; a second
attachment kicks the first (4409), unknown ids get 4404.

New endpoints under /hosts/terminal/sessions (search, close) let the
frontend list and recover sessions after a tab or browser is closed.

* feat(terminal): floating terminal dock with session recovery

Terminals now live in a layout-level host and are teleported into whichever
view shows them, so leaving the terminal page no longer kills them. A dock
handle on the right edge opens a non-modal dialog from any page with every
live session, a picker for local shell / ssh hosts, minimize, and
close-all. On page load the store recovers sessions the server still holds,
so an accidentally closed tab or browser can resume within the grace period.
The menu-tab label shows the live session count.

* fix(terminal): page re-claims its slots under a locked menu tab

With the terminal menu tab locked (keep-alive), leaving the page deactivates
it instead of unmounting it, so the slot ref callback never re-runs on
return. After the dock had taken the Terminal over and released it, nobody
claimed it for the page again and it stayed parked in the hidden host.

Claim/release slots explicitly on mount, activated, deactivated and unmount,
the same ownership rule the dock uses, instead of relying on the ref callback.

* fix(terminal): logout closes every kept-alive terminal session

A logged-out panel has nobody watching it, so nothing it left running should
survive: core now tells the local agent to close all terminal sessions when the
user logs out, changes the password, or changes the bind domain. Until now the
teardown relied on the logging-out tab sending close code 1000; a second tab or
a websocket held outside the SPA kept its shell after logout.

Agent: terminal.CloseAll and POST /hosts/terminal/sessions/closeAll.
Core: LogOut / deleteCurrentSession / BindDomain call it via proxy_local,
best effort.

* fix(terminal): pin a local shell to the node it was opened on

The node a local shell connects to was resolved from the current node every
time the websocket was built, so after switching nodes a reconnect carried the
old session id to the new node (4404) and then opened a shell there instead.
Store the operateNode on the entry when it is created; ssh shells keep going to
the master. Shells on a non-master node get the node name in their title so a
restore in another node's view can tell them apart.
2026-09-07 15:01:35 +08:00
ssongliu a917ca00a1 feat: refactor auth and xpack integration 2026-05-21 12:32:52 +08:00
ssongliu 69906046e8 feat: add xpackee permission-aware settings flow 2026-05-21 11:34:08 +08:00
ssongliu d9cedeca09 feat: update xpack integration behavior 2026-05-21 11:34:08 +08:00
ssongliu 0e28f27819 feat: Support multi-user login and node management 2026-05-21 11:34:06 +08:00
ssongliu 218f92a960 fix: fallback to password login when mfa needs captcha (#12438) 2026-04-09 10:28:39 +08:00
ssongliu ec981f8153 fix: harden login IP checks and entrance cookie (#12378) 2026-04-01 08:22:09 +00:00
ssongliu b2853277e7 fix: improve auth lock handling and login feedback (#12377) 2026-03-31 11:00:06 +00:00
ssongliu f573a0fa0e fix: improve request validation and session lifecycle (#12375) 2026-03-31 10:58:05 +00:00
ssongliu b5aba18248 fix: harden core memory session handling (#12366) 2026-03-30 14:30:06 +00:00
ssongliu 924e59d948 fix: Fix login log recording abnormality in some scenarios (#11948) 2026-02-25 08:39:46 +00:00
KOMATA 62beb534d2 feat: enhance passkey function 2026-02-24 17:19:13 +08:00
KOMATA d742c7d333 feat: add support for passkey login method (#11601)
* feat: Add passkey authentication support with registration and login endpoints

* style: Refactor import statements and improve button formatting in login and settings views

* chore: Update dependencies in go.mod and go.sum, including adding go-webauthn and updating indirect dependencies

* refactor: Consolidate passkey session management and update related structures for improved clarity and functionality

* feat: Add passkey support in multiple languages with corresponding error messages and management options

* feat: Implement passkey reset command and enhance internationalization support for passkey-related messages

* refactor: Simplify login form structure by removing commented sections and unused passkey login function

* fix: Update passkey failure messages across multiple languages to include SSL certificate verification instructions

* chore: update go mod

* refactor: Update passkey handling by consolidating status checks and renaming related fields for clarity

* style: Format i18n file

* refactor: Enhance passkey configuration checks
2026-01-20 10:28:04 +08:00
CityFun ac43f00273 perf: optimize login API logic (#11104) 2025-11-28 03:05:27 +00:00
ssongliu 1278e910f5 fix: Fix the issue of abnormal login log recording (#9139)
Refs #9054
2025-06-17 08:06:55 +00:00
ChengPlay b0a7efe9c3 feat: apply acme account use proxy (#8516) 2025-04-29 19:13:00 +08:00
ssongliu 11349642da fix: Remove the jwt login mode (#8242) 2025-03-25 09:29:34 +00:00
zhengkunwang 8c2bb231c6 feat(system): Optimize the logic of the login page (#7828) 2025-02-08 22:57:08 +08:00
zhengkunwang 8b30308a4b feat(system): Password encryption for login API. (#7825) 2025-02-08 08:43:55 +00:00
zhengkunwang 88684c7cf0 feat: Update Login Page (#7815) 2025-02-07 10:15:20 +00:00
ssongliu 8283cd7d02 feat: adjust internationalization errors and the positions of global … (#7767) 2025-01-24 03:00:07 +00:00
zhengkunwang 909b10f422 feat(system-security): Optimized unauthenticated settings to enhance system security (#7532) 2024-12-23 15:49:57 +08:00
ssongliu 7631c237e9 feat: Uniform state style (#7436) 2024-12-19 06:30:20 +00:00
ssongliu a8170a499a feat: Add support for multiple host license (#7296) 2024-12-10 05:57:38 +00:00
zhengkunwang ff0606b896 feat(session): Refactor session storage implementation (#7185) 2024-11-26 08:00:29 +00:00
ssongliu f79adc9bc0 feat: 概览页支持调整应用显示 (#6892)
Refs #4862 #3819
2024-10-30 07:58:40 +00:00
ssongliu f0274701cf feat: 修改备份账号同步方式 (#6108) 2024-08-13 15:33:34 +08:00
ssongliu 2ef7b8b3b1 feat: core 功能代码拆分 2024-07-19 19:04:11 +08:00