Commit b363f16
chore: merge dev into production (#34)
* feat: harden Cloud Run security with Secret Manager, VPC connector, and private backend
- Secret Manager: move all sensitive env vars (Azure credentials, Gemini key,
DB credentials) out of GitHub Secrets and into GCP Secret Manager; Cloud Run
reads them at runtime via --set-secrets, so secrets are never exposed in
workflow logs or build args.
- VPC Connector: add Serverless VPC Access connector (terraform/network.tf) so
Cloud Run services can reach Cloud SQL and each other over the private VPC
network.
- Private backend: set backend Cloud Run ingress to 'internal', blocking all
public internet access. Frontend nginx now proxies /api/* to the backend's
internal URL (with BACKEND_URL injected as a runtime env var), so the browser
never needs a direct connection to the backend.
- Terraform IaC: terraform/ directory manages the VPC connector, Secret Manager
secrets, Cloud Run service account, and Cloud SQL (importable via import.sh).
CI continues to own image builds and Cloud Run deployments.
- Data migration script: scripts/migrate_db.sh migrates PostgreSQL data between
Cloud SQL instances via Cloud SQL Auth Proxy if the database ever needs to be
rebuilt.
https://claude.ai/code/session_01SRRzCWrpwgMpdYFurMVn7m
* fix: construct Cloud Run SA email inline to use PROJECT_ID, clarify VITE_API_BASE_URL
GitHub Actions does not interpolate ${{ env.X }} inside the top-level env:
block, so the full SA email could not reference PROJECT_ID there. Replaced
CLOUD_RUN_SA with CLOUD_RUN_SA_NAME and build the email inline in the flags
blocks where expression context is available.
Added a comment explaining VITE_API_BASE_URL=/api — it is the nginx location
prefix, not a full URL, because the browser calls the frontend's own origin
and nginx proxies /api/* to the internal backend.
https://claude.ai/code/session_01SRRzCWrpwgMpdYFurMVn7m
* docs: add infrastructure documentation with architecture diagrams to README
- Add production architecture Mermaid diagram showing Cloud Run services,
VPC connector, Secret Manager, Cloud SQL, and external dependencies
- Add network security model table (frontend public / backend internal)
- Add secret management table listing all Secret Manager secrets
- Add IaC ownership table (Terraform vs CI pipeline)
- Add CI/CD pipeline Mermaid flowchart showing Workload Identity auth,
image build/push, and deploy steps with secret injection
- Add Terraform to technology stack table
Also remove overly broad github_actions_secret_accessor IAM binding from
terraform/iam.tf — the GitHub Actions SA never reads secret values directly;
Cloud Run reads them at startup using the Cloud Run SA identity.
https://claude.ai/code/session_01SRRzCWrpwgMpdYFurMVn7m
* fix: align Terraform DB config and reorganize docs (#33)
* fix: align database.tf backup config with actual Cloud SQL instance state
Backup was disabled on the real instance; syncing so terraform plan is clean
with no spurious diff on next apply.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: reorganize README into focused docs/ files
README trimmed to a lean landing page. Detailed content moved to:
- docs/ARCHITECTURE.md (BFF pattern, ReAct agent, security model)
- docs/INFRASTRUCTURE.md (Cloud topology, Terraform, Secret Manager, CI/CD)
- docs/AZURE_SETUP.md (Entra ID registration, Cosmos DB, frontend config)
- docs/DEVELOPMENT.md (local setup, testing, code style)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3ba242d commit b363f16
20 files changed
Lines changed: 923 additions & 464 deletions
File tree
- .github/workflows
- docs
- frontend
- scripts
- terraform
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | | - | |
| 44 | + | |
39 | 45 | | |
40 | | - | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
45 | 49 | | |
46 | | - | |
47 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | | - | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | | - | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 71 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 72 | | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | | - | |
| 92 | + | |
| 93 | + | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | | - | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
91 | 106 | | |
92 | | - | |
93 | 107 | | |
94 | 108 | | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
99 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
100 | 118 | | |
101 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | | - | |
| 126 | + | |
| 127 | + | |
105 | 128 | | |
106 | 129 | | |
107 | | - | |
108 | 130 | | |
| 131 | + | |
0 commit comments