mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
fix(ui): increase ssh pre-auth key expiry time and present errors
Closes HP-546
This commit is contained in:
@@ -16,6 +16,7 @@ import { loadHeadplaneWASM } from "./wasm.client";
|
||||
|
||||
const WASM_MODULE_URL = `${__PREFIX__}/hp_ssh.wasm`;
|
||||
const WASM_HELPER_URL = `${__PREFIX__}/wasm_exec.js`;
|
||||
const SSH_PREAUTH_KEY_TTL_MS = 10 * 60 * 1000;
|
||||
|
||||
export const shouldRevalidate: ShouldRevalidateFunction = () => {
|
||||
return false;
|
||||
@@ -75,7 +76,7 @@ export async function loader({ request, params, context }: Route.LoaderArgs) {
|
||||
user: hsUser.id,
|
||||
ephemeral: true,
|
||||
reusable: false,
|
||||
expiration: new Date(Date.now() + 60 * 1000), // 1 minute expiry
|
||||
expiration: new Date(Date.now() + SSH_PREAUTH_KEY_TTL_MS),
|
||||
aclTags: null,
|
||||
});
|
||||
|
||||
@@ -173,7 +174,12 @@ function SSHConsole({
|
||||
setSsh(instance);
|
||||
}
|
||||
},
|
||||
onError: (msg) => console.error("[ssh] IPN error:", msg),
|
||||
onError: (msg) => {
|
||||
console.error("[ssh] IPN error:", msg);
|
||||
if (!cancelled) {
|
||||
setStatus(`Failed to join Tailnet: ${msg}`);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
console.log("[ssh] IPN instance created", instance);
|
||||
|
||||
Reference in New Issue
Block a user