diff --git a/MyMistakes.md b/MyMistakes.md index 4552994..04f96be 100644 --- a/MyMistakes.md +++ b/MyMistakes.md @@ -68,6 +68,49 @@ Password comes in on **stdin** (`SITE_SUDO_PW=... ./deploy.sh`), never on a comm - ⚠️ Ports **22 and 1319 are closed**; 2214 is the only SSH door, and it is the *host*, not Gitea (Gitea pushes go over **HTTPS** with the credential helper — see `docs/ai/environment.md`). +### POINTING www AT THE APEX ON THE YUNOHOST DROPLET (RECIPE, 2026-10-31) + +**Problem:** `www.llamacasty.com` did not resolve at all, and once a record existed the server half +was four separate traps: YunoHost added the vhost with a **self-signed** cert, refused to issue +Let's Encrypt without a diagnosis, and served the **SSO login** because the domain has no app. + +**1. DNS** — Namecheap BasicDNS, zone `llamacasty.com`. `www CNAME llamacasty.com.` (YunoHost's own +subdomain example uses a CNAME per subdomain, and a CNAME follows the apex if the droplet IP moves; +an `A www` record would need a second edit for every rebuild). The apex `A` is the only IP holder. + +**2. Domain + cert on the droplet:** + +```bash +yunohost domain add www.llamacasty.com --install-letsencrypt-cert # vhost + SELF-SIGNED cert +yunohost domain cert install www.llamacasty.com --no-checks # real LE cert +``` + +- ⚠️ The `--install-letsencrypt-cert` flag **does nothing here**: *"Skipping Let's Encrypt certificate + attempt because there's no wildcard configured on the parent domain's DNS records."* It exits + SUCCESS with a self-signed cert, so check `openssl s_client -servername ` afterwards. +- ⚠️ Plain `yunohost domain cert install` refuses with *"no diagnosis result for domain … use + `--no-checks`"*. `--no-checks` is safe when the name resolves publicly — LE's HTTP-01 validation + is itself the DNS proof (it failed over to a real cert on the first attempt). + +**3. The redirect** — with no app installed the vhost 302s to `/yunohost/sso?r=…`, so a `301` is +needed. YunoHost includes `/etc/nginx/conf.d/.d/*.conf` **inside the server{} block**; +`location / { return 301 https://llamacasty.com$request_uri; }` there wins over SSO because `return` +runs in the rewrite phase, before `access_by_lua_file` (the global SSO guard). The `.d` include +survives YunoHost regenerating the `.conf`; never edit the `.conf` itself. + +- ⚠️ **The heredoc ate `$request_uri`.** Writing that file through `ssh "sudo bash -c 'cat > … <`. + +**Verify:** `curl --resolve www.llamacasty.com:443:143.244.176.131 -o /dev/null -w '%{http_code} +%{redirect_url}' https://www.llamacasty.com/privacy.html` → `301 https://llamacasty.com/privacy.html`; +the cert must read `CN=www.llamacasty.com`, issuer Let's Encrypt. + ### CONVERTING A MEDIAPIPE .tflite (WITH CUSTOM OPS) TO ONNX — AND PROVING IT (RECIPE, TASK 51) **Problem:** MediaPipe segmentation models end in the custom op `Convolution2DTransposeBias`;