AcevedoR / AcevedoR/rpg-maestro

Cloud-readiness: deployment hygiene (health probes, CORS, tracing, config)

未关闭
#117 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
0
派生
0
平均合并
16 分钟
30 天内合并 PR
7

描述

## Problem

Smaller items, but each one bites once the backend runs as multiple managed instances rather than one long-lived process.

**Env vars captured at module import time**
- `apps/rpg-maestro/src/app/auth/jwt-auth.guard.ts:9` — `ISSUER` / `JWKS_URL` / `JWKS` are resolved at import
- `apps/audio-file-uploader/src/app/fileUpload/FileUploadService.ts:3` and `.../UploadFromYoutubeService.ts:12-13`

Acceptable for containers, but it means no config reload and that misconfiguration surfaces as an import-time failure rather than through `checkValidConfig()` in `apps/rpg-maestro/src/config.ts`.

**`/health` does not distinguish readiness from liveness**
- `apps/rpg-maestro/src/app/health.controller.ts` and `apps/audio-file-uploader/src/app/app.controller.ts:24` both return a static `{ status: 'ok' }`

An instance whose Firestore connection is dead still passes the check and keeps receiving traffic. Needs a readiness probe that actually checks downstream dependencies, kept separate from liveness.

**Wildcard CORS on the uploader**
- `apps/audio-file-uploader/src/main.ts:11` — `enableCors({ origin: '*' })` with an existing `// TODO fix this`

The maestro backend already resolves its allowed origin properly (`app-bootstrap.ts`, via `NetworkingConfiguration`). The uploader should do the same, especially once it is separately internet-reachable.

**No request/trace correlation**

There is no correlation or trace id on requests or log lines, which makes debugging across N instances (and across the maestro → uploader hop) painful.

**No graceful shutdown**

Neither `apps/rpg-maestro/src/app-bootstrap.ts` nor `apps/audio-file-uploader/src/main.ts` calls `enableShutdownHooks()` or handles SIGTERM. Tracked in more detail in the ingestion-pipeline issue, but it applies to both apps.

贡献指南

这个仓库没有索引到贡献指南

调研方向

The issue lists specific files: jwt-auth.guard.ts, config.ts, health.controller.ts, app.controller.ts, main.ts, and app-bootstrap.ts. Start by understanding the existing config validation and health check logic. For each sub-task (env vars, health probes, CORS, tracing, graceful shutdown), examine the current implementation and the project's deployment setup. 'Done' means each app has proper readiness/liveness checks, config reloading, secure CORS, request tracing, and handles SIGTERM.

由索引模型根据 Issue 内容生成。

评估

技术栈
docker, firebase, kubernetes, nginx, nodejs, typescript
领域
api, backend, cloud, devops, observability
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。