@goodandready/dsh-ollama-cloud-provider 0.1.5 → 0.1.7
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 +12 -0
- package/README.md +5 -5
- package/README.ru.md +4 -4
- package/README.zh.md +4 -4
- package/lib/index.js +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.7 — 2026-10-22
|
|
4
|
+
|
|
5
|
+
- Identify the Desktop renderer by the signed host auth cookie plus the desktop
|
|
6
|
+
user agent when Origin and Referer are absent (the dsh-app protocol strips
|
|
7
|
+
both). Plain LAN clients without either still receive 403 (#28).
|
|
8
|
+
|
|
9
|
+
## 0.1.6 — 2026-10-22
|
|
10
|
+
|
|
11
|
+
- Accept the DSH Desktop renderer origin `dsh-app://app` on write routes after
|
|
12
|
+
the loopback Host and socket checks. Without this explicit exception the
|
|
13
|
+
same-origin guard in 0.1.5 rejected every Desktop settings write (#28).
|
|
14
|
+
|
|
3
15
|
## 0.1.5 — 2026-10-22
|
|
4
16
|
|
|
5
17
|
- 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.7
|
|
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.7
|
|
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.7.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.7.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 is identified by its `dsh-auth-*` cookie and desktop user agent when both headers are absent), and are restricted to loopback (`127.0.0.1` / `::1`); a write without any source identity 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.7
|
|
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.7
|
|
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.7.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.7.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.7
|
|
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.7
|
|
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.7.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.7.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.7";
|
|
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,16 @@ function sourceHost(value) {
|
|
|
3668
3668
|
}
|
|
3669
3669
|
}
|
|
3670
3670
|
/**
|
|
3671
|
+
* The Desktop renderer runs on `dsh-app://app`. Its host fetch has no Origin
|
|
3672
|
+
* or Referer, but it carries the signed host auth cookie and the desktop user
|
|
3673
|
+
* agent. Require both so a plain LAN client without either stays fail-closed.
|
|
3674
|
+
*/
|
|
3675
|
+
function desktopShellRequest(req) {
|
|
3676
|
+
const agent = req.headers["user-agent"] ?? "";
|
|
3677
|
+
const cookie = req.headers.cookie ?? "";
|
|
3678
|
+
return agent.includes("@deepseek-ai/dsh-desktop/") && cookie.includes("dsh-auth-");
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3671
3681
|
* Write routes must prove a same-origin browser context. A LAN bridge that
|
|
3672
3682
|
* rewrites Host and socket to loopback would otherwise let any non-browser
|
|
3673
3683
|
* client write keys and settings without an Origin. Fail closed when neither
|
|
@@ -3678,6 +3688,7 @@ function writeSourceError(req) {
|
|
|
3678
3688
|
if (host === void 0 || host === "") return "request host required";
|
|
3679
3689
|
const origin = req.headers.origin;
|
|
3680
3690
|
if (origin !== void 0 && origin !== "") return sourceHost(origin) === host ? void 0 : "cross-origin request refused";
|
|
3691
|
+
if (desktopShellRequest(req)) return void 0;
|
|
3681
3692
|
const referer = req.headers.referer;
|
|
3682
3693
|
if (referer === void 0 || referer === "") return "request origin required";
|
|
3683
3694
|
return sourceHost(referer) === host ? void 0 : "cross-origin request refused";
|