feat(hosting): add HostWizard platform module and fix migration chain
Some checks failed
Some checks failed
- Add complete hosting module (models, routes, schemas, services, templates, migrations) - Add HostWizard platform to init_production seed (code=hosting, domain=hostwizard.lu) - Fix cms_002 migration down_revision to z_unique_subdomain_domain - Fix prospecting_001 migration to chain after cms_002 (remove branch label) - Add hosting/prospecting version_locations to alembic.ini - Fix admin_services delete endpoint to use proper response model - Add hostwizard.lu to deployment docs (DNS, Caddy, Cloudflare) - Add hosting and prospecting user journey docs to mkdocs nav Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -611,7 +611,16 @@ It should match the value in the Hetzner Cloud Console (Networking tab). Then cr
|
||||
| AAAA | `git` | `2a01:4f8:1c1a:b39c::1` | 300 |
|
||||
| AAAA | `flower` | `2a01:4f8:1c1a:b39c::1` | 300 |
|
||||
|
||||
Repeat for `omsflow.lu` and `rewardflow.lu`.
|
||||
Repeat for `omsflow.lu`, `rewardflow.lu`, and `hostwizard.lu`.
|
||||
|
||||
**hostwizard.lu DNS Records:**
|
||||
|
||||
| Type | Name | Value | TTL |
|
||||
|---|---|---|---|
|
||||
| A | `@` | `91.99.65.229` | 300 |
|
||||
| A | `www` | `91.99.65.229` | 300 |
|
||||
| AAAA | `@` | `2a01:4f8:1c1a:b39c::1` | 300 |
|
||||
| AAAA | `www` | `2a01:4f8:1c1a:b39c::1` | 300 |
|
||||
|
||||
!!! tip "DNS propagation"
|
||||
Set TTL to 300 (5 minutes) initially. DNS changes can take up to 24 hours to propagate globally, but usually complete within 30 minutes. Verify with: `dig api.wizard.lu +short`
|
||||
@@ -661,6 +670,15 @@ www.rewardflow.lu {
|
||||
redir https://rewardflow.lu{uri} permanent
|
||||
}
|
||||
|
||||
# ─── Platform 4: HostWizard (hostwizard.lu) ──────────────────
|
||||
hostwizard.lu {
|
||||
reverse_proxy localhost:8001
|
||||
}
|
||||
|
||||
www.hostwizard.lu {
|
||||
redir https://hostwizard.lu{uri} permanent
|
||||
}
|
||||
|
||||
# ─── Services ───────────────────────────────────────────────
|
||||
api.wizard.lu {
|
||||
reverse_proxy localhost:8001
|
||||
@@ -676,7 +694,7 @@ flower.wizard.lu {
|
||||
```
|
||||
|
||||
!!! info "How multi-platform routing works"
|
||||
All platform domains (`wizard.lu`, `omsflow.lu`, `rewardflow.lu`) point to the **same FastAPI backend** on port 8001. The `PlatformContextMiddleware` reads the `Host` header to detect which platform the request is for. Caddy preserves the Host header by default, so no extra configuration is needed.
|
||||
All platform domains (`wizard.lu`, `omsflow.lu`, `rewardflow.lu`, `hostwizard.lu`) point to the **same FastAPI backend** on port 8001. The `PlatformContextMiddleware` reads the `Host` header to detect which platform the request is for. Caddy preserves the Host header by default, so no extra configuration is needed.
|
||||
|
||||
The `domain` column in the `platforms` database table must match:
|
||||
|
||||
@@ -685,6 +703,7 @@ flower.wizard.lu {
|
||||
| Main | `main` | `wizard.lu` |
|
||||
| OMS | `oms` | `omsflow.lu` |
|
||||
| Loyalty+ | `loyalty` | `rewardflow.lu` |
|
||||
| HostWizard | `hosting` | `hostwizard.lu` |
|
||||
|
||||
Start Caddy:
|
||||
|
||||
@@ -1909,6 +1928,7 @@ Cloudflare Origin Certificates (free, 15-year validity) avoid ACME challenge iss
|
||||
- `wizard.lu`: `wizard.lu, api.wizard.lu, www.wizard.lu, flower.wizard.lu, grafana.wizard.lu`
|
||||
- `omsflow.lu`: `omsflow.lu, www.omsflow.lu`
|
||||
- `rewardflow.lu`: `rewardflow.lu, www.rewardflow.lu`
|
||||
- `hostwizard.lu`: `hostwizard.lu, www.hostwizard.lu`
|
||||
3. Download the certificate and private key (private key is shown only once)
|
||||
|
||||
!!! warning "Do NOT use wildcard origin certs for wizard.lu"
|
||||
@@ -1917,12 +1937,12 @@ Cloudflare Origin Certificates (free, 15-year validity) avoid ACME challenge iss
|
||||
Install on the server:
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/caddy/certs/{wizard.lu,omsflow.lu,rewardflow.lu}
|
||||
sudo mkdir -p /etc/caddy/certs/{wizard.lu,omsflow.lu,rewardflow.lu,hostwizard.lu}
|
||||
|
||||
# For each domain, create cert.pem and key.pem:
|
||||
sudo nano /etc/caddy/certs/wizard.lu/cert.pem # paste certificate
|
||||
sudo nano /etc/caddy/certs/wizard.lu/key.pem # paste private key
|
||||
# Repeat for omsflow.lu and rewardflow.lu
|
||||
# Repeat for omsflow.lu, rewardflow.lu, and hostwizard.lu
|
||||
|
||||
sudo chown -R caddy:caddy /etc/caddy/certs/
|
||||
sudo chmod 600 /etc/caddy/certs/*/key.pem
|
||||
@@ -1976,6 +1996,17 @@ www.rewardflow.lu {
|
||||
redir https://rewardflow.lu{uri} permanent
|
||||
}
|
||||
|
||||
# ─── Platform 4: HostWizard (hostwizard.lu) ──────────────────
|
||||
hostwizard.lu {
|
||||
tls /etc/caddy/certs/hostwizard.lu/cert.pem /etc/caddy/certs/hostwizard.lu/key.pem
|
||||
reverse_proxy localhost:8001
|
||||
}
|
||||
|
||||
www.hostwizard.lu {
|
||||
tls /etc/caddy/certs/hostwizard.lu/cert.pem /etc/caddy/certs/hostwizard.lu/key.pem
|
||||
redir https://hostwizard.lu{uri} permanent
|
||||
}
|
||||
|
||||
# ─── Services (wizard.lu origin cert) ───────────────────────
|
||||
api.wizard.lu {
|
||||
tls /etc/caddy/certs/wizard.lu/cert.pem /etc/caddy/certs/wizard.lu/key.pem
|
||||
@@ -2010,7 +2041,7 @@ sudo systemctl status caddy
|
||||
|
||||
### 21.6 Cloudflare Settings (per domain)
|
||||
|
||||
Configure these in the Cloudflare dashboard for each domain (`wizard.lu`, `omsflow.lu`, `rewardflow.lu`):
|
||||
Configure these in the Cloudflare dashboard for each domain (`wizard.lu`, `omsflow.lu`, `rewardflow.lu`, `hostwizard.lu`):
|
||||
|
||||
| Setting | Location | Value |
|
||||
|---|---|---|
|
||||
|
||||
Reference in New Issue
Block a user