Skip to content

Remove --address 0.0.0.0 from kiwix-serve startup (#1)#1

Open
ldab wants to merge 3 commits into
MichalTorma:mainfrom
ldab:main
Open

Remove --address 0.0.0.0 from kiwix-serve startup (#1)#1
ldab wants to merge 3 commits into
MichalTorma:mainfrom
ldab:main

Conversation

@ldab

@ldab ldab commented May 30, 2026

Copy link
Copy Markdown
  • fix: remove --address 0.0.0.0 from kiwix-serve to fix startup error

The 0.0.0.0 address is rejected by kiwix-serve in certain environments. Since both kiwix-serve and the management API are behind an nginx reverse proxy on the same container, they only need to be accessible locally.

  • Remove --address flag from kiwix-serve (uses default bind)
  • Change management API host from 0.0.0.0 to 127.0.0.1
  • Update comment to reflect the binding change
  • Context: why --address 0.0.0.0 was removed

kiwix-serve rejects 0.0.0.0 as a bind address in the Alpine/HA OS container environment with:
ERROR: IP address is not available on this system: 0.0.0.0

This previously worked because older kiwix-tools packages accepted 0.0.0.0 without validation. The current Alpine package validates the address and fails when the wildcard address cannot be resolved against available interfaces in the container network namespace.

The fix removes --address entirely from kiwix-serve, letting it bind to its default (all interfaces). The management API is changed to bind to 127.0.0.1 explicitly. Both services sit behind nginx on the same container and are only reached via proxy_pass to 127.0.0.1, so external bind is unnecessary.

Dev tested: addon starts, kiwix-serve responds on port 8080, nginx proxies correctly.


* fix: remove --address 0.0.0.0 from kiwix-serve to fix startup error

The 0.0.0.0 address is rejected by kiwix-serve in certain environments.
Since both kiwix-serve and the management API are behind an nginx reverse
proxy on the same container, they only need to be accessible locally.

- Remove --address flag from kiwix-serve (uses default bind)
- Change management API host from 0.0.0.0 to 127.0.0.1
- Update comment to reflect the binding change

* Context: why --address 0.0.0.0 was removed

kiwix-serve rejects 0.0.0.0 as a bind address in the Alpine/HA OS
container environment with:
  ERROR: IP address is not available on this system: 0.0.0.0

This previously worked because older kiwix-tools packages accepted
0.0.0.0 without validation. The current Alpine package validates the
address and fails when the wildcard address cannot be resolved against
available interfaces in the container network namespace.

The fix removes --address entirely from kiwix-serve, letting it bind
to its default (all interfaces). The management API is changed to bind
to 127.0.0.1 explicitly. Both services sit behind nginx on the same
container and are only reached via proxy_pass to 127.0.0.1, so external
bind is unnecessary.

Dev tested: addon starts, kiwix-serve responds on port 8080, nginx
proxies correctly.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 30, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Tightens network binding for internal services so they are no longer directly exposed on all interfaces, instead being accessed via the nginx proxy.

Changes:

  • Bind the management API to 127.0.0.1 instead of 0.0.0.0.
  • Remove explicit --address 0.0.0.0 from kiwix-serve invocations (relying on its default bind address).
  • Update inline comment to reflect the new localhost binding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rootfs/etc/services.d/kiwix/run Outdated
Comment on lines +96 to +99
nohup kiwix-serve --library --monitorLibrary --port ${KIWIX_INTERNAL_PORT} "${LIBRARY_XML}" \
> /proc/1/fd/1 2>/proc/1/fd/2 &
else
nohup kiwix-serve --library --monitorLibrary --address 0.0.0.0 --port ${KIWIX_INTERNAL_PORT} . \
nohup kiwix-serve --library --monitorLibrary --port ${KIWIX_INTERNAL_PORT} . \
ldab and others added 2 commits June 5, 2026 14:52
In some container network configurations (e.g., Home Assistant OS),
binding to 0.0.0.0 fails with 'IP address is not available on this system'.
Since nginx already handles external connections as a reverse proxy,
kiwix-serve only needs to listen on localhost.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move addon files into kiwix-server/ subdirectory and add
repository.yaml so Home Assistant recognizes this as a valid
addon repository.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants