piha.lc / beta.piha.li + company_site marketing landing (#4)
Deploy Beta / unit-tests (push) Successful in 4s
Deploy Beta / docker (push) Successful in 10s
Deploy Beta / deploy-beta (push) Successful in 1m3s

## Summary

- Public short domain is **`piha.lc`** (prod) and **`beta.piha.li`** (beta)
- `/` is a marketing page in [aimloperations.com](https://aimloperations.com) / `company_site` styling (Inter, dark, cyan)
- CTA: want access → [contact](https://aimloperations.com/contact)
- Nav/logo/footer match the company site; debug mint form uses the same chrome

Closes #3.

## Secrets (control node)

Update hostnames only — no new token/pepper unless you are rotating:

**`url_shortening_service_prod.env`**
```text
DJANGO_ALLOWED_HOSTS=piha.lc,shortener.aimloperations.com,url-shortener,web
SHORT_DOMAIN=piha.lc
PUBLIC_SHORT_URL=https://piha.lc
SHORT_PUBLIC_HOSTS=piha.lc
CONTACT_URL=https://aimloperations.com/contact
```

**`url_shortening_service_beta.env`**
```text
DJANGO_ALLOWED_HOSTS=beta.piha.li,shortener-beta.aimloperations.com,url-shortener,web
SHORT_DOMAIN=beta.piha.li
PUBLIC_SHORT_URL=https://beta.piha.li
SHORT_PUBLIC_HOSTS=beta.piha.li
CONTACT_URL=https://aimloperations.com/contact
```

NPM: `piha.lc` / `beta.piha.li` → this container. Still do not proxy `/api/` on the short host.

## Test plan
- [ ] `cd site && uv run python manage.py test`
- [ ] `GET /` looks like aimloperations.com; Request access / Contact go to aimloperations.com/contact
- [ ] `GET /<code>` still 302
- [ ] `/api/` on Host `piha.lc` is 404

Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
2026-08-30 06:55:43 -07:00
parent 630b770c12
commit ccb4d0097d
18 changed files with 1373 additions and 214 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
Django 6 service in Docker, packaged with `uv`. First caller is `monica_site` (SMS campaign
bodies and ad-hoc texts). A short public domain will be pointed at this service later;
until then a subdomain (for example `go.mkdrealtor.com`) is enough.
until then a subdomain is enough. Public short hosts: `piha.lc` (prod), `beta.piha.li` (beta).
This document is the build spec. Implement in this repo. Do not fold the shortener into
`monica_site`.
@@ -69,7 +69,7 @@ cannot mint links without a configured Bearer token. Empty `SHORTENER_API_TOKENS
```
Internet
├─ NPM: SHORT_DOMAIN (mkd.to / go.mkdrealtor.com)
├─ NPM: SHORT_DOMAIN (piha.lc / beta.piha.li)
│ location ~*^/[a-z0-9]{4,8}$ → gunicorn (redirects only)
│ /api/* → 404 / drop
│ /admin/ → 404 / drop
@@ -130,7 +130,7 @@ Caller (`monica_site`) is an HTTP client. It does not share this database.
Until the purchased short domain exists:
- Set `SHORT_DOMAIN=go.mkdrealtor.com` (or `localhost:8005` locally).
- Set `SHORT_DOMAIN=piha.lc` (or `localhost:8005` locally).
- Codes do not change when DNS is swapped. Only `SHORT_DOMAIN` / `PUBLIC_SHORT_URL` change.
---
@@ -274,7 +274,7 @@ Response `201`:
```json
{
"code": "a3k9xm",
"short_url": "https://go.mkdrealtor.com/a3k9xm",
"short_url": "https://piha.lc/a3k9xm",
"target_url": "https://mkdrealtor.com/listings/oak-st?utm_source=monica&utm_medium=sms",
"title": "Oak St listing",
"is_active": true,
@@ -355,8 +355,8 @@ Reject codes that do not match `^[a-z0-9]{4,8}$` with 404 (no extra work).
| `DJANGO_DEBUG` | false in prod |
| `DJANGO_ALLOWED_HOSTS` | public short host **and** API hostname |
| `DATABASE_URL` | Postgres; empty → SQLite |
| `SHORT_DOMAIN` | public hostname phones use (`go.mkdrealtor.com` then `mkd.to`) |
| `PUBLIC_SHORT_URL` | origin for minted URLs, e.g. `https://go.mkdrealtor.com` (no trailing slash) |
| `SHORT_DOMAIN` | public hostname phones use (`piha.lc` prod, `beta.piha.li` beta) |
| `PUBLIC_SHORT_URL` | origin for minted URLs, e.g. `https://piha.lc` (no trailing slash) |
| `SHORT_PUBLIC_HOSTS` | comma list; Host values that only serve redirects |
| `SHORT_API_HOSTS` | comma list; Host values that serve `/api/` (public API DNS and/or docker name) |
| `SHORT_ADMIN_HOSTS` | comma list; Host values that serve `/admin/` (default localhost only) |