Skip to content

Commit 63d2be5

Browse files
authored
Merge branch 'cameri:main' into fix/dns-preflight-check
2 parents 7dc1830 + 4652d00 commit 63d2be5

15 files changed

Lines changed: 309 additions & 220 deletions

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,16 @@ Start:
210210
./scripts/start_with_tor
211211
```
212212
213+
**Windows / WSL2 users:** Docker bind-mounts can cause PostgreSQL permission errors on Windows. Use the dedicated override file instead:
214+
```
215+
docker compose -f docker-compose.yml -f docker-compose.windows.yml up --build
216+
```
217+
Or add this to your `.env` file so you don't have to type it every time:
218+
```
219+
COMPOSE_FILE=docker-compose.yml:docker-compose.windows.yml
220+
```
221+
> **Note:** If you previously ran Nostream on Linux/Mac and are switching to Windows, your existing data lives at `.nostr/data/` on the host. You'll need to copy it into the Docker named volume manually or it won't be visible to the new setup.
222+
213223
Stop the server with:
214224
```
215225
./scripts/stop
@@ -263,6 +273,60 @@ The logs can be viewed with:
263273
journalctl -u nostream
264274
```
265275
276+
## Troubleshooting
277+
278+
### Linux: Docker DNS resolution failures (`EAI_AGAIN`)
279+
280+
On some Linux environments (especially rolling-release distros or setups using
281+
`systemd-resolved`), `docker compose` builds can fail with DNS errors such as:
282+
283+
- `getaddrinfo EAI_AGAIN registry.npmjs.org`
284+
- `Temporary failure in name resolution`
285+
286+
To fix this, configure Docker daemon DNS in `/etc/docker/daemon.json`.
287+
288+
1. Create or update `/etc/docker/daemon.json`:
289+
290+
```
291+
sudo mkdir -p /etc/docker
292+
sudo nano /etc/docker/daemon.json
293+
```
294+
295+
Add or update the file with:
296+
297+
```
298+
{
299+
"dns": ["1.1.1.1", "8.8.8.8"]
300+
}
301+
```
302+
303+
If this file already exists, merge the `dns` key into the existing JSON
304+
instead of replacing the entire file.
305+
306+
If your environment does not allow public resolvers, replace `1.1.1.1` and
307+
`8.8.8.8` with DNS servers approved by your network.
308+
309+
2. Restart Docker:
310+
311+
```
312+
sudo systemctl restart docker
313+
```
314+
315+
3. Verify DNS works inside containers:
316+
317+
```
318+
docker run --rm busybox nslookup registry.npmjs.org
319+
```
320+
321+
4. Retry starting nostream:
322+
323+
```
324+
./scripts/start
325+
```
326+
327+
Note: avoid `127.0.0.53` in Docker DNS settings because it points to the host's
328+
local resolver stub and is often unreachable from containers.
329+
266330
## Quick Start (Standalone)
267331
268332
Set the following environment variables:
@@ -372,7 +436,7 @@ Clone repository and enter directory:
372436
373437
Start:
374438
```
375-
./scripts/start_local
439+
./scripts/start
376440
```
377441
378442
This will run in the foreground of the terminal until you stop it with Ctrl+C.

docker-compose.windows.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# docker-compose.windows.yml
2+
#
3+
# Windows / WSL2 override for Nostream.
4+
#
5+
# On Windows (including WSL2), Docker bind-mounts to host paths can cause
6+
# PostgreSQL permission errors. This override replaces the bind-mount for
7+
# PostgreSQL data with a named Docker volume, which is managed entirely
8+
# by the Docker engine and avoids those issues.
9+
#
10+
# Usage:
11+
# docker compose -f docker-compose.yml -f docker-compose.windows.yml up --build
12+
#
13+
# Or set COMPOSE_FILE in your .env:
14+
# COMPOSE_FILE=docker-compose.yml:docker-compose.windows.yml
15+
#
16+
# WARNING: If you previously ran Nostream with the default docker-compose.yml
17+
# your data is in .nostr/data/ on the host. Before switching to this file,
18+
# migrate your data or it will not be accessible from the named volume.
19+
20+
services:
21+
nostream-db:
22+
volumes:
23+
- nostream-db-data:/var/lib/postgresql/data
24+
- ${PWD}/.nostr/db-logs:/var/log/postgresql
25+
- ${PWD}/postgresql.conf:/postgresql.conf
26+
27+
volumes:
28+
nostream-db-data:

0 commit comments

Comments
 (0)