feat(storage,deploy): delad S3/mock-lagring, SSM .env-sync, Gemini readyz

- @app/storage med MockStorage + AwsStorage delas mellan API och worker

- Workerns readUrl() ger presignerad S3-URL i aws-läge (fixar mock-s3 404)

- sync-env-from-ssm.py hämtar /cibello/prod/* och skriver .env; first-deploy.sh kör det i prod

- /readyz returnerar 503 om app.aamos.healthCheck() misslyckas

- docs/SECRETS.md med rotations- och SSM-regler
This commit is contained in:
Sven (AAMOS AI)
2026-08-12 17:28:58 +07:00
parent 535e3e36e8
commit 6e2d794130
17 changed files with 516 additions and 241 deletions
+5 -1
View File
@@ -13,10 +13,14 @@ export async function healthRoutes(app: FastifyInstance) {
app.get("/readyz", { config: { rateLimit: false } }, async (_req, reply) => {
try {
await app.db.execute(sql`SELECT 1`);
return { ok: true };
} catch {
return reply.status(503).send({ ok: false, reason: "database" });
}
const aamosHealth = await app.aamos.healthCheck();
if (!aamosHealth.ok) {
return reply.status(503).send({ ok: false, reason: "aamos", detail: aamosHealth.detail });
}
return { ok: true };
});
/** Enkel endpointöversikt i stället för tung OpenAPI-generering (se beslutslogg D-011). */