fix(cookbook): default Ollama serve to loopback (#872)

This commit is contained in:
lolwuttav
2026-06-01 21:27:04 -06:00
committed by GitHub
parent ffb77d7ff2
commit c99193041a
6 changed files with 95 additions and 9 deletions
+12
View File
@@ -125,6 +125,18 @@ def test_readme_native_quickstart_uses_loopback():
assert "Use `--host 0.0.0.0` only when you intentionally want" in readme
def test_ollama_cookbook_runner_does_not_force_public_bind():
route = Path("routes/cookbook_routes.py").read_text(encoding="utf-8")
cookbook_js = Path("static/js/cookbook.js").read_text(encoding="utf-8")
assert 'OLLAMA_HOST="0.0.0.0:${ODYSSEUS_OLLAMA_PORT}" ollama serve' not in route
assert 'OLLAMA_HOST="${ODYSSEUS_OLLAMA_HOST}:${ODYSSEUS_OLLAMA_PORT}" ollama serve' in route
assert '_ollama_default_host = "0.0.0.0" if remote else "127.0.0.1"' in route
assert "WARNING: remote Ollama will bind" in route
assert "OLLAMA_HOST=0.0.0.0:${ollamaPort}" not in cookbook_js
assert "const bindHost = _envState.remoteHost ? '0.0.0.0' : '127.0.0.1';" in cookbook_js
assert "OLLAMA_HOST=${bindHost}:${ollamaPort}" in cookbook_js
def _import_integrations(tmp_path, monkeypatch):
"""Import src.integrations with data + encryption key redirected to tmp."""
_import_secret_storage(tmp_path, monkeypatch)