Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
App settings: the Allow browser origins help says it does nothing in the app, that the app's API already allows pages of any site, and where cors_origins really goes; text in all 8 languages and in DETAILS (#3208)
Niko1221d8a6a0e012d4
diff --git a/apps/host/server/catalog.mjs b/apps/host/server/catalog.mjsindex 2ecfd53b9..8a326af7f 100644--- a/apps/host/server/catalog.mjs+++ b/apps/host/server/catalog.mjs@@ -103,7 +103,7 @@ export function expertParams(cores = null) {{ id: 'server.parallel', group: 'Server', label: 'Engine request slots', effect: 'This UI host dispatches one request at a time', type: 'number', value: 1, recommended: 1 },{ id: 'server.queue', group: 'Server', label: 'Queue depth', effect: 'Requests allowed to wait', type: 'number', value: 8, recommended: 8 },{ id: 'server.timeout', group: 'Server', label: 'Request timeout', effect: 'Seconds before a call is dropped', type: 'number', value: 600, recommended: 600 },- { id: 'server.cors', group: 'Server', label: 'Allow browser origins', effect: 'CORS for local web apps', type: 'toggle', value: false, recommended: false },+ { id: 'server.cors', group: 'Server', label: 'Allow browser origins', effect: 'This switch does nothing in the app. Web pages from any site can already call the API shown under Serving. To allow only some sites, or to use the engine’s own server (port 8080), add "cors_origins": ["https://your.site"] to the model’s config file.', type: 'toggle', value: false, recommended: false },// Advanced{ id: 'adv.rope', group: 'Advanced', label: 'RoPE scaling', effect: 'Extends context beyond training', type: 'number', value: 1, recommended: 1, advanced: true },diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.jsonindex e24fe16f9..1668d132d 100644--- a/apps/host/src/locales/de.json+++ b/apps/host/src/locales/de.json@@ -3343,5 +3343,6 @@"s8254": "Das hat nicht geklappt","s8255": "Keine passenden Karten.","s8256": "Im Moment nichts hier.",- "s8257": "alle {0} Min."+ "s8257": "alle {0} Min.",+ "s8258": "Dieser Schalter bewirkt in der App nichts. Webseiten beliebiger Seiten können die unter „API-Server“ gezeigte API schon aufrufen. Um nur bestimmte Seiten zuzulassen oder den eigenen Server der Engine (Port 8080) zu nutzen, tragen Sie \"cors_origins\": [\"https://ihre.seite\"] in die Konfigurationsdatei des Modells ein."}diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.jsonindex 44dc7202b..1e83adbfb 100644--- a/apps/host/src/locales/en.json+++ b/apps/host/src/locales/en.json@@ -3343,5 +3343,6 @@"s8254": "That did not work","s8255": "No matching cards.","s8256": "Nothing here right now.",- "s8257": "every {0} min"+ "s8257": "every {0} min",+ "s8258": "This switch does nothing in the app. Web pages from any site can already call the API shown under Serving. To allow only some sites, or to use the engine’s own server (port 8080), add \"cors_origins\": [\"https://your.site\"] to the model’s config file."}diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.jsonindex a61b6d859..d75b44a18 100644--- a/apps/host/src/locales/es.json+++ b/apps/host/src/locales/es.json@@ -3343,5 +3343,6 @@"s8254": "Eso no funcionó","s8255": "No hay tarjetas que coincidan.","s8256": "Nada por aquí ahora mismo.",- "s8257": "cada {0} min"+ "s8257": "cada {0} min",+ "s8258": "Este interruptor no hace nada en la app. Las páginas web de cualquier sitio ya pueden llamar a la API que se muestra en Servicio. Para permitir solo algunos sitios, o para usar el servidor propio del motor (puerto 8080), añada \"cors_origins\": [\"https://su.sitio\"] al archivo de configuración del modelo."}diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.jsonindex 2ea9e8cb5..05e03d73e 100644--- a/apps/host/src/locales/ja.json+++ b/apps/host/src/locales/ja.json@@ -3343,5 +3343,6 @@"s8254": "うまくいきませんでした","s8255": "一致するカードはありません。","s8256": "今は何もありません。",- "s8257": "{0}分ごと"+ "s8257": "{0}分ごと",+ "s8258": "このスイッチはアプリでは何もしません。どのサイトのWebページも、「配信」に表示されるAPIをすでに呼び出せます。一部のサイトだけを許可したい場合や、エンジン自身のサーバー(ポート8080)を使う場合は、モデルの設定ファイルに \"cors_origins\": [\"https://your.site\"] を追加してください。"}diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.jsonindex 5acfc7034..a031b97c2 100644--- a/apps/host/src/locales/ko.json+++ b/apps/host/src/locales/ko.json@@ -3343,5 +3343,6 @@"s8254": "실패했습니다","s8255": "일치하는 카드가 없습니다.","s8256": "지금은 아무것도 없습니다.",- "s8257": "{0}분마다"+ "s8257": "{0}분마다",+ "s8258": "이 스위치는 앱에서는 아무 일도 하지 않습니다. 어느 사이트의 웹 페이지든 ‘API 서비스’에 표시된 API를 이미 호출할 수 있습니다. 일부 사이트만 허용하거나 엔진의 자체 서버(포트 8080)를 쓰려면 모델의 설정 파일에 \"cors_origins\": [\"https://your.site\"] 를 추가하세요."}diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.jsonindex 06614f99e..b49e0476f 100644--- a/apps/host/src/locales/pt.json+++ b/apps/host/src/locales/pt.json@@ -3343,5 +3343,6 @@"s8254": "Isso não funcionou","s8255": "Nenhum cartão correspondente.","s8256": "Nada aqui por enquanto.",- "s8257": "a cada {0} min"+ "s8257": "a cada {0} min",+ "s8258": "Este botão não faz nada no app. Páginas web de qualquer site já podem chamar a API mostrada em API. Para permitir só alguns sites, ou para usar o servidor próprio do motor (porta 8080), adicione \"cors_origins\": [\"https://seu.site\"] ao arquivo de configuração do modelo."}diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.jsonindex 51bae0e13..ea74e0a1d 100644--- a/apps/host/src/locales/ru.json+++ b/apps/host/src/locales/ru.json@@ -3343,5 +3343,6 @@"s8254": "Не получилось","s8255": "Нет подходящих карточек.","s8256": "Сейчас здесь пусто.",- "s8257": "каждые {0} мин"+ "s8257": "каждые {0} мин",+ "s8258": "Этот переключатель в приложении ничего не делает. Веб-страницы любого сайта уже могут обращаться к API, который показан в «API». Чтобы разрешить только некоторые сайты или использовать собственный сервер движка (порт 8080), добавьте \"cors_origins\": [\"https://your.site\"] в файл настроек модели."}diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.jsonindex e0cf24ecb..5656ae2a0 100644--- a/apps/host/src/locales/zh.json+++ b/apps/host/src/locales/zh.json@@ -3343,5 +3343,6 @@"s8254": "操作没有成功","s8255": "没有匹配的卡片。","s8256": "目前这里没有内容。",- "s8257": "每 {0} 分钟"+ "s8257": "每 {0} 分钟",+ "s8258": "这个开关在应用中不起作用。任何网站的网页都已经可以调用“API 服务”页面显示的 API。如果只想允许部分网站,或要使用引擎自带的服务器(端口 8080),请在模型的配置文件中添加 \"cors_origins\": [\"https://your.site\"]。"}diff --git a/apps/host/tests/cors-help.test.mjs b/apps/host/tests/cors-help.test.mjsnew file mode 100644index 000000000..12c178fea--- /dev/null+++ b/apps/host/tests/cors-help.test.mjs@@ -0,0 +1,23 @@+// #3208: the "Allow browser origins" setting says in plain words that it does nothing in the app, where CORS really is, and how to limit it.+import test from 'node:test';+import assert from 'node:assert/strict';+import { readFile } from 'node:fs/promises';+import { expertParams } from '../server/catalog.mjs';++const languages = ['en', 'de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh'];++test('the CORS setting explains itself and the explanation exists in all 8 languages', async () => {+ const cors = expertParams().find(p => p.id === 'server.cors');+ assert.match(cors.effect, /does nothing in the app/);+ assert.match(cors.effect, /"cors_origins"/);+ const english = JSON.parse(await readFile(new URL('../src/locales/en.json', import.meta.url), 'utf8'));+ const id = Object.keys(english).find(key => english[key] === cors.effect);+ assert.ok(id, 'the English text is in the catalog');+ for (const language of languages) {+ const catalog = JSON.parse(await readFile(new URL(`../src/locales/${language}.json`, import.meta.url), 'utf8'));+ assert.ok(catalog[id]?.trim(), `${language} has ${id}`);+ assert.ok(catalog[id].includes('cors_origins'), `${language} keeps the config key`);+ assert.ok(catalog[id].includes('8080'), `${language} keeps the port`);+ if (language !== 'en') assert.notEqual(catalog[id], english[id], `${language} is translated`);+ }+});diff --git a/docs/DETAILS.md b/docs/DETAILS.mdindex 86859cbc4..4957a6a5f 100644--- a/docs/DETAILS.md+++ b/docs/DETAILS.md@@ -1072,6 +1072,9 @@ print(r.choices[0].message.content)- **From web apps in a browser (CORS).** Off by default. `"cors_origins": ["https://chat.example.com"]` lets pages ofthose origins call `/v1/*` from the browser (Open WebUI's direct connections, browser extensions); `["*"]` lets anypage do it - only sensible with an API key. It never opens `/settings`, `/unload` or the MCP tools.+ `cors_origins` belongs to the engine's own server (`strata serve`, `./setup.sh`, port 8080 by default). The desktop+ app answers browser pages on its own API address (the one under Serving, port 47831 or the next free one) and already allows pages of+ any site there, so its "Allow browser origins" switch in the Expert parameters does nothing.- **Host names (DNS rebinding).** A web page of another site can point its own name at `127.0.0.1` and then reachthis server as if it were its own, so without an API key the server answers only requests whose `Host` is a nameit knows (with a key the check is off: such a page cannot send the key, and tunnels and proxies that pass their