# Simply Nostr → NCC: Operator's Runbook

**For:** Greeny & the Simply Nostr team
**Goal:** put a working copy of simplynostr.com on the NCC system (Nostr Navigator) as an experimental mirror/backup, and validate the technology end-to-end.
**Time:** ~1 hour for Phase 1 (the demo), ~half a day for Phase 2 (the real mirror on a VPS).
**Written against:** Nostr Navigator v0.48.x (desktop + Android) and NCC-Server v0.2.33, 30 Nov 2026. Both ship weekly — if a menu label moved, the commands still work.

> **The one-line version:** you don't need a domain or DNS. Your Nostr keypair *becomes* the address. `ncc://npub15jnwtaz…/web/` is simplynostr.com's new, DNS-free alias; the current site keeps running untouched.
>
> **Try it right now, before reading on:** install Nostr Navigator, then open `ncc://npub1khf5amw8mrupe649a5mhkk3d2d8wjj06urz6kwawpftk4f68tjlstdmd3q/` — that's the NCC project author's node running this exact stack. The padlock shows the signed locator, its TTL, and the TLS pin.

---

## 0. What the pieces are (60-second primer)

| Piece | What it is |
|---|---|
| **Nostr Navigator** | The browser that understands `ncc://` and `nsite://` addresses. Desktop (Win/mac/Linux) from GitHub releases; Android (`Nostr Navigator (alpha)`) via Zapstore. |
| **NCC-05 "locator"** | A signed, expiring Nostr event (`kind 30058`) that says "this keypair's service `web` is here." Holds one or more endpoints; the browser tries them in order. This is the "DNS record". |
| **NCC-02 "anchor"** | A second record (`kind 30059`) that ties the service to your identity with an expiry. Extra trust, optional but recommended. |
| **TLS pin (`k`)** | A hash of the server certificate, published in the locator. The browser trusts the cert **because the signed record says so**, not because a certificate authority did. No Let's Encrypt needed. |
| **ncc-sidecar / NCC-Server** | The publisher + web server bundle (Docker Compose, Debian/Ubuntu). Renews the locator automatically and serves the site. |
| **nsite** | Separate fallback for *static* files: content-addressed uploads to Blossom servers + a signed manifest (`nsite://npub…/`). No server, no renewal, no expiry. |

Nostr Navigator added a built-in identity/signer, an encrypted password manager, passkeys on Android, and Tor. So this is a browser you can actually do the demo in — the mirror will behave like a real site (cookies, video embeds, the follow link, all of it).

---

## 1. Hello, world (do this first — 10 minutes)

1. Install Nostr Navigator on your laptop: <https://github.com/imattau/ncc-browser/releases> → latest release → the installer for your OS. (Android build: search "Nostr Navigator" in Zapstore; it's labelled alpha.)
2. Open a few NCC addresses to calibrate what "working" looks like:
   - `ncc://npub1khf5amw8mrupe649a5mhkk3d2d8wjj06urz6kwawpftk4f68tjlstdmd3q/` — the NCC-Server author's node
   - Same address with `/search/` on the end — a search service running on it
3. Click the **padlock** in the address bar on each: you'll see *Locator record* (d tag, age, expiry, source), the anchor, and the certificate pin status. **This panel is the thing that will impress people** — it's DNS, but signed by a keypair.
4. In **Settings → General**, turn on **Require NCC-02 service records**. Reload. It still works — that's "strict anchoring," the mode a skeptic should judge it in.

If those load, your machine and network are ready.

---

## 2. Phase 1 — Demo day, zero new infrastructure (1 hour)

The cheapest possible proof: publish a locator whose endpoint is simply **the current site**. No new server, no DNS change. Either of you can do this; use a *pilot* key first, not a business-critical one.

> **Heads-up an operator should hear from a friend, not learn in production:** keys cannot be rotated, only replaced. In Nostr, the npub *is* the identity — publishing a new keypair means a new `ncc://` address. `service-new` in NCC-Server even refuses to reuse the operator `addr` service because rekeying it "would break the node root." So for anything beyond the demo, create the production key deliberately, back it up (password manager + offline copy with two custodians), and don't use a personal social key.

### 2.1 In Nostr Navigator
1. **Settings → Identity → New identity** → name it `Simply Nostr (pilot)` → save → **copy the nsec into your password manager**.
2. **Settings → Services → Add service**:
   - **Your app:** name `Simply Nostr`, service id **`web`**. The service id is permanent; lowercase, no spaces.
   - **Access:** **Public**.
   - **Check & publish** step → open **More options**:
     - **Endpoints:** `https://simplynostr.com` (this is the existing site; the mirror comes later)
     - **Locator lifetime:** 30 days (the max)
     - **Anchor:** leave on
3. **Publish**. The card shows how many relays accepted it and gives you `ncc://<npub>/web/`.
4. Test it on a second device (phone with Zapstore build) with the same address. Public locators resolve for everyone.
5. Record the result — date, relays accepted, machines tested, anything that rendered differently. That's your Phase-1 evidence.

### 2.2 What this proves
- The identity→service→endpoint chain works **with zero changes to your current hosting**.
- The locator is a signed record in Nostr, visible to anyone: you can inspect it independently with `nak` (below) or any Nostr client that renders `30058` events.
- Limits of the demo, stated honestly: the desktop app must stay open to auto-renew (it renews in the background at half its TTL), it's a laptop as a production publisher, and there is no uptime failover yet — that's Phase 2.

```bash
# independent inspection (install nak: https://github.com/fiatjaf/nak)
nak decode npub1...                       # npub → hex pubkey
nak req -k 30058 -a <hexpub> -d web wss://relay.primal.net
nak req -k 30059 -a <hexpub> -d web wss://relay.primal.net
# in the 30058 event: content has endpoints[] with url / priority / k
```

---

## 3. Phase 2 — The real mirror on a VPS (half a day)

This is the setup worth shipping: **the site served three ways from one identity**, each layer independent of the old hosting:

```
ordinary visitors ──▶ https://simplynostr.com           (unchanged)
ordinary visitors ──▶ https://backup.simplynostr.<…>    (optional 2nd domain, normal HTTPS)
Navigator users  ──▶ ncc://<npub>/web/  ──▶ pinned HTTPS on :8443
                                        └─▶ .onion address (works even if the IP is blocked)
no infrastructure ──▶ nsite://<npub>/                   (Phase 3: static snapshot, no server)
```

### 3.1 Buy the box
- Any VPS: **Debian 12 or Ubuntu**, **≥ 4 GiB RAM** (OpenSearch in the stack takes 1 GiB), a **public IPv4** (no CGNAT), and 20+ GB disk.
- Pick a different provider/region from the current site host — that's the whole point.
- Open/forward **TCP 8443** (pinned HTTPS web). Optionally 8080 (plain HTTP). Leave 3000/3010/8081/9050–9051/9200 closed — the stack binds them to loopback on purpose.
- If you later want the normal-HTTPS front door on a backup domain, also open 80/443 and point that domain's A record at this box.

### 3.2 Install NCC-Server
```bash
# on the VPS
curl -fsSL https://raw.githubusercontent.com/imattau/ncc-server/main/scripts/quick-install.sh | sudo bash
```
…or clone and read first (recommended, it's your box):
```bash
sudo apt-get update && sudo apt-get install -y git
sudo git clone https://github.com/imattau/ncc-server.git /opt/ncc-server
cd /opt/ncc-server && sudo make install-compose-host
```
First start asks: **generate a new keypair or import an existing identity file**. For production, this is where the *deliberate* Simply Nostr key is created (or imported as JSON `{nsec, npub, pubkey}`). It ends up saved at `/etc/ncc-server/operator-identity.json` (root-only). **Back that file up off the box, encrypted.** Then the installer publishes the node's own services (`addr`, `web`, `relay`, `search`, …), starts Caddy, and prints the npub.

### 3.3 Verify before touching content
```bash
cd /opt/ncc-server && sudo make bundle-health
```
- In Navigator: `ncc://<npub>/` → welcome page; `ncc://<npub>/web/` → placeholder page.
- **Padlock check:** the locator shows an `https://<ip>:8443` endpoint with a `k` pin (the sidecar made a self-signed cert and published its fingerprint). That's the moment NCC "clicks" for most people: **no CA, no warning, and it still can't be MITM'd.**

### 3.4 Deploy the Simply Nostr site
Use the included `sn-deploy.sh` from your workstation (mirrors the site, checks link hygiene, rsyncs to the server's `CONTENT_ROOT`):
```bash
./sn-deploy.sh greeny@203.0.113.10
```
Or by hand: build/copy the site so `index.html` is at the web root (`/srv/ncc-server/public` by default), with `episodes/index.html` etc. One-liner from a laptop:
```bash
rsync -az --delete ./site/ greeny@203.0.113.10:/srv/ncc-server/public/
```

**Link hygiene — why it matters here (we tested it):** the current simplynostr.com is a Next.js static export whose links are **root-relative** (`/_next/…`, `/episodes/…`). NCC serves a service at its *own sub-path* (`…/web/`), so `/anything` resolves to the mirror root — fine — but **absolute** self-links (`https://simplynostr.com/…`) would kick the visitor out of `ncc://` and back onto the clearnet. Our capture of the live site (27 HTML pages, 22 episodes, 3.6 MB) has **zero** absolute self-links and **zero** root-absolute links, so it degrades gracefully either way. Keep it that way; `sn-deploy.sh` warns if a future redesign reintroduces them.

**Known-good facts from our test capture (today):**
- 27 HTML pages (home + episodes index + 22 episode pages + a few redirect stubs), 39 files, ~3.6 MB.
- Assets are local (`_next/…`, logo). Episode videos are **hotlinked from `v.nostr.build` / `e.nostr.build`** — they keep working in Navigator (HTTPS, CORS-friendly), and they are *not* copied into the mirror, so updating episodes stays a website job, not a mirror job.
- No forms, no logins, no dynamic API calls → the mirror is a pure static copy. 

### 3.5 The free resilience upgrade: keep the Tor onion on
NCC-Server provisions a **Tor onion endpoint for every service automatically** and publishes it *alongside* the clearnet endpoint in the same locator. Navigator falls back between them. Nothing to configure, nothing to forward on the router. This is the part that handles "the IP is blocked / the host is having a bad day."

### 3.6 Optional but strongly recommended: a normal-HTTPS front door
Most of the audience won't have Navigator. Give the mirror a plain domain too:
1. Point e.g. `backup.simplynostr.com` (or any domain — **ideally in a different registrar/DNS zone** from the main site) at the VPS's IPv4.
2. Open TCP 80/443.
3. Admin panel → **Installed → Domain** → enter the domain. Caddy gets a real certificate and reverse-proxies to the service. The `ncc://` records don't change.

Now a 2am outage message can say: "site down? try **backup.simplynostr.com**, or open **ncc://npub…/web/** in Nostr Navigator."

### 3.7 Operating it (the boring part that makes it real)
```bash
cd /opt/ncc-server
sudo make bundle-health     # health
sudo make bundle-logs       # logs
sudo make bundle-down       # stop, KEEPS data
# NEVER: docker compose down -v   (deletes volumes)
```
- Back up, off-box, encrypted: `/etc/ncc-server/operator-identity.json`, `.env`, and `/var/lib/ncc-sidecar/` (sidecar DB + certs + nsite builds).
- **Renewal** is automatic on the sidecar's cadence (default: refresh every 6 h, TTL 12 h; tune in the admin panel). If the sidecar dies for longer than the TTL, the address stops resolving until it's back — one more reason the nsite layer exists.
- **After every upgrade**, glance at the padlock: the `k` pin must match the cert the server presents. A stale pin fails closed (correct behaviour, bad surprise).
- The admin panel (`/admin` on the `admin` service, or loopback via SSH tunnel) shows records, relay delivery, cadence, service health, and the **Nsites** page.

---

## 4. Phase 3 — The "nothing left to take down" layer: an nsite (30 min)

The mirror survives *server* failure. It does not survive *both* boxes dying at once. An **nsite** does: it's the static site, chunked, hashed (`sha256`), uploaded to **Blossom** media servers, with a signed **manifest** on Nostr relays. Readers verify every byte against the hashes.

- Static-only (fits Simply Nostr perfectly), public, **no TTL, no renewal, no server, no DNS**.
- Address: `nsite://<npub>/<site-id>/`.

**Publish from NCC-Server (easiest):** Admin → **Nsites** → choose the built folder (needs `index.html` at root) → site id (`sn`) → upload. Uses the operator identity, the node's relays, and the Blossom servers in `.env` (`NCC_NSITE_BLOSSOM_SERVERS`). You can also give it a **public domain** later (v0.2.33+) so even non-Navigator visitors can fall back to it.
**Or from the desktop browser:** **Settings → Sites → Choose folder** → publish.

Limits & hygiene:
- NCC-Server caps a publish at **500 files / 25 MiB per file / 100 MiB total** — our capture is 39 files / 3.6 MB, fine.
- Publish to **several** Blossom servers (NCC-Server does this by default), and **keep the source folder** — Blossom servers may garbage-collect; re-uploading is one command. The episode videos stay on nostr.build and are not part of the nsite (poster images are).
- Deletion is best-effort in this ecosystem: don't snapshot anything you'd regret hosting forever.

---

## 5. The resiliency map (what covers what)

| If this fails… | www (today) | `ncc://` mirror | `nsite://` |
|---|---|---|---|
| Web server / host crash | ❌ | ✅ different box | ✅ no server |
| DNS or registrar trouble | ❌ | ✅ no DNS in the path | ✅ no DNS |
| Hosting account suspended | ❌ | ✅ different provider | ✅ blobs on multiple Blossom servers |
| IP blocked / ports filtered | ❌ | ✅ automatic `.onion` endpoint | ✅ n/a |
| One relay down | ✅ n/a | ✅ locator on ≥3 relays | ✅ manifest on multiple relays |
| The NCC VPS dies | ✅ | ❌ until restored (identity + backups; ≤ 12 h TTL) | ✅ unaffected |
| The keypair is lost | ✅ | ❌ address can't renew; dies at TTL | ⚠️ frozen, un-updatable |
| Content complaint / legal demand | applies | applies | applies |

Publishing to **multiple relays** matters: the defaults (e.g. `relay.primal.net`, `relay.damus.io`, `relay.ditto.pub`) plus the node's own relay give you an n-of-m system. You can also publish a NIP-65 relay list (`kind 10002`) for the identity so browsers that use relay discovery find them.

---

## 6. Honest limitations (say these out loud on the show)

1. **Audience:** `ncc://` opens only in Nostr Navigator. Everyone else needs a normal URL — hence the optional front door domain. This is a fallback + experiment, not an SEO channel.
2. **It's alpha-grade tooling.** Browser has an Android alpha; server is v0.2.x with frequent releases. Pin versions on the VPS; read release notes before upgrading.
3. **Key custody replaces domain custody.** Whoever holds the nsec controls the address. Same care as your domain login, different shape (password-manager item + offline copy, 2 custodians).
4. **Videos remain on nostr.build.** The mirror inherits that dependency. (If nostr.build ever hiccups, the pages still load; the embedded player doesn't.)
5. **Self-hosting ≠ anonymity.** Your VPS IP is in the record; the onion helps against IP-level blocking, not against everything.
6. **Content responsibility doesn't move.** A mirror is still publishing — same standards, same compliance, same takedown exposure. NCC removes *DNS/registrar/host-panel* single points of failure, not jurisdiction.

---

## 7. Quick answers you'll get asked

- **"Do we need a domain?"** No. That's the point. `ncc://<npub>/web/` is the address. Domains become optional conveniences (the front door).
- **"Who runs the DNS?"** Nobody. Replaced by: Nostr relays + your signed locator.
- **"What if the relays censor us?"** Publish to several, including your own relay (NCC-Server bundles a Ditto relay). One accepting relay is enough for a reader.
- **"Is TLS still secure without a CA?"** Yes, differently: the certificate fingerprint is in the *signed* locator (`k`). Mismatch = fail closed. The record is the trust anchor, not a CA list.
- **"Can we move the mirror later?"** Yes — repoint the locator at the new endpoint; the address (`npub + service id`) never changes.
- **"Why not just run the mirror on a second normal host?"** Do that too (the front door). NCC's value-add is: no DNS anywhere in the resolution path, one identity as the root of trust, and automatic multi-endpoint fallback including Tor.
- **"Is this a Vinney/SEO play?"** No. It's uptime insurance with a side of protocol research.
- **"Cost?"** One small VPS (~$10–40/mo) + optional domain. nsite storage via public Blossom servers; consider donating to the ones you rely on.

---

## 8. Checklist

**Phase 1 (today)**
- [ ] Navigator installed (desktop + phone)
- [ ] Tested strict anchoring on the author's node
- [ ] Pilot key created, nsec in password manager
- [ ] Service `web` published → `ncc://<npub>/web/` opens simplynostr.com
- [ ] Notes recorded (relays accepted, devices, rendering diffs)

**Phase 2 (this week)**
- [ ] VPS provisioned (Debian 12/Ubuntu, 4 GiB, public IPv4, 8443 open)
- [ ] NCC-Server installed; **production npm/identity created & backed up twice**
- [ ] `make bundle-health` green; padlock shows pin + anchor
- [ ] Mirror deployed with `sn-deploy.sh`; spot-check 5 pages + episode index
- [ ] Onion endpoint confirmed in the locator
- [ ] Optional: backup-domain front door live (different DNS zone)
- [ ] Backups scheduled (identity, .env, sidecar data); runbook written for "site down"
- [ ] Monthly: padlock check after upgrades; locator age vs TTL

**Phase 3 (next quiet week)**
- [ ] Nsite `sn` published from NCC-Server; `nsite://<npub>/sn/` tested
- [ ] Source folder archived somewhere safe for re-uploads
- [ ] Maybe a post/livestream: "we put the show's site on NCC — here's what happened"

---

## Appendix A — Files in this pack

| File | What |
|---|---|
| `simply-nostr-ncc/OPERATOR-RUNBOOK.md` (this) | Everything above |
| `simply-nostr-ncc/sn-deploy.sh` | Mirror + link-check + rsync deploy script |
| `simply-nostr-ncc/mirror-site/` | A tested static capture of simplynostr.com today — 27 HTML pages, 39 files, 3.6 MB — ready to rsync |
| `ncc-website-hosting-guide.md` (workspace root) | The generic, more technical version (failure modes, private services, custom apps) |

## Appendix B — What we actually verified before writing this

- Captured the live site with `wget --mirror`: 27 HTML files, 39 files total, 3.6 MB; 22 episode pages; **no forms, no logins**; all assets local; videos hotlinked to `v./e.nostr.build`.
- Served that capture locally behind Caddy (the same server NCC-Server uses) both plain on `:8080` and self-signed HTTPS on `:8443`, hit `/episodes/kat/`, `/_next/…css` and the logo → all **200**; derived the SPKI pin the same way NCC-Server publishes `k` (e.g. `c66MXv0t4jjzKibYhdR-Ud8Aa-yaF5Cy8Rqy9V3kbk4` for that throwaway cert — yours will differ).
- Re-ran the mirror script end-to-end to confirm the deploy script's checks pass on the current site.

---

*Questions while setting it up: the NCC ecosystem lives on Nostr — start with the author (`npub1khf5amw8mrupe649a5mhkk3d2d8wjj06urz6kwawpftk4f68tjlstdmd3q`) on the relays.*
