preserve client IP visibility
Previously, TLS termination was moved to nginx for better separation of concerns.
However, this introduced an issue with the new device IP display feature:
- With nginx reverse proxying, all device connections appear to originate from 127.0.0.1
- The actual device IP addresses were masked by the proxy layer
- This prevented accurate IP-based device identification and reporting
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Encapsulate API routes into APIServer methods (api.go)
- Split large handleUserConnection into smaller methods (user.go)
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
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>
- 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>
- Add horizontal and vertical split options to context menu
- Support recursive splitting for complex terminal layouts
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- 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>
- 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>
- 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>
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>
- 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>
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>