From e5649148f7bedf85e298b4a227942624352730a1 Mon Sep 17 00:00:00 2001 From: tocmo0nlord Date: Sun, 12 Apr 2026 16:18:10 -0400 Subject: [PATCH] Default to localhost for workstation install - ConnectionPanel defaults host to localhost, blank username - Backend OLLAMA_URL defaults to localhost:11434 - Systemd service reads /etc/llm-trainer/env for overrides Co-Authored-By: Claude Sonnet 4.6 --- backend/main.py | 2 +- frontend/src/components/ConnectionPanel.jsx | 4 ++-- packaging/build-deb.sh | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/main.py b/backend/main.py index 0eec91f..4891bef 100644 --- a/backend/main.py +++ b/backend/main.py @@ -27,7 +27,7 @@ app.add_middleware( allow_headers=["*"], ) -OLLAMA_URL = os.getenv("OLLAMA_URL", "http://192.168.2.47:11434") +OLLAMA_URL = os.getenv("OLLAMA_URL", "http://localhost:11434") # ────────────────────────────────────────────────────────────────────────────── diff --git a/frontend/src/components/ConnectionPanel.jsx b/frontend/src/components/ConnectionPanel.jsx index a7703fb..fb54eb4 100644 --- a/frontend/src/components/ConnectionPanel.jsx +++ b/frontend/src/components/ConnectionPanel.jsx @@ -4,8 +4,8 @@ import { Server, LogIn, LogOut, Key, Eye, EyeOff } from 'lucide-react' export default function ConnectionPanel({ onConnect, setStatus }) { const [form, setForm] = useState({ - host: '192.168.2.47', - username: 'tocmo0nlord', + host: 'localhost', + username: '', password: '', key_path: '', port: 22, diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index e374f89..b296a0e 100644 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -88,6 +88,7 @@ Restart=always RestartSec=5 StandardOutput=append:/var/log/llm-trainer/backend.log StandardError=append:/var/log/llm-trainer/backend.log +EnvironmentFile=-/etc/llm-trainer/env Environment=PYTHONUNBUFFERED=1 [Install] @@ -137,6 +138,15 @@ fi chown -R llm-trainer:llm-trainer /opt/llm-trainer chown -R llm-trainer:llm-trainer /var/log/llm-trainer +# Write default env config (only on first install) +if [ ! -f /etc/llm-trainer/env ]; then + cat > /etc/llm-trainer/env <<'ENV' +# LLM Trainer configuration +# Override Ollama URL if it runs on a different host +OLLAMA_URL=http://localhost:11434 +ENV +fi + # Build Python venv and install deps echo "Installing Python dependencies..." python3 -m venv /opt/llm-trainer/venv