mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4582] [GUI] add --lan (STRATA_LAN=1) to the Linux AppImage so the model is on your network as Strata starts #5100
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
a6261a4desktop (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.1only, 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:
and the terminal prints the address to type into the other device, taken from what the host answered:
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_HOMEit printed the address and the warning). Everything else is unchanged: without--lannothing is shared, Strata's own page and its controls still listen on127.0.0.1, and the share is the second, inference-only listener that answers only/v1/models,/v1/chat/completionsand/v1/messages— no host API, no UI.Approach
I reused the share the app already has instead of adding a second serving path:
apps/desktop/src-tauri/src/supervisor.rs, which is Linux-only code, behind#[cfg(target_os = "linux")]):--lanandSTRATA_LAN=1setOptions.lan, the host is started withSTRATA_SHARE_ON_START=1, and--helpnames the option and says the pages stay on this computer. Starting again while Strata already runs does not start a second copy:--lanthen asks that host for the share through the same/api/serving/sharecall the page makes, and prints the address.apps/host/server/local-share.mjs,index.mjs): onSTRATA_SHARE_ON_START=1it 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.Docs:
docs/INSTALL.md,docs/SAFETY.md,docs/DETAILS.mdand the Linux tester README (apps/desktop/tester/README-linux.txt.in). One thing to look at in review:docs/SAFETY.mdsaid 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_WARNINGinapps/host/server/local-share.mjs, the owner decision for 0.2.2, andtests/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/modelsanswers,/api/servingdoes not).node --test tests/cors-share.test.mjs tests/keyless-share.test.mjs→ 6 passed: the existing share behaviour unchanged.node scripts/test.mjsinapps/host→ 1230 tests, 1123 passed, 2 failed (the two pre-existing failures below; the same two fail atupstream/main, which ran 1225 tests / 1118 passed).python3 -m unittest tests.desktop.test_tester_readme→ 3 passed, 1 failed (pre-existing, below).STRATA_PORT=47999 STRATA_BIND=127.0.0.1 STRATA_SHARE_ON_START=1 node server/index.mjsprinted[strata] sharing the model on your network at http://192.168.178.50:48000/v1and nothing else about the share; the same withSTRATA_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 withoutSTRATA_SHARE_ON_STARTprinted no share line, so the default path says nothing new. The engine in those runs was Strata's simulated one (STRATA_REAL_ENGINEnot 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, at46c152a1); nothing here comes from this change:desktoplog::tests::a_failed_start_is_explained_in_plain_words_and_written_to_a_crash_fileasserts the string0.2.0, whileapps/desktop/src-tauri/Cargo.tomlsays0.2.7.tests/desktop/test_tester_readme.py::test_every_hash_and_size_in_the_readme_comes_from_the_fileassertsStrata 0.2.3for the same reason.apps/host:packaged: an update job an OLDER host left running is finished …andtests/timeskip-real.test.mjs: "Stop ends the job and everything it started …".Not run, and what that leaves unverified:
Limits
--lanturns 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).Settings > Serving > Set keyis the fix.STRATA_SHARE_PORT,PORT + 1by 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/#3366are 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.