From edeb77f8335d59ec8200f1da3ce518e205ee59e3 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 4 Nov 2026 18:16:12 -0800 Subject: [PATCH] Docs: repo is public; simplify install commands The raw installer URL is confirmed (200, matches main) and anonymous clone works, so installs need no token. Private-repo steps move to a fallback note. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 7 ++++--- README.md | 25 +++++++++---------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 15932ef..c9bfab1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -16,10 +16,11 @@ A home network monitor with two roles, built from one repo: While the hub is unreachable, results queue in memory and upload later. With no `HUB_URL` it is serve-only, e.g. on a VPS. -Remote: `https://git.neilbantoc.dev/services/network-monitor.git` (Gitea). **The repo is private.** Anonymous requests to its web, API and raw URLs return 404. Machines need a read-only token (`GIT_TOKEN`, saved in their `.env`) to clone and update. +Remote: `https://git.neilbantoc.dev/services/network-monitor.git` (Gitea). The repo is public, so anonymous clone and fetch work and installs need no token. -- **Hub install:** fetch the installer with `curl -H "Authorization: token $GIT_TOKEN" https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install.sh`. That raw path is assumed from Gitea's URL scheme and hasn't been confirmed with a token yet. If it 404s, `git clone` the repo and run `install.sh` from the clone. -- **Probe installs:** fetch `install-probe.sh` from the hub (`http://:8000/install-probe.sh`, open even with `UI_PASSWORD`). The Add probe dialog builds that command. +- **Hub installer:** `https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install.sh`. Confirmed: returns 200 and matches `main`. +- **Probe installer:** the Add probe dialog fetches it from the hub (`http://:8000/install-probe.sh`, open even with `UI_PASSWORD`), so probe installs don't depend on Gitea's raw URLs. It is also at the raw URL. +- **If the repo becomes private:** the installers ask for a read-only `GIT_TOKEN` and save it in `.env` for updates. ## Deployment modes diff --git a/README.md b/README.md index e833342..0ad8aaf 100644 --- a/README.md +++ b/README.md @@ -57,19 +57,11 @@ Either way, the service starts on boot and restarts if it crashes. ### 1. The hub -The repo is private, so fetching the installer needs a read-only Gitea token (Settings → Applications → Access tokens, scope `read:repository`). The token is read without echoing it or saving it in history, and the installer reuses it to clone: - ```bash -read -rsp 'Gitea token: ' GIT_TOKEN && export GIT_TOKEN && curl -fsSL -H "Authorization: token $GIT_TOKEN" https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install.sh | bash +curl -fsSL https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install.sh | bash ``` -Inside an LXC you are root, so that's it. On another Linux machine in native mode, use `| sudo -E env INSTALL_MODE=native bash`. If the raw URL gives a 404 even with the token, clone and run the installer instead: - -```bash -git clone https://git.neilbantoc.dev/services/network-monitor.git /tmp/nm && bash /tmp/nm/install.sh -``` - -The token is saved in `/opt/network-monitor/.env` (`GIT_TOKEN`) so `update` can fetch. Only the update step sees it, not the running app. +Inside an LXC you are root, so that's it. On another Linux machine in native mode, use `| sudo env INSTALL_MODE=native bash`. Then connect AdGuard Home in `/opt/network-monitor/.env`: @@ -95,7 +87,7 @@ curl -fsSL http://192.168.1.10:8000/install-probe.sh | HUB_URL=http://192.168.1. curl -fsSL http://192.168.1.10:8000/install-probe.sh | sudo env HUB_URL=http://192.168.1.10:8000 PROBE_TOKEN=... bash ``` -Because the repo is private, the installer asks for a read-only Gitea token on the terminal before it clones. To skip the prompt, put `GIT_TOKEN=...` before `bash`. +The same installer is also at `https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install-probe.sh`. The probe's test server listens on port 8765 (`PROBE_PORT`) on all interfaces. @@ -135,12 +127,13 @@ curl -fsSL http://:8000/install-probe.sh | HUB_URL=http://:8000 On the VPS, run `install-probe.sh` with no `HUB_URL` or `PROBE_TOKEN`, and open 8765/tcp in its firewall. Then set `VPS_URL=http://:8765` in the hub's `.env`. Every probe then tests the VPS too. -### Private repo +### If the repo becomes private -- **Fetching:** the hub installer comes from Gitea with a token (above), and probe installers come from the hub. -- **Cloning:** both installers clone with `GIT_TOKEN` and ask for it on the terminal if they can't read the repo. -- **Storage:** the token goes into that machine's `.env` for later updates. -- **Revoking:** use a read-only token per machine, so one can be revoked without touching the others. +The installers ask for a read-only token on the terminal when they can't read the repo, and save it in that machine's `.env` for updates (`GIT_TOKEN`). Probe install commands keep working, because they fetch the installer from the hub. To fetch the hub installer, pass the token to curl (Gitea's header): + +```bash +read -rsp 'Gitea token: ' GIT_TOKEN && export GIT_TOKEN && curl -fsSL -H "Authorization: token $GIT_TOKEN" https://git.neilbantoc.dev/services/network-monitor/raw/branch/main/install.sh | bash +``` ## Deploy changes