diff options
Diffstat (limited to 'devel-phases.md')
| -rw-r--r-- | devel-phases.md | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/devel-phases.md b/devel-phases.md index 1d5424b..5ca76fc 100644 --- a/devel-phases.md +++ b/devel-phases.md @@ -94,7 +94,7 @@ Multiple groups, chat, QUIC, module sandbox, mobile pairing, HLS streaming. --- -## Phase 3 — Hub v1 production 🚧 IN PROGRESS +## Phase 3 — Hub v1 production ✅ DONE **Goal:** replace POC in-memory hub with a production-ready service on meshbay.org. PostgreSQL persistence, HTTPS via Caddy, all endpoints hardened, legal IP logging, deploy. @@ -120,23 +120,53 @@ slowapi>=0.1 # rate limiting (FastAPI middleware) | # | Component | File(s) | Status | |---|---|---|---| -| 3.1 | DB models | `meshbay_hub/db/models.py` | 🚧 | -| 3.2 | DB engine + session | `meshbay_hub/db/engine.py` | 🚧 | -| 3.3 | Alembic migrations | `meshbay_hub/db/migrations/` | 🚧 | -| 3.4 | Hub config | `meshbay_hub/config.py` | 🚧 | -| 3.5 | Auth (JWT + Argon2id) | `meshbay_hub/auth.py` | 🚧 | -| 3.6 | API deps | `meshbay_hub/api/deps.py` | 🚧 | -| 3.7 | Hub info router | `meshbay_hub/api/hub.py` | 🚧 | -| 3.8 | Users router | `meshbay_hub/api/users.py` | 🚧 | -| 3.9 | Nodes router | `meshbay_hub/api/nodes.py` | 🚧 | -| 3.10 | Groups router | `meshbay_hub/api/groups.py` | 🚧 | -| 3.11 | IP logging middleware | `meshbay_hub/api/middleware.py` | 🚧 | -| 3.12 | App factory | `meshbay_hub/app.py` | 🚧 | -| 3.13 | Hub daemon CLI | `meshbay_hub/daemon.py` | 🚧 | -| 3.14 | Install PostgreSQL | meshbay.org | 🚧 | -| 3.15 | Caddy + TLS | meshbay.org Caddyfile | 🚧 | -| 3.16 | Systemd service | `meshbay-hub.service` | 🚧 | -| 3.17 | Deploy + smoke test | meshbay.org | 🚧 | +| 3.1 | DB models | `meshbay_hub/db/models.py` | ✅ | +| 3.2 | DB engine + session | `meshbay_hub/db/engine.py` | ✅ | +| 3.3 | Alembic migrations | `meshbay_hub/db/migrations/` | ✅ initial_schema | +| 3.4 | Hub config | `meshbay_hub/config.py` | ✅ | +| 3.5 | Auth (JWT + Argon2id) | `meshbay_hub/auth.py` | ✅ | +| 3.6 | API deps | `meshbay_hub/api/deps.py` | ✅ | +| 3.7 | Hub info router | `meshbay_hub/api/hub.py` | ✅ | +| 3.8 | Users router | `meshbay_hub/api/users.py` | ✅ | +| 3.9 | Nodes router | `meshbay_hub/api/nodes.py` | ✅ | +| 3.10 | Groups router | `meshbay_hub/api/groups.py` | ✅ | +| 3.11 | Rate limiting | `meshbay_hub/api/middleware.py` | ✅ slowapi | +| 3.12 | App factory + lifespan | `meshbay_hub/app.py` | ✅ | +| 3.13 | Hub daemon CLI | `meshbay_hub/daemon.py` | ✅ | +| 3.14 | PostgreSQL 16 | meshbay.org | ✅ DB: meshbay_hub | +| 3.15 | Caddy + Let's Encrypt | meshbay.org Caddyfile | ✅ HTTPS auto-cert | +| 3.16 | Systemd service | `/etc/systemd/system/meshbay-hub.service` | ✅ | +| 3.17 | Deploy + smoke test | https://meshbay.org | ✅ 11/11 endpoints | + +**Total: 40 local tests (SQLite) + 11/11 smoke tests HTTPS production** + +### Phase 3 deployment details (meshbay.org) + +- PostgreSQL 16, user `meshbay`, DB `meshbay_hub` +- Caddy auto-handles Let's Encrypt for `meshbay.org` +- Hub listens on `127.0.0.1:8000`, Caddy proxies 80/443 +- Systemd service: `meshbay-hub.service` (restart-on-failure) +- Hub config: `~/.config/meshbay/hub.toml` +- Hub keypair: `~/.config/meshbay/hub_private.pem` (chmod 600) +- Source deployed at: `~/meshbay-hub/` (common_pkg + hub_pkg) + +### Additional Python dependencies added in Phase 3 + +``` +sqlalchemy==2.0.51 # async ORM +alembic==1.19.1 # DB migrations +asyncpg==0.31.0 # PostgreSQL async driver +aiosqlite # SQLite async (tests only) +slowapi==0.1.10 # rate limiting +hatchling==1.31.0 # build backend (needed for pip install) +``` + +### Notes + +- Initial DB schema created via `init_db()` (`create_all`) — Alembic tracks future changes +- IP logging records: account_create, login, login_fail, group_create, node_announce +- Rate limiting active on /v1/users/register and /v1/users/login (slowapi) +- Revocation, CSAM hash matching, moderation deferred to Phase 5 ### Phase 3 scope |