[PR #4582] [GUI] add --lan (STRATA_LAN=1) to the Linux AppImage so the model is on your network as Strata starts #5100

Open
opened 2026-11-07 16:32:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4582
Author: @o-leary
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: gui/appimage-lan


📝 Commits (1)

  • a6261a4 desktop (Linux): --lan (STRATA_LAN=1) shares the model on your network as Strata starts

📊 Changes

10 files changed (+205 additions, -26 deletions)

View changed files

📝 apps/desktop/src-tauri/src/main.rs (+1 -1)
📝 apps/desktop/src-tauri/src/supervisor.rs (+101 -16)
📝 apps/desktop/tester/README-linux.txt.in (+5 -0)
📝 apps/host/server/index.mjs (+13 -1)
📝 apps/host/server/local-share.mjs (+16 -0)
➕ apps/host/tests/share-on-start.test.mjs (+48 -0)
📝 docs/DETAILS.md (+5 -0)
📝 docs/INSTALL.md (+4 -1)
📝 docs/SAFETY.md (+11 -6)
📝 tests/desktop/test_tester_readme.py (+1 -1)

📄 Description

Problem and result

On Linux, the AppImage served on 127.0.0.1 only, and a person who wants their model from another device (a phone, another PC) had to start Strata, open the page, and press Settings > Serving > Local sharing before anything was reachable. There was no way to say "share it from the start" when launching.

This adds that switch:

./Strata-0.2.7-linux-x86_64.AppImage --lan          (also: STRATA_LAN=1 ./Strata-...AppImage)

and the terminal prints the address to type into the other device, taken from what the host answered:

[strata] sharing the model on your network at http://192.168.178.50:48000/v1
[strata] No API key is set, so any device on this network can use your model. Create an API key to protect it.

The second line only appears when no key is set (verified below: with a key the run printed the address line alone, and with an empty STRATA_HOME it printed the address and the warning). Everything else is unchanged: without --lan nothing is shared, Strata's own page and its controls still listen on 127.0.0.1, and the share is the second, inference-only listener that answers only /v1/models, /v1/chat/completions and /v1/messages — no host API, no UI.

Approach

I reused the share the app already has instead of adding a second serving path:

  • The shell (apps/desktop/src-tauri/src/supervisor.rs, which is Linux-only code, behind #[cfg(target_os = "linux")]): --lan and STRATA_LAN=1 set Options.lan, the host is started with STRATA_SHARE_ON_START=1, and --help names the option and says the pages stay on this computer. Starting again while Strata already runs does not start a second copy: --lan then asks that host for the share through the same /api/serving/share call the page makes, and prints the address.
  • The host (apps/host/server/local-share.mjs, index.mjs): on STRATA_SHARE_ON_START=1 it brings that listener up with Strata, before any page is open, and prints the line above. The words accepted (1, on, true, yes, lan) are the shell's, so a person can set the variable directly. A share that cannot take its port leaves Strata serving this computer only, with a one-line explanation — it does not stop the app.
  • Windows and macOS get no command-line option: they have the page. I say so in the docs.

Docs: docs/INSTALL.md, docs/SAFETY.md, docs/DETAILS.md and the Linux tester README (apps/desktop/tester/README-linux.txt.in). One thing to look at in review: docs/SAFETY.md said the share "will not start without an API key", which is not what the code does (a keyless share is allowed and warns — NO_KEY_WARNING in apps/host/server/local-share.mjs, the owner decision for 0.2.2, and tests/keyless-share.test.mjs). I reworded it to match the code and the new option. Say so if you would rather keep the old wording and split that out.

Validation

Revision 7cff667f, Arch Linux x86_64 (kernel 7.2.11-arch1-1), node v26.12.1, cargo 1.99.0, NVIDIA RTX 4070.

Passed:

  • cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml → 28 passed, 1 failed (pre-existing, below). The supervisor tests cover the switch from the command line and the environment, and the line printed from the host's answer (with a key, without one, and with no address in the answer).
  • node --test apps/host/tests/share-on-start.test.mjs → 5 passed, 0 failed (new file: nothing shared unless the switch is on, the words it accepts, the printed line, and that the listener that comes up is the inference-only one — /v1/models answers, /api/serving does not).
  • node --test tests/cors-share.test.mjs tests/keyless-share.test.mjs → 6 passed: the existing share behaviour unchanged.
  • node scripts/test.mjs in apps/host → 1230 tests, 1123 passed, 2 failed (the two pre-existing failures below; the same two fail at upstream/main, which ran 1225 tests / 1118 passed).
  • python3 -m unittest tests.desktop.test_tester_readme → 3 passed, 1 failed (pre-existing, below).
  • Ran the host for real, two ways: STRATA_PORT=47999 STRATA_BIND=127.0.0.1 STRATA_SHARE_ON_START=1 node server/index.mjs printed [strata] sharing the model on your network at http://192.168.178.50:48000/v1 and nothing else about the share; the same with STRATA_HOME=/tmp/strata-home-lan (so no key) printed that line plus [strata] No API key is set, so any device on this network can use your model. Create an API key to protect it.; and the same without STRATA_SHARE_ON_START printed no share line, so the default path says nothing new. The engine in those runs was Strata's simulated one (STRATA_REAL_ENGINE not set), so it checked the listener and the printed words, not a real inference through it.

Failed, and pre-existing (I checked by running the same commands after git checkout upstream/main, at 46c152a1); nothing here comes from this change:

  • desktoplog::tests::a_failed_start_is_explained_in_plain_words_and_written_to_a_crash_file asserts the string 0.2.0, while apps/desktop/src-tauri/Cargo.toml says 0.2.7.
  • tests/desktop/test_tester_readme.py::test_every_hash_and_size_in_the_readme_comes_from_the_file asserts Strata 0.2.3 for the same reason.
  • apps/host: packaged: an update job an OLDER host left running is finished … and tests/timeskip-real.test.mjs: "Stop ends the job and everything it started …".

Not run, and what that leaves unverified:

  • No Windows or macOS build; the Rust part is Linux-only code and the shared Node host tests ran on Linux.
  • No C++/engine file is touched, so no CUDA/HIP/SYCL build was needed.

Limits

  • --lan turns the share on for that start only: it is not remembered, and starting Strata again without it leaves the share off. Turning it off mid-run is still the page (Local sharing → Stop sharing).
  • It makes no API key. Without one any device on the network can use the model, and the warning says that; Settings > Serving > Set key is the fix.
  • It is the app's existing share on its own port (STRATA_SHARE_PORT, PORT + 1 by default), not the Terminal's --access lan, and it opens no tunnel.

No earlier issue for this: I searched the open and closed PRs and issues first, and #3198 / #3366 are about serving to a LAN without a key at all (the bind policy), not about the app's existing share coming up at start. If you want a scope issue before an option like this, I'll open one and link it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4582 **Author:** [@o-leary](https://github.com/o-leary) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `gui/appimage-lan` --- ### 📝 Commits (1) - [`a6261a4`](https://github.com/Niko1221/Strata/commit/a6261a4784fbf38e0f8033535f6b0dfc97c6ec31) desktop (Linux): --lan (STRATA_LAN=1) shares the model on your network as Strata starts ### 📊 Changes **10 files changed** (+205 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `apps/desktop/src-tauri/src/main.rs` (+1 -1) 📝 `apps/desktop/src-tauri/src/supervisor.rs` (+101 -16) 📝 `apps/desktop/tester/README-linux.txt.in` (+5 -0) 📝 `apps/host/server/index.mjs` (+13 -1) 📝 `apps/host/server/local-share.mjs` (+16 -0) ➕ `apps/host/tests/share-on-start.test.mjs` (+48 -0) 📝 `docs/DETAILS.md` (+5 -0) 📝 `docs/INSTALL.md` (+4 -1) 📝 `docs/SAFETY.md` (+11 -6) 📝 `tests/desktop/test_tester_readme.py` (+1 -1) </details> ### 📄 Description ### Problem and result On Linux, the AppImage served on `127.0.0.1` only, and a person who wants their model from another device (a phone, another PC) had to start Strata, open the page, and press **Settings > Serving > Local sharing** before anything was reachable. There was no way to say "share it from the start" when launching. This adds that switch: ``` ./Strata-0.2.7-linux-x86_64.AppImage --lan (also: STRATA_LAN=1 ./Strata-...AppImage) ``` and the terminal prints the address to type into the other device, taken from what the host answered: ``` [strata] sharing the model on your network at http://192.168.178.50:48000/v1 [strata] No API key is set, so any device on this network can use your model. Create an API key to protect it. ``` The second line only appears when no key is set (verified below: with a key the run printed the address line alone, and with an empty `STRATA_HOME` it printed the address and the warning). Everything else is unchanged: without `--lan` nothing is shared, Strata's own page and its controls still listen on `127.0.0.1`, and the share is the second, inference-only listener that answers only `/v1/models`, `/v1/chat/completions` and `/v1/messages` — no host API, no UI. ### Approach I reused the share the app already has instead of adding a second serving path: - **The shell** (`apps/desktop/src-tauri/src/supervisor.rs`, which is Linux-only code, behind `#[cfg(target_os = "linux")]`): `--lan` and `STRATA_LAN=1` set `Options.lan`, the host is started with `STRATA_SHARE_ON_START=1`, and `--help` names the option and says the pages stay on this computer. Starting again while Strata already runs does not start a second copy: `--lan` then asks that host for the share through the same `/api/serving/share` call the page makes, and prints the address. - **The host** (`apps/host/server/local-share.mjs`, `index.mjs`): on `STRATA_SHARE_ON_START=1` it brings that listener up with Strata, before any page is open, and prints the line above. The words accepted (`1`, `on`, `true`, `yes`, `lan`) are the shell's, so a person can set the variable directly. A share that cannot take its port leaves Strata serving this computer only, with a one-line explanation — it does not stop the app. - Windows and macOS get no command-line option: they have the page. I say so in the docs. Docs: `docs/INSTALL.md`, `docs/SAFETY.md`, `docs/DETAILS.md` and the Linux tester README (`apps/desktop/tester/README-linux.txt.in`). One thing to look at in review: `docs/SAFETY.md` said the share "will not start without an API key", which is not what the code does (a keyless share is allowed and warns — `NO_KEY_WARNING` in `apps/host/server/local-share.mjs`, the owner decision for 0.2.2, and `tests/keyless-share.test.mjs`). I reworded it to match the code and the new option. Say so if you would rather keep the old wording and split that out. ### Validation Revision `7cff667f`, Arch Linux x86_64 (kernel 7.2.11-arch1-1), node v26.12.1, cargo 1.99.0, NVIDIA RTX 4070. Passed: - `cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml` → 28 passed, 1 failed (pre-existing, below). The supervisor tests cover the switch from the command line and the environment, and the line printed from the host's answer (with a key, without one, and with no address in the answer). - `node --test apps/host/tests/share-on-start.test.mjs` → 5 passed, 0 failed (new file: nothing shared unless the switch is on, the words it accepts, the printed line, and that the listener that comes up is the inference-only one — `/v1/models` answers, `/api/serving` does not). - `node --test tests/cors-share.test.mjs tests/keyless-share.test.mjs` → 6 passed: the existing share behaviour unchanged. - `node scripts/test.mjs` in `apps/host` → 1230 tests, 1123 passed, 2 failed (the two pre-existing failures below; the same two fail at `upstream/main`, which ran 1225 tests / 1118 passed). - `python3 -m unittest tests.desktop.test_tester_readme` → 3 passed, 1 failed (pre-existing, below). - Ran the host for real, two ways: `STRATA_PORT=47999 STRATA_BIND=127.0.0.1 STRATA_SHARE_ON_START=1 node server/index.mjs` printed `[strata] sharing the model on your network at http://192.168.178.50:48000/v1` and nothing else about the share; the same with `STRATA_HOME=/tmp/strata-home-lan` (so no key) printed that line plus `[strata] No API key is set, so any device on this network can use your model. Create an API key to protect it.`; and the same without `STRATA_SHARE_ON_START` printed no share line, so the default path says nothing new. The engine in those runs was Strata's simulated one (`STRATA_REAL_ENGINE` not set), so it checked the listener and the printed words, not a real inference through it. Failed, and pre-existing (I checked by running the same commands after `git checkout upstream/main`, at `46c152a1`); nothing here comes from this change: - `desktoplog::tests::a_failed_start_is_explained_in_plain_words_and_written_to_a_crash_file` asserts the string `0.2.0`, while `apps/desktop/src-tauri/Cargo.toml` says `0.2.7`. - `tests/desktop/test_tester_readme.py::test_every_hash_and_size_in_the_readme_comes_from_the_file` asserts `Strata 0.2.3` for the same reason. - `apps/host`: `packaged: an update job an OLDER host left running is finished …` and `tests/timeskip-real.test.mjs: "Stop ends the job and everything it started …"`. Not run, and what that leaves unverified: - No Windows or macOS build; the Rust part is Linux-only code and the shared Node host tests ran on Linux. - No C++/engine file is touched, so no CUDA/HIP/SYCL build was needed. ### Limits - `--lan` turns the share on for that start only: it is not remembered, and starting Strata again without it leaves the share off. Turning it off mid-run is still the page (**Local sharing** → Stop sharing). - It makes no API key. Without one any device on the network can use the model, and the warning says that; `Settings > Serving > Set key` is the fix. - It is the app's existing share on its own port (`STRATA_SHARE_PORT`, `PORT + 1` by default), not the Terminal's `--access lan`, and it opens no tunnel. No earlier issue for this: I searched the open and closed PRs and issues first, and `#3198` / `#3366` are about serving to a LAN without a key at all (the bind policy), not about the app's existing share coming up at start. If you want a scope issue before an option like this, I'll open one and link it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5100
No description provided.