mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3208] [Other] Strata 0.2.0-beta - XCORS settings unclear #1300
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#1300
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?
Originally created by @MaKla89 on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3208
Cheers!
In previous releases (and likely still working like that in the CLI-version) I was able to add "cors-origins" to the json config and have my selfmade (okay... vibe coded) web-apps access the strata-api.
With the new app, adding this line does not help it any longer. I guess this is due to the new app using a different client-facing api server (which also comes with a different default port. 8080 is still configured in the json-file, but the app shows port 47832 as the default. I have no clue how to enable XCORS for this new server, though.
I'm running this on a Ryzen 7 9800x3D with 128GB DDR5 RAM , a GeForce 4080 and a Geforce 3060 (12GB). I'm using Strata 0.2.0-beta under linux / cachyOS
@github-actions[bot] commented on GitHub (Oct 19, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
strata --version).Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 19, 2026):
Thanks, this follows the format now.
@Niko1221 commented on GitHub (Oct 20, 2026):
The help text was misleading, sorry. In the app there is nothing to switch: the app's own API (the address under Serving, port 47831 or the next free one) already answers browser pages from any site, so your web apps can call it without a cors_origins entry. cors_origins belongs to the engine's own server (the port in your json, 8080 by default), which the app keeps internal. The "Allow browser origins" switch in the Expert parameters does nothing in the app; its help line now says that, where CORS really is, and how to limit it, in all eight languages. DETAILS.md says the same.
This is in Strata 0.2.1: https://github.com/Niko1221/Strata/releases/tag/v0.2.1
@MaKla89 commented on GitHub (Oct 21, 2026):
Hmm, I've tried it a couple of times again, but with 0.2.1 (as with 0.2.0) I can't connect my local (=same LAN but different machine) chat to strata, but if I use the "old" terminal version of strata (with manually changed port to be the same as in the app) it works.
I have given strata the task to debug my chat app, but it states that the strata app seems to be missing XCOR support.
@MaKla89 commented on GitHub (Oct 21, 2026):
Here's Strata's own assessment of the situation in my case. Minimal chatbot is hosted on my NAS. Chatbot is engaged via either the machine I'm having strata running on or by my mobile. With Strata App, nothing works, with the old strata, everything works (once "cors_origins" have been added to the config).
============================================
CORS preflight fails on
/v1/*— noAccess-Control-*headers; auth middleware interceptsOPTIONSA browser client (origin
http://<NAS-IP>:9999) calls the API on port47832with a standard cross-originfetch+Authorization: Bearer …header — the canonical OpenAI-compatible browser scenario. The browser's spec-mandated preflight fails:Probes against the server itself (2026-10-21, curl only — no client involved):
GET /v1/models+ valid key +Origin: http://<NAS-IP>:9999200 OK(correct model list)OPTIONS /v1/models(browser-style preflight, no auth — as the spec requires)401 {"error":"Invalid API key"}Two server-side issues:
Access-Control-Allow-Originon any response, for any origin.Authorizationon a preflight, so it always 401s — no client can work around this.Fix: short-circuit
OPTIONS /v1/*before auth →204withAccess-Control-Allow-Origin(echo origin or allowlist),Allow-Methods: GET, POST, OPTIONS,Allow-Headers: authorization, content-type(+Max-Age: 600); and addAllow-Originto GET/POST responses too. If CORS is opt-in via a flag, please document it — I found no setting enabling it on this build.The API itself works fine (valid key → 200 + model list); this is purely missing CORS handling.
==============================================
@MaKla89 commented on GitHub (Oct 23, 2026):
I (well... mostly Qwen, I'll be honest, sorry... :D) opened #3853 with a fix, since I could reproduce this on my own machine and the
cause turned out to be something specific.
The app has two listeners, and only one of them handled CORS. The address under Serving (port 47831) is started on loopback only by the desktop shell, so a second device can never reach it — the address a second device has to use is the shared one (47832), and that listener sent no CORS headers at all. It passed OPTIONS straight into the same handler that checks the API key first, and a browser never sends a key on a preflight, so every preflight came back 401. That is exactly the table I posted above, and it is why the Terminal version worked for me and the app did not.
The fix answers the preflight on the shared listener and puts the headers on every answer, in the same shape the engine's own server already uses. One thing worth a maintainer's eye: it only does this when an API key is set. Without a key the listener behaves exactly as before, because a keyless share is documented as reaching devices on my network, and a web page can point its own name at a LAN address — unconditional
*there would quietly widen that. With a key the key is the gate and*is safe.What I checked: the probes from my comment, run against a real host with sharing on, at v0.2.3.1 and at the fix commit — 401 with no headers before, 204 with them after, and the 200 now carries
Access-Control-Allow-Origin.npm testinapps/hostpasses apart from one pre-existing failure (timeskip-real.test.mjs, which fails the same way at v0.2.3.1 and does not touch this code).What I have not checked: a real model loaded on a GPU, and a real browser on a second device. I'll run both against the branch and report back here.
@Niko1221 commented on GitHub (Oct 24, 2026):
This is fixed in Strata 0.2.1. Please update to the latest release (in the Terminal:
strata update; in the app: download the newest installer from the releases page). If it still happens on the latest version, reply here and we will reopen it. Thank you for the report.@MaKla89 commented on GitHub (Oct 24, 2026):
Thanks for your reply, but I've always run updated version and in my PR and its Tests I've been testing against at least 0.2.3.0 as the baseline with no success
@octal-ip commented on GitHub (Oct 25, 2026):
+1 for this issue, the latest version is still not returning the expected Access-Control headers, breaking CORS.