Remove --address 0.0.0.0 from kiwix-serve startup (#1)#1
Open
ldab wants to merge 3 commits into
Open
Conversation
* 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>
There was a problem hiding this comment.
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.1instead of0.0.0.0. - Remove explicit
--address 0.0.0.0fromkiwix-serveinvocations (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 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} . \ |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.