dsh-remote-plugin 0.8.8 → 0.9.0
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/README.en.md +16 -5
- package/README.md +15 -4
- package/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +527 -78
- package/index.mjs +1 -0
- package/package.json +8 -3
- package/public/activity.js +53 -4
- package/public/admin.html +34 -33
- package/public/admin.js +10 -2
- package/public/app.js +1204 -174
- package/public/bc-integration.css +81 -0
- package/public/build.json +2 -2
- package/public/composer-tools.css +184 -0
- package/public/composer-tools.js +888 -0
- package/public/desktop/desktop.html +92 -73
- package/public/desktop/desktop.js +631 -77
- package/public/file-inbox.js +77 -18
- package/public/genui.css +10 -0
- package/public/genui.js +22 -4
- package/public/host-queue.js +232 -0
- package/public/host-schedule.js +301 -0
- package/public/host-state.css +19 -0
- package/public/index.html +330 -140
- package/public/md.js +21 -1
- package/public/network.js +33 -1
- package/public/onboarding.js +3 -3
- package/public/operations.js +4 -3
- package/public/plan-review.css +297 -0
- package/public/plan-review.js +621 -0
- package/public/plugin.html +29 -28
- package/public/relay-autopair.js +25 -10
- package/public/relay-settings.css +11 -0
- package/public/relay-settings.js +350 -28
- package/public/session-management.css +61 -0
- package/public/session-management.js +742 -0
- package/public/session-search.css +137 -0
- package/public/session-search.js +977 -0
- package/public/skins/blue-fish/preview.html +3 -3
- package/public/skins/bocchi/preview.html +5 -5
- package/public/skins/kita/preview.html +6 -6
- package/public/skins/miku/SOURCES.json +10 -0
- package/public/skins/miku/chibi.png +0 -0
- package/public/skins/miku/preview.html +33 -0
- package/public/skins/miku/skin.css +82 -0
- package/public/skins/nijika/preview.html +6 -6
- package/public/skins/penguin/preview.html +3 -3
- package/public/skins/ryo/preview.html +6 -6
- package/public/slash-suggestions.js +15 -3
- package/public/sponsor-entry.js +11 -3
- package/public/styles.css +141 -21
- package/public/subagents.css +5 -0
- package/public/subagents.js +52 -0
- package/public/theme-vars.css +65 -1
- package/public/theme.js +4 -3
- package/public/turn-diff.css +323 -0
- package/public/turn-diff.js +778 -0
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.css +305 -34
- package/public/workflow.js +141 -41
package/public/plugin.html
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="zh-CN">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="dsh-remote-build" content="
|
|
4
|
+
<meta name="dsh-remote-build" content="62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
7
7
|
<title>DSH Remote</title>
|
|
8
|
-
<script>(function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
9
|
-
<link rel="stylesheet" href="theme-vars.css?dsr-build=
|
|
10
|
-
<link rel="stylesheet" href="setup.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="insights.css?dsr-build=
|
|
12
|
-
<link rel="stylesheet" href="remote-ui.css?dsr-build=
|
|
13
|
-
<link rel="stylesheet" href="doctor.css?dsr-build=
|
|
14
|
-
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=
|
|
15
|
-
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=
|
|
22
|
-
<
|
|
8
|
+
<script>(function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'&&t!=='miku'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
9
|
+
<link rel="stylesheet" href="theme-vars.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
10
|
+
<link rel="stylesheet" href="setup.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
11
|
+
<link rel="stylesheet" href="insights.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
12
|
+
<link rel="stylesheet" href="remote-ui.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
13
|
+
<link rel="stylesheet" href="doctor.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
14
|
+
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
15
|
+
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
16
|
+
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
17
|
+
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
18
|
+
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
19
|
+
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
20
|
+
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
21
|
+
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
22
|
+
<link rel="stylesheet" href="skins/miku/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
23
|
+
<style>html[data-theme="light"],html[data-theme="neutral"],html[data-theme="fish"],html[data-theme="penguin"],html[data-theme="bocchi"],html[data-theme="nijika"],html[data-theme="ryo"],html[data-theme="kita"],html[data-theme="miku"]{color-scheme:light}</style>
|
|
23
24
|
</head>
|
|
24
25
|
<body class="remote-panel-body">
|
|
25
26
|
<main class="plugin-shell" data-motion-view>
|
|
@@ -53,17 +54,17 @@
|
|
|
53
54
|
</section>
|
|
54
55
|
<footer class="plugin-foot"><span id="plugin-version">—</span><a id="plugin-about" href="/remote/admin/#remote/settings" target="_blank" rel="noopener">关于与支持</a></footer>
|
|
55
56
|
</main>
|
|
56
|
-
<script src="i18n.js?dsr-build=
|
|
57
|
-
<script src="vendor/gsap/gsap.min.js?dsr-build=
|
|
58
|
-
<script src="motion.js?dsr-build=
|
|
59
|
-
<script type="module" src="morphicons-init.js?dsr-build=
|
|
60
|
-
<script src="qrcode.min.js?dsr-build=
|
|
61
|
-
<script src="remote-state.js?dsr-build=
|
|
62
|
-
<script src="remote-ui.js?dsr-build=
|
|
63
|
-
<script src="setup.js?dsr-build=
|
|
64
|
-
<script src="insights.js?dsr-build=
|
|
65
|
-
<script src="plugin.js?dsr-build=
|
|
66
|
-
<script src="doctor.js?dsr-build=
|
|
67
|
-
<script src="doctor-entry.js?dsr-build=
|
|
57
|
+
<script src="i18n.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
58
|
+
<script src="vendor/gsap/gsap.min.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
59
|
+
<script src="motion.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
60
|
+
<script type="module" src="morphicons-init.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
61
|
+
<script src="qrcode.min.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
62
|
+
<script src="remote-state.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
63
|
+
<script src="remote-ui.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
64
|
+
<script src="setup.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
65
|
+
<script src="insights.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
66
|
+
<script src="plugin.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
67
|
+
<script src="doctor.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
68
|
+
<script src="doctor-entry.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
68
69
|
</body>
|
|
69
70
|
</html>
|
package/public/relay-autopair.js
CHANGED
|
@@ -112,11 +112,11 @@
|
|
|
112
112
|
}
|
|
113
113
|
return false
|
|
114
114
|
}
|
|
115
|
-
async function verifyIdentity(c, origin, pin) {
|
|
115
|
+
async function verifyIdentity(c, origin, pin, plain = false) {
|
|
116
116
|
for (let attempt = 1; attempt <= 4 && c.valid(); attempt++) {
|
|
117
117
|
try {
|
|
118
118
|
const remote = await read(c, origin + '/relay')
|
|
119
|
-
if (remote?.e2ee?.fingerprint !== pin || new URL(remote.publicUrl).origin !== origin) throw fail('E2EE_HOST_MISMATCH')
|
|
119
|
+
if ((plain ? remote?.fingerprint : remote?.e2ee?.fingerprint) !== pin || new URL(remote.publicUrl).origin !== origin) throw fail('E2EE_HOST_MISMATCH')
|
|
120
120
|
record('verify', { attempt, ok: true })
|
|
121
121
|
return true
|
|
122
122
|
} catch (error) {
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
function contextKey(c) {
|
|
141
141
|
return JSON.stringify([new URL(c.url('/relay'), root.location.href).origin, c.headers?.authorization || ''])
|
|
142
142
|
}
|
|
143
|
-
async function finish(c, endpoint, origin, pin, onPaired, notify) {
|
|
143
|
+
async function finish(c, endpoint, origin, pin, onPaired, notify, plain = false) {
|
|
144
144
|
notify(text('公网通道已在线,正在验证主机身份…', 'Relay channel is online. Verifying the host…'))
|
|
145
|
-
if (!await verifyIdentity(c, origin, pin)) throw fail('E2EE_VERIFY_FAILED')
|
|
145
|
+
if (!await verifyIdentity(c, origin, pin, plain)) throw fail('E2EE_VERIFY_FAILED')
|
|
146
146
|
if (!c.valid()) throw fail('E2EE_CONNECTION_INVALID')
|
|
147
147
|
notify(text('公网主机身份已验证,正在读取会话列表…', 'Public host identity verified. Reading the session list…'))
|
|
148
148
|
if (!await verifySessions(c, origin)) throw fail('E2EE_SESSION_VERIFY_FAILED')
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
onPaired?.(origin, c)
|
|
152
152
|
notify(text('电脑已确认配对,公网会话读取已验证。局域网连接保留。', 'The computer confirmed pairing and the session list was read over the relay. The LAN connection is kept.'), false, 'ready')
|
|
153
153
|
}
|
|
154
|
-
async function offer({ connection, onPaired, onStatus = () => {}, force = false }) {
|
|
154
|
+
async function offer({ connection, onPaired, onStatus = () => {}, force = false, activationId = '' }) {
|
|
155
155
|
const manual = force === true
|
|
156
156
|
let key = ''
|
|
157
157
|
const notify = (message, error, phase = error ? 'error' : 'working') => {
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
if (manual) { record('skipped', { reason: 'native-unavailable' }); notify(reason('E2EE_NATIVE_UNAVAILABLE')) }
|
|
163
163
|
return { ok: false, code: 'E2EE_NATIVE_UNAVAILABLE' }
|
|
164
164
|
}
|
|
165
|
-
if (bridge.supported?.() === false) {
|
|
165
|
+
if (!activationId && bridge.supported?.() === false) {
|
|
166
166
|
if (manual) { record('skipped', { reason: 'tls13-unavailable' }); notify(reason('E2EE_TLS_UNAVAILABLE')) }
|
|
167
167
|
return { ok: false, code: 'E2EE_TLS_UNAVAILABLE' }
|
|
168
168
|
}
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
return { ok: false, code: 'E2EE_CONNECTION_INVALID' }
|
|
183
183
|
}
|
|
184
184
|
key = contextKey(c)
|
|
185
|
-
const attempt = JSON.stringify([key, c.setupId || ''])
|
|
185
|
+
const attempt = JSON.stringify([key, c.setupId || '', activationId])
|
|
186
186
|
if (!force && attempts.has(attempt)) return { ok: false, code: 'E2EE_ALREADY_ATTEMPTED' }
|
|
187
187
|
attempts.add(attempt); busy = true
|
|
188
188
|
const started = Date.now()
|
|
@@ -192,11 +192,26 @@
|
|
|
192
192
|
const host = await read(c, endpoint.href)
|
|
193
193
|
record('host', { enabled: !!host?.enabled, canPairLocally: !!host?.canPairLocally, phase: host?.phase, e2ee: !!host?.e2ee?.enabled })
|
|
194
194
|
if (!host?.canPairLocally) throw fail('E2EE_LOCAL_ONLY')
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
if (activationId && host.activationId !== activationId) throw fail('E2EE_CONNECTION_INVALID')
|
|
196
|
+
if (!host.enabled) throw fail('E2EE_HOST_NOT_ENCRYPTED')
|
|
197
|
+
const publicUrl = new URL(host.publicUrl)
|
|
198
|
+
const origin = publicUrl.origin
|
|
199
|
+
const plain = !!activationId && host.e2ee?.enabled === false
|
|
200
|
+
const pin = plain ? host.fingerprint : host.e2ee?.fingerprint
|
|
201
|
+
if (publicUrl.protocol !== 'https:' || publicUrl.href !== origin + '/' || !/^[a-f0-9]{64}$/.test(pin || '')) throw fail('E2EE_HOST_INVALID')
|
|
198
202
|
let old = {}
|
|
199
203
|
try { old = JSON.parse(bridge.info(origin) || '{}') } catch { throw fail('E2EE_STORAGE_UNAVAILABLE') }
|
|
204
|
+
if (plain) {
|
|
205
|
+
if (old.configured || old.required || old.error) throw fail('E2EE_PAIRING_CHANGED')
|
|
206
|
+
if (!root.confirm(text('通过普通 HTTPS 连接这台主机?中转方在技术上可读取转发内容和访问令牌。\n主机:','Connect to this host over HTTPS? The relay can technically read forwarded content and your access token.\nHost: ') + origin) || !c.valid()) {
|
|
207
|
+
return { ok: false, code: 'E2EE_CANCELLED' }
|
|
208
|
+
}
|
|
209
|
+
if (host.phase !== 'online' && !await waitOnline(c, endpoint)) throw fail('E2EE_RELAY_OFFLINE')
|
|
210
|
+
await finish(c, endpoint, origin, pin, onPaired, notify, true)
|
|
211
|
+
return { ok: true, mode: 'https' }
|
|
212
|
+
}
|
|
213
|
+
if (!host.e2ee?.configured || !host.e2ee.enabled) throw fail('E2EE_HOST_NOT_ENCRYPTED')
|
|
214
|
+
if (bridge.supported?.() === false) throw fail('E2EE_TLS_UNAVAILABLE')
|
|
200
215
|
if (old.configured && old.fingerprint === pin && !old.error && old.deviceId && old.expiresAt > Date.now()) {
|
|
201
216
|
record('existing', { deviceId: old.deviceId })
|
|
202
217
|
notify(text('已保留配对,正在等待公网通道就绪…', 'Saved pairing found. Waiting for the relay channel…'))
|
|
@@ -22,3 +22,14 @@
|
|
|
22
22
|
.relay-pair-progress[data-phase=error]{color:var(--warning,#9d4b27)}
|
|
23
23
|
.relay-phone-code:not(:empty){display:block;width:min(220px,100%);padding:8px;margin:8px 0;background:#fff;border-radius:8px}
|
|
24
24
|
.relay-phone-code svg{display:block;width:100%;height:auto}
|
|
25
|
+
|
|
26
|
+
#settings-page-cloud-relay .relay-settings{margin:12px 0 0;border-radius:var(--dsr-radius,12px);padding:16px}
|
|
27
|
+
#settings-page-cloud-relay :is(.relay-status,.relay-muted):empty{display:none}
|
|
28
|
+
.relay-registration{border-block-end:1px solid var(--dsr-line);margin-block-end:16px;padding-block-end:12px}
|
|
29
|
+
.relay-registration h3{font-size:15px;margin:0}
|
|
30
|
+
.relay-registration .relay-actions{gap:8px}
|
|
31
|
+
.relay-registration .mini-btn{display:inline-flex;align-items:center;min-height:44px;text-decoration:none;padding-inline:12px}
|
|
32
|
+
.relay-bind-options{margin:10px 0;font-size:13px}
|
|
33
|
+
.relay-bind-options summary{padding:10px 0;cursor:pointer;color:var(--dsr-accent-strong,var(--accent));min-height:24px}
|
|
34
|
+
.relay-operation-auth{display:grid;gap:6px;margin:8px 0;font-size:13px}
|
|
35
|
+
.relay-operation-auth input{min-height:44px;max-width:100%;box-sizing:border-box;padding:8px 10px;background:transparent;color:inherit;border:1px solid var(--dsr-line);border-radius:9px;font:inherit}
|