feat: support configurable bind host via LLM_WIKI_BIND_HOST env var#475
Open
wzh448040 wants to merge 1 commit into
Open
feat: support configurable bind host via LLM_WIKI_BIND_HOST env var#475wzh448040 wants to merge 1 commit into
wzh448040 wants to merge 1 commit into
Conversation
Both the API server (port 19828) and Clip server (port 19827) were hardcoded to bind 127.0.0.1, preventing access from other machines on the local network. Add a shared bind_host() helper in each module that reads LLM_WIKI_BIND_HOST from the environment, defaulting to 127.0.0.1 for full backward compatibility. Users who need LAN access can set LLM_WIKI_BIND_HOST=0.0.0.0 to listen on all interfaces. Closes nashsu#474
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.
Summary
Both the API server (port 19828) and Clip server (port 19827) are hardcoded to bind
127.0.0.1, which prevents LAN access from other machines. This PR adds anLLM_WIKI_BIND_HOSTenvironment variable so users can set0.0.0.0to listen on all interfaces.Closes #474
Changes
src-tauri/src/api_server.rs: Addedbind_host()helper that readsLLM_WIKI_BIND_HOST(default127.0.0.1). Used inbind_server_with_retry()and the listening log line.src-tauri/src/clip_server.rs: Samebind_host()helper. Used in the bind loop and the listening log line.Behavior
LLM_WIKI_BIND_HOST127.0.0.1— identical to current behavior0.0.0.0192.168.1.100Backward Compatibility
Fully backward compatible. No environment variable = no behavior change. Existing users, CI, and the default desktop experience are unaffected.
Testing
cargo buildpasses on Linux (the same check run in CI).bind_host()returns"127.0.0.1"when the env var is unset.bind_host()returns the env var value when set.Diff Summary