mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-03-15 23:46:51 +08:00
refactor: 移除 ttyd 扩展的“用户凭据”功能
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user