Commit Graph

746 Commits

Author SHA1 Message Date
Jianhui Zhao 0525361a79 bump version 5.4.1
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 22:29:11 +08:00
Jianhui Zhao 0bf696269f ci: push github container registry
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 22:28:36 +08:00
Jianhui Zhao c892998cfe add goreportcard in README
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 15:00:53 +08:00
Jianhui Zhao 2489b605a7 Remove log file fallback for non-TTY output
The feature that wrote logs to a file when stdout wasn't a terminal is
removed. Systemd services already handle log persistence through journald
and its logging facilities. This duplication is unnecessary and conflicts
with standard systemd logging practices.

View log in systemd:

```
journalctl -u rttys
```

or

```
journalctl -u rttys -f
```

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:29 +08:00
Jianhui Zhao 5dbb4bf951 Update module name to 'github.com/zhaojh329/rttys/v5'
This is in line with the Go language module specifications.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:29 +08:00
Jianhui Zhao c10c0f3e58 ui: Optimize context menu display effect
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:29 +08:00
Jianhui Zhao 549794c3d5 ui: add support change font size via shortcut key
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:29 +08:00
Jianhui Zhao f54f5323bd ui: add support find in terminal
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:29 +08:00
Jianhui Zhao 0bf9eff0ab ui: Optimize terminal display effect
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-29 14:55:20 +08:00
Jianhui Zhao f1aca8fa64 ui: simplify FitAddon initialization in RttyTerm.vue
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-25 22:49:07 +08:00
Jianhui Zhao 14c35e8263 test: optimize rttys_stress_test.go
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-23 19:12:15 +08:00
Jianhui Zhao 19eb331421 bump version 5.3.0
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-21 22:03:28 +08:00
Jianhui Zhao 315ba884a6 ui: set cursorStyle to 'bar'
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-21 21:41:55 +08:00
Jianhui Zhao 92b71481f8 ui: add addon @xterm/addon-web-links
Adds web link detection and interaction in terminal.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-21 21:18:32 +08:00
Jianhui Zhao 7c3eb9cc99 http proxy: simplify session management and remove redundant cookies
- Add devid, group, destaddr, and https fields to HttpProxySession for better session tracking and logging.
- Refactor doHttpProxy to use only the rtty-http-sid cookie for session lookup, removing dependencies on group, devid, proto, and destaddr cookies.
- In httpProxyRedirect, store all necessary session info in HttpProxySession and set only the rtty-http-sid cookie.
- Unify logging to use the session string for easier debugging.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-21 21:18:32 +08:00
Jianhui Zhao 6787a39007 ui: add support virtual keyboard
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-21 21:18:26 +08:00
Jianhui Zhao 1c5c761470 ui: migrate all Vue components from Options API to Composition API
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-20 17:06:33 +08:00
Jianhui Zhao 9ff0f441eb update README
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-20 13:49:59 +08:00
Jianhui Zhao 49106e5602 ui: Optimize font size settings
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-20 13:31:51 +08:00
Jianhui Zhao f992856d53 ui: add terminal window splitting functionality
- Add horizontal and vertical split options to context menu
- Support recursive splitting for complex terminal layouts

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-20 13:31:28 +08:00
Jianhui Zhao 1251278902 ui: fix locale for Upload file to device in en.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 19:21:03 +08:00
Jianhui Zhao 55e2803404 ui: Optimize the display effect of the right-click menus
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 18:21:11 +08:00
Jianhui Zhao 3efb274902 improve authentication logic for empty password
- Move empty password check from httpLogin to httpAuth
- httpLogin now only validates actual password comparison
- httpAuth handles empty password as authentication bypass
- This ensures consistent authentication behavior across all endpoints

Previously, empty password would always return true in httpLogin,
now it's properly handled at the authentication middleware level.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 15:32:23 +08:00
Jianhui Zhao dd10162d34 ui: add smart positioning for context menu
- Add viewport boundary detection to prevent menu overflow
- Auto-adjust menu position when near screen edges
- Ensure menu stays within visible area with 15px margin
- Use $nextTick to calculate position after DOM update

This prevents context menu from being cut off when right-clicking
near screen boundaries, especially in bottom-right corner.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 15:28:12 +08:00
Jianhui Zhao 39e2d8bbb6 ui: This WebSocket should be closed on unmounted
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 15:19:17 +08:00
Jianhui Zhao cec373b4dd ui: fix ContextMenu.vue
may be el is null in close.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 11:42:45 +08:00
Jianhui Zhao 9561f5efc7 ui: add component RttyTerm.vue
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 11:39:04 +08:00
Jianhui Zhao b63d9852a1 ui: fix scroll in terminal
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 11:29:02 +08:00
Jianhui Zhao 8e9081d551 ui: use class instead of inline style for terminal
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-19 11:25:29 +08:00
Jianhui Zhao e9d345287a ui: enhance clipboard paste with permission guidance
- Detect clipboard permission errors and show user-friendly instructions
- Add fallback to Shift+Insert shortcut for unsupported scenarios
- Implement unified clipboard permission guidance with i18n support
- Improve error handling for better user

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-17 11:12:29 +08:00
Jianhui Zhao d2320dce67 refine user hook URL control for specific API endpoints
Move user hook validation to individual endpoints (/connect, /cmd, /web).

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 20:35:04 +08:00
Jianhui Zhao 989d9be983 ui: add loading indicator for create terminal
This prevents users from seeing a blank terminal while waiting for the WebSocket
connection to establish and the login process to complete.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 19:27:11 +08:00
Jianhui Zhao f8e63ad01a ui: redesign error page for better user experience
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:06:41 +08:00
Jianhui Zhao 50bfe1a1e2 improve login timeout handling with proper race condition protection
- Extract login waiting logic into separate waitForLogin function for better code organization
- Fix race condition between timeout and device response by using LoadAndDelete atomically
- Continue waiting for device response if timeout occurs but device has already responded

This refactoring ensures robust handling of the login process even when timeout and
device response

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:05:56 +08:00
Jianhui Zhao d1703f44cd add pprof performance profiling support
Add --pprof command line option to enable performance profiling

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:05:39 +08:00
Jianhui Zhao 0ca0086bdd ui: handle WebSocket 403 unauthorized errors properly
When WebSocket connection fails due to 403 unauthorized status from server,
browser WebSocket API cannot distinguish HTTP status codes and only fires
a generic 'error' event. Redirect to /connect/:devid HTTP endpoint so that
browser can properly capture and handle the 403 status code response.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:05:17 +08:00
Jianhui Zhao 3842518da9 optimize the terminal login process via websocket close messages.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:04:49 +08:00
Jianhui Zhao 948e304984 ui: fix locales for Error.vue.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:04:31 +08:00
Jianhui Zhao 17599404f8 Add devid into the response of command execution #119
```
{"devid":"test","err":1,"msg":"operation not permitted"}
```

```
{"code":0,"devid":"test","stderr":"","stdout":"SGVsbG8sIFJ0dHkK"}
```

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:03:42 +08:00
Jianhui Zhao 98f3dbce02 add HTTP error responses to proxy connections
- Add sendHTTPErrorResponse function to send proper HTTP error pages
- Improve user experience by showing meaningful error pages instead of silent connection drops

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:02:15 +08:00
Jianhui Zhao 4f47087148 Remove unnecessary empty group parameter from redirect URLs
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-15 16:24:31 +08:00
Jianhui Zhao c98a09465f add downloads badge
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-15 09:29:17 +08:00
Jianhui Zhao d6c5d6a578 bump version 5.2.0
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 23:43:31 +08:00
Jianhui Zhao cf2f50eae8 ci: release assets
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 23:25:23 +08:00
Jianhui Zhao 6df295f324 ci: add build windows
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 23:16:12 +08:00
Jianhui Zhao 3a7df54e8b ci: do not run build.yml on push tag
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 23:14:58 +08:00
Jianhui Zhao 2179298bf7 fix build fail for windows.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 22:34:24 +08:00
Jianhui Zhao 7edc2ac18e add a script to create deb package.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 21:57:52 +08:00
Jianhui Zhao a50f99baf8 Improve configuration file documentation and clarity
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 18:07:04 +08:00
Jianhui Zhao 6c36d6d1c8 Add user hook URL support for API access validation
- Forward all original HTTP headers plus custom rttys headers:
  - X-Rttys-Hook: true
  - X-Original-Method: original request method
  - X-Original-URL: original request URL
- Hook must return HTTP 200 to allow API access.

This enables external services to validate and control user API access
by receiving the complete original request context through HTTP hooks.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-14 18:06:58 +08:00