Update doc

This commit is contained in:
2026-09-21 07:14:56 +00:00
parent e5145a8c1e
commit e88361ff65
+36 -15
View File
@@ -18,7 +18,7 @@ down on power loss, you hit that wall fast.
- It runs its **own NUT server**, which has no artificial client limit.
- All your machines then connect to the relay instead of the UPS directly.
```bash
```
Your UPS (NUT server, limited clients)
│ single connection (repeater mode)
@@ -44,24 +44,49 @@ simulated device.
## Server Setup (the relay)
### 1. Get the image
### 1. Create a project folder
```bash
docker pull git.ericampire.app/ericampire/nut-relay:latest
mkdir nut-relay && cd nut-relay
```
Or build it yourself from this repo:
```bash
docker build -t nut-relay .
### 2. Create `docker-compose.yml`
```yaml
services:
nut-relay:
image: git.ericampire.app/ericampire/nut-relay:latest
container_name: nut-relay
restart: unless-stopped
network_mode: host
volumes:
- ./config:/etc/nut
```
### 2. Create your config folder
> `network_mode: host` is recommended so the container shares the host's
> network stack directly — this matters if your UPS lives on a different
> network segment/VLAN than Docker's default bridge network can reach. If
> your setup doesn't need that, you can instead use a `ports:` mapping:
> ```yaml
> ports:
> - "3493:3493"
> ```
> (don't combine both — `ports:` is ignored/redundant under `network_mode: host`)
If you'd rather build the image yourself instead of pulling the published
one, replace `image:` with `build: .` and make sure the `Dockerfile` and
`entrypoint.sh` from this repo are in the same folder.
### 3. Create your config folder
```bash
cp -r config.example config
```
### 3. Edit `config/ups.conf`
This gives you `config/nut.conf`, `config/ups.conf`, `config/upsd.conf`, and
`config/upsd.users` as a starting point — edit each one for your setup below.
### 4. Edit `config/ups.conf`
Point it at your actual UPS. The `port` value must be in the form
`<remote_ups_name>@<remote_host>:<remote_port>` for repeater mode to work
@@ -77,7 +102,7 @@ Point it at your actual UPS. The `port` value must be in the form
> Not sure of your UPS's NUT device name? Run:
> `docker run --rm --network host <image> upsc -l <your_ups_ip>`
### 4. Edit `config/upsd.users`
### 5. Edit `config/upsd.users`
One account for the relay-to-UPS connection, and **one unique account per
client** you plan to connect:
@@ -101,18 +126,14 @@ Generate strong passwords with:
openssl rand -base64 24
```
### 5. Start the relay
### 6. Start the relay
```bash
docker compose up -d
docker compose logs -f
```
> If your UPS lives on a different network segment/VLAN than the default
> Docker bridge can reach, set `network_mode: host` in `docker-compose.yml`
> (and drop the `ports:` block, since it becomes redundant in host mode).
### 6. Verify
### 7. Verify
```bash
docker exec -it nut-relay upsc relayups@localhost