diff --git a/.env.example b/.env.example index 9e23301..13313f9 100644 --- a/.env.example +++ b/.env.example @@ -46,7 +46,7 @@ LOG_LEVEL=INFO # ── Public URL (used by share_file for download links) ─────────────────────── -PUBLIC_URL=http://localhost:8000 +PUBLIC_URL=http://localhost:8099 # ── Persona ───────────────────────────────────────────────────────────────────── # Preferred: put persona in persona.txt and set NAVI_PERSONA_FILE. @@ -71,7 +71,7 @@ NAVI_WEBCLIENT_ENABLED=true # Bind address/port for the `navi-server` launcher (and systemd unit). NAVI_HOST=127.0.0.1 -NAVI_PORT=8000 +NAVI_PORT=8099 # ── Internal navi_ui MCP server ───────────────────────────────────────────────── # Lets the agent push structured UI components (card_grid, form) to the webclient @@ -79,7 +79,7 @@ # (only when the web UI is enabled). NAVI_UI_MCP_ENABLED=true NAVI_UI_MCP_HOST=127.0.0.1 -NAVI_UI_MCP_PORT=8001 +NAVI_UI_MCP_PORT=8098 # ── gnexus-auth OAuth ──────────────────────────────────────────────────────────── GNAUTH_BASE_URL=https://auth.your-domain.com diff --git a/android-client/app/src/main/res/values/strings.xml b/android-client/app/src/main/res/values/strings.xml index b3ea2ae..599aa85 100644 --- a/android-client/app/src/main/res/values/strings.xml +++ b/android-client/app/src/main/res/values/strings.xml @@ -2,7 +2,7 @@ Navi Укажи адрес сервера - http://192.168.1.x:8000 + http://192.168.1.x:8099 Подключиться Введи корректный URL (http:// или https://) Настройки diff --git a/clients/terminal/config.py b/clients/terminal/config.py index 6fa5ff4..1a4bf43 100644 --- a/clients/terminal/config.py +++ b/clients/terminal/config.py @@ -17,7 +17,7 @@ extra="ignore", ) - base_url: str = "http://localhost:8000" + base_url: str = "http://localhost:8099" ws_url: str | None = None state_dir: Path = Path.home() / ".navi_code" default_profile_id: str = "navi_code" diff --git a/deploy/README.md b/deploy/README.md index 7a3c63b..3134129 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -53,11 +53,11 @@ | Piece | State | |---|---| -| Navi API server | systemd `navi.service`, `Restart=always`, starts on boot, binds `127.0.0.1:8000` | +| Navi API server | systemd `navi.service`, `Restart=always`, starts on boot, binds `127.0.0.1:8099` | | PostgreSQL | docker container `navi-postgres` (pgvector image), `restart: always`, bound to `127.0.0.1:5432`, data in the `navi-pgdata` volume | | Web UI (`/`, `/assets`, `/admin`, debug panels, navi_ui MCP) | **off** (`NAVI_WEBCLIENT_ENABLED=false`) | | Auth | **off** (`NAVI_AUTH_ENABLED=false`) — trusted single-server module, the API listens on localhost only | -| Terminal client | `navi-code` symlinked into `/usr/local/bin`, talks to `http://localhost:8000` | +| Terminal client | `navi-code` symlinked into `/usr/local/bin`, talks to `http://localhost:8099` | | LLM | Ollama Cloud (`OLLAMA_HOST=https://ollama.com`), model priority lists come from the profile configs | ## Branch layout diff --git a/deploy/env.template b/deploy/env.template index e6d7e54..6566625 100644 --- a/deploy/env.template +++ b/deploy/env.template @@ -36,7 +36,7 @@ # Server bind (used by navi-server / the systemd unit) NAVI_HOST=127.0.0.1 -NAVI_PORT=8000 +NAVI_PORT=8099 # ─── Client profile ────────────────────────────────────────────────── NAVI_DEFAULT_PROFILE_ID=navi_code diff --git a/deploy/install.sh b/deploy/install.sh index 98e6ca5..6e1eca9 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -204,7 +204,7 @@ # ── 6. health check + PATH symlinks ──────────────────────────────── say "Waiting for the server to become healthy" NAVI_PORT_CFG="$(grep -E '^NAVI_PORT=' .env | tail -1 | cut -d= -f2 || true)" -NAVI_PORT_CFG="${NAVI_PORT_CFG:-8000}" +NAVI_PORT_CFG="${NAVI_PORT_CFG:-8099}" HEALTH="ok" for i in $(seq 1 60); do if curl -sf -o /dev/null "http://127.0.0.1:${NAVI_PORT_CFG}/health" 2>/dev/null; then break; fi diff --git a/docs/api.md b/docs/api.md index d76ab48..13aa0c7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,6 +1,6 @@ # Navi API Reference -Base URL: `http://localhost:8000` +Base URL: `http://localhost:8099` --- diff --git a/docs/archive/visual.html b/docs/archive/visual.html index 4797cee..d4d43bc 100644 --- a/docs/archive/visual.html +++ b/docs/archive/visual.html @@ -472,7 +472,7 @@
Run command
uvicorn navi.main:app
-
--reload --port 8000
+
--reload --port 8099
Default model
diff --git a/docs/auth.md b/docs/auth.md index b8dc85e..b7dd9ac 100644 --- a/docs/auth.md +++ b/docs/auth.md @@ -341,7 +341,7 @@ | `GNAUTH_BASE_URL` | str | `http://gnexus-auth.local` | gnexus-auth server base URL | | `GNAUTH_CLIENT_ID` | str | `""` | OAuth client ID from gnexus-auth | | `GNAUTH_CLIENT_SECRET` | str | `""` | OAuth client secret | -| `GNAUTH_REDIRECT_URI` | str | `http://localhost:8000/auth/callback` | Must match the redirect URI registered in gnexus-auth exactly | +| `GNAUTH_REDIRECT_URI` | str | `http://localhost:8099/auth/callback` | Must match the redirect URI registered in gnexus-auth exactly | | `GNAUTH_ADMIN_ROLE_SLUG` | str | `navi_admin` | Role slug that grants admin status | | `NAVI_AUTH_ENCRYPTION_KEY` | str | `""` | **Fernet key** (base64, 32 bytes). Generate once, keep constant. See below. | | `NAVI_AUTH_COOKIE_NAME` | str | `navi_auth_session` | Cookie name | @@ -373,7 +373,7 @@ | Field | Value | |---|---| | Name | `navi` | -| Redirect URI | `https://navi.your-domain.com/auth/callback` (or `http://localhost:8000/auth/callback` for local dev) | +| Redirect URI | `https://navi.your-domain.com/auth/callback` (or `http://localhost:8099/auth/callback` for local dev) | | Scopes | `openid`, `email`, `profile`, `roles`, `permissions` | If you need both server and local development, check if gnexus-auth supports multiple redirect URIs per client. Otherwise create a separate dev client. diff --git a/docs/config.md b/docs/config.md index b83eef7..d11860c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -102,7 +102,7 @@ |---|---|---|---| | `NAVI_WEBCLIENT_ENABLED` | bool | `true` | Master switch for the web UI. `false` registers none of the web-facing routes (`/`, `/assets`, `/images`, `/content-viewers`, `/content`, `/admin` panel, `/debug*`) and skips the navi_ui MCP server — a pure API/WS server for terminal clients. The admin JSON API (`/admin/*`) stays, still gated by `require_admin`. Toggling requires a server restart. | | `NAVI_HOST` | str | `127.0.0.1` | Bind address for the `navi-server` launcher (uvicorn). `127.0.0.1` = local-only; remote clients connect via SSH tunnel or reverse proxy. | -| `NAVI_PORT` | int | `8000` | Bind port for the `navi-server` launcher. | +| `NAVI_PORT` | int | `8099` | Bind port for the `navi-server` launcher. | See [`deploy/README.md`](../deploy/README.md) for the one-command server deployment (`bash deploy/install.sh`): dockerized PostgreSQL + systemd + `navi-code` in PATH, web UI and auth off by default. @@ -133,7 +133,7 @@ | Variable | Type | Default | Description | |---|---|---|---| -| `PUBLIC_URL` | str | `http://localhost:8000` | Base URL used by `share_file` to build download links. Set this when behind a reverse proxy. | +| `PUBLIC_URL` | str | `http://localhost:8099` | Base URL used by `share_file` to build download links. Set this when behind a reverse proxy. | ## Context compression @@ -162,7 +162,7 @@ | `GNAUTH_BASE_URL` | str | `http://gnexus-auth.local` | gnexus-auth server base URL | | `GNAUTH_CLIENT_ID` | str | `""` | OAuth client ID | | `GNAUTH_CLIENT_SECRET` | str | `""` | OAuth client secret | -| `GNAUTH_REDIRECT_URI` | str | `http://localhost:8000/auth/callback` | Must match redirect URI registered in gnexus-auth | +| `GNAUTH_REDIRECT_URI` | str | `http://localhost:8099/auth/callback` | Must match redirect URI registered in gnexus-auth | | `GNAUTH_ADMIN_ROLE_SLUG` | str | `navi_admin` | Role slug that maps to Navi `admin` role | | `GNAUTH_USER_ROLE_SLUG` | str | `navi_user` | Role slug that maps to Navi `user` role | | `GNAUTH_PROFILE_PATH` | str | `/account/profile` | Path appended to `gnauth_base_url` for profile links | diff --git a/docs/eval_system.md b/docs/eval_system.md index 8a27040..d474d0f 100644 --- a/docs/eval_system.md +++ b/docs/eval_system.md @@ -11,7 +11,7 @@ Веб-интерфейс доступен по адресу: ``` -http://:8000/debug/eval +http://:8099/debug/eval ``` Требует PostgreSQL (`DATABASE_URL` в `.env`). Если база не настроена — система вернёт 503. diff --git a/docs/index.md b/docs/index.md index 7e9494c..71e30c7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,11 +12,11 @@ cp .env.example .env # set OLLAMA_HOST, NAVI_PERSONA_FILE, etc. # Run -.venv/bin/uvicorn navi.main:app --reload --reload-dir navi --port 8000 +.venv/bin/uvicorn navi.main:app --reload --reload-dir navi --port 8099 ``` -Default UI: `http://localhost:8000` -Debug panel: `http://localhost:8000/debug` +Default UI: `http://localhost:8099` +Debug panel: `http://localhost:8099/debug` ## File map diff --git a/docs/navi_code.md b/docs/navi_code.md index 431d013..227de88 100644 --- a/docs/navi_code.md +++ b/docs/navi_code.md @@ -29,7 +29,7 @@ ``` 4. Запустите сервер: ```bash - .venv/bin/uvicorn navi.main:app --reload --reload-dir navi --port 8000 + .venv/bin/uvicorn navi.main:app --reload --reload-dir navi --port 8099 ``` 5. В другом терминале запустите клиент: ```bash diff --git a/docs/navi_code_cli.md b/docs/navi_code_cli.md index b2f93fd..b203cff 100644 --- a/docs/navi_code_cli.md +++ b/docs/navi_code_cli.md @@ -24,7 +24,7 @@ navi-code ``` -Клиент подключается к `http://localhost:8000`, создаёт или восстанавливает сессию и запускает чат. +Клиент подключается к `http://localhost:8099`, создаёт или восстанавливает сессию и запускает чат. ### One-shot режим diff --git a/navi/config.py b/navi/config.py index 62c420b..1746138 100644 --- a/navi/config.py +++ b/navi/config.py @@ -77,7 +77,7 @@ # Public base URL used by share_file tool to build download links. # Change if the server is behind a reverse proxy or runs on a different port. - public_url: str = "http://localhost:8000" + public_url: str = "http://localhost:8099" # Gmail IMAP/SMTP (App Password auth) gmail_address: str = "" @@ -87,7 +87,7 @@ gnauth_base_url: str = "http://gnexus-auth.local" gnauth_client_id: str = "" gnauth_client_secret: str = "" - gnauth_redirect_uri: str = "http://localhost:8000/auth/callback" + gnauth_redirect_uri: str = "http://localhost:8099/auth/callback" gnauth_admin_role_slug: str = "navi_admin" gnauth_user_role_slug: str = "navi_user" gnauth_profile_path: str = "/account/profile" # appended to gnauth_base_url for profile links @@ -116,14 +116,16 @@ # Bind address for the navi-server launcher (navi/server.py + systemd). # 127.0.0.1 keeps the server local-only; terminals on other machines # connect through SSH tunneling or a reverse proxy. + # 8099/8098 instead of the common 8000/8001: navi runs on shared servers + # where those ports are usually taken. navi_host: str = "127.0.0.1" - navi_port: int = 8000 + navi_port: int = 8099 # Internal navi_ui MCP server — lets the agent push structured UI components # (card_grid, form) to the webclient via the render_component tool. navi_ui_mcp_enabled: bool = True navi_ui_mcp_host: str = "127.0.0.1" - navi_ui_mcp_port: int = 8001 + navi_ui_mcp_port: int = 8098 # Auth session cookie encryption (Fernet key, 32-byte base64) navi_auth_encryption_key: str = "" diff --git a/navi/mcp/ui_server/server.py b/navi/mcp/ui_server/server.py index 63960a2..c327d80 100644 --- a/navi/mcp/ui_server/server.py +++ b/navi/mcp/ui_server/server.py @@ -8,7 +8,7 @@ the rest of the turn. This server is started by ``navi.main:lifespan`` on a dedicated port -(``NAVI_UI_MCP_PORT``, default 8001) before the main container is built so +(``NAVI_UI_MCP_PORT``, default 8098) before the main container is built so that :class:`navi.mcp.McpManager` can connect to it during startup like any other MCP server. """ @@ -22,6 +22,8 @@ import structlog from mcp.server import FastMCP +from navi.config import settings + from .components import ComponentRegistry, discover_components logger = logging.getLogger(__name__) @@ -45,7 +47,7 @@ mcp = FastMCP( "navi_ui", host="127.0.0.1", - port=8001, + port=settings.navi_ui_mcp_port, streamable_http_path="/mcp", instructions=_build_instructions(_registry), ) diff --git a/navi/server.py b/navi/server.py index 591bc7b..99ff5f5 100644 --- a/navi/server.py +++ b/navi/server.py @@ -1,6 +1,6 @@ """`navi-server` — one-command launcher for the Navi API server. -Reads bind address from settings (NAVI_HOST / NAVI_PORT, default 127.0.0.1:8000) +Reads bind address from settings (NAVI_HOST / NAVI_PORT, default 127.0.0.1:8099) so a deployed unit needs no hardcoded values. Meant for systemd / interactive use; for development `uvicorn navi.main:app --reload` is still the way. """ diff --git a/tests/unit/test_deployment_flags.py b/tests/unit/test_deployment_flags.py index 37deb40..819be2a 100644 --- a/tests/unit/test_deployment_flags.py +++ b/tests/unit/test_deployment_flags.py @@ -39,7 +39,7 @@ s = Settings(database_url="postgresql://x") assert s.navi_webclient_enabled is True assert s.navi_host == "127.0.0.1" - assert s.navi_port == 8000 + assert s.navi_port == 8099 def test_webclient_enabled_default_registers_ui_routes(): diff --git a/webclient/CLAUDE.md b/webclient/CLAUDE.md index a61846e..bc196ee 100644 --- a/webclient/CLAUDE.md +++ b/webclient/CLAUDE.md @@ -2,15 +2,15 @@ ## What this repo is -A new web client for **Navi** — a personal modular AI agent system. The backend (FastAPI + Ollama) already exists and is fully operational at `http://localhost:8000`. Your job is to build the frontend that talks to it. +A new web client for **Navi** — a personal modular AI agent system. The backend (FastAPI + Ollama) already exists and is fully operational at `http://localhost:8099`. Your job is to build the frontend that talks to it. The current client (`/home/gmikcon/Projects/navi-1/client/`) is a vanilla JS placeholder. It works, but it was built as a temporary scaffold. The new client should be a proper application. ## Server The backend lives at `/home/gmikcon/Projects/navi-1/`. -Running server: `http://localhost:8000` -WebSocket: `ws://localhost:8000/ws/sessions/{session_id}` +Running server: `http://localhost:8099` +WebSocket: `ws://localhost:8099/ws/sessions/{session_id}` **Do not modify the backend.** All server docs are in `docs/`. diff --git a/webclient/src/composables/useWebSocket.js b/webclient/src/composables/useWebSocket.js index d600867..bbf9318 100644 --- a/webclient/src/composables/useWebSocket.js +++ b/webclient/src/composables/useWebSocket.js @@ -4,7 +4,7 @@ const WS_SCHEME = location.protocol === 'https:' ? 'wss' : 'ws' const WS_BASE = import.meta.env.DEV - ? `${WS_SCHEME}://${location.hostname}:8000` + ? `${WS_SCHEME}://${location.hostname}:8099` : `${WS_SCHEME}://${location.host}` const MAX_FAST_RETRIES = 3 diff --git a/webclient/src/utils/contentLinks.js b/webclient/src/utils/contentLinks.js index 29e615d..336831f 100644 --- a/webclient/src/utils/contentLinks.js +++ b/webclient/src/utils/contentLinks.js @@ -1,4 +1,4 @@ -const DEV_API_PORT = '8000' +const DEV_API_PORT = '8099' export function contentFileUrl(url) { if (!url) return '' diff --git a/webclient/vite.config.js b/webclient/vite.config.js index b5dbfd4..f9aeaa1 100644 --- a/webclient/vite.config.js +++ b/webclient/vite.config.js @@ -28,11 +28,11 @@ server: { proxy: { '/api': { - target: 'http://localhost:8000', + target: 'http://localhost:8099', rewrite: path => path.replace(/^\/api/, '') }, '/ws': { - target: 'ws://localhost:8000', + target: 'ws://localhost:8099', ws: true } }