@goodandready/dsh-ollama-cloud-provider 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +5 -5
- package/README.ru.md +4 -4
- package/README.zh.md +4 -4
- package/lib/index.js +11 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.6 — 2026-10-22
|
|
4
|
+
|
|
5
|
+
- Accept the DSH Desktop renderer origin `dsh-app://app` on write routes after
|
|
6
|
+
the loopback Host and socket checks. Without this explicit exception the
|
|
7
|
+
same-origin guard in 0.1.5 rejected every Desktop settings write (#28).
|
|
8
|
+
|
|
3
9
|
## 0.1.5 — 2026-10-22
|
|
4
10
|
|
|
5
11
|
- Write routes now require an `Origin` or `Referer` whose host matches `Host`;
|
package/README.md
CHANGED
|
@@ -103,17 +103,17 @@ npm pack
|
|
|
103
103
|
Install the published package:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
106
|
+
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
107
107
|
# DSH Desktop:
|
|
108
|
-
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
108
|
+
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Or install the packed tarball into a profile:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
114
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
115
115
|
# DSH Desktop:
|
|
116
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
116
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Restart dsh (or DSH Desktop), then pick **Ollama Cloud** in the model picker.
|
|
@@ -194,7 +194,7 @@ Open **Settings → Ollama Cloud**:
|
|
|
194
194
|
- **Sidebar** — show or hide the quota card, and an optional plan label (for example `PRO`) shown next to the provider name.
|
|
195
195
|
- **Plugin update** — current/latest version and **Update now**.
|
|
196
196
|
|
|
197
|
-
The Host serves `/dsh-ollama/state`, `/health`, `/analytics`, `/usage`, `/balance`, `/config`, `/key`, `/key/clear`, `/refresh`, `/models/refresh`, `/test` and `/update`. Writes require JSON, an `Origin` or `Referer` matching `Host
|
|
197
|
+
The Host serves `/dsh-ollama/state`, `/health`, `/analytics`, `/usage`, `/balance`, `/config`, `/key`, `/key/clear`, `/refresh`, `/models/refresh`, `/test` and `/update`. Writes require JSON, an `Origin` or `Referer` matching `Host` (the Desktop renderer's `dsh-app://app` origin is accepted after loopback checks), and are restricted to loopback (`127.0.0.1` / `::1`); a write without either source header is rejected with 403.
|
|
198
198
|
|
|
199
199
|
## Command
|
|
200
200
|
|
package/README.ru.md
CHANGED
|
@@ -103,17 +103,17 @@ npm pack
|
|
|
103
103
|
Установка опубликованного пакета из npm:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
106
|
+
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
107
107
|
# DSH Desktop:
|
|
108
|
-
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
108
|
+
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Либо установка из упакованного tarball:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
114
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
115
115
|
# DSH Desktop:
|
|
116
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
116
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
После установки перезапустите dsh (или DSH Desktop) и выберите **Ollama Cloud** в списке моделей.
|
package/README.zh.md
CHANGED
|
@@ -102,17 +102,17 @@ npm pack
|
|
|
102
102
|
从 npm 安装已发布版本:
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
105
|
+
dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
106
106
|
# DSH 桌面端:
|
|
107
|
-
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.
|
|
107
|
+
dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.6
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
或通过打包文件安装:
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
113
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
114
114
|
# DSH 桌面端:
|
|
115
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.
|
|
115
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.6.tgz
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
安装完成后重启 dsh 或 DSH 桌面端,在模型列表中选择 **Ollama Cloud** 即可。
|
package/lib/index.js
CHANGED
|
@@ -51,7 +51,7 @@ const DEFAULT_API_BASE = "https://ollama.com";
|
|
|
51
51
|
const DEFAULT_OPENAI_BASE = "https://ollama.com/v1";
|
|
52
52
|
const DEFAULT_USAGE_URL = "https://ollama.com/api/usage";
|
|
53
53
|
const DEFAULT_BALANCE_URL = "https://ollama.com/api/balance";
|
|
54
|
-
const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.
|
|
54
|
+
const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.6";
|
|
55
55
|
const DEFAULT_CONTEXT_WINDOW = 131072;
|
|
56
56
|
const DEFAULT_MAX_TOKENS = 32768;
|
|
57
57
|
const DEFAULT_GENERATE_MAX_TOKENS = 131072;
|
|
@@ -3668,6 +3668,12 @@ function sourceHost(value) {
|
|
|
3668
3668
|
}
|
|
3669
3669
|
}
|
|
3670
3670
|
/**
|
|
3671
|
+
* The Desktop renderer runs on `dsh-app://app`; its relative fetch reaches the
|
|
3672
|
+
* loopback host with that Origin. The request must still pass the loopback
|
|
3673
|
+
* Host check below and the loopback socket check in `requirePost`.
|
|
3674
|
+
*/
|
|
3675
|
+
const DESKTOP_ORIGIN = "dsh-app://app";
|
|
3676
|
+
/**
|
|
3671
3677
|
* Write routes must prove a same-origin browser context. A LAN bridge that
|
|
3672
3678
|
* rewrites Host and socket to loopback would otherwise let any non-browser
|
|
3673
3679
|
* client write keys and settings without an Origin. Fail closed when neither
|
|
@@ -3677,7 +3683,10 @@ function writeSourceError(req) {
|
|
|
3677
3683
|
const host = req.headers.host;
|
|
3678
3684
|
if (host === void 0 || host === "") return "request host required";
|
|
3679
3685
|
const origin = req.headers.origin;
|
|
3680
|
-
if (origin !== void 0 && origin !== "")
|
|
3686
|
+
if (origin !== void 0 && origin !== "") {
|
|
3687
|
+
if (origin === DESKTOP_ORIGIN) return void 0;
|
|
3688
|
+
return sourceHost(origin) === host ? void 0 : "cross-origin request refused";
|
|
3689
|
+
}
|
|
3681
3690
|
const referer = req.headers.referer;
|
|
3682
3691
|
if (referer === void 0 || referer === "") return "request origin required";
|
|
3683
3692
|
return sourceHost(referer) === host ? void 0 : "cross-origin request refused";
|