106 lines
3.3 KiB
Markdown
106 lines
3.3 KiB
Markdown
# Cloudflare-Aufgaben (manuell, browser-basiert)
|
|
|
|
Stand 2026-05-14.
|
|
|
|
Diese zwei Tasks brauchen Zugang zum **Cloudflare-Dashboard**
|
|
(`https://dash.cloudflare.com`) oder einen Cloudflare-API-Token mit
|
|
`Zone:DNS:Edit` für die Zone `zitare.com`. Beides ist in der Memory
|
|
heute nicht hinterlegt — daher muss das ein Mensch erledigen.
|
|
|
|
## Task 1 — DNS-CNAME für `zitare.com` setzen (production-blocker)
|
|
|
|
**Symptom:** `dig +short zitare.com @1.1.1.1` → leer. Die Domain ist
|
|
in Cloudflare als Zone registriert, aber kein DNS-Record zeigt auf
|
|
den cloudflared-Tunnel. Deshalb läuft heute alles über
|
|
`zitare.mana.how` (Workaround in `Sources/Core/Auth/AppConfig.swift`,
|
|
`webBaseURL = appBaseURL`).
|
|
|
|
**Variante A — Dashboard (empfohlen):**
|
|
|
|
1. https://dash.cloudflare.com → Zone `zitare.com` → DNS
|
|
2. „Add record":
|
|
- Type: **CNAME**
|
|
- Name: **@** (apex) bzw. **zitare.com**
|
|
- Target: **`1435166a-0e3f-4222-8de6-744f32cea5c9.cfargotunnel.com`**
|
|
- Proxy status: **Proxied (orange)**
|
|
- TTL: Auto
|
|
3. Save → Propagation < 60s
|
|
|
|
**Variante B — `cloudflared tunnel login` auf dem Mac Mini:**
|
|
|
|
Würde einen neuen `cert.pem` erzeugen, der auch für die Zone
|
|
`zitare.com` autorisiert ist. Browser-Flow auf dem Mac Mini:
|
|
|
|
```bash
|
|
ssh mana-server
|
|
/opt/homebrew/bin/cloudflared tunnel login
|
|
# → Browser öffnet sich, Zone zitare.com auswählen
|
|
/opt/homebrew/bin/cloudflared tunnel route dns \
|
|
1435166a-0e3f-4222-8de6-744f32cea5c9 zitare.com
|
|
```
|
|
|
|
**Verifikation nach Setup:**
|
|
|
|
```bash
|
|
dig +short zitare.com @1.1.1.1
|
|
# → Cloudflare-IPs (188.114.96.x / 97.x)
|
|
|
|
curl -sI https://zitare.com/ | head -3
|
|
# → HTTP/2 200, cloudflared liefert zitare-com:3085 aus
|
|
|
|
curl -sI https://zitare.com/.well-known/apple-app-site-association | grep -i content-type
|
|
# → content-type: application/json
|
|
```
|
|
|
|
**Danach im Native-Code:**
|
|
|
|
`Sources/Core/Auth/AppConfig.swift` umstellen:
|
|
|
|
```swift
|
|
- static let webBaseURL = appBaseURL
|
|
+ static let webBaseURL = publicWebURL
|
|
```
|
|
|
|
Optional: `applinks:zitare.mana.how` aus `project.yml` entfernen, wenn
|
|
die Staging-Domain nicht mehr gebraucht wird. Schadet aber nicht, sie
|
|
drin zu lassen.
|
|
|
|
## Task 2 — Versehentlichen CNAME `zitare.com.mana.how` entfernen
|
|
|
|
**Symptom:** `dig +short zitare.com.mana.how @1.1.1.1` →
|
|
`188.114.96.12 / 97.12`. Wurde versehentlich am 2026-05-14 angelegt,
|
|
als der Versuch `cloudflared tunnel route dns ... zitare.com` mit dem
|
|
auf `mana.how` beschränkten Cert lief — cloudflared hat den Hostname
|
|
als Subdomain unter `mana.how` interpretiert und einen CNAME angelegt.
|
|
|
|
Harmlos (cloudflared-config.yml hat keine Route für
|
|
`zitare.com.mana.how`, also würde der Tunnel mit 404 antworten), aber
|
|
unsauber.
|
|
|
|
**Cleanup:**
|
|
|
|
1. https://dash.cloudflare.com → Zone `mana.how` → DNS
|
|
2. Filter auf „zitare.com.mana.how" — sollte ein CNAME-Record sein,
|
|
Target `…cfargotunnel.com`
|
|
3. Edit → Delete
|
|
|
|
## Verifikation E2E nach beiden Tasks
|
|
|
|
```bash
|
|
# 1. zitare.com auflösbar
|
|
dig +short zitare.com @1.1.1.1
|
|
|
|
# 2. AASA + index-min.json über zitare.com
|
|
curl -sI https://zitare.com/.well-known/apple-app-site-association
|
|
curl -sI https://zitare.com/index-min.json
|
|
|
|
# 3. Versehentlicher CNAME weg
|
|
dig +short zitare.com.mana.how @1.1.1.1 # → leer
|
|
```
|
|
|
|
Dann im Simulator:
|
|
|
|
```bash
|
|
xcrun simctl openurl booted https://zitare.com/q/spitteler-schweizer-bleiben
|
|
# → App öffnet auf der Quote-Page (statt Safari)
|
|
```
|