diff --git a/.gitignore b/.gitignore
index 48e9af8..0dca800 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/target
/frx-data/
/comments.txt
+/relay.log
diff --git a/DEPLOY.md b/DEPLOY.md
index b2e239c..931c164 100644
--- a/DEPLOY.md
+++ b/DEPLOY.md
@@ -47,7 +47,7 @@ Run `frxd` on loopback and terminate TLS with Caddy:
caddy reverse-proxy --from relay.federatedsearch.org --to 127.0.0.1:7700
```
-Caddyfile equivalent (apex is the public front door, `ma.` the membership service, `relay.` the relay — all on one host):
+Caddyfile equivalent (apex is the public front door, `ma.` the membership service, `relay.` the relay, `git.` the code host — all on one host):
```
federatedsearch.org {
@@ -61,6 +61,10 @@ ma.federatedsearch.org {
relay.federatedsearch.org {
reverse_proxy 127.0.0.1:7700
}
+
+git.federatedsearch.org {
+ reverse_proxy 127.0.0.1:3000
+}
```
Relay command (peers and registry gated by the MA):
@@ -112,6 +116,77 @@ frxd registry --dir /var/lib/frxd/registry serve --listen 127.0.0.1:7800
Put the same Caddy in front, or distribute `registry.json` out of band (it is signed, so the channel does not matter). The snapshot is versioned; nodes reject rollback and fail static during outages.
+## Code hosting and downloads (Gitea)
+
+The public source and release binaries live at `git.federatedsearch.org` (Gitea), so the
+download step on the membership page stays on infrastructure the federation operates.
+
+One-time install on the server (root):
+
+```
+VER=1.27.3
+curl -fsSLO https://dl.gitea.com/gitea/$VER/gitea-$VER-linux-amd64{,.sha256}
+sha256sum -c gitea-$VER-linux-amd64.sha256
+install -m 0755 gitea-$VER-linux-amd64 /usr/local/bin/gitea
+adduser --system --shell /bin/bash --gecos 'Gitea' --home /home/git --group git
+mkdir -p /var/lib/gitea/{custom,data,log} /etc/gitea && chown -R git:git /var/lib/gitea /etc/gitea
+```
+
+`/etc/gitea/app.ini` essentials (rest defaults; secrets via `gitea generate secret`):
+
+```ini
+WORK_PATH = /var/lib/gitea
+
+[database]
+DB_TYPE = sqlite3
+PATH = /var/lib/gitea/data/gitea.db
+
+[server]
+DOMAIN = git.federatedsearch.org
+SSH_DOMAIN = git.federatedsearch.org
+ROOT_URL = https://git.federatedsearch.org/
+HTTP_ADDR = 127.0.0.1
+HTTP_PORT = 3000
+
+[security]
+INSTALL_LOCK = true
+
+[service]
+DISABLE_REGISTRATION = true
+REQUIRE_SIGNIN_VIEW = false
+```
+
+systemd unit (`User=git`, `ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini`,
+`WorkingDirectory=/var/lib/gitea`), then `gitea migrate --config /etc/gitea/app.ini` as the
+`git` user and `systemctl enable --now gitea`. Git-over-SSH uses the host sshd via the `git`
+user's Gitea-managed `authorized_keys`; HTTPS pushes can use an access token instead.
+
+Admin bootstrap (as `git` user):
+
+```
+gitea admin user create --admin --username
Everything else — matching, ranking, retention, trust — is local.
-Your identifier is <label>.frx.federatedsearch.org — no domain or DNS of
+your own is needed. Registration returns a one-time credential block:
+id=... token=... registry=... ma_key=....
Static Linux x86_64 binaries (musl — no runtime dependencies):
+curl -LO https://git.federatedsearch.org/frx/frxd/releases/download/v0.1.0/frxd-linux-amd64 +curl -LO https://git.federatedsearch.org/frx/frxd/releases/download/v0.1.0/frxd-linux-amd64.sha256 +curl -LO https://git.federatedsearch.org/frx/frxd/releases/download/v0.1.0/frx-linux-amd64 +curl -LO https://git.federatedsearch.org/frx/frxd/releases/download/v0.1.0/frx-linux-amd64.sha256+
All releases: git.federatedsearch.org/frx/frxd/releases.
+Source and spec (rfc.txt): git.federatedsearch.org/frx/frxd.
sha256sum -c frxd-linux-amd64.sha256 +chmod +x frxd-linux-amd64 frx-linux-amd64 +sudo mv frxd-linux-amd64 /usr/local/bin/frxd +sudo mv frx-linux-amd64 /usr/local/bin/frx+
No sudo? Run them in place — each is a single self-contained binary.
+frxd --onboarding
frxd.frxd --onboarding and paste the credential block it gives you.frxd add ~/documents --name docs --shared --exposure metadata +frxd serve+
Search local-first with frx search "..."; broadcast to the federation with
+frx query "...". Nothing is shared until a collection is explicitly marked
+--shared.
…
@@ -762,7 +798,7 @@ document.getElementById("f").onsubmit = async (e) => { const body = await res.json(); out.style.display = "block"; out.textContent = res.ok - ? "Membership approved.\n\nRun `frxd --onboarding` and paste this block:\n\n" + body.credentials + "\n" + ? "Membership approved.\n\nNext: download frxd (step 2), install it (step 3), then run `frxd --onboarding` and paste this block:\n\n" + body.credentials + "\n" : "Failed: " + (body.error || ("http " + res.status)); };