fix: sudo incorrect styling and remove expiration date

This commit is contained in:
LukeGus
2025-12-20 01:15:25 -06:00
parent c104197dd6
commit b7fdb2143d
11 changed files with 1419 additions and 1531 deletions

View File

@@ -211,7 +211,6 @@ async function initializeCompleteDatabase(): Promise<void> {
docker_config TEXT,
terminal_config TEXT,
notes TEXT,
expiration_date TEXT,
use_socks5 INTEGER,
socks5_host TEXT,
socks5_port INTEGER,
@@ -578,7 +577,6 @@ const migrateSchema = () => {
addColumnIfNotExists("ssh_data", "docker_config", "TEXT");
addColumnIfNotExists("ssh_data", "notes", "TEXT");
addColumnIfNotExists("ssh_data", "expiration_date", "TEXT");
// SOCKS5 Proxy columns
addColumnIfNotExists("ssh_data", "use_socks5", "INTEGER");

View File

@@ -94,7 +94,6 @@ export const sshData = sqliteTable("ssh_data", {
terminalConfig: text("terminal_config"),
quickActions: text("quick_actions"),
notes: text("notes"),
expirationDate: text("expiration_date"),
useSocks5: integer("use_socks5", { mode: "boolean" }),
socks5Host: text("socks5_host"),

View File

@@ -256,7 +256,6 @@ router.post(
terminalConfig,
forceKeyboardInteractive,
notes,
expirationDate,
useSocks5,
socks5Host,
socks5Port,
@@ -316,7 +315,6 @@ router.post(
terminalConfig: terminalConfig ? JSON.stringify(terminalConfig) : null,
forceKeyboardInteractive: forceKeyboardInteractive ? "true" : "false",
notes: notes || null,
expirationDate: expirationDate || null,
useSocks5: useSocks5 ? 1 : 0,
socks5Host: socks5Host || null,
socks5Port: socks5Port || null,
@@ -508,7 +506,6 @@ router.put(
terminalConfig,
forceKeyboardInteractive,
notes,
expirationDate,
useSocks5,
socks5Host,
socks5Port,
@@ -518,9 +515,6 @@ router.put(
overrideCredentialUsername,
} = hostData;
// Temporary logging to debug notes and expirationDate
console.log("DEBUG - Update host data:", { notes, expirationDate });
if (
!isNonEmptyString(userId) ||
!isNonEmptyString(ip) ||
@@ -566,7 +560,6 @@ router.put(
terminalConfig: terminalConfig ? JSON.stringify(terminalConfig) : null,
forceKeyboardInteractive: forceKeyboardInteractive ? "true" : "false",
notes: notes || null,
expirationDate: expirationDate || null,
useSocks5: useSocks5 ? 1 : 0,
socks5Host: socks5Host || null,
socks5Port: socks5Port || null,
@@ -773,7 +766,6 @@ router.get(
overrideCredentialUsername: sshData.overrideCredentialUsername,
quickActions: sshData.quickActions,
notes: sshData.notes,
expirationDate: sshData.expirationDate,
enableDocker: sshData.enableDocker,
useSocks5: sshData.useSocks5,
socks5Host: sshData.socks5Host,
@@ -1677,15 +1669,21 @@ async function resolveHostCredentials(
if (credentials.length > 0) {
const credential = credentials[0];
return {
const resolvedHost: Record<string, unknown> = {
...host,
username: credential.username,
authType: credential.auth_type || credential.authType,
password: credential.password,
key: credential.key,
keyPassword: credential.key_password || credential.keyPassword,
keyType: credential.key_type || credential.keyType,
};
// Only override username if overrideCredentialUsername is not enabled
if (!host.overrideCredentialUsername) {
resolvedHost.username = credential.username;
}
return resolvedHost;
}
}