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

@@ -18,6 +18,7 @@ pub async fn get_web_server_status(
pub struct StartWebServerParams {
pub port: Option<u16>,
pub host: Option<String>,
pub token: Option<String>,
}
pub async fn start_web_server(