fix: clone URL under noctools org; per-agent env file for second agents; drop -u sam from public fallback

This commit is contained in:
sam
2026-08-21 06:03:05 +00:00
parent 09f2b3fd3f
commit 5c32baa3c7
3 changed files with 23 additions and 16 deletions
+9 -5
View File
@@ -25,7 +25,7 @@ contains no secrets.
## Install
```bash
git clone https://gitea.noctools.nz/sam/onlyscans-agent-kit.git
git clone https://gitea.noctools.nz/noctools/onlyscans-agent-kit.git
cd onlyscans-agent-kit
cp .env.agent.example .env
# edit .env: AGENT_IDENTITY / AGENT_PASSWORD / AGENT_LOCATION
@@ -62,9 +62,13 @@ The agent re-authenticates and resumes polling.
- **Host-network variant** (scan the site LAN directly, ARP-level
discovery, non-routed subnets): swap the service to `network_mode: host`
per the commented block in `docker-compose.agent.yml`.
- **Second agent on the same box:** copy the compose file, change the
project `name:` and `container_name` (and `WORKER_HEALTH_PORT` under
host networking) per the comments in the file.
- **Second agent on the same box:** each agent needs its OWN credentials —
copy the compose file AND create a second env file (`.env-agent2`), then
run it with `docker compose --env-file .env-agent2 -f
docker-compose.agent2.yml up -d`. In the copy, change the project `name:`
and `container_name` (and `WORKER_HEALTH_PORT` under host networking) per
the comments in the file. Two agents sharing one `.env` would share one
auth record — unsupported and silently wrong.
- **CVE matching** (optional): fill `CVE_MATCH_API` + `CVE_MATCH_TOKEN`
in `.env` only if Sam provides them. Without it, scans complete
normally with the CVE stage skipped.
@@ -73,6 +77,6 @@ The agent re-authenticates and resumes polling.
| Symptom | Meaning |
|---|---|
| Container exits ~1 s after start | Bad `AGENT_PASSWORD` or unknown `AGENT_LOCATION` — fatal by design; fix `.env` and recreate |
| Container exits ~1 s after start | Bad `AGENT_IDENTITY`, `AGENT_PASSWORD`, or unknown `AGENT_LOCATION` — fatal by design; fix `.env` and recreate |
| Agent shows **offline** centrally (`/agents`) | Container down, or no egress to `scan-api.noctools.nz:443` — check `docker logs onlyscans-agent` |
| Scans stay queued | Agent online but for a different location, or targets unreachable from the container's network — try the host-network variant |