← back to Dw Photo Capture
visual-search: make bind host configurable via VS_HOST (default 127.0.0.1, unchanged); enables opt-in tailnet exposure for remote consumers
a0e586bdc5d335b5649ab8ddce2899c77228fa18 · 2026-07-13 00:10:45 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
M visual-search/search_service.py
Diff
commit a0e586bdc5d335b5649ab8ddce2899c77228fa18
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jul 13 00:10:45 2026 -0700
visual-search: make bind host configurable via VS_HOST (default 127.0.0.1, unchanged); enables opt-in tailnet exposure for remote consumers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
visual-search/search_service.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/visual-search/search_service.py b/visual-search/search_service.py
index 0b9f9f4..9f7df9b 100644
--- a/visual-search/search_service.py
+++ b/visual-search/search_service.py
@@ -14,6 +14,10 @@ from PIL import Image
DB = os.environ["DW_UNIFIED_DB"]
PORT = int(os.environ.get("VS_PORT", "9914"))
+# Bind host. Defaults to 127.0.0.1 (localhost-only, unchanged behavior). Set
+# VS_HOST=0.0.0.0 to expose on the tailnet so a remote host (e.g. Kamatera
+# pairs-well) can reach it — only do that when the exposure is intended.
+HOST = os.environ.get("VS_HOST", "127.0.0.1")
_MODEL = {"model": None, "preprocess": None}
def _get_model():
@@ -271,4 +275,4 @@ class H(BaseHTTPRequestHandler):
if __name__ == "__main__":
load()
print(f"visual-search on :{PORT} · {STATE['n']} embeddings", flush=True)
- ThreadingHTTPServer(("127.0.0.1", PORT), H).serve_forever()
+ ThreadingHTTPServer((HOST, PORT), H).serve_forever()
← 2890b8f auto-save: 2026-07-12T23:51:20 (5 files) — visual-search/sea
·
back to Dw Photo Capture
·
auto-save: 2026-07-13T00:51:43 (2 files) — visual-search/__p 95931a9 →