refactor(infra): repurpose asepharyana-hub into infra-only reverse-proxy repo
- Remove app submodules (hub/scraper/tools/llm-api/plugins) — apps are now standalone repos with their own flake.nix + deploy.yml CI - Delete monorepo CI: nix-build.yml matrix, update-submodule.yml, lint, security, flakehub-publish — replaced by infra-only caddy-deploy.yml - Sync Caddyfile.prod with live /etc/caddy/Caddyfile (add wiki. + mcp. blocks) - Prune legacy Docker/Traefik/Dapr/NATS/otel + scripts/root tooling - Docs: rename ADR 0001 superseded, add ADR 0003 (repo rename + split CI), update add-new-app, infra README, troubleshooting
This commit is contained in:
1 parent
97b635e8c6
commit
0194a865b7
86 files changed
+293
-9655
No files matched your search
@@ -1,49 +1,38 @@
|
||||
# ADR 0001: Use a Hub Repository with App Submodules
|
||||
# ADR 0001: Infra Repo — Reverse Proxy Config Only (Submodules Removed)
|
||||
|
||||
## Status
|
||||
|
||||
Accepted
|
||||
**Superseded** (2026-08-28) — lihat ADR ini sebagai arsip keputusan awal.
|
||||
|
||||
## Context
|
||||
## Context (aslinya)
|
||||
|
||||
The project contains multiple independent application services that share one deployment surface: Docker Compose, Traefik routing, GitHub Actions workflows, and operational documentation.
|
||||
Proyek awal memakai `asepharyana-hub` sebagai monorepo: aplikasi di `apps/<service>` sebagai
|
||||
git submodule, infra (compose/traefik/dokumen/CI) terpusat di root. Keputusan itu masuk akal
|
||||
saat semua service berbagi satu deployment surface.
|
||||
|
||||
The services should be developed and versioned independently, while deployment infrastructure should remain centralized so production routing and compose manifests stay consistent.
|
||||
## Decision (aslinya)
|
||||
|
||||
## Decision
|
||||
Gunakan `asepharyana-hub` sebagai root hub: app code submodule, infra + CI di root.
|
||||
|
||||
Use `asepharyana-hub` as the root hub repository.
|
||||
## Superseded By
|
||||
|
||||
- Application code lives under `apps/<service>` as Git submodules.
|
||||
- Infrastructure lives in the root repo under `infra/`.
|
||||
- Documentation lives in the root repo under `docs/`.
|
||||
- CI/CD workflows live in the root repo under `.github/workflows/`.
|
||||
- Root tooling stays minimal: `package.json`, Prettier, ESLint, Makefile helpers, and deployment scripts.
|
||||
Mulai **2026-08-28** repo dirombak:
|
||||
|
||||
Current app submodules:
|
||||
|
||||
| Service | Path | Remote |
|
||||
| ----------- | -------------- | --------------------------------------- |
|
||||
| Scraper API | `apps/scraper` | `asepharyana/asepharyana-hub-scraper` |
|
||||
- **Parent `asepharyana-hub` → `asepharyana/infra`** — murni config reverse proxy (Caddy),
|
||||
firewall, systemd drop-ins, docs. CI hanya untuk deploy Caddy.
|
||||
- **App repos di-rename & self-contained**: `hub`, `scraper`, `tools`, `llm-api`.
|
||||
Masing-masing punya `flake.nix` + `.github/workflows/deploy.yml` sendiri
|
||||
(`nix build → nix copy → nix-env --profile → systemctl restart`).
|
||||
- **Submodule dihapus** — tidak ada lagi pointer submodule / repository_dispatch chain.
|
||||
- `update-submodule.yml`, `notify-parent.yml`, matrix `nix-build.yml` dihapus.
|
||||
|
||||
## Consequences
|
||||
|
||||
### Positive
|
||||
|
||||
- Each app can evolve in its own repository.
|
||||
- The hub pins exact submodule revisions for reproducible deployments.
|
||||
- Deployment infrastructure remains centralized and easier to audit.
|
||||
- Root tooling stays lightweight and does not impose one build system on every service.
|
||||
- CI tiap app independen: push ke repo app langsung build+deploy, tak perlu 2 hop.
|
||||
- Parent kecil & fokus: diff Caddyfile mudah di-audit.
|
||||
- Tanpa submodule = tanpa `dubious ownership` / pointer drift / fetchGit pin.
|
||||
|
||||
### Negative
|
||||
|
||||
- Developers must understand Git submodule workflows.
|
||||
- Updating a service requires updating the submodule pointer in the hub repo.
|
||||
- Cross-service changes require coordinating commits across multiple repositories.
|
||||
|
||||
### Mitigations
|
||||
|
||||
- Keep `.gitmodules` accurate and minimal.
|
||||
- Use `scripts/sync-submodules.sh` for local checkout consistency.
|
||||
- Document service-addition steps in `docs/add-new-app.md`.
|
||||
- Keep GitHub Actions responsible for Docker image builds, compose tag updates, and deployments.
|
||||
- Koordinasi cross-repo manual (app + Caddy bila perlu port baru).
|
||||
- Repo lama `asepharyana-hub-*` redirect ke nama baru (GitHub auto).
|
||||
Reference in new issue
Block a user