feat: add safe Gitea sync and signed updates
ForgeFlow quality gate / secret-scan (push) Failing after 32s
ForgeFlow quality gate / quality (push) Failing after 0s

This commit is contained in:
NuklearRabbit
2026-08-27 00:38:58 +02:00
parent cb9bdcd713
commit d47c7b5e41
46 changed files with 1658 additions and 246 deletions
+14 -2
View File
@@ -415,13 +415,25 @@ function registerIpc({
await diagnostics.info("server.deleted", { serverId });
return store.getPublicState();
});
register("server:test", async ({ serverId }) => {
register("server:test", async ({ serverId, expectedFingerprint = "" }) => {
const server = store.getServer(serverId);
if (!server) throw new Error("The configured server no longer exists.");
const expected = String(expectedFingerprint || "").trim();
if (!server.hostFingerprint && !expected) {
const probe = await ssh.probeHostFingerprint(serverId);
return { ...probe, connected: false, needsTrust: true, state: store.getPublicState() };
}
if (!server.hostFingerprint && !/^SHA256:[A-Za-z0-9+/]{40,44}$/.test(expected))
throw new Error("Confirm the exact SSH host fingerprint returned by ForgeFlow.");
const result = await ssh.test(serverId, {
trustOnFirstUse: !server.hostFingerprint,
expectedFingerprint: server.hostFingerprint ? null : expected,
});
if (!server.hostFingerprint) {
if (result.fingerprint !== expected) {
const error = new Error("The SSH host identity changed between preview and confirmation.");
error.code = "SSH_HOST_KEY_MISMATCH";
throw error;
}
await store.saveServer(
{ ...server, hostFingerprint: result.fingerprint },
{},