feat(web-service): allow custom access token with persisted port and localized start errors

- Persist user-supplied access token and last-used port in app_metadata, falling back to defaults when unset
- Atomically guard concurrent starts via compare_exchange with RAII rollback of the running flag
- Wrap token and port persistence in a single SeaORM transaction to prevent partial writes
- Classify bind errors (port in use, permission denied, address unavailable, invalid address) into stable i18n keys
- Localize start-failure messages across all 10 supported languages
This commit is contained in:
xintaofei
2026-04-18 10:18:34 +08:00
parent 32b4c88582
commit fd10494128
16 changed files with 427 additions and 67 deletions

View File

@@ -1857,7 +1857,17 @@
"copy": "Copy",
"addressLabel": "Access Address",
"tokenLabel": "Access Token",
"tokenHint": "Enter this token when accessing the Web client for the first time"
"tokenHint": "Enter this token when accessing the Web client for the first time",
"tokenPlaceholder": "Leave empty to auto-generate",
"regenerate": "Regenerate",
"errors": {
"alreadyRunning": "Web service is already running",
"invalidAddress": "Invalid host or port format",
"portInUse": "Port {port} is already in use. Close the process using it or choose another port.",
"permissionDenied": "Permission denied. Try a port above 1024 or run with higher privileges.",
"addressUnavailable": "The address is not available on this machine",
"bindFailed": "Failed to bind address"
}
},
"DirectoryBrowser": {
"title": "Browse Directory",