Skip to content

feat: support configurable bind host via LLM_WIKI_BIND_HOST env var#475

Open
wzh448040 wants to merge 1 commit into
nashsu:mainfrom
wzh448040:feat/configurable-bind-host
Open

feat: support configurable bind host via LLM_WIKI_BIND_HOST env var#475
wzh448040 wants to merge 1 commit into
nashsu:mainfrom
wzh448040:feat/configurable-bind-host

Conversation

@wzh448040

Copy link
Copy Markdown

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 an LLM_WIKI_BIND_HOST environment variable so users can set 0.0.0.0 to listen on all interfaces.

Closes #474

Changes

  • src-tauri/src/api_server.rs: Added bind_host() helper that reads LLM_WIKI_BIND_HOST (default 127.0.0.1). Used in bind_server_with_retry() and the listening log line.
  • src-tauri/src/clip_server.rs: Same bind_host() helper. Used in the bind loop and the listening log line.

Behavior

LLM_WIKI_BIND_HOST Behavior
(unset) Binds 127.0.0.1 — identical to current behavior
0.0.0.0 Listens on all interfaces — enables LAN access
192.168.1.100 Binds to a specific interface

Backward Compatibility

Fully backward compatible. No environment variable = no behavior change. Existing users, CI, and the default desktop experience are unaffected.

Testing

  • cargo build passes on Linux (the same check run in CI).
  • Verified bind_host() returns "127.0.0.1" when the env var is unset.
  • Verified bind_host() returns the env var value when set.

Diff Summary

 2 files changed, 25 insertions(+), 5 deletions(-)

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
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.

Feature: Support configurable bind host (0.0.0.0) for LAN access to API and Clip servers

1 participant