refactor: 移除 ttyd 扩展的“用户凭据”功能

This commit is contained in:
mofeng-git
2026-02-11 16:50:49 +08:00
parent 24c4002ef2
commit f912c977d0
7 changed files with 1 additions and 26 deletions

View File

@@ -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)

View File

@@ -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<String>,
}
impl Default for TtydConfig {
@@ -113,7 +110,6 @@ impl Default for TtydConfig {
enabled: false,
port: 7681,
shell: "/bin/bash".to_string(),
credential: None,
}
}
}

View File

@@ -156,7 +156,6 @@ pub struct TtydConfigUpdate {
pub enabled: Option<bool>,
pub port: Option<u16>,
pub shell: Option<String>,
pub credential: Option<String>,
}
/// 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?;

View File

@@ -741,7 +741,6 @@ export default {
openInNewTab: 'Open in New Tab',
port: 'Port',
shell: 'Shell',
credential: 'Credential',
},
// gostc
gostc: {

View File

@@ -741,7 +741,6 @@ export default {
openInNewTab: '在新标签页打开',
port: '端口',
shell: 'Shell',
credential: '认证凭据',
},
// gostc
gostc: {

View File

@@ -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 */

View File

@@ -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 () => {
<Label class="sm:text-right">{{ t('extensions.ttyd.shell') }}</Label>
<Input v-model="extConfig.ttyd.shell" class="sm:col-span-3" placeholder="/bin/bash" :disabled="isExtRunning(extensions?.ttyd?.status)" />
</div>
<div class="grid gap-2 sm:grid-cols-4 sm:items-center">
<Label class="sm:text-right">{{ t('extensions.ttyd.credential') }}</Label>
<Input v-model="extConfig.ttyd.credential" class="sm:col-span-3" placeholder="user:password" :disabled="isExtRunning(extensions?.ttyd?.status)" />
</div>
</div>
<!-- Logs -->
<div class="space-y-2">