diff --git a/.github/workflows/smoke-test.yaml b/.github/workflows/smoke-test.yaml index 5580a29..25c14f9 100644 --- a/.github/workflows/smoke-test.yaml +++ b/.github/workflows/smoke-test.yaml @@ -41,7 +41,7 @@ jobs: - name: Prepare host directories run: | - mkdir -p netdisco/logs netdisco/config netdisco/nd-site-local + mkdir -p netdisco/config netdisco/nd-site-local sudo chown -R 901:901 netdisco - name: Start the stack @@ -73,6 +73,28 @@ jobs: fi done + - name: Confirm no real log files written (foreground mode) + run: | + # Post netdisco/netdisco#1500: foreground mode skips log file + # creation entirely. The Dockerfile keeps the legacy + # /home/netdisco/logs/netdisco-*.log -> /dev/stdout symlinks as a + # safety net for non-foreground use, so '-type f' excludes those + # and only catches *real* files (which would mean log writes + # accumulating inside the container instead of reaching stdout). + fail=0 + for svc in netdisco-backend netdisco-web; do + real=$(docker compose exec -T "$svc" find /home/netdisco/logs \ + -maxdepth 1 -type f -name '*.log' 2>/dev/null || true) + if [ -n "$real" ]; then + echo "FAIL: $svc has real log files (expected stdout only):" + echo "$real" + fail=1 + else + echo "OK: $svc — no real .log files in /home/netdisco/logs/" + fi + done + exit $fail + - name: Dump compose logs if: always() run: docker compose logs --no-color || true diff --git a/README.md b/README.md index 643aa75..6b6f067 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ On Linux hosts, create these directories and allow the service uid (`901`) to wr *(this step is only necessary on Linux hosts and can be omitted in the macOS and Windows versions of Docker)* - mkdir -p netdisco/{logs,config,nd-site-local} + mkdir -p netdisco/{config,nd-site-local} sudo chown -R 901:901 netdisco ### New Deployments @@ -35,7 +35,7 @@ Download `compose.yaml` and start everything: This runs the database, backend daemon, and web frontend listening on port 5000. If you have a device using the SNMP community `public`, enter it in the Netdisco homepage and click "Discover". -The default configuration is available in `netdisco/config/deployment.yml`. The daemons automatically restart when you save changes to this file. Logs are available in `netdisco/logs/`. +The default configuration is available in `netdisco/config/deployment.yml`. The daemons automatically restart when you save changes to this file. Logs are available via `docker compose logs` (the daemons write directly to the container stdout in foreground mode). The web frontend is initally configured to allow unauthenticated access with full admin rights. We suggest you visit the `Admin -> User Management` menu item, and set `no_auth: false` in `deployment.yml`, to remove this guest account and set up authenticated user access. diff --git a/docker-compose.yml b/docker-compose.yml index 2e82548..051c6d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,7 +71,6 @@ services: volumes: - "./netdisco/nd-site-local:/home/netdisco/nd-site-local" - "./netdisco/config:/home/netdisco/environments" - - "./netdisco/logs:/home/netdisco/logs" environment: <<: *common-environment dns_opt: @@ -93,7 +92,6 @@ services: volumes: - "./netdisco/nd-site-local:/home/netdisco/nd-site-local" - "./netdisco/config:/home/netdisco/environments" - - "./netdisco/logs:/home/netdisco/logs" environment: <<: *common-environment IPV: '${IPV:-4}'