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 <noreply@anthropic.com>
This commit is contained in:
parent
efd3836945
commit
edeb77f833
2 changed files with 13 additions and 19 deletions
|
|
@ -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://<hub>: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://<hub>: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
|
||||
|
||||
|
|
|
|||
25
README.md
25
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://<hub-ip>:8000/install-probe.sh | HUB_URL=http://<hub-ip>: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://<vps>: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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue