Commit Graph

7476 Commits

Author SHA1 Message Date
Daniel b868ec0bbb 🎨 File exports no longer rely on browser downloads on mobile https://github.com/siyuan-note/siyuan/issues/17580
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 21:57:01 +08:00
Daniel 4ad66c2eee 🎨 File exports no longer rely on browser downloads on mobile https://github.com/siyuan-note/siyuan/issues/17580
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 19:51:42 +08:00
Daniel 1987ec3aba 🎨 Improve data indexing stability https://github.com/siyuan-note/siyuan/issues/17610
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 17:53:33 +08:00
Daniel 6674933fa2 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 17:31:08 +08:00
Daniel e4c346b65d 🎨 Improve data indexing stability https://github.com/siyuan-note/siyuan/issues/17610
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 16:59:55 +08:00
Daniel 2e33429a37 🎨 Improve index queue https://github.com/siyuan-note/siyuan/issues/17694
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 14:41:53 +08:00
Daniel 2a5356a236 🎨 Improve index queue
Signed-off-by: Daniel <845765@qq.com>
2026-05-16 14:41:53 +08:00
Daniel 4c72b64e49 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-15 21:51:10 +08:00
Daniel 68fe206e93 ⬆️ Upgrade lute
Signed-off-by: Daniel <845765@qq.com>
2026-05-15 16:15:34 +08:00
Daniel aa531b0ce4 ⬆️ Upgrade lute
Signed-off-by: Daniel <845765@qq.com>
2026-05-15 09:51:36 +08:00
Daniel 82fa906966 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 22:53:16 +08:00
Daniel 7d3225164c ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 20:49:07 +08:00
Daniel d7d06a98e1 ✨ New default appearance icon https://github.com/siyuan-note/siyuan/issues/7976
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 12:37:47 +08:00
Daniel 9f9769c6d5 ✨ New default appearance icon https://github.com/siyuan-note/siyuan/issues/7976
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 12:37:47 +08:00
Daniel d7bb2fb176 ✨ New default appearance icon https://github.com/siyuan-note/siyuan/issues/7976
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 12:37:47 +08:00
Daniel 269d3af9f5 ✨ New default appearance icon https://github.com/siyuan-note/siyuan/issues/7976
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 12:37:46 +08:00
Daniel 20cbd21b7a ✨ New default appearance icon https://github.com/siyuan-note/siyuan/issues/7976
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 10:29:03 +08:00
Daniel d9bc87d95a ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 09:52:14 +08:00
Daniel eaa3a35e5a ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 09:44:30 +08:00
Daniel a50b15fbbd ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 09:35:43 +08:00
Daniel ade459cf08 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-14 00:05:36 +08:00
Daniel e1482b4141 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 22:36:54 +08:00
Daniel 6c4471aff1 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 21:41:59 +08:00
Daniel b0177c4aa1 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 21:18:21 +08:00
Daniel b6ba091f7d ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 19:55:40 +08:00
Daniel 490ede88f6 ✨ Command Line Interface https://github.com/siyuan-note/siyuan/issues/17674
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 16:41:58 +08:00
Daniel 1dd7321fd5 🎨 Supports returning a list of files from data snapshots via filename search https://github.com/siyuan-note/siyuan/issues/17258
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 11:26:35 +08:00
Daniel 2bfa97a802 🎨 Supports returning a list of files from data snapshots via filename search https://github.com/siyuan-note/siyuan/issues/17258
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 10:31:12 +08:00
Daniel b00314167d 🔨 Update build scripts
Signed-off-by: Daniel <845765@qq.com>
2026-05-13 08:55:13 +08:00
Yingyi / 颖逸 c4ae1d44e5 🎨 Fix kernel plugin related issues (#17670)
* feat(kernel-plugin): Prevent storage.put and storage.remove in read-only mode

* feat(kernel-plugin): Reload petal plugin on install

When installing a Bazaar package, ensure that if the corresponding petal exists and is enabled we call SetPetalEnabled to trigger a kernel plugin reload before scheduling the plugin reload. This ensures the petal's kernel plugin picks up the newly installed package immediately.

* feat(kernel-plugin): Use gin-contrib/sse.Event for SSE handling

Replace the custom sseEvent type with gin-contrib/sse.Event and update the SSE handling pipeline. The JS handler now accepts an event object (data, event, id, retry), which is validated and converted to sse.Event before being sent on the channel; the server renders events with c.Render(-1, e). Added import for github.com/gin-contrib/sse and bumped gin-contrib/sse to v1.1.1 in go.mod (go.sum updated accordingly).

* feat(kernel-plugin): Add global kernel plugin start/stop hooks

Introduce OnKernelPluginsStart and OnKernelPluginsStop hooks and replace the previous OnKernelPluginShutdown usage. Update Close to call OnKernelPluginsStop and wire the new hooks in the plugin manager (OnKernelPluginsStart -> GetManager().Start, OnKernelPluginsStop -> GetManager().Stop). Existing per-plugin OnKernelPluginStart/OnKernelPluginStop handlers remain unchanged. This adds global lifecycle hooks to start and stop all valid plugins via the manager.

* feat(kernel-plugin): Add plugin manager state and bazaar handling

Call kernel plugin start/stop callbacks when bazaar settings change and add lifecycle state to the PluginManager. setting.go now triggers model.OnKernelPluginsStop or model.OnKernelPluginsStart when Bazaar.PetalDisabled or Bazaar.Trust change. plugin/manager.go introduces a PluginManagerState enum, initializes the manager as stopped, adds a State() accessor, and changes lifecycleMu to an RWMutex. Start/Stop now check the current state to avoid redundant operations, skip starting if bazaar config disables plugins, and update the manager state after start/stop, with additional log messages. These changes improve safety around concurrent start/stop and ensure bazaar configuration is honored.

* feat(kernel-plugin): Add plugin hot-reload watcher and per-plugin dirs

Add fsnotify-based watcher and manager context to detect kernel.js changes and trigger plugin hot-reloads. Introduce pluginsDir, pluginDir and storageDir fields and use storageDir in storage API to prevent path traversal. Replace single plugin mutex map with per-plugin mutex map, serialize start/stop per plugin, and adjust StartPlugin/StopPlugin flow to stop first for hot-reload, honor Bazaar config flags, and propagate start context. Update KernelPlugin to accept a start context and set per-plugin directories. Add helper functions to add/remove plugin dirs from the watcher and simplify GetLoadedPlugin. (Note: go.sum changes are present but not described.)

* feat(kernel-plugin): Add storage watcher and plugin reload improvements

Introduce per-plugin fsnotify storage watcher and expose a JS API for it (siyuan.storage.watcher.add/remove). KernelPlugin now accepts a parent context, creates an fsnotify.Watcher, starts a storage watch goroutine that publishes standardized runtime events (createEventMessage) for fs changes, and provides addStorageWatch/removeStorageWatch helpers. Manager API renamed to addPluginSourceWatch/removePluginSourceWatch with safer watcher handling and clearer reload logging; StartPlugin now passes the manager context into NewKernelPlugin. Also refactor runtime start/stop event publishing to use createEventMessage and add minor logging/error handling for watcher creation and path watch operations. The JS watcher object is frozen and integrated into siyuan.storage.
2026-05-13 08:24:46 +08:00
Daniel ccd35d5af0 ⬆️ Upgrade lute
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 21:02:11 +08:00
Daniel 08f3a81ae2 🔒 Stored XSS via Attribute View name to Electron renderer RCE in SiYuan https://github.com/siyuan-note/siyuan/security/advisories/GHSA-2h64-c999-c9r6
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 19:59:25 +08:00
Daniel 8626d7f1c3 🐛 Fix npe
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 19:02:20 +08:00
Daniel 55726b30cd ⬆️ Upgrade lute
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 17:59:58 +08:00
Daniel 94082e9b2d 🔒 Fix some security vulnerabilities CNVD-2026-19400
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 17:58:15 +08:00
Daniel dfb331e589 🎨 Clear all cached data when open the user guide
Signed-off-by: Daniel <845765@qq.com>
2026-05-12 00:14:15 +08:00
Daniel fe8f96da48 🎨 Supports returning a list of files from data snapshots via filename search https://github.com/siyuan-note/siyuan/issues/17258
Signed-off-by: Daniel <845765@qq.com>
2026-05-11 20:24:34 +08:00
Daniel 4b1c10ee94 🎨 Supports returning a list of files from data snapshots via filename search https://github.com/siyuan-note/siyuan/issues/17258
Signed-off-by: Daniel <845765@qq.com>
2026-05-11 20:03:16 +08:00
Jeffrey Chen 6ee1b8d989 Improve export file (#17647)
* 🎨 Improve export file

* 🎨 Improve export file
2026-05-11 12:57:52 +08:00
Jeffrey Chen c20212594d ♻️ Extract IsMobileContainer and replace the mobile ternary judgment (#17661) 2026-05-11 00:03:33 +08:00
Daniel 971bfb4786 🔨 Update build scripts
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 23:38:44 +08:00
Jeffrey Chen ff9d839c00 🔒 Escape package name, version, keywords and funding https://github.com/siyuan-note/siyuan/security/advisories/GHSA-27qc-m5gf-jv5r (#17660) 2026-05-10 23:32:19 +08:00
Daniel 74cdf2ca9f 🔒 https://github.com/siyuan-note/siyuan/security/advisories/GHSA-gmmv-4cc5-wr9r
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 20:09:48 +08:00
Daniel 58da3744e1 🎨 Improve text
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 19:59:40 +08:00
Daniel 038dc6e183 🎨 Improve wal queue
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 19:32:03 +08:00
Qiaochu Hu 3071ad22d4 🔒 Use parameterized queries in putStat to prevent SQL injection (#17658)
The putStat function in kernel/sql/stat.go was building SQL queries
via string concatenation instead of using parameterized queries.
While currently only called with hardcoded internal values, this is
a defense-in-depth improvement that prevents future SQL injection
if the function is ever called with user-controlled input.

The execStmtTx helper already supports variadic args, so this is
a straightforward change to use ? placeholders.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 19:24:21 +08:00
Qiaochu Hu 890d2c5a67 🔒 Fix path traversal vulnerability in /repo/diff/ endpoint (#17657)
The /repo/diff/ endpoint used the URL path parameter directly in
filepath.Join without validation, allowing an authenticated admin
user to read arbitrary files via path traversal sequences.

This fix:
- Cleans the path with filepath.Clean
- Rejects paths containing ".."
- Validates the final path with IsSubPath to ensure it stays within
  {TempDir}/repo/diff/

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 19:20:31 +08:00
Qiaochu Hu b763d787d1 🔒 Fix path traversal vulnerability in /export/temp/ endpoint (#17656)
The /export/temp/ endpoint used c.Request.URL.Path directly in
filepath.Join without any validation, allowing path traversal via
sequences like /export/temp/../../ to access files outside the
intended temp directory.

This fix:
- Constrains file access to {TempDir}/export/temp/ base directory
- Cleans the relative path with filepath.Clean
- Rejects paths containing ".."
- Validates the final path with IsSubPath check

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 19:01:32 +08:00
Daniel 06065475cd 🎨 Improve text https://github.com/siyuan-note/siyuan/issues/14414
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 15:36:29 +08:00
Daniel 87eee0db67 ✨ Shorthands on HarmonyOS https://github.com/siyuan-note/siyuan/issues/17654
Signed-off-by: Daniel <845765@qq.com>
2026-05-10 13:46:42 +08:00