Commit Graph

21 Commits

Author SHA1 Message Date
Kelorastus df2f30af17 fix 2026-09-30 11:24:46 +02:00
Kelorastus d780c12b71 fix 2026-09-30 11:15:30 +02:00
Kelorastus ffbb8fc9a5 fix 2026-09-30 10:53:46 +02:00
JIMMY_JFEXP 58ebd1dded Say it when a live launch has no DHP sign-in on this PC
The dev drive on another PC still showed no live aircraft after ce36cf0. Its
API log, on the drive: "now LIVE on the DHP (the DHP answered, but this PC has
no DHP sign-in yet)". The operator in launcher.json travels with the drive; the
DHP sign-in lives in that PC's Credential Manager and does not. So the launcher
launched as the drive's operator, wrote an empty upstream.token, and the API
and the tile server served the drive's own data - with nothing in the launcher's
window to say why.

run_stack now logs, when live mode has no token: no DHP sign-in on this PC, what
that costs (no live aircraft, no site tiles), and to stop ODIAN and sign in,
per PC.
2026-09-29 16:05:00 +02:00
Kelorastus cf8f0d28a6 Merge branch 'main' of http://192.168.1.41:30061/admin/ODIAN_Launcher 2026-09-29 15:54:30 +02:00
Kelorastus 0252f95e35 fixed Dev mode 2026-09-29 15:54:26 +02:00
JIMMY_JFEXP 8b69e445b5 Merge remote-tracking branch 'origin/main' 2026-09-29 15:29:46 +02:00
JIMMY_JFEXP ce36cf0f37 Live mode on a PC that started offline: re-probe at launch, remember the Engine API
The dev drive, plugged into another PC that was offline and then connected,
ran two sessions with no live aircraft. Its API log, on the drive, says why:
"upstream: live mode off (ODIAN_UPSTREAM_URL is unset)" - both times.

Root cause: live mode is decided when the stack starts (StackConfig::
upstream_url = Inner::engine_url), and engine_url was only ever learned from a
site probe and held in MEMORY. A launcher opened offline has none, and it probes
again only on window focus (30 s debounce) or the refresh button - so a Launch
pressed after connecting still used the offline answer, the API got no
ODIAN_UPSTREAM_URL, and live_loop (which would have synced the offline edits and
switched the API to the DHP when the network came) never started.

- launch() re-probes the site first when the launcher thinks it is offline (one
  probe, 2 s at most on a PC that really is). It is also the update check a
  launch from a stale "offline" skipped.
- The Engine API address is kept in launcher.json (LauncherState::engine, keyed
  by site like tile_sync) and loaded at start, so a session started offline
  still arms live mode and goes live by itself once the network is back - the
  path live_loop already handles. Changing the DHP address in Settings drops it.

Spot-check: state::tests - per-site, unchanged-is-no-write, survives save/load,
and a launcher.json from before the field still loads.
2026-09-29 15:29:09 +02:00
Kelorastus afbb597044 fix 2026-09-29 14:57:33 +02:00
JIMMY_JFEXP b46b81ac12 Dev: install Node.js with winget when a web run finds none
A dev web launch on a PC without Node.js - a fresh one, or another PC the dev
drive was plugged into - failed with nothing but "stopped while starting (exit
code: 1)": `cmd /c npm run dev` had no npm to run, so nothing said why.

New nodejs.rs finds the folder holding node.exe AND npm.cmd - this process's
PATH first, then %ProgramFiles%\nodejs, where the installer puts it (an
install adds itself to the SYSTEM PATH, which the running launcher never sees).
Launcher::ensure_node runs before a web run's build/start: with no Node.js it
logs why and runs `winget install --id OpenJS.NodeJS.LTS --exact --source
winget --accept-*-agreements` in its own console (progress, Windows' permission
prompt and any failure stay on screen), then judges by what is on disk - not
by winget's exit code, which is non-zero for "already installed" too. No Node
afterwards stops the launch with the manual step spelled out.

`npm run dev` (web_command) and `npm install` (install_web) now get that folder
first on their PATH, so the launch goes on straight after the install without
restarting the launcher. start_web keeps a guard with a real message.

Spot-check: `winget show --id OpenJS.NodeJS.LTS --exact --source winget` names
the nodejs.org x64 MSI; nodejs::tests cover PATH-first, the fresh-install
folder, npm-without-node, and the argument list.
2026-09-29 14:48:28 +02:00
JIMMY_JFEXP 2d79664dc7 Dev: route the web's map through this stack's tile server; power grid offline
Two reasons an offline dev run's web client had no map:

1. Vite proxied every tile to the public tile host. web_command now sets
   ODIAN_TILE_SERVER_URL=http://127.0.0.1:18081 for the Vite it starts, and
   ODIAN_Engine's _WEB/vite.config.ts sends /basemap, /mvt and /netlayer there:
   the site while it answers, this PC's installed tiles when it does not - the
   same path the .exe already draws from.

2. The power-grid netlayer had no source offline. datasets.json named every
   PostGIS overlay but `powerv2_postgis`, so the tile server answered
   /netlayer/<ds>/powerv2/* with 404 "powerv2_render_sqlite not found" while
   postgis_power_entities / _links / _topology sat in the local snapshot. Added
   to POSTGIS_SOURCES; the tile server resolves it through the same
   ODIAN_TILE_POSTGIS_DSN as the others.

Spot-check: with the site unreachable, /netlayer/<ds>/powerv2/bbox/8/128/86/131/89.json
answers 200 (721064 B, the same body the site serves) and topology.bin 200.
2026-09-29 14:00:28 +02:00
JIMMY_JFEXP d90dda1df5 Dev: keep Vite off the workspace's target/ so tauri dev starts
`npm run tauri dev` died before the window opened: Vite's watcher crashed
with EBUSY on target\debug\deps\odian_launcher_lib.dll. Root cause: the Cargo
workspace builds into target/ at the repo root, not under src-tauri/, and
vite.config.ts only excluded src-tauri - so Vite watched the DLLs the Rust
build holds locked.

Spot-check: a fresh clone, `npm install`, `npm run tauri dev` opens the
launcher window instead of "beforeDevCommand terminated".
2026-09-29 12:14:30 +02:00
JIMMY_JFEXP 425acebe0d Dev mode: sign the web client in so live mode reaches it
A dev run's web client showed no live tracks while the .exe beside it did.
Root cause: the local API relays a request to the DHP only when it carries a
token that API minted itself (main.cpp's forwarder, the guard that keeps it
from being an open proxy). The .exe mints one with ODIAN_MINT_SECRET; the web
client was opened with ?user= only, so every /session/* call it made was
served from this PC's database.

The launcher now mints a token from this stack's API for the run's operator
(stack::mint_web_token) and opens the browser with it in the URL FRAGMENT
(StackConfig::web_url_signed). A fragment never reaches a request line or a
server log, and the launcher's own log still prints the tokenless address.
If the mint fails the web opens as before and the log says it shows this PC's
data only. Needs ODIAN_Engine's _WEB/src/auth.ts to read #token=.

Spot-check: launch dev mode with the web target while online; the API log
reads "now LIVE on the DHP" and the browser shows live tracks.
2026-09-29 12:11:38 +02:00
Kelorastus 80dd1e7c7d update 2026-09-29 10:29:52 +02:00
Kelorastus 73a8f2c30c updtae 2026-09-28 11:19:02 +02:00
Kelorastus 21d6e6bffb update 2026-09-25 10:14:44 +02:00
Kelorastus 4d620fc5ad update 2026-09-23 16:05:19 +02:00
Kelorastus 4a92cc0b63 update 2026-09-22 13:37:29 +02:00
Kelorastus d5da361952 V1 of laucher 2026-09-18 14:42:28 +02:00
Kelorastus 3fdfde7043 M4 2026-09-16 11:42:24 +02:00
Kelorastus b7f3061be3 ODIAN Launcher: hub, installer, local stack and remembered sign-in (M2)
- Tauri 2 + Svelte 5 hub in ODIAN dark: patch notes and roadmap, install and
  update progress, local stack status, settings with DHP and MCP addresses.
- crates/odian-packs: Rust installer for pack format v1 (signed manifests,
  resumable verified downloads from a DHP or an ODIAN drive), byte-compatible
  with ODIAN_MCP_Server's Python odian_packs.
- Local stack on 127.0.0.1: Postgres -> Engine API -> tile server -> Odian.exe,
  one Job Object, clean shutdown; database snapshot restore on a fresh PC only.
- Keycloak sign-in through the DHP's MCP, remembered until Sign out with a
  launcher session that renews the Engine token silently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 15:23:17 +02:00