From f912c977d0acf70fdf28aaf4c54f13d490f42228 Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Wed, 11 Feb 2026 16:50:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20ttyd=20?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E7=9A=84=E2=80=9C=E7=94=A8=E6=88=B7=E5=87=AD?= =?UTF-8?q?=E6=8D=AE=E2=80=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extensions/manager.rs | 7 ------- src/extensions/types.rs | 4 ---- src/web/handlers/extensions.rs | 4 ---- web/src/i18n/en-US.ts | 1 - web/src/i18n/zh-CN.ts | 1 - web/src/types/generated.ts | 3 --- web/src/views/SettingsView.vue | 7 +------ 7 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/extensions/manager.rs b/src/extensions/manager.rs index 279d303c..6feedbb2 100644 --- a/src/extensions/manager.rs +++ b/src/extensions/manager.rs @@ -230,13 +230,6 @@ impl ExtensionManager { "-W".to_string(), // Writable (allow input) ]; - // Add credential if set (still useful for additional security layer) - if let Some(ref cred) = c.credential { - if !cred.is_empty() { - args.extend(["-c".to_string(), cred.clone()]); - } - } - // Add shell as last argument args.push(c.shell.clone()); Ok(args) diff --git a/src/extensions/types.rs b/src/extensions/types.rs index b8c69c77..10358ddf 100644 --- a/src/extensions/types.rs +++ b/src/extensions/types.rs @@ -102,9 +102,6 @@ pub struct TtydConfig { pub port: u16, /// Shell to execute pub shell: String, - /// Credential in format "user:password" (optional) - #[serde(skip_serializing_if = "Option::is_none")] - pub credential: Option, } impl Default for TtydConfig { @@ -113,7 +110,6 @@ impl Default for TtydConfig { enabled: false, port: 7681, shell: "/bin/bash".to_string(), - credential: None, } } } diff --git a/src/web/handlers/extensions.rs b/src/web/handlers/extensions.rs index a90c8962..ac0bf39d 100644 --- a/src/web/handlers/extensions.rs +++ b/src/web/handlers/extensions.rs @@ -156,7 +156,6 @@ pub struct TtydConfigUpdate { pub enabled: Option, pub port: Option, pub shell: Option, - pub credential: Option, } /// Update gostc config @@ -203,9 +202,6 @@ pub async fn update_ttyd_config( if let Some(ref shell) = req.shell { ttyd.shell = shell.clone(); } - if req.credential.is_some() { - ttyd.credential = req.credential.clone(); - } }) .await?; diff --git a/web/src/i18n/en-US.ts b/web/src/i18n/en-US.ts index 0beae2c6..a7b163a3 100644 --- a/web/src/i18n/en-US.ts +++ b/web/src/i18n/en-US.ts @@ -741,7 +741,6 @@ export default { openInNewTab: 'Open in New Tab', port: 'Port', shell: 'Shell', - credential: 'Credential', }, // gostc gostc: { diff --git a/web/src/i18n/zh-CN.ts b/web/src/i18n/zh-CN.ts index 441a6b59..b7ed1841 100644 --- a/web/src/i18n/zh-CN.ts +++ b/web/src/i18n/zh-CN.ts @@ -741,7 +741,6 @@ export default { openInNewTab: '在新标签页打开', port: '端口', shell: 'Shell', - credential: '认证凭据', }, // gostc gostc: { diff --git a/web/src/types/generated.ts b/web/src/types/generated.ts index a88f18d6..5c94fece 100644 --- a/web/src/types/generated.ts +++ b/web/src/types/generated.ts @@ -302,8 +302,6 @@ export interface TtydConfig { port: number; /** Shell to execute */ shell: string; - /** Credential in format "user:password" (optional) */ - credential?: string; } /** gostc configuration (NAT traversal based on FRP) */ @@ -659,7 +657,6 @@ export interface TtydConfigUpdate { enabled?: boolean; port?: number; shell?: string; - credential?: string; } /** Simple ttyd status for console view */ diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index fb94ec7d..0753e55c 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -168,7 +168,7 @@ const showTerminalDialog = ref(false) // Extension config (local edit state) const extConfig = ref({ - ttyd: { enabled: false, shell: '/bin/bash', credential: '' }, + ttyd: { enabled: false, shell: '/bin/bash' }, gostc: { enabled: false, addr: 'gostc.mofeng.run', key: '', tls: true }, easytier: { enabled: false, network_name: '', network_secret: '', peer_urls: [] as string[], virtual_ip: '' }, }) @@ -780,7 +780,6 @@ async function loadExtensions() { extConfig.value.ttyd = { enabled: ttyd.enabled, shell: ttyd.shell, - credential: ttyd.credential || '', } extConfig.value.gostc = { ...extensions.value.gostc.config } const easytier = extensions.value.easytier.config @@ -2115,10 +2114,6 @@ onMounted(async () => { -
- - -