An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Support trusted remote extensions https://github.com/siyuan-note/siyuan/issues/19202
Danielc4a1fa7880e3
diff --git a/app/electron/main.js b/app/electron/main.jsindex 7078f5cf23..6266ea2b12 100644--- a/app/electron/main.js+++ b/app/electron/main.js@@ -53,7 +53,9 @@ const {} = require("./appleSilicon");const {createRemoteDocumentContentSecurityPolicy,+ createRemoteKernelTarget,getArgFrom,+ getKernelConnection,getRemoteKernelRedirectDecision,getRemoteKernelRequestPolicy,getRemoteKernelWebRequestDestination,@@ -483,13 +485,7 @@ let remoteKernelArgError;const remoteKernelArg = getArg("--remote");if (remoteKernelArg !== undefined) {try {- const origin = normalizeRemoteKernelOrigin(remoteKernelArg);- remoteKernelTarget = {- mode: "remote",- origin,- ownsKernel: false,- port: "",- };+ remoteKernelTarget = createRemoteKernelTarget(remoteKernelArg, process.argv);} catch (error) {remoteKernelArgError = error;}@@ -697,7 +693,8 @@ for (let i = argStart; i < process.argv.length; i++) {let arg = process.argv[i];if (arg.startsWith("--workspace=") || arg.startsWith("--openAsHidden") || arg.startsWith("--port=") ||arg.startsWith("--safe-mode=") || arg.startsWith("--lang=") || arg === "--remote" ||- arg.startsWith("--remote=") ||+ arg.startsWith("--remote=") || arg === "--trust-remote-extensions" ||+ arg.startsWith("--trust-remote-extensions=") ||arg.startsWith("siyuan://")) {// 跳过内置参数if (arg.startsWith("--openAsHidden")) {@@ -1330,6 +1327,7 @@ const installRemoteFrontendProtocol = (target) => {destination,localResourceAvailable: Boolean(localResource),isTargetOrigin,+ trustRemoteExtensions: target.trustRemoteExtensions,});} catch (error) {requestPolicy = "deny-active-content";@@ -1367,6 +1365,7 @@ const installRemoteFrontendProtocol = (target) => {destination: requestDestination,localResourceAvailable: Boolean(localResource),isTargetOrigin,+ trustRemoteExtensions: target.trustRemoteExtensions,});if (requestPolicy === "deny-api") {writeLog("blocked remote kernel lifecycle request [path=" + requestPathname + "]");@@ -1446,7 +1445,8 @@ const installRemoteFrontendProtocol = (target) => {const responseHeaders = new Headers(localResponse.headers);responseHeaders.set("Cache-Control", "no-store");responseHeaders.set("Content-Security-Policy",- createRemoteDocumentContentSecurityPolicy(fs.readFileSync(localResource, "utf8"), target.origin));+ createRemoteDocumentContentSecurityPolicy(fs.readFileSync(localResource, "utf8"), target.origin,+ requestURL.pathname === "/check-auth" ? undefined : target.extensionScriptNonce));return new Response(localResponse.body, {status: localResponse.status,statusText: localResponse.statusText,@@ -1488,6 +1488,7 @@ const installRemoteFrontendProtocol = (target) => {destination: requestDestination,localResourceAvailable: Boolean(redirectLocalResource),isTargetOrigin: true,+ trustRemoteExtensions: target.trustRemoteExtensions,});if (redirectPolicy === "deny-api" || redirectPolicy === "deny-active-content" ||redirectPolicy === "not-found") {@@ -2881,6 +2882,9 @@ app.whenReady().then(() => {app.exit();});ipcMain.handle("siyuan-get", async (event, data) => {+ if (data.cmd === "kernelConnection") {+ return getKernelConnection(getWindowKernelTarget(event.sender.id));+ }const remoteSender = getWindowKernelTarget(event.sender.id)?.mode === "remote";if (remoteSender && ["beginRichClipboard", "completeRichClipboard", "cancelRichClipboard", "clipboardRead", "clipboardReadFiles"].includes(data.cmd)) {@@ -3543,11 +3547,7 @@ app.whenReady().then(() => {if (kernelTarget) {initializedWindowIds.add(event.sender.id);}- const capabilities = kernelTarget ? {- kernelMode: kernelTarget.mode,- ownsKernel: kernelTarget.ownsKernel,- kernelOrigin: kernelTarget.origin,- } : undefined;+ const capabilities = getKernelConnection(kernelTarget);const exitWS = workspaces.find(item => {if (event.sender.id === item.webContentsId && item.initialized) {if (item.tray && ("win32" === process.platform || "linux" === process.platform)) {diff --git a/app/electron/remoteKernel.js b/app/electron/remoteKernel.jsindex ebb40c0814..b3478affe2 100644--- a/app/electron/remoteKernel.js+++ b/app/electron/remoteKernel.js@@ -27,6 +27,28 @@ const normalizeRemoteKernelOrigin = (value) => {return url.origin;};+const createRemoteKernelTarget = (value, args) => {+ const origin = normalizeRemoteKernelOrigin(value);+ const trustRemoteExtensions = args.includes("--trust-remote-extensions");+ return {+ mode: "remote",+ origin,+ ownsKernel: false,+ port: "",+ trustRemoteExtensions,+ extensionScriptNonce: trustRemoteExtensions ? crypto.randomBytes(32).toString("base64") : undefined,+ };+};++const getKernelConnection = (target) => target ? {+ kernelMode: target.mode,+ ownsKernel: target.ownsKernel,+ kernelOrigin: target.origin,+ trustRemoteExtensions: target.mode === "remote" && target.trustRemoteExtensions === true,+ extensionScriptNonce: target.mode === "remote" && target.trustRemoteExtensions === true+ ? target.extensionScriptNonce : undefined,+} : undefined;+const insecureCertificateSwitchNames = Object.freeze(["allow-insecure-localhost","ignore-certificate-errors",@@ -150,7 +172,13 @@ const isProtectedLocalPath = (pathname) => pathname === "/check-auth" || pathnampathname === "/stage" || pathname.startsWith("/stage/") || pathname === "/widgets" ||pathname.startsWith("/widgets/");-const getRemoteKernelRequestPolicy = ({method, pathname, destination, localResourceAvailable, isTargetOrigin = true}) => {+// 内置外观和前端始终由客户端提供,自定义扩展只从当前远程内核加载。+const isRemoteExtensionPath = (pathname) => !pathname.split("/").some(part => part === "." || part === "..") &&+ (pathname.startsWith("/plugins/") || (/^\/appearance\/(themes|icons)\//.test(pathname) &&+ !/^\/appearance\/(themes\/(daylight|midnight)|icons\/litheness)(\/|$)/.test(pathname)));++const getRemoteKernelRequestPolicy = ({method, pathname, destination, localResourceAvailable, isTargetOrigin = true,+ trustRemoteExtensions = false}) => {const requestedPathname = pathname;const normalizedPathnames = normalizeRequestPathname(pathname);if (isTargetOrigin && normalizedPathnames.some((candidate) => deniedAPIPaths.has(candidate))) {@@ -158,12 +186,17 @@ const getRemoteKernelRequestPolicy = ({method, pathname, destination, localResou}pathname = normalizedPathnames[normalizedPathnames.length - 1];const safeMethod = method === "GET" || method === "HEAD";+ const remoteExtension = trustRemoteExtensions && isTargetOrigin && safeMethod &&+ normalizedPathnames.every(isRemoteExtensionPath);if (documentDestinations.has(destination)) {return isTargetOrigin && safeMethod && localResourceAvailable && localDocumentPaths.has(requestedPathname)? "local": "deny-active-content";}if (executableDestinations.has(destination)) {+ if (remoteExtension && localExecutableDestinations.has(destination)) {+ return "remote";+ }return isTargetOrigin && safeMethod && localResourceAvailable && localExecutableDestinations.has(destination)? "local": "deny-active-content";@@ -174,6 +207,9 @@ const getRemoteKernelRequestPolicy = ({method, pathname, destination, localResouif (!safeMethod) {return "remote";}+ if (remoteExtension) {+ return "remote";+ }if (localResourceAvailable) {return "local";}@@ -372,7 +408,7 @@ const getRemoteDocumentInlineScriptSources = (html) => {return {eventHandlers, inlineScripts};};-const createRemoteDocumentContentSecurityPolicy = (html, origin) => {+const createRemoteDocumentContentSecurityPolicy = (html, origin, extensionScriptNonce) => {const {inlineScripts} = getRemoteDocumentInlineScriptSources(html);const hashes = [...new Set(inlineScripts.map((source) =>"'sha256-" + crypto.createHash("sha256").update(source, "utf8").digest("base64") + "'"))];@@ -380,6 +416,12 @@ const createRemoteDocumentContentSecurityPolicy = (html, origin) => {const appearanceSource = new URL("/appearance/", origin).href;const defaultIconSource = new URL("/appearance/icons/litheness/icon.js", origin).href;const scriptSources = [stageSource, defaultIconSource, "blob:", "'wasm-unsafe-eval'", ...hashes];+ const extensionSources = ["/plugins/", "/appearance/themes/", "/appearance/icons/"]+ .map((pathname) => new URL(pathname, origin).href);+ if (extensionScriptNonce) {+ // 插件加载器需要动态求值,代码片段通过本地主进程提供的随机数授权。+ scriptSources.push(...extensionSources, "'unsafe-eval'", "'nonce-" + extensionScriptNonce + "'");+ }return ["base-uri " + new URL("/", origin).href,"child-src 'none'",@@ -387,14 +429,17 @@ const createRemoteDocumentContentSecurityPolicy = (html, origin) => {"object-src 'none'","script-src " + scriptSources.join(" "),"script-src-attr 'none'",- "style-src 'unsafe-inline' " + stageSource + " " + appearanceSource,- "worker-src " + stageSource,+ "style-src 'unsafe-inline' " + stageSource + " " + appearanceSource ++ (extensionScriptNonce ? " " + new URL("/plugins/", origin).href : ""),+ "worker-src " + stageSource + (extensionScriptNonce ? " " + extensionSources.join(" ") : ""),].join("; ");};module.exports = {+ createRemoteKernelTarget,createRemoteDocumentContentSecurityPolicy,getArgFrom,+ getKernelConnection,getInsecureCertificateSwitchName,getRemoteKernelRedirectDecision,getRemoteKernelRequestPolicy,diff --git a/app/electron/remoteKernel.test.js b/app/electron/remoteKernel.test.jsindex a7940e8f0b..7c5507425b 100644--- a/app/electron/remoteKernel.test.js+++ b/app/electron/remoteKernel.test.js@@ -4,7 +4,9 @@ const path = require("node:path");const test = require("node:test");const {createRemoteDocumentContentSecurityPolicy,+ createRemoteKernelTarget,getArgFrom,+ getKernelConnection,getInsecureCertificateSwitchName,getRemoteKernelRedirectDecision,getRemoteKernelRequestPolicy,@@ -46,6 +48,107 @@ test("normalizeRemoteKernelOrigin rejects insecure or non-origin URLs", () => {].forEach((value) => assert.throws(() => normalizeRemoteKernelOrigin(value)));});+test("remote extension trust requires the exact startup flag and a valid remote origin", () => {+ for (const args of [[], ["--trust-remote-extensions=false"], ["--trust-remote-extensions=true"],+ ["--trust-remote-extensions-extra"]]) {+ const target = createRemoteKernelTarget("https://example.com", args);+ assert.equal(target.trustRemoteExtensions, false);+ assert.equal(target.extensionScriptNonce, undefined);+ }+ const args = ["--trust-remote-extensions"];+ const target = createRemoteKernelTarget("https://example.com:443/", args);+ assert.equal(target.origin, "https://example.com");+ assert.equal(target.trustRemoteExtensions, true);+ assert.equal(Buffer.from(target.extensionScriptNonce, "base64").length, 32);+ assert.notEqual(createRemoteKernelTarget(target.origin, args).extensionScriptNonce, target.extensionScriptNonce);+ assert.throws(() => createRemoteKernelTarget("http://example.com", args));+ assert.throws(() => createRemoteKernelTarget(undefined, args));+ assert.deepEqual(getKernelConnection(target), {+ kernelMode: "remote", ownsKernel: false, kernelOrigin: target.origin,+ trustRemoteExtensions: true, extensionScriptNonce: target.extensionScriptNonce,+ });+ assert.equal(getKernelConnection({...target, mode: "local"}).trustRemoteExtensions, false);+ assert.equal(getKernelConnection({...target, mode: "local"}).extensionScriptNonce, undefined);+ assert.equal(getKernelConnection(undefined), undefined);+});++test("trusted extensions load from the selected origin without replacing the packaged frontend", () => {+ const request = {+ method: "GET", destination: "script", localResourceAvailable: false, trustRemoteExtensions: true,+ };+ for (const pathname of ["/plugins/example/index.js", "/appearance/themes/custom/theme.js",+ "/appearance/icons/custom/icon.js"]) {+ for (const destination of ["script", "style", "worker", ""]) {+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, destination}), "remote");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, destination,+ localResourceAvailable: true}), "remote");+ }+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, trustRemoteExtensions: false}),+ "deny-active-content");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, isTargetOrigin: false}), "deny-active-content");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, method: "POST"}), "deny-active-content");+ for (const destination of ["document", "frame", "iframe", "object", "serviceworker", "sharedworker"]) {+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, destination}), "deny-active-content");+ }+ }+ for (const pathname of ["/stage/build/app/index.js", "/appearance/icons/litheness/icon.js",+ "/appearance/themes/daylight/theme.css", "/appearance/themes/midnight/theme.css",+ "/appearance/langs/en.json", "/appearance/fonts/emoji.woff2"]) {+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname, localResourceAvailable: true}), "local");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname}), "deny-active-content");+ }+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname: "/custom-fonts/font-id", destination: "font"}),+ "remote");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname: "/plugins/example/icon.png", destination: "image"}),+ "remote");+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname: "/api/petal/loadPetals", destination: "",+ method: "POST"}), "remote");+ for (const pathname of ["/assets/code.js", "/widgets/example/index.html", "/api/file/getFile",+ "/appearance/themes/%64aylight/theme.js", "/appearance/icons/%256citheness/icon.js",+ "/plugins/%252e%252e/stage/build/app/index.js", "/appearance/themes/custom/../../langs/en.json"]) {+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname}), "deny-active-content");+ }+ assert.equal(getRemoteKernelRequestPolicy({...request, pathname: "/api/system/exit", destination: "",+ method: "POST"}), "deny-api");+});++test("trusted extension redirects retain origin and resource restrictions", () => {+ const origin = "https://example.com";+ for (const [location, expected] of [["/plugins/example/chunk.js", "remote"],+ ["/assets/code.js", "deny-active-content"], ["/api/system/exit", "deny-api"],+ ["/widgets/example/index.html", "deny-active-content"]]) {+ const redirect = getRemoteKernelRedirectDecision({status: 302, location, origin, method: "GET"});+ assert.equal(redirect.action, "follow");+ assert.equal(getRemoteKernelRequestPolicy({method: redirect.method, pathname: redirect.url.pathname,+ destination: "script", localResourceAvailable: false, trustRemoteExtensions: true}), expected);+ }+ assert.equal(getRemoteKernelRedirectDecision({status: 302, location: "https://other.example.com/plugins/code.js",+ origin, method: "GET"}).action, "deny");+});++test("trusted extension CSP authorizes snippets explicitly while retaining document restrictions", () => {+ const target = createRemoteKernelTarget("https://example.com", ["--trust-remote-extensions"]);+ const policy = createRemoteDocumentContentSecurityPolicy("<script>packaged();</script>", target.origin,+ target.extensionScriptNonce);+ assert.ok(policy.includes("'nonce-" + target.extensionScriptNonce + "'"));+ const directives = Object.fromEntries(policy.split("; ").map(value => {+ const [name, ...sources] = value.split(" ");+ return [name, sources];+ }));+ assert.ok(directives["script-src"].includes("'unsafe-eval'"));+ assert.equal(directives["script-src"].includes("'unsafe-inline'"), false);+ assert.equal(directives["script-src"].includes("'self'"), false);+ for (const pathname of ["/plugins/", "/appearance/themes/", "/appearance/icons/"]) {+ assert.ok(directives["script-src"].includes(target.origin + pathname));+ }+ for (const name of ["script-src-attr", "frame-src", "child-src", "object-src"]) {+ assert.deepEqual(directives[name], ["'none'"]);+ }+ const untrusted = createRemoteDocumentContentSecurityPolicy("", target.origin);+ assert.equal(untrusted.includes("'unsafe-eval'"), false);+ assert.equal(untrusted.includes("'nonce-"), false);+});+test("remote kernel request policy rejects lifecycle and workspace APIs", () => {["/api/system/exit",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.syindex 377888de4b..5ee8a5c781 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy@@ -6,27 +6,31 @@"id": "20260903150000-s4hctea","title": "Connect to a Remote Kernel","type": "doc",- "updated": "20260903205342"+ "updated": "20260908082237"},"Children": [{"ID": "20260903150000-mz3r596", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-mz3r596", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Overview"}]},{"ID": "20260903150000-dood0bb", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-dood0bb", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "The desktop app can connect to a SiYuan kernel running on another device and use the local desktop interface for editing. Remote mode only connects to an existing kernel and does not start a kernel on the local device."}]},{"ID": "20260903150000-c2oh8cr", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-c2oh8cr", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Start"}]},{"ID": "20260903150000-601s61t", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-601s61t", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "After completely exiting the SiYuan desktop client, start the desktop app from a command line and append "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": ". If an instance is already running, the single-instance mechanism does not switch its current connection."}]},- {"ID": "20260903150000-rir445a", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-rir445a", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Security and Version"}]},- {"ID": "20260903150000-0ekr8rg", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-0ekr8rg", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Only HTTPS remote addresses are supported, and the client operating system must trust the TLS certificate used by the server. Connect only to a server you trust. The desktop client and remote kernel versions must match exactly; otherwise, the connection is rejected. The desktop client loads only the frontend bundled with the installation package and does not load executable frontend resources such as HTML or scripts from the remote server. Consequently, same-origin remote HTML embeds are also unavailable."}]},- {"ID": "20260903150000-knpctlf", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-knpctlf", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "Limitations"}]},+ {"ID": "20260903150000-rir445a", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-rir445a", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Security and Version"}]},+ {"ID": "20260903150000-0ekr8rg", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-0ekr8rg", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Only HTTPS remote addresses are supported, and the client operating system must trust the server's TLS certificate. Connect only to a server you trust. The desktop client and remote kernel versions must match exactly; otherwise, the connection is rejected. The core frontend and sign-in page always come from the client installation package. Remote extension code is disabled by default, and remote HTML embeds are unavailable."}]},+ {"ID": "20260908082237-ng9rmna", "Type": "NodeHeading", "Properties": {"id": "20260908082237-ng9rmna", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Trust Remote Extensions"}], "HeadingLevel": 2},+ {"ID": "20260908082237-vrsfycm", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-vrsfycm", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "After completely exiting the desktop client, start it with "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port] --trust-remote-extensions"}, {"Type": "NodeText", "Data": ". This option is off by default and applies only to the server specified for this launch. It is not saved in a trust list or automatically added to launch-at-login arguments. Starting another instance does not change the running instance's trust state. To revoke trust, completely exit and start again without this option."}]},+ {"ID": "20260908082237-czd7cy0", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-czd7cy0", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Once enabled, plugins, theme scripts, icon scripts, and JavaScript code snippets from the remote workspace execute in the local desktop environment. They can use Node.js to read and write local files and execute programs. Use this option only if you trust the server and the extension code it supplies, including future updates."}]},+ {"ID": "20260908082237-9eymwn3", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-9eymwn3", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "This option enables plugins, Bazaar, custom themes, icons, fonts, and code snippets. The bundled frontend, themes, and icons still come from the client. Widgets and the other remote-mode restrictions remain unchanged. Plugin code runs on the client while the workspace is on the server. Plugins that depend on local workspace paths, native modules, or external programs may require adaptation; compatibility with every desktop plugin is not guaranteed."}]},+ {"ID": "20260903150000-knpctlf", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-knpctlf", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Limitations"}]},{"ID": "20260903150000-lazpxpz", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-lazpxpz", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "Remote mode does not support the following features. Local mode is not affected:"}]},{"ID": "20260903150000-x3th06t","Type": "NodeList","ListData": {},- "Properties": {"id": "20260903150000-x3th06t", "updated": "20260903150000"},+ "Properties": {"id": "20260903150000-x3th06t", "updated": "20260908082237"},"Children": [{"ID": "20260903150000-b45enwi", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-b45enwi", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-gbt9mdf", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-gbt9mdf", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Import and export"}]}]},{"ID": "20260903150000-mzhpk4r", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-mzhpk4r", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-88q1701", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-88q1701", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "File clipboard operations"}]}]},{"ID": "20260903150000-5amb0yu", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-5amb0yu", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-j9eobwv", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-j9eobwv", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Operations that depend on a client-local path or a server absolute path, such as showing a file in the file manager or dragging in or opening a file by path; normal asset uploads through a file picker remain available"}]}]},- {"ID": "20260903150000-hxh4cr0", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-hxh4cr0", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-1f4zzal", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-1f4zzal", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Desktop plugins, Bazaar, and widgets are unavailable. Only the client's built-in appearance is used; remote custom themes, icon sets, fonts, and code snippets are not loaded"}]}]},+ {"ID": "20260903150000-hxh4cr0", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-hxh4cr0", "updated": "20260908082237"}, "Children": [{"ID": "20260903150000-1f4zzal", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-1f4zzal", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Desktop plugins, Bazaar, and custom appearance are disabled by default; the trust option described above enables remote plugins, Bazaar, custom themes, icons, fonts, and code snippets, while widgets remain unavailable"}]}]},{"ID": "20260903150000-88njhnb", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-88njhnb", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-p2n9ukv", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-p2n9ukv", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Scripts in HTML and SVG blocks, database templates, and JavaScript query embeds are not executed; iframe blocks are unavailable. Chart, diagram, and math rendering results are sanitized"}]}]},{"ID": "20260903150000-ckttrsj", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-ckttrsj", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-8lxisgw", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-8lxisgw", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Access authorization code sign-in only; OIDC sign-in is not supported"}]}]}]diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.syindex ad71881e5d..ebb216e1a8 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy@@ -6,7 +6,7 @@"id": "20260903150000-u4065fm","title": "连接远程内核","type": "doc",- "updated": "20260903205342"+ "updated": "20260908082237"},"Children": [{@@ -82,7 +82,7 @@"HeadingLevel": 2,"Properties": {"id": "20260903150000-fjznin7",- "updated": "20260903150000"+ "updated": "20260908082237"},"Children": [{@@ -96,22 +96,26 @@"Type": "NodeParagraph","Properties": {"id": "20260903150000-54fwkfr",- "updated": "20260903150000"+ "updated": "20260908082237"},"Children": [{"Type": "NodeText",- "Data": "仅支持 HTTPS 远程地址,客户端操作系统必须信任服务器使用的 TLS 证书。请只连接你信任的服务器;桌面客户端与远程内核的版本必须完全一致,否则无法连接。桌面客户端只加载安装包内置前端,不加载远端服务器提供的 HTML、脚本等可执行前端资源,因此同源的远端 HTML 嵌入内容也不可用。"+ "Data": "仅支持 HTTPS 远程地址,客户端操作系统必须信任服务器使用的 TLS 证书。请只连接你信任的服务器;桌面客户端与远程内核的版本必须完全一致,否则无法连接。桌面客户端始终使用安装包内置的核心前端和登录页,默认不加载远程扩展代码;远程 HTML 嵌入内容不可用。"}]},+ {"ID": "20260908082237-1yxgmt2", "Type": "NodeHeading", "Properties": {"id": "20260908082237-1yxgmt2", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "信任远程扩展"}], "HeadingLevel": 2},+ {"ID": "20260908082237-t1800dj", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-t1800dj", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "完全退出桌面客户端后,可使用参数 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port] --trust-remote-extensions"}, {"Type": "NodeText", "Data": " 启动。该选项默认关闭,只信任本次指定的服务器,不会保存为信任列表,也不会自动加入开机启动参数。运行中的实例不会因再次启动而改变信任状态;如需撤销,请完全退出后去掉该参数重新启动。"}]},+ {"ID": "20260908082237-6wn2z6e", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-6wn2z6e", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "开启后,远程工作空间中的插件、主题脚本、图标脚本和 JavaScript 代码片段会在本机桌面环境中执行,能够通过 Node.js 读写本机文件和执行程序。请仅在信任服务器及其提供的扩展代码(包括后续更新)时使用。"}]},+ {"ID": "20260908082237-cfxcjm5", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-cfxcjm5", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "该选项开放插件、集市、自定义主题、图标、字体和代码片段。内置前端、主题和图标仍由客户端提供,小部件及其他远程模式限制保持不变。插件代码在客户端运行,工作空间位于服务器;依赖本地工作空间路径、原生模块或外部程序的插件可能需要适配,不能保证所有桌面插件都兼容。"}]},{"ID": "20260903150000-bh8cy8d","Type": "NodeHeading","HeadingLevel": 2,"Properties": {"id": "20260903150000-bh8cy8d",- "updated": "20260903205342"+ "updated": "20260908082237"},"Children": [{@@ -140,7 +144,7 @@"ListData": {},"Properties": {"id": "20260903150000-kvy0i58",- "updated": "20260903150000"+ "updated": "20260908082237"},"Children": [{@@ -236,7 +240,7 @@},"Properties": {"id": "20260903150000-5k7d57t",- "updated": "20260903150000"+ "updated": "20260908082237"},"Children": [{@@ -244,12 +248,12 @@"Type": "NodeParagraph","Properties": {"id": "20260903150000-4p58ioe",- "updated": "20260903150000"+ "updated": "20260908082237"},"Children": [{"Type": "NodeText",- "Data": "桌面端插件、集市和挂件不可用;仅使用客户端内置外观,不加载远端自定义主题、图标、字体和代码片段"+ "Data": "默认不支持桌面端插件、集市和自定义外观;可通过上述信任参数开启远程插件、集市、自定义主题、图标、字体和代码片段,小部件仍不可用"}]}diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.syindex 7dd371c06e..f4f7bd1a54 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy@@ -6,27 +6,31 @@"id": "20260903150000-3qa6edk","title": "連線至遠端內核","type": "doc",- "updated": "20260903205342"+ "updated": "20260908082237"},"Children": [{"ID": "20260903150000-jrf9aw4", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-jrf9aw4", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "概述"}]},{"ID": "20260903150000-6shebfx", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-6shebfx", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "桌面端可以連線至其他裝置上執行的思源內核,並使用本機桌面介面進行編輯。遠端模式僅用於連線至現有內核,不會在本機啟動內核。"}]},{"ID": "20260903150000-o9vrit3", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-o9vrit3", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "啟動方式"}]},{"ID": "20260903150000-m5fkfh5", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-m5fkfh5", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "完全結束思源桌面用戶端後,從命令列啟動桌面端並加入參數 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": "。如果已有執行中的實例,單一實例機制不會切換目前的連線。"}]},- {"ID": "20260903150000-l1lghrh", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-l1lghrh", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "安全性與版本"}]},- {"ID": "20260903150000-dk8m7z0", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-dk8m7z0", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "僅支援 HTTPS 遠端位址,用戶端作業系統必須信任伺服器使用的 TLS 憑證。請只連線至你信任的伺服器;桌面用戶端與遠端內核的版本必須完全一致,否則無法連線。桌面用戶端僅載入安裝套件內建的前端,不會載入遠端伺服器提供的 HTML、指令碼等可執行前端資源,因此同源的遠端 HTML 嵌入內容也無法使用。"}]},- {"ID": "20260903150000-uleg2f1", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-uleg2f1", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "功能限制"}]},+ {"ID": "20260903150000-l1lghrh", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-l1lghrh", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "安全性與版本"}]},+ {"ID": "20260903150000-dk8m7z0", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-dk8m7z0", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "僅支援 HTTPS 遠端位址,用戶端作業系統必須信任伺服器使用的 TLS 憑證。請只連線至你信任的伺服器;桌面用戶端與遠端內核的版本必須完全一致,否則無法連線。桌面用戶端始終使用安裝套件內建的核心前端與登入頁面,預設不載入遠端擴充程式碼;遠端 HTML 嵌入內容不可用。"}]},+ {"ID": "20260908082237-vvacz9q", "Type": "NodeHeading", "Properties": {"id": "20260908082237-vvacz9q", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "信任遠端擴充功能"}], "HeadingLevel": 2},+ {"ID": "20260908082237-rkm8fy4", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-rkm8fy4", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "完全結束桌面用戶端後,可使用參數 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port] --trust-remote-extensions"}, {"Type": "NodeText", "Data": " 啟動。此選項預設關閉,僅信任本次指定的伺服器,不會儲存為信任清單,也不會自動加入開機啟動參數。執行中的實例不會因再次啟動而改變信任狀態;如需撤銷,請完全結束後移除此參數重新啟動。"}]},+ {"ID": "20260908082237-q1w5tx8", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-q1w5tx8", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "啟用後,遠端工作空間中的外掛程式、佈景主題指令碼、圖示指令碼和 JavaScript 程式碼片段會在本機桌面環境中執行,能夠透過 Node.js 讀寫本機檔案和執行程式。請僅在信任伺服器及其提供的擴充程式碼(包括後續更新)時使用。"}]},+ {"ID": "20260908082237-hz1tyvi", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-hz1tyvi", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "此選項開放外掛程式、集市、自訂佈景主題、圖示、字型和程式碼片段。內建前端、佈景主題和圖示仍由用戶端提供,小工具及其他遠端模式限制維持不變。外掛程式碼在用戶端執行,工作空間位於伺服器;依賴本機工作空間路徑、原生模組或外部程式的外掛程式可能需要調整,無法保證所有桌面外掛程式都相容。"}]},+ {"ID": "20260903150000-uleg2f1", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-uleg2f1", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "功能限制"}]},{"ID": "20260903150000-ovlxdje", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-ovlxdje", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "遠端模式不支援以下功能,本機模式不受影響:"}]},{"ID": "20260903150000-lw8m6qj","Type": "NodeList","ListData": {},- "Properties": {"id": "20260903150000-lw8m6qj", "updated": "20260903150000"},+ "Properties": {"id": "20260903150000-lw8m6qj", "updated": "20260908082237"},"Children": [{"ID": "20260903150000-iaab0bj", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-iaab0bj", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-rj4jvo4", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-rj4jvo4", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "匯入和匯出"}]}]},{"ID": "20260903150000-o4d17am", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-o4d17am", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-uqpqmld", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-uqpqmld", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "檔案剪貼簿操作"}]}]},{"ID": "20260903150000-7489c2g", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-7489c2g", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-gopw68q", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-gopw68q", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "依賴用戶端本機路徑或伺服器絕對路徑的操作,例如在檔案管理器中顯示,以及透過路徑拖入或開啟檔案;透過檔案選擇器進行一般資源上傳仍可使用"}]}]},- {"ID": "20260903150000-yn3mxw7", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-yn3mxw7", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-m8ot8ql", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-m8ot8ql", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "桌面端外掛程式、集市和小工具不可用;僅使用用戶端內建外觀,不載入遠端自訂佈景主題、圖示、字型和程式碼片段"}]}]},+ {"ID": "20260903150000-yn3mxw7", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-yn3mxw7", "updated": "20260908082237"}, "Children": [{"ID": "20260903150000-m8ot8ql", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-m8ot8ql", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "預設不支援桌面端外掛程式、集市和自訂外觀;可透過上述信任參數啟用遠端外掛程式、集市、自訂佈景主題、圖示、字型和程式碼片段,小工具仍不可用"}]}]},{"ID": "20260903150000-3s12hif", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-3s12hif", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-pfjakt6", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-pfjakt6", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "HTML 和 SVG 區塊、資料庫範本及 JavaScript 查詢嵌入區塊中的指令碼不會執行,iframe 區塊不可用;圖表、圖解和數學公式等渲染結果會進行安全淨化"}]}]},{"ID": "20260903150000-kl3k0d9", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-kl3k0d9", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-c7bpnf2", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-c7bpnf2", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "僅支援存取授權碼登入,不支援 OIDC 登入"}]}]}]diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.syindex 14efba4d34..99263cd391 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy@@ -6,27 +6,31 @@"id": "20260903150000-hpfmx4t","title": "リモートカーネルへの接続","type": "doc",- "updated": "20260903205342"+ "updated": "20260908082237"},"Children": [{"ID": "20260903150000-ekjy0ld", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-ekjy0ld", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "概要"}]},{"ID": "20260903150000-0adfpc3", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-0adfpc3", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "デスクトップ版では、別のデバイスで動作している SiYuan カーネルに接続し、ローカルのデスクトップ UI から編集できます。リモートモードは既存のカーネルへの接続専用であり、ローカルではカーネルを起動しません。"}]},{"ID": "20260903150000-c8khz3k", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-c8khz3k", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "起動方法"}]},{"ID": "20260903150000-bqc7crd", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-bqc7crd", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "SiYuan デスクトップクライアントを完全に終了してから、コマンドラインでデスクトップ版を起動し、"}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": " パラメーターを追加します。既存のインスタンスが実行中の場合、シングルインスタンス機構によって現在の接続先が切り替わることはありません。"}]},- {"ID": "20260903150000-csljqix", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-csljqix", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "セキュリティとバージョン"}]},- {"ID": "20260903150000-1qj316h", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-1qj316h", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "リモートアドレスには HTTPS のみを使用でき、クライアントのオペレーティングシステムがサーバーの TLS 証明書を信頼している必要があります。信頼できるサーバーにのみ接続してください。デスクトップクライアントとリモートカーネルのバージョンは完全に一致している必要があります。一致しない場合は接続できません。デスクトップクライアントはインストールパッケージに内蔵されたフロントエンドのみを読み込み、リモートサーバーが提供する HTML やスクリプトなどの実行可能なフロントエンドリソースは読み込みません。そのため、同一オリジンのリモート HTML 埋め込みコンテンツも利用できません。"}]},- {"ID": "20260903150000-uo7ekyt", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-uo7ekyt", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "機能制限"}]},+ {"ID": "20260903150000-csljqix", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-csljqix", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "セキュリティとバージョン"}]},+ {"ID": "20260903150000-1qj316h", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-1qj316h", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "リモートアドレスには HTTPS のみを使用でき、クライアントのオペレーティングシステムがサーバーの TLS 証明書を信頼している必要があります。信頼できるサーバーにのみ接続してください。デスクトップクライアントとリモートカーネルのバージョンは完全に一致している必要があります。一致しない場合は接続できません。コアフロントエンドとログインページは常にクライアントのインストールパッケージから読み込みます。リモート拡張機能のコードは既定では読み込まず、リモート HTML の埋め込みは利用できません。"}]},+ {"ID": "20260908082237-zf9x3va", "Type": "NodeHeading", "Properties": {"id": "20260908082237-zf9x3va", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "リモート拡張機能を信頼する"}], "HeadingLevel": 2},+ {"ID": "20260908082237-qepobrf", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-qepobrf", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "デスクトップクライアントを完全に終了してから、"}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port] --trust-remote-extensions"}, {"Type": "NodeText", "Data": " を指定して起動できます。このオプションは既定では無効で、今回の起動で指定したサーバーにのみ適用されます。信頼リストには保存されず、ログイン時の自動起動引数にも自動では追加されません。別のインスタンスを起動しても、実行中のインスタンスの信頼状態は変わりません。信頼を取り消すには、完全に終了してからこのオプションを外して起動してください。"}]},+ {"ID": "20260908082237-843e8r9", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-843e8r9", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "有効にすると、リモートワークスペースのプラグイン、テーマスクリプト、アイコンスクリプト、JavaScript コードスニペットがローカルのデスクトップ環境で実行されます。これらは Node.js を使ってローカルファイルの読み書きやプログラムの実行ができます。サーバーと、今後の更新を含めてサーバーが提供する拡張機能のコードを信頼できる場合にのみ使用してください。"}]},+ {"ID": "20260908082237-jlqabtc", "Type": "NodeParagraph", "Properties": {"id": "20260908082237-jlqabtc", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "このオプションはプラグイン、マーケットプレイス、カスタムテーマ、アイコン、フォント、コードスニペットを有効にします。内蔵のフロントエンド、テーマ、アイコンは引き続きクライアントから読み込みます。ウィジェットおよびその他のリモートモードの制限は変わりません。プラグインのコードはクライアントで実行され、ワークスペースはサーバーにあります。ローカルのワークスペースパス、ネイティブモジュール、外部プログラムに依存するプラグインには対応作業が必要な場合があり、すべてのデスクトッププラグインとの互換性は保証されません。"}]},+ {"ID": "20260903150000-uo7ekyt", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-uo7ekyt", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "機能制限"}]},{"ID": "20260903150000-zbe0bfm", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-zbe0bfm", "updated": "20260903205342"}, "Children": [{"Type": "NodeText", "Data": "リモートモードでは、次の機能を利用できません。ローカルモードには影響しません。"}]},{"ID": "20260903150000-8orlk9f","Type": "NodeList","ListData": {},- "Properties": {"id": "20260903150000-8orlk9f", "updated": "20260903150000"},+ "Properties": {"id": "20260903150000-8orlk9f", "updated": "20260908082237"},"Children": [{"ID": "20260903150000-b5xb7ub", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-b5xb7ub", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-t5961l9", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-t5961l9", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "インポートとエクスポート"}]}]},{"ID": "20260903150000-xoz3jw0", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-xoz3jw0", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-rme1xbh", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-rme1xbh", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "ファイルのクリップボード操作"}]}]},{"ID": "20260903150000-3s8fcw7", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-3s8fcw7", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-p1m4g9q", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-p1m4g9q", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "クライアントのローカルパスまたはサーバーの絶対パスに依存する操作(ファイルマネージャーでの表示や、パスを使ったファイルのドラッグ&ドロップまたはオープンなど)。ファイル選択ダイアログからの通常のアセットアップロードは引き続き利用できます"}]}]},- {"ID": "20260903150000-j3snjto", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-j3snjto", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-adyybel", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-adyybel", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "デスクトッププラグイン、マーケットプレイス、ウィジェットは利用できません。クライアント内蔵の外観のみを使用し、リモートのカスタムテーマ、アイコン、フォント、コードスニペットは読み込みません"}]}]},+ {"ID": "20260903150000-j3snjto", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-j3snjto", "updated": "20260908082237"}, "Children": [{"ID": "20260903150000-adyybel", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-adyybel", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "デスクトッププラグイン、マーケットプレイス、カスタム外観は既定では無効です。上記の信頼オプションでリモートのプラグイン、マーケットプレイス、カスタムテーマ、アイコン、フォント、コードスニペットを有効にできますが、ウィジェットは引き続き利用できません"}]}]},{"ID": "20260903150000-x0al0du", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-x0al0du", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-di7qo01", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-di7qo01", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "HTML/SVG ブロック、データベーステンプレート、JavaScript クエリ埋め込みブロック内のスクリプトは実行されません。iframe ブロックは利用できません。チャート、ダイアグラム、数式などのレンダリング結果は安全のためサニタイズされます"}]}]},{"ID": "20260903150000-mmdrbxv", "Type": "NodeListItem", "ListData": {"BulletChar": 42, "Marker": "Kg=="}, "Properties": {"id": "20260903150000-mmdrbxv", "updated": "20260903150000"}, "Children": [{"ID": "20260903150000-nkf4jkp", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-nkf4jkp", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "アクセス認証コードによるログインのみをサポートし、OIDC ログインには対応していません"}]}]}]diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.tsindex 40c628ef6a..2437169069 100644--- a/app/src/boot/onGetConfig.ts+++ b/app/src/boot/onGetConfig.ts@@ -40,6 +40,17 @@ import {dispatchPluginGlobalShortcut} from "../plugin/globalShortcut";import {requestResponsiveDockLayout} from "../layout/dock/responsive";import {getHostCapabilities, setHostConnection, type TKernelConnection} from "../util/hostCapabilities";+export const loadDesktopHostConnection = async () => {+ /// #if !BROWSER+ try {+ // 加载扩展前先读取主进程的连接能力,信任状态不从远程配置或页面参数获取。+ setHostConnection(await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "kernelConnection"}));+ } catch (error) {+ console.error("load desktop host connection failed:", error);+ }+ /// #endif+};+export const initDesktopHost = async () => {/// #if !BROWSERtry {diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.tsindex ebdf8b23f8..309b717752 100644--- a/app/src/config/bazaar.ts+++ b/app/src/config/bazaar.ts@@ -4,6 +4,7 @@ import {confirmDialog} from "../dialog/confirmDialog";import {highlightRender} from "../protyle/render/highlightRender";import {Constants} from "../constants";import {getFrontend, isBrowser, isMobile} from "../util/functions";+import {getHostCapabilities} from "../util/hostCapabilities";import {hasPluginSetting, Plugin} from "../plugin";import type {App} from "../index";import {escapeAttr, escapeHtml} from "../util/escape";@@ -400,7 +401,7 @@ export const bazaar = {<span data-position="north" class="ariaLabel block__icon block__icon--show" data-type="uninstall" aria-label="${window.siyuan.languages.uninstall}"><svg><use xlink:href="#iconTrashcan"></use></svg></span>- <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}">+ <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() || !getHostCapabilities().localFileSystem ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}"><svg><use xlink:href="#iconFolder"></use></svg></span>${bazaar._genOpenStorageHTML(item, bazaarType)}@@ -411,7 +412,7 @@ export const bazaar = {if (bazaarType !== "plugins" || !item.hasStorageData) {return "";}- return `<span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() ? " fn__none" : ""}" data-type="open-storage" aria-label="${window.siyuan.languages.openStorageLocation}">+ return `<span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() || !getHostCapabilities().localFileSystem ? " fn__none" : ""}" data-type="open-storage" aria-label="${window.siyuan.languages.openStorageLocation}"><svg><use xlink:href="#iconDatabase"></use></svg></span>`;},@@ -603,7 +604,7 @@ ${primaryAction ? '<div class="fn__hr"></div>' : ""}${bazaar._genIncompatibleChipHTML(available, "bazaar", bazaarType)}${bazaar._genDeprecatedChipHTML(available)}${bazaar._genFundingHTML(installed.preferredFunding, false)}- <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}">+ <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() || !getHostCapabilities().localFileSystem ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}"><svg><use xlink:href="#iconFolder"></use></svg></span>${bazaar._genOpenStorageHTML(installed, bazaarType)}@@ -848,7 +849,7 @@ ${primaryAction ? '<div class="fn__hr"></div>' : ""}<span data-position="north" class="ariaLabel block__icon block__icon--show" data-type="uninstall" aria-label="${window.siyuan.languages.uninstall}"><svg><use xlink:href="#iconTrashcan"></use></svg></span>- <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}">+ <span data-position="north" class="ariaLabel block__icon block__icon--show${isBrowser() || !getHostCapabilities().localFileSystem ? " fn__none" : ""}" data-type="open" aria-label="${window.siyuan.languages.showInFolder}"><svg><use xlink:href="#iconFolder"></use></svg></span>${bazaar._genOpenStorageHTML(bazaarItem, bazaarType)}diff --git a/app/src/config/tabs/appearanceTab.ts b/app/src/config/tabs/appearanceTab.tsindex e5a47f9b31..cc58356326 100644--- a/app/src/config/tabs/appearanceTab.ts+++ b/app/src/config/tabs/appearanceTab.ts@@ -800,11 +800,13 @@ const registerAppearanceInterfaceGroup = (tab: SettingTabBuilder) => {}, (stack) => {stack.title(window.siyuan.languages.theme);/// #if !BROWSER- stack.button({- id: "appearanceOpenTheme",- label: window.siyuan.languages.appearance9,- icon: "iconFolder",- });+ if (getHostCapabilities().localFileSystem) {+ stack.button({+ id: "appearanceOpenTheme",+ label: window.siyuan.languages.appearance9,+ icon: "iconFolder",+ });+ }/// #endifstack.select("appearance.themeLight", {desc: window.siyuan.languages.theme11,@@ -840,11 +842,13 @@ const registerAppearanceInterfaceGroup = (tab: SettingTabBuilder) => {}, (stack) => {stack.title(window.siyuan.languages.icon);/// #if !BROWSER- stack.button({- id: "appearanceOpenIcon",- label: window.siyuan.languages.appearance8,- icon: "iconFolder",- });+ if (getHostCapabilities().localFileSystem) {+ stack.button({+ id: "appearanceOpenIcon",+ label: window.siyuan.languages.appearance8,+ icon: "iconFolder",+ });+ }/// #endifstack.select("appearance.icon", {desc: window.siyuan.languages.theme2,@@ -1197,18 +1201,20 @@ const registerAppearancePersonalizationGroup = (tab: SettingTabBuilder) => {const group = tab.group("personalization", window.siyuan.languages.configGroupPersonalization);/// #if !BROWSER- group.button({- id: "appearanceOpenEmoji",- title: window.siyuan.languages.customEmoji,- desc: window.siyuan.languages.customEmojiTip,- label: window.siyuan.languages.showInFolder,- icon: "iconFolder",- afterMount: (root) => {- root.querySelector("#appearanceOpenEmoji")?.addEventListener("click", () => {- useShell("openPath", path.join(window.siyuan.config.system.dataDir, "emojis"));- });- },- });+ if (getHostCapabilities().localFileSystem) {+ group.button({+ id: "appearanceOpenEmoji",+ title: window.siyuan.languages.customEmoji,+ desc: window.siyuan.languages.customEmojiTip,+ label: window.siyuan.languages.showInFolder,+ icon: "iconFolder",+ afterMount: (root) => {+ root.querySelector("#appearanceOpenEmoji")?.addEventListener("click", () => {+ useShell("openPath", path.join(window.siyuan.config.system.dataDir, "emojis"));+ });+ },+ });+ }/// #endifgroup.stack({key: "codeSnippet",diff --git a/app/src/config/util/snippets.ts b/app/src/config/util/snippets.tsindex 720cb2de14..504b633df8 100644--- a/app/src/config/util/snippets.ts+++ b/app/src/config/util/snippets.ts@@ -4,7 +4,7 @@ import {isMobile, objEquals} from "../../util/functions";import {confirmDialog} from "../../dialog/confirmDialog";import {Constants} from "../../constants";import {refreshHeadingNumberMeasurements} from "../../util/assets";-import {getHostCapabilities} from "../../util/hostCapabilities";+import {getExtensionScriptNonce, getHostCapabilities} from "../../util/hostCapabilities";export const renderSnippet = (timeout = 0) => {if (!getHostCapabilities().customAppearance) {@@ -50,6 +50,10 @@ export const renderSnippet = (timeout = 0) => {} else if (item.type === "js") {exitElement = document.createElement("script");exitElement.type = "text/javascript";+ const nonce = getExtensionScriptNonce();+ if (nonce) {+ exitElement.nonce = nonce;+ }exitElement.text = item.content;exitElement.id = id;document.head.appendChild(exitElement);diff --git a/app/src/index.ts b/app/src/index.tsindex d388a31e4d..30e665396c 100644--- a/app/src/index.ts+++ b/app/src/index.ts@@ -1,7 +1,7 @@import {Constants} from "./constants";import {Menus} from "./menus";import {Model} from "./layout/Model";-import {onGetConfig} from "./boot/onGetConfig";+import {loadDesktopHostConnection, onGetConfig} from "./boot/onGetConfig";import {initBlockPopover} from "./block/popover";import {applyCloudUserState, onSetaccount} from "./config/tabs/accountUi";import {addScript, addScriptSync} from "./protyle/util/addScript";@@ -305,6 +305,7 @@ export class App {await addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");window.siyuan.config = response.data.conf;+ await loadDesktopHostConnection();ensureUILayout();window.siyuan.isPublish = response.data.isPublish;setBodyHighlight();diff --git a/app/src/util/hostCapabilities.test.ts b/app/src/util/hostCapabilities.test.tsindex de3d567db1..c3fd5225a6 100644--- a/app/src/util/hostCapabilities.test.ts+++ b/app/src/util/hostCapabilities.test.ts@@ -1,6 +1,47 @@import {describe, it} from "node:test";import * as assert from "node:assert/strict";-import {detectRemoteKernel, hasRemoteArgument, isExternalURLAllowed, resolveRemoteKernel} from "./hostCapabilities";+import {+ detectRemoteKernel, hasRemoteArgument, isExternalURLAllowed, resolveHostCapabilities, resolveRemoteKernel,+ type TKernelConnection,+} from "./hostCapabilities";++describe("trusted remote extension capabilities", () => {+ const connection: TKernelConnection = {+ kernelMode: "remote", ownsKernel: false, kernelOrigin: "https://example.com",+ trustRemoteExtensions: true,+ };++ it("only enables plugins and appearance for the matching host connection", () => {+ const restricted = resolveHostCapabilities(true, undefined, connection.kernelOrigin);+ assert.equal(restricted.plugins, false);+ assert.equal(restricted.customAppearance, false);+ assert.deepEqual(resolveHostCapabilities(true, connection, connection.kernelOrigin), {+ ...restricted, plugins: true, customAppearance: true,+ });+ for (const origin of ["https://other.example.com", "https://example.com:8443", "http://example.com"]) {+ assert.deepEqual(resolveHostCapabilities(true, connection, origin), restricted);+ }+ assert.deepEqual(resolveHostCapabilities(true, {...connection, trustRemoteExtensions: false},+ connection.kernelOrigin), restricted);+ assert.deepEqual(resolveHostCapabilities(true, {...connection, kernelMode: "local"},+ connection.kernelOrigin), restricted);+ });++ it("does not grant trust from query strings or renderer command line arguments", () => {+ const remote = detectRemoteKernel("?remote=1&trustRemoteExtensions=true", ["--trust-remote-extensions"]);+ assert.equal(resolveHostCapabilities(remote, undefined, connection.kernelOrigin).plugins, false);+ });++ it("preserves local capabilities", () => {+ const local = resolveHostCapabilities(false, undefined, "https://127.0.0.1:6806");+ assert.equal(local.remoteKernel, false);+ for (const [name, value] of Object.entries(local)) {+ if (name !== "remoteKernel") {+ assert.equal(value, true, name);+ }+ }+ });+});describe("remote kernel detection", () => {it("detects the remote query", () => {diff --git a/app/src/util/hostCapabilities.ts b/app/src/util/hostCapabilities.tsindex 5c16bda45c..0a9f929f51 100644--- a/app/src/util/hostCapabilities.ts+++ b/app/src/util/hostCapabilities.ts@@ -2,6 +2,8 @@ export type TKernelConnection = {kernelMode: "local" | "remote";ownsKernel: boolean;kernelOrigin: string;+ trustRemoteExtensions?: boolean;+ extensionScriptNonce?: string;};export type THostCapabilities = {@@ -46,22 +48,30 @@ export const setHostConnection = (connection: TKernelConnection | undefined) =>export const isRemoteKernel = () => resolveRemoteKernel(hostConnection, window.location.search, getProcessArgs());-export const getHostCapabilities = (): THostCapabilities => {- const remoteKernel = isRemoteKernel();- const ownsKernel = !remoteKernel && hostConnection?.ownsKernel !== false;+export const resolveHostCapabilities = (remoteKernel: boolean, connection: TKernelConnection | undefined,+ origin: string): THostCapabilities => {+ const ownsKernel = !remoteKernel && connection?.ownsKernel !== false;+ const trustedExtensions = remoteKernel && connection?.kernelMode === "remote" &&+ connection.kernelOrigin === origin && connection.trustRemoteExtensions === true;return {remoteKernel,ownsKernel,localFileSystem: !remoteKernel,importExport: !remoteKernel,- plugins: !remoteKernel,+ plugins: !remoteKernel || trustedExtensions,workspaces: !remoteKernel,- customAppearance: !remoteKernel,+ customAppearance: !remoteKernel || trustedExtensions,widgets: !remoteKernel,oidcAuthentication: !remoteKernel,};};+export const getHostCapabilities = (): THostCapabilities =>+ resolveHostCapabilities(isRemoteKernel(), hostConnection, window.location.origin);++export const getExtensionScriptNonce = () => isRemoteKernel() && getHostCapabilities().customAppearance+ ? hostConnection?.extensionScriptNonce : undefined;+export const appendRemoteQuery = (url: URL) => {if (isRemoteKernel()) {url.searchParams.set("remote", "1");diff --git a/app/src/window/desktopHostInitialization.test.ts b/app/src/window/desktopHostInitialization.test.tsindex 260f46da3c..f360403662 100644--- a/app/src/window/desktopHostInitialization.test.ts+++ b/app/src/window/desktopHostInitialization.test.ts@@ -4,6 +4,15 @@ import {readFileSync} from "node:fs";import {resolve} from "node:path";describe("desktop host initialization", () => {+ it("awaits host capabilities before loading extensions in both desktop windows", () => {+ for (const file of ["src/index.ts", "src/window/index.ts"]) {+ const source = readFileSync(resolve(process.cwd(), file), "utf8");+ const connectionIndex = source.indexOf("await loadDesktopHostConnection();");+ assert.ok(connectionIndex > source.indexOf("window.siyuan.config = response.data.conf;"));+ assert.ok(connectionIndex < source.indexOf("await loadPlugins(this);"));+ }+ });+it("registers main and detached windows before desktop event handling", () => {const mainSource = readFileSync(resolve(process.cwd(), "src/boot/onGetConfig.ts"), "utf8");const detachedSource = readFileSync(resolve(process.cwd(), "src/window/init.ts"), "utf8");diff --git a/app/src/window/index.ts b/app/src/window/index.tsindex 4e8ac607a4..8e0590b0c1 100644--- a/app/src/window/index.ts+++ b/app/src/window/index.ts@@ -22,6 +22,7 @@ import {initMessage} from "../dialog/message";import {getAllTabs} from "../layout/getAll";import {getLocalStorage} from "../protyle/util/compatibility";import {init} from "./init";+import {loadDesktopHostConnection} from "../boot/onGetConfig";import {loadPlugins} from "../plugin/loader";import {applyPluginReload, syncGlobalPluginConfig} from "../plugin/globalState";import {hideAllElements} from "../protyle/ui/hideElements";@@ -212,6 +213,7 @@ class App {await addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");window.siyuan.config = response.data.conf;+ await loadDesktopHostConnection();ensureUILayout();setBodyHighlight();window.siyuan.isPublish = response.data.isPublish;