diff --git a/README.md b/README.md index 5ea0a00..ab5ce2d 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ The JSON API is session-authenticated unless noted: - `POST /api/telegram-link/unlink` - `POST /api/vpn-clients` - `POST /api/vpn-clients/{id}/enabled` -- `POST /api/vpn-clients/{id}/group` changes the group and rotates the client key pair +- `POST /api/vpn-clients/{id}/group` changes the server-side connectivity group without changing the client config - `DELETE /api/vpn-clients/{id}` - `GET /api/vpn-clients/{id}/config` returns `servers[]` with one raw AWG config and one Amnezia `vpn://` import link per registered endpoint - `POST /api/vpn-clients/sync` diff --git a/src/api/mod.rs b/src/api/mod.rs index c6fa0a2..102ba3a 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -533,10 +533,7 @@ async fn set_vpn_client_group_handler( return Ok(json_error(cot::http::StatusCode::NOT_FOUND, "not found")); }; - if let Err(e) = client - .set_group_and_rotate_keys(&db, request.group_name.as_deref()) - .await - { + if let Err(e) = client.set_group(&db, request.group_name.as_deref()).await { return Ok(json_error_typed( cot::http::StatusCode::BAD_REQUEST, "client_group_update_failed", diff --git a/src/i18n/phrases.rs b/src/i18n/phrases.rs index b613435..6541c73 100644 --- a/src/i18n/phrases.rs +++ b/src/i18n/phrases.rs @@ -148,9 +148,7 @@ translations! { configs_group_placeholder: "Leave empty for isolation" , "Оставьте пустым для изоляции"; configs_group_hint: "Clients with the same group name can connect to each other on the same VPN server." , "Клиенты с одинаковой группой могут обращаться друг к другу на одном VPN-сервере."; configs_change_group: "Change group" , "Сменить группу"; - configs_group_rotation_warning: "Changing the group rotates this client's keys. The old config will stop working; download or import a new one." , "При смене группы ключи клиента будут заменены. Старый конфиг перестанет работать — скачайте или импортируйте новый."; - configs_group_rotation_confirm: "Change the group and invalidate the old client config?" , "Сменить группу и сделать старый конфиг клиента недействительным?"; - configs_group_changed: "Group changed. Update the client config." , "Группа изменена. Обновите конфиг клиента."; + configs_group_changed: "Group changed. The existing client config remains valid." , "Группа изменена. Текущий конфиг клиента остаётся действительным."; configs_empty_title: "Create your first key" , "Создайте первый ключ"; configs_empty_hint: "It will appear here after creation." , "После создания он появится здесь."; configs_enabled_state: "active" , "активен"; diff --git a/src/vpn.rs b/src/vpn.rs index 0a10ec2..5250502 100644 --- a/src/vpn.rs +++ b/src/vpn.rs @@ -122,7 +122,7 @@ impl VpnClient { self.save(db).await } - pub async fn set_group_and_rotate_keys( + pub async fn set_group( &mut self, db: &Database, group_name: Option<&str>, @@ -132,9 +132,6 @@ impl VpnClient { return Ok(()); } - let keypair = generate_keypair().map_err(db_custom_error)?; - self.public_key = LimitedString::new(keypair.public_key).unwrap(); - self.private_key = LimitedString::new(keypair.private_key).unwrap(); self.group_name = group_name; let now = now_timestamp(); self.updated_at = LimitedString::new(now).unwrap(); diff --git a/templates/client_portal.html b/templates/client_portal.html index 6878058..6b2a02f 100644 --- a/templates/client_portal.html +++ b/templates/client_portal.html @@ -118,7 +118,6 @@ .telegram-copy { color: #53616c; line-height: 1.45; margin: 0; } .form-stack { display: grid; gap: .8rem; } .field-hint { margin: 0; color: #69777f; font-size: .82rem; line-height: 1.4; } - .warning-box { border: 1px solid #e5c76c; border-radius: 8px; background: #fff8df; color: #5f4911; padding: .7rem; font-size: .86rem; line-height: 1.4; } .guide-list { margin: 0; padding-left: 1.2rem; color: #34424b; display: grid; gap: .45rem; line-height: 1.4; } .guide-list a { color: #18342f; font-weight: 850; } .guide-list a.disabled { color: #69777f; pointer-events: none; text-decoration: none; } @@ -312,9 +311,6 @@

{{ t.configs_group_hint }}

- -