Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ body:
label: Logs
description: Please go to plugin settings - `Development` - `Export logs`, click `Export`, copy and paste the content of the full log. This will be automatically formatted into code, so no need for backticks.
render: shell
placeholder: If the log contains information that you think is improper to disclose, it's OK to only paste sections with `ERROR` labels.
placeholder: If the log contains information that is improper to disclose, it's OK to only paste "General logs" and sections with "ERROR" labels.

- type: checkboxes
id: terms
Expand All @@ -61,7 +61,7 @@ body:
- type: markdown
attributes:
value: |
- I have updated Sync Engine to the latest version but the bug persists.
- I have updated Sync Engine and its modules to latest versions but the bug persists. The latest version of Sync Engine can be found in the [GitHub releases page](https://github.com/hesprs/sync-engine/releases/latest) and modules versions are in [the module catalog in the documentation website](https://sync.consensia.cc/usage/modules).
- I have provided clear and reproducible information about the bug.
- I have ensured that this issue only contains one bug.
- I have checked historical bugs and there's no entry fitting this scenario.
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

All notable changes to this project will be documented in this file.

## Sync Engine v3.4.2 - 2026-11-13

### Core

- Supported editing module version in the module editor.
- Fixed the bug that causes module update button to never show when auto-update is disabled.
- Added module management menu item to manually refresh sources.
- Add a loading indicator when module sources are being loaded.
- Ensured network response headers are always normalized to lowercase.

### WebDAV Module

- Implemented support for digest authorization and automatic digest authorization detection.

### Google Drive Module

- Fixed the bug that when base directory is `/`, sync planning reports to delete all local files after upload.
- Missing account ID is now treated as not authenticated to prevent mysterious record mismatch and decryption error.

### Rclone S3 Timestamp Module

- Implement the module to transform `x-amz-meta-mtime` header to second precision to make Rclone parse and apply modification time to server files.

### Dropbox Module

- Missing account ID is now treated as not authenticated to prevent mysterious record mismatch and decryption error.

### Contributors

@alan16742, @hesprs

## Sync Engine v3.4.1 - 2026-11-08

### Core
Expand Down
2 changes: 2 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion docs/src/pages/en/deep-dive/extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ New modules are disabled by default. The downloaded text is integrity-checked be

### Install From File

The module management menu also offers **Install module from file**. The user picks a `.js` file (other extensions are rejected with a notice), and the module editor opens with metadata prefilled from the file's magic bytes, a leading `/*! ... */` comment of `key: value` lines embedded at build time. On save, `installModule()` writes the file to the module directory, stores the confirmed metadata, and loads the module when it is enabled. No source is involved in this path.
The module management menu also offers **Install module from file**. The user picks a `.js` or `.mjs` file (other extensions are rejected with a notice), and the module editor opens with metadata prefilled from the file's magic bytes, a leading `/*! ... */` comment of `key: value` lines embedded at build time. On save, `installModule()` writes the file to the module directory, stores the confirmed metadata, and loads the module when it is enabled. No source is involved in this path.

### Install From Code

The module management menu also offers **Install module from code**. The user pastes module code into a code input modal, and the module editor opens with metadata prefilled from the code's magic bytes. On save, `installModule()` writes the code to the module directory, stores the confirmed metadata, and loads the module when it is enabled. No source is involved in this path.

### Automatic Update

Expand Down
10 changes: 5 additions & 5 deletions docs/src/pages/en/deep-dive/module-management-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Sync Engine uses a native Obsidian settings page to manage executable modules fr
`ModuleManagement` extends Obsidian's `SettingPage`. Its page contains:

- a full-width search field;
- an icon button that opens a menu with the **Show installed only** toggle and **Install module from file**;
- a Solid.js module-card list.
- an icon button that opens a menu with the **Show installed only** toggle, **Install module from file**, **Install module from code**, and **Refresh sources**;
- a Solid.js module-card grid.

Module source URLs are edited separately on **Settings > Sync Engine > Development > Module sources**. Returning to Module management creates a new source snapshot and refreshes the catalog.

The search field uses Obsidian's `SearchComponent`. An empty query sorts modules alphabetically. A non-empty query uses `prepareFuzzySearch()` against module names and descriptions, then sorts by match score and name.
The search field uses Obsidian's `SearchComponent`. An empty query sorts modules alphabetically by module ID. A non-empty query uses `prepareFuzzySearch()` against module names and descriptions, then sorts by match score and module ID.

**Install module from file** opens a file picker that only accepts `.js` files; other extensions are rejected with a notice. The chosen file opens the module editor with metadata prefilled from the file's magic bytes, see [extensibility: install from file](./extensibility#install-from-file).
**Install module from file** opens a file picker that accepts `.js` and `.mjs` files; other extensions are rejected with a notice. The chosen file opens the module editor with metadata prefilled from the file's magic bytes, see [extensibility: install from file](./extensibility#install-from-file). **Install module from code** opens a code input modal where the user pastes module code, then follows the same editor flow.

## Module Cards

Expand All @@ -31,7 +31,7 @@ Actions are disabled while another action for the same module is running. Runnin

## Source And Compatibility State

`fetchSources()` reads every configured source. Source responses are cached for automatic update checks and can be forced to refresh for manual operations. Duplicate IDs within a source are ignored.
`fetchSources()` reads every configured source. Source responses are cached for automatic update checks. The **Refresh sources** menu item forces a refresh and shows a notice with the number of discovered modules and sources. Duplicate IDs within a source are ignored.

If a source entry declares a `minPluginVersion` newer than the running plugin, the catalog marks the plugin as outdated. Update Sync Engine before installing modules that require the newer version.

Expand Down
6 changes: 5 additions & 1 deletion docs/src/pages/en/deep-dive/modules/webdav.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The WebDAV module registers the `webdav` remote file system. It implements the [

## Supported Backends

The standard mode can theoretically work with any WebDAV service that supports HTTP(S), Basic authentication, ranged `GET`, `PROPFIND`, `PUT`, `DELETE`, `MOVE`, and `MKCOL`. This includes WebDAV installations based on:
The standard mode can theoretically work with any WebDAV service that supports HTTP(S), Basic or Digest (MD5) authentication, ranged `GET`, `PROPFIND`, `PUT`, `DELETE`, `MOVE`, and `MKCOL`. This includes WebDAV installations based on:

- Nextcloud
- ownCloud
Expand All @@ -20,6 +20,10 @@ The standard mode can theoretically work with any WebDAV service that supports H

The optional chunked-upload mode requires Nextcloud's upload protocol and is not standard WebDAV. Enable it only for compatible Nextcloud servers.

## Authentication

The module sends Basic credentials first. When the server answers with `401` and a Digest challenge, it switches to Digest (MD5 with `qop=auth`, or the legacy scheme without `qop`) and caches the challenge state in the in-memory database, keyed by endpoint, username, and password. Challenges naming other algorithms are declined, and the module keeps sending Basic credentials.

## Settings

The module registers these settings:
Expand Down
5 changes: 3 additions & 2 deletions docs/src/pages/en/development/develop-a-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ export default defineConfig({
minify: true,
outExtensions: () => ({ js: '.js' }),
outputOptions: { codeSplitting: false },
platform: 'browser',
plugins: [syncEngineModule()],
});
```

This config makes Tsdown output a single minified JavaScript file, which can be directly loaded by Sync Engine core. The `syncEngineModule` plugin bridges Obsidian API imports and can embed module metadata as magic bytes, see [Tsdown Plugin](#tsdown-plugin).
This config makes Tsdown output a single minified JavaScript file, which can be directly loaded by Sync Engine core. The `syncEngineModule` plugin bridges Obsidian API imports and can embed module metadata as magic bytes, see [Tsdown Plugin](#tsdown-plugin). `platform: 'browser'` targets the browser runtime that loads modules inside Obsidian's renderer.

Finally add following commands to your `package.json`:

Expand Down Expand Up @@ -163,7 +164,7 @@ You can found abundant module examples in Sync Engine monorepo:

- [Encryption](https://github.com/hesprs/sync-engine/tree/main/packages/encryption): uses settings, i18n, file system, and in-memory database API.
- [Smart Merge](https://github.com/hesprs/sync-engine/tree/main/packages/smart-merge): uses settings, i18n, file system, IndexedDB, and conflict resolution API.
- [WebDAV](ttps://github.com/hesprs/sync-engine/tree/main/packages/webdav): great example of how to add a backend to Sync Engine.
- [WebDAV](https://github.com/hesprs/sync-engine/tree/main/packages/webdav): great example of how to add a backend to Sync Engine.

## Build A Feedback Loop

Expand Down
4 changes: 3 additions & 1 deletion docs/src/pages/en/development/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ Version and metadata are persisted in IndexedDB (`AugmentedModuleMeta`). For det

When `Auto update modules` is enabled, on plugin load the plugin:

1. Waits 200 milliseconds.
1. Waits 500 milliseconds.
2. Fetches all configured source URLs.
3. For each installed module, compares the remote version with the local version.
4. If the remote version is newer, queues a download.
5. Waits for the sync engine to be idle, then downloads and replaces the module file.

The update check is skipped while the device reports being offline.

Only already-installed modules are auto-updated. New modules must be manually installed via the Module Management UI.

## Publishing a Module
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/en/development/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ unsubscribe();
| `logGeneral` | `string` general log message |
| `errorSync` | `Error` sync error |
| `errorGeneral` | `Error` general error |
| `moduleLoaded` | `string` module name |
| `moduleLoaded` | `AugmentedModuleMeta` module metadata |
| `moduleUnloaded` | `string` module name |
| `syncStarted` | `{ isCancelled: Ref<boolean>; trigger: string }` |
| `syncInitialized` | `Infras & { match: (path: string) => GlobMatchResult }`: the run's file systems, record store, and compiled matcher |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/en/usage/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Sync Engine plugin and `sync.consensia.cc` don't contain any type of telemetry.
Obsidian secret storage is shown as "Keychain" in Obsidian settings. Sync Engine and official modules acquire secrets in following scenarios:

- Plugin core: reads the configured [secret headers](./settings#custom-headers) at the start of a sync run
- [WebDAV](../deep-dive/modules/webdav) module: reads the configured WebDAV token secret at the start of a sync run for service authentication
- [WebDAV](../deep-dive/modules/webdav) module: reads the configured WebDAV password secret at the start of a sync run for service authentication
- [S3](../deep-dive/modules/s3) module: reads the configured secret access key when resolving S3 credentials for connection checks or sync operations
- [Google Drive](../deep-dive/modules/gdrive) module: manages a secret named `sync-engine-gdrive-refresh-token` automatically and uses that for authorizing connection checks and sync operations.
- [Dropbox](../deep-dive/modules/dropbox) module: manages a secret named `sync-engine-dropbox-refresh-token` automatically and uses that for authorizing connection checks and sync operations.
Expand Down
11 changes: 6 additions & 5 deletions docs/src/pages/en/usage/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Choose the installed module that connects Sync Engine to your storage service. T

### Module Management

Open the module management page. From there, you can install modules from sources or local files, and update, enable, disable, remove, or edit modules. Modules provide storage backends and extra sync strategies. Review [Security](./security) before installing modules from sources you do not control.
Open the module management page. From there, you can install modules from sources, local files, or pasted code, and update, enable, disable, remove, or edit modules. Modules provide storage backends and extra sync strategies. Review [Security](./security) before installing modules from sources you do not control.

The [module management page](../deep-dive/module-management-page) contains a search bar, an installed-only filter, an install-from-file entry, and module cards. Module source URLs are edited in the **Module sources** page under Development.
The [module management page](../deep-dive/module-management-page) contains a search bar, an installed-only filter, install-from-file and install-from-code entries, a refresh-sources entry, and module cards. Module source URLs are edited in the **Module sources** page under Development.

### Auto-Update Modules

Expand Down Expand Up @@ -163,9 +163,10 @@ Rules use [`glob` expressions](<https://en.wikipedia.org/wiki/Glob_(programming)
- `**` matches any number of segments, including none.
- `?` matches one character.
- `[abc]` matches one character from the set.
- `[!abc]` matches one outside thr set.
- `[!abc]` matches one outside the set.
- `{a,b,c}` matches any listed variants, and braces can nest.
- End a rule with `/` to match folders only. A rule containing a slash (other than a trailing one) starts matching from the vault root; otherwise it matches at any depth.
- End a rule with `/` to match folders only.
- A rule starting with `/` starts matching from the vault root; otherwise it matches at any depth.
- Rules are case-sensitive: `Temp` does not match `temp`.

::: tip
Expand Down Expand Up @@ -230,4 +231,4 @@ Write Sync Engine's logs to a file in `<vault root>/Sync Engine Logs/` folder. U

Edit the URLs Sync Engine uses to obtain the module catalog. URLs must use `http:` or `https:` and invalid entries are marked until corrected; use HTTPS whenever possible.

The default source is `https://sync.consensia.cc/modules.json`. An alternative GitHub-hosted source `https://raw.githubusercontent.com/hesprs/sync-engine/refs/heads/gh-pages/modules-alternative.json` is available for networks that cannot reach the default source. Use one official source at a time to avoid duplicate module entries.
The default source is `https://sync.consensia.cc/modules.json`. An alternative GitHub-hosted source `https://raw.githubusercontent.com/hesprs/sync-engine/refs/heads/gh-pages/modules-alternative.json` is available for networks that cannot reach the default source. Use one official source at a time to avoid duplicating module entries.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "sync-engine",
"name": "Sync Engine",
"version": "3.4.1",
"version": "3.4.2",
"minAppVersion": "1.13.0",
"authorUrl": "https://hesprs.github.io",
"description": "The extensible vault synchronization engine: Fast · Free · Reliable. Supports WebDAV, S3, Google Drive, and Dropbox.",
Expand Down
26 changes: 13 additions & 13 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
{
"id": "webdav",
"name": "WebDAV",
"version": "1.0.0",
"version": "1.1.0",
"description": "WebDAV backend support.",
"icon": "server",
"main": "https://sync.consensia.cc/modules/webdav.js",
"minPluginVersion": "3.4.0",
"minPluginVersion": "3.4.2",
"readme": "https://sync.consensia.cc/deep-dive/modules/webdav"
},
{
"id": "s3",
"name": "S3",
"version": "1.0.0",
"version": "1.0.1",
"description": "S3 and S3-compatible backend support.",
"icon": "server",
"main": "https://sync.consensia.cc/modules/s3.js",
"minPluginVersion": "3.4.0",
"minPluginVersion": "3.4.2",
"readme": "https://sync.consensia.cc/deep-dive/modules/s3"
},
{
"id": "gdrive",
"name": "Google Drive",
"version": "1.0.1",
"version": "1.0.2",
"description": "Google Drive backend support.",
"icon": "server",
"main": "https://sync.consensia.cc/modules/gdrive.js",
"minPluginVersion": "3.4.0",
"minPluginVersion": "3.4.2",
"readme": "https://sync.consensia.cc/deep-dive/modules/gdrive"
},
{
"id": "dropbox",
"name": "Dropbox",
"version": "0.1.0",
"version": "0.1.1",
"description": "[Beta] Dropbox backend support.",
"icon": "server",
"main": "https://sync.consensia.cc/modules/dropbox.js",
Expand All @@ -42,7 +42,7 @@
{
"id": "encryption",
"name": "Encryption",
"version": "1.0.0",
"version": "1.0.1",
"description": "Client-side encrypt vault files before uploading to backend.",
"icon": "key-round",
"main": "https://sync.consensia.cc/modules/encryption.js",
Expand All @@ -52,7 +52,7 @@
{
"id": "i18n-zh",
"name": "I18n 简体中文",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simplified Chinese UI language pack. / 简体中文介面语言包。",
"icon": "languages",
"main": "https://sync.consensia.cc/modules/i18n-zh.js",
Expand All @@ -61,7 +61,7 @@
{
"id": "i18n-zh-TW",
"name": "I18n 繁體中文",
"version": "1.0.0",
"version": "1.0.1",
"description": "Traditional Chinese UI language pack. / 繁體中文介面語言包。",
"icon": "languages",
"main": "https://sync.consensia.cc/modules/i18n-zh-TW.js",
Expand All @@ -70,7 +70,7 @@
{
"id": "i18n-ru",
"name": "I18n Русский",
"version": "1.0.0",
"version": "1.0.1",
"description": "Russian UI language pack. / Пакет русского интерфейса.",
"icon": "languages",
"main": "https://sync.consensia.cc/modules/i18n-ru.js",
Expand All @@ -89,11 +89,11 @@
{
"id": "rclone-s3-timestamp",
"name": "Rclone S3 Timestamp",
"version": "0.1.0",
"version": "0.1.1",
"description": "Preserves file modification times at server side if you are using \"Rclone serve S3\". This module depends on the S3 module.",
"icon": "bandage",
"main": "https://sync.consensia.cc/modules/rclone-s3-timestamp.js",
"minPluginVersion": "3.3.0",
"minPluginVersion": "3.4.2",
"readme": "https://sync.consensia.cc/deep-dive/modules/rclone-s3-timestamp"
}
]
3 changes: 2 additions & 1 deletion packages/dropbox/src/dropbox/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { requestUrl } from 'obsidian';
import type { Binary, Request, StringKV } from '@hesprs/sync-engine-sdk';
import type { ObsidianProtocolData, SecretStorage } from 'obsidian';

export const AUTH_ERROR_MESSAGE = 'Please authenticate the Dropbox account!';
export const APP_KEY = atob(process.env.DROPBOX_APP_KEY ?? '');
export const REDIRECT_URI = 'obsidian://sync-engine-dropbox-auth';
export const OAUTH_SCOPE = 'files.content.read files.content.write files.metadata.read';
Expand Down Expand Up @@ -134,7 +135,7 @@ export class TokenManager {

private async refresh(): Promise<string> {
const refresh_token = this.getRefreshToken();
if (!refresh_token) throw new Error('Please authorize the Dropbox account!');
if (!refresh_token) throw new Error(AUTH_ERROR_MESSAGE);
const response = await requestUrl({
body: formEncode({ client_id: APP_KEY, grant_type: 'refresh_token', refresh_token }),
contentType: FORM_CONTENT_TYPE,
Expand Down
7 changes: 6 additions & 1 deletion packages/dropbox/src/dropbox/check-connection.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { rpc } from './api';
import { AUTH_ERROR_MESSAGE } from './auth';
import { toError } from '@repo/shared/error';
import type { Request } from '@hesprs/sync-engine-sdk';

/** Validates the token by listing the app folder root, the lightest permission-honoring call. */
export default async function checkConnection(request: Request): Promise<void | Error> {
export default async function checkConnection(
request: Request,
accountId: string,
): Promise<void | Error> {
if (!accountId) return new Error(AUTH_ERROR_MESSAGE);
try {
await rpc(request, '/2/files/list_folder', { path: '' });
} catch (error) {
Expand Down
Loading
Loading