2 Commits

Author SHA1 Message Date
syntaxbullet
fee4969910 feat: configure dedicated bot SSH key and non-interactive SSH for git operations.
Some checks failed
Deploy to Production / test (push) Failing after 20s
Deploy to Production / build (push) Has been skipped
Deploy to Production / deploy (push) Has been skipped
2026-01-30 15:26:07 +01:00
syntaxbullet
dabcb4cab3 feat: Mount SSH keys for Git authentication and disable interactive prompts in the update service. 2026-01-30 15:21:41 +01:00
2 changed files with 14 additions and 3 deletions

View File

@@ -58,6 +58,9 @@ services:
volumes:
# Project directory - allows git pull and rebuild
- .:/app/deploy
# SSH Keys for git authentication
- ~/.ssh/aurora_bot_key:/home/bun/.ssh/id_ed25519:ro
- ~/.ssh/known_hosts:/home/bun/.ssh/known_hosts:ro
working_dir: /app
environment:
- NODE_ENV=production

View File

@@ -24,7 +24,14 @@ async function execWithTimeout(
options: { cwd?: string } = {}
): Promise<{ stdout: string; stderr: string }> {
return new Promise((resolve, reject) => {
const process = exec(cmd, { cwd: options.cwd }, (error: ExecException | null, stdout: string, stderr: string) => {
const child = exec(cmd, {
cwd: options.cwd,
env: {
...process.env,
GIT_TERMINAL_PROMPT: "0",
GIT_SSH_COMMAND: "ssh -o BatchMode=yes"
}
}, (error: ExecException | null, stdout: string, stderr: string) => {
if (error) {
reject(error);
} else {
@@ -33,11 +40,11 @@ async function execWithTimeout(
});
const timer = setTimeout(() => {
process.kill("SIGTERM");
child.kill("SIGTERM");
reject(new Error(`Command timed out after ${timeoutMs}ms: ${cmd}`));
}, timeoutMs);
process.on("exit", () => clearTimeout(timer));
child.on("exit", () => clearTimeout(timer));
});
}
@@ -572,6 +579,7 @@ export class UpdateService {
deployProcess.unref();
output += `🚀 Deploy triggered - container will restart\n`;
console.log("Deploy triggered successfully:", output);
return {
success: true,