Commit Graph

2296 Commits

Author SHA1 Message Date
0xJacky
7ed73f621a feat(analytic): implement WebSocket keepalive mechanism 2026-04-18 11:02:52 +00:00
0xJacky
b1b1596a4d chore: update .gitignore and remove settings.local.json 2026-04-18 08:08:03 +00:00
0xJacky
535c8efb38 fix(sitecheck): bound outbound connections and add global controls (#1608)
The site checker created a fresh http.Transport per request and per
EnhancedSiteChecker, with Go's default Happy-Eyeballs dialer. When
server_name entries resolved to ingress services returning many A
records (ngrok, AWS ALB, Cloudflare), each sweep opened enough flows
to exhaust conntrack tables on consumer routers (UniFi).

Introduce a package-level shared http.Transport with MaxConnsPerHost=2,
MaxIdleConnsPerHost=2 and FallbackDelay=-1 (disables IPv6 dial races),
plumb it through SiteChecker and EnhancedSiteChecker, and only build a
custom client when the per-site HealthCheckConfig truly diverges on
TLS. Reuse the response body fetched by the health check for favicon
extraction so each site is hit at most once per sweep, and dedupe sites
sharing the same host:port before fan-out.

Add a [site_check] settings section (Enabled, Concurrency, Interval-
Seconds) so operators can disable the checker entirely or tune the
sweep cadence; clamp Concurrency to [1, 20] and IntervalSeconds to
>=30. Document the new section in en, zh_CN and zh_TW guides and add
sidebar entries.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 16:06:06 +08:00
0xJacky
c38e0a28b8 fix(sites): honor configured healthcheck protocol (#1628)
The site healthcheck built its request URL from the indexed site URL
(e.g. http://example.com) and never rewrote the scheme to match the
user-configured HealthCheckConfig.Protocol. As a result, sites
configured for HTTPS were probed over HTTP and always shown as
unreachable. TestHealthCheck compounded the issue by using
siteConfig.Scheme (default "http") instead of req.Config.Protocol.

Introduce rewriteCheckURLScheme which aligns only the URL scheme with
the configured protocol while preserving path, query, and port, and
call it from CheckSiteWithConfig. TestHealthCheck now passes the stored
site URL and relies on the same rewrite, so the "Test" button exercises
the same code path as the scheduled checker.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 16:03:23 +08:00
0xJacky
50ccaaeb2f chore: update settings.local.json 2026-04-18 14:54:29 +08:00
0xJacky
329e8589e9 fix(cert): restore WebSocket connection for certificate issuance (#1630)
`ObtainCert.job()` called `issueCert()` synchronously after `step.value++`,
before Vue mounted `<ObtainCertLive>`, so `refObtainCertLive.value` was
null and the optional-chain call silently no-oped — no log entry, no
WebSocket connection, progress stuck at 0%. Add an `await nextTick()`
so the live component is mounted before its method is invoked.

Also harden the long-token WebSocket fallback: switch the frontend to
URL-safe base64 (avoids `+` being decoded as a space in query strings)
and accept both URL-safe and standard base64 in `getTokenWS` for
backward compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 14:54:29 +08:00
renovate[bot]
513d5d6fbb chore(deps): update all non-major dependencies (#1641)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-18 13:29:01 +08:00
Tema Smirnov
32d5ce0018 fix(app): embed generated assets with underscore names (#1640) 2026-04-18 08:59:45 +08:00
0xJacky
b01ea55ed6 chore: update deps 2026-04-17 19:36:03 +08:00
renovate[bot]
f73aabb59b chore(deps): update softprops/action-gh-release action to v3 (#1632)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-16 16:44:03 +08:00
the fire inside me
89c1fdfb44 fix upstream (#1637) 2026-04-15 23:26:19 +08:00
renovate[bot]
20538d9c7b chore(deps): update all non-major dependencies (#1634)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-15 01:15:44 +00:00
renovate[bot]
335fc66c90 chore(deps): update pnpm.catalog.default marked to v18 (#1626)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
v2.3.6
2026-04-08 09:52:13 +08:00
0xJacky
863f36179c chore: prepare v2.3.6 2026-04-04 15:44:07 +00:00
0xJacky
f8019e68b9 feat(ngx-config-editor): enhance location and directive handling with unique keys
- Introduced unique key generation for locations and directives using WeakMap to improve item identification in draggable lists.
- Updated the `item-key` binding in `LocationEditor.vue` and `DirectiveEditor.vue` to utilize the new key generation functions.
- Refactored the NgxConfig store to include a reset function, ensuring a clean state for ngxConfig when needed.
- Enhanced the `SiteAdd.vue` component to reset the ngxConfigStore during initialization.
2026-04-04 14:28:56 +00:00
0xJacky
0b0f854f9b feat(backup): enhance backup and restore functionality with crypto secret handling
- Added tests to verify backup and restore processes when the crypto secret changes, ensuring hash verification passes.
- Updated `writeManifestFiles` and `verifyBackupManifest` functions to accept an AES key for improved security.
- Implemented fallback mechanism for verifying manifest signatures using both AES-derived and legacy signing keys.
- Enhanced the overall robustness of the backup and restore system to handle legacy signatures and different crypto secrets.
2026-04-04 14:26:34 +00:00
renovate[bot]
edf92e4ffe chore(deps): update all non-major dependencies (#1623)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-04 11:06:43 +08:00
Jacky
d454a2a9d2 fix(mcp): prevent panic on nil interface conversion for tool arguments (#1622)
* fix(mcp): prevent panic on nil interface conversion for tool arguments

Add safe argument extraction helper functions in internal/mcp/args.go
that handle nil values gracefully instead of panicking on direct type
assertions.

This fixes the issue where MCP config tools panic with:
'interface conversion: interface {} is nil, not string'
when called via Claude Desktop with protocol version 2025-11-25.

Affected tools:
- nginx_config_list
- nginx_config_get
- nginx_config_add
- nginx_config_modify
- nginx_config_rename
- nginx_config_mkdir
- nginx_config_history
- nginx_config_enable

Fixes #36ec

Co-authored-by: Jacky <me@jackyu.cn>

* Add required argument validation to MCP config handlers to prevent data loss

The safe argument extraction helpers (mcp.GetString, etc.) return zero values
for nil/missing arguments, which could cause silent data loss. This adds
explicit validation for required arguments in:

- config_modify: validate relative_path and content
- config_add: validate name and content
- config_rename: validate orig_name and new_name
- config_mkdir: validate folder_name

This follows the same pattern already used in handleNginxConfigEnable.

* Add required argument validation to config_get and config_history handlers

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-04-04 10:51:50 +08:00
0xJacky
9f1b9bbbba refactor(ws): implement SafeWebSocketWriter for serialized access
- Introduced SafeWebSocketWriter to ensure thread-safe writes to WebSocket connections.
- Updated WebSocket handling in certificate issuance, revocation, Nginx log tailing, and system upgrades to use the new writer.
- Enhanced WebSocket client management in the site navigation module for improved message handling and connection stability.
2026-04-04 02:01:20 +00:00
Simon Zöllner
b9e1951423 Fix #1619, WebSocket check fails during initial setup on custom ports (#1620)
* enhance(ws): improve session security

* Fix #1619, WebSocket check fails during initial setup on custom ports in docker

---------

Co-authored-by: 0xJacky <me@jackyu.cn>
2026-04-04 09:50:48 +08:00
0xJacky
d895c4a336 enhance(ws): improve session security 2026-04-04 09:48:18 +08:00
0xJacky
7d9887bfe8 fix: enhance WebSocket origin validation for trusted node requests 2026-04-03 11:31:41 +08:00
0xJacky
02931d6c31 feat: enhance TLS certificate handling and server configuration 2026-04-02 22:44:10 +08:00
renovate[bot]
f290060e55 chore(deps): update all non-major dependencies (#1612)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-02 11:04:57 +08:00
renovate[bot]
314efd0c25 chore(deps): update pnpm.catalog.default @antfu/eslint-config to v8 (#1617)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-02 11:00:27 +08:00
0xJacky
fb37c94276 feat: implement short token endpoint for WebSocket authentication
- Added `InitTokenRouter` to define the `/token/short` endpoint for issuing short tokens.
- Created `IssueShortToken` function to handle short token generation and response.
- Updated WebSocket middleware to require short token for authentication, preventing CSWSH attacks.
- Modified user store and login handling to integrate short token functionality.
- Enhanced documentation to reflect changes in WebSocket security requirements.
2026-04-02 00:06:04 +08:00
renovate[bot]
f89f8ff822 chore(deps): update pnpm.catalog.default unplugin-vue-components to v32 (#1605)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-28 11:13:41 +08:00
renovate[bot]
c9dfdd4197 chore(deps): update all non-major dependencies (#1603)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-23 01:16:38 +00:00
renovate[bot]
95120616df chore(deps): update all non-major dependencies (#1595)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-19 01:03:16 +00:00
0xJacky
926b3248b3 feat: enhance service initialization logic with mutex handling and return types 2026-03-16 13:59:45 +00:00
0xJacky
1a9cd29a30 style: center align WeChat community QR code in documentation v2.3.5 2026-03-16 05:33:37 +00:00
0xJacky
3a38914fe2 feat: add official WeChat community group information to documentation 2026-03-16 05:31:54 +00:00
0xJacky
58b183956a chore(deps): update risefront dependency from v1.3.2 to v1.3.3 2026-03-16 03:45:52 +00:00
0xJacky
95ab34bbe1 feat: implement migration to encrypt sensitive JSON fields in database models 2026-03-16 11:34:10 +08:00
0xJacky
9e41ecf9df feat: add support for root block configuration in NgxConfig and implement parsing logic 2026-03-16 03:15:27 +00:00
0xJacky
88a86edcd2 fix: preserve previous data when saving certificate updates 2026-03-16 00:56:58 +00:00
0xJacky
cb92cc4da8 feat: add ACMEUserID to certificate issuance and auto-certification requests 2026-03-16 00:52:12 +00:00
0xJacky
af6d3b9ae4 chore: prepare v2.3.5 2026-03-15 16:17:04 +00:00
0xJacky
f89916e0fb feat: add ResolveConfPathInDirPreserveLeaf function for symlink handling in configuration paths 2026-03-16 00:03:32 +08:00
0xJacky
20412b5b54 refactor: configuration path resolution for sites and streams v2.3.4 2026-03-15 22:20:29 +08:00
0xJacky
5741b9f9ff style: update Delete component styles for improved UI consistency 2026-03-15 21:41:53 +08:00
renovate[bot]
f8ef0494b0 chore(deps): update pnpm.catalog.default vite-plugin-build-id to v0.7.0 (#1568) 2026-03-15 20:49:48 +08:00
0xJacky
b06cce311a fix: correct recovery code verification logic in OTP handling 2026-03-15 19:18:03 +08:00
0xJacky
bc8df5beda feat: add DELETE endpoint for DDNS configuration and implement deletion logic 2026-03-15 02:44:48 +00:00
0xJacky
a2e1e8e31c fix: add IP address family handling and tests for DNS functionality #1572 2026-03-15 02:28:49 +00:00
0xJacky
7f7e569460 chore: prepare v2.3.4 2026-03-15 02:17:16 +00:00
0xJacky
f61bcec547 refactor: enhance backup restoration process with integrity checks 2026-03-15 09:52:03 +08:00
0xJacky
1593e6fb7d feat: integrate WebSocket usage in proxy availability store 2026-03-14 23:53:18 +08:00
0xJacky
1cec07d6ea feat: implement demo mode for terminal with restricted commands 2026-03-14 23:49:58 +08:00
0xJacky
413dc631ee feat: add WebSocketTrustedOrigins configuration and implement origin validation for WebSocket connections
- Introduced `WebSocketTrustedOrigins` setting in `app.example.ini` and corresponding documentation.
- Refactored WebSocket origin checks across multiple API endpoints to utilize the new middleware for improved security.
- Added tests for the new origin validation logic to ensure proper handling of trusted origins and node secret requests.
2026-03-14 23:37:10 +08:00