25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(sync): support ZIP snapshots for restricted WebDAV services
t8y23fa23a6e4708
diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vueindex 864e32adfa..31bdc3884c 100644--- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue+++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue@@ -9845,7 +9845,7 @@ LIMIT 100;</pre</div><div class="space-y-2 md:col-span-2"><Label for="webdav-user-agent">{{ t("settings.syncUserAgent") }}</Label>- <Input id="webdav-user-agent" v-model="webdavUserAgent" autocomplete="off" placeholder="Zotero/7.0.15" />+ <Input id="webdav-user-agent" v-model="webdavUserAgent" autocomplete="off" placeholder="Zotero/10.0.0" /><p class="text-xs text-muted-foreground">{{ t("settings.syncUserAgentDescription") }}</p>diff --git a/apps/desktop/src/i18n/locales/az.ts b/apps/desktop/src/i18n/locales/az.tsindex f474e41bb7..d4acd515ea 100644--- a/apps/desktop/src/i18n/locales/az.ts+++ b/apps/desktop/src/i18n/locales/az.ts@@ -7587,9 +7587,9 @@ export default withEnglishFallback({syncSavedPassword: "(yadda saxlanılıb)",syncRememberWebDavPasswordDescription: "Parol şifrələnir və yalnız cari DBX instansiyasında saxlanılır. WebDAV ilə sinxronlaşdırılmır və sinxronlaşdırma parolunu əvəz etmir.",syncRemotePath: "Uzaq anlıq nüsxənin yolu",- syncRemotePathDescription: "Yükləmə zamanı DBX çatışmayan üst qovluqları yaradacaq.",+ syncRemotePathDescription: "DBX çatışmayan üst qovluqları yaradır. ZIP surəti yükləmək üçün yolu .zip ilə bitirin (məsələn, DBX/sync/snapshot.zip); digər yollar JSON istifadə edir. Bütün cihazlar eyni yoldan istifadə etməli və seçilmiş formatı dəstəkləməlidir.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "İstəyə bağlı. Bəzi WebDAV xidmətləri yalnız müəyyən klient tətbiqlərinə icazə verir; uyğun User-Agent daxil edin (məsələn, Zotero/7.0.15). Boş buraxılsa User-Agent göndərilmir.",+ syncUserAgentDescription: "İstəyə bağlı. Bəzi WebDAV xidmətləri uyğun klient User-Agent tələb edir (məsələn, Zotero/10.0.0) və fayl növlərini də məhdudlaşdıra bilər. Təkcə bu parametr girişi təmin etmir. Boş buraxılsa User-Agent göndərilmir.",syncSecretNotice: "Standart olaraq DBX yalnız əlaqə məlumatlarını və parametrləri sinxronlaşdırır. Verilənlər bazası parolları, SSH parolları, proksi parolları, HTTP tunel tokenləri, əlaqə sətirləri və AI API açarları yerli olaraq qalır.",syncSecrets: "Şifrələnmiş məxfi məlumatları sinxronlaşdır",syncSecretsDescription: "Aktiv olduqda DBX verilənlər bazası parollarını, SSH parollarını, proksi parollarını, HTTP tunel tokenlərini və AI API açarlarını uzaq yaddaşa yükləməzdən əvvəl şifrələyir.",diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex b232ddac04..b5d827d335 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -8657,9 +8657,9 @@ export default {syncSavedPassword: "(saved)",syncRememberWebDavPasswordDescription: "The password is encrypted and stored in the current DBX instance only. It is not synced to WebDAV and does not replace the sync password.",syncRemotePath: "Remote snapshot path",- syncRemotePathDescription: "DBX will create missing parent folders when uploading.",+ syncRemotePathDescription: "DBX creates missing parent folders. End the path with .zip to upload a ZIP snapshot (for example DBX/sync/snapshot.zip); other paths use JSON. All devices must use the same path and support the selected format.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Optional. Some WebDAV services only allow specific client applications; fill in the matching User-Agent (for example Zotero/7.0.15). Leave empty to send no User-Agent.",+ syncUserAgentDescription: "Optional. Some WebDAV services require a matching client User-Agent (for example Zotero/10.0.0) and may also restrict file types. Setting this alone does not guarantee access. Leave empty to send no User-Agent.",syncSecretNotice: "By default, DBX syncs connection details and settings only. Database passwords, SSH passwords, proxy passwords, HTTP tunnel tokens, connection strings, and AI API keys stay local.",syncSecrets: "Sync encrypted secrets",syncSecretsDescription: "When enabled, DBX encrypts database passwords, SSH passwords, proxy passwords, HTTP tunnel tokens, and AI API keys before uploading them to remote storage.",diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.tsindex eda63cd58c..9edbce6086 100644--- a/apps/desktop/src/i18n/locales/es.ts+++ b/apps/desktop/src/i18n/locales/es.ts@@ -7906,9 +7906,9 @@ export default withEnglishFallback({syncSavedPassword: "(guardada)",syncRememberWebDavPasswordDescription: "La contraseña se cifra y se guarda solo en la instancia DBX actual. No se sincroniza a WebDAV ni reemplaza la contraseña de sync.",syncRemotePath: "Ruta remota",- syncRemotePathDescription: "DBX creará las carpetas padre faltantes al subir.",+ syncRemotePathDescription: "DBX crea las carpetas padre que faltan. Termina la ruta en .zip para subir una instantánea ZIP (por ejemplo, DBX/sync/snapshot.zip); las demás rutas usan JSON. Todos los dispositivos deben usar la misma ruta y admitir el formato elegido.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Opcional. Algunos servicios WebDAV solo permiten aplicaciones cliente específicas; introduce el User-Agent correspondiente (por ejemplo, Zotero/7.0.15). Si se deja vacío, no se envía ningún User-Agent.",+ syncUserAgentDescription: "Opcional. Algunos servicios WebDAV exigen un User-Agent de cliente compatible (por ejemplo, Zotero/10.0.0) y también pueden restringir los tipos de archivo. Este ajuste por sí solo no garantiza el acceso. Déjalo vacío para no enviar User-Agent.",syncSecretNotice: "De forma predeterminada, DBX solo sincroniza detalles de conexión y ajustes. Las contraseñas de base de datos, SSH, proxy, cadenas de conexión y API keys de IA quedan locales.",syncSecrets: "Sincronizar secretos cifrados",syncSecretsDescription: "Al activarlo, DBX cifra contraseñas de base de datos, contraseñas SSH y API keys de IA antes de subirlas a WebDAV.",diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.tsindex b538f8b8c1..cd056b3190 100644--- a/apps/desktop/src/i18n/locales/id.ts+++ b/apps/desktop/src/i18n/locales/id.ts@@ -8386,9 +8386,9 @@ export default withEnglishFallback({syncSavedPassword: "(tersimpan)",syncRememberWebDavPasswordDescription: "Kata sandi dienkripsi dan disimpan hanya pada instans DBX saat ini. Tidak disinkronkan ke WebDAV dan tidak menggantikan kata sandi sinkronisasi.",syncRemotePath: "Jalur snapshot jarak jauh",- syncRemotePathDescription: "DBX akan membuat folder induk yang hilang saat mengunggah.",+ syncRemotePathDescription: "DBX membuat folder induk yang belum ada. Akhiri jalur dengan .zip untuk mengunggah snapshot ZIP (misalnya DBX/sync/snapshot.zip); jalur lain menggunakan JSON. Semua perangkat harus memakai jalur yang sama dan mendukung format yang dipilih.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Opsional. Beberapa layanan WebDAV hanya mengizinkan aplikasi klien tertentu; isi User-Agent yang sesuai (misalnya Zotero/7.0.15). Jika dikosongkan, User-Agent tidak dikirim.",+ syncUserAgentDescription: "Opsional. Beberapa layanan WebDAV memerlukan User-Agent klien yang cocok (misalnya Zotero/10.0.0) dan juga dapat membatasi jenis berkas. Pengaturan ini saja tidak menjamin akses. Kosongkan untuk tidak mengirim User-Agent.",syncSecretNotice: "Secara default, DBX hanya menyinkronkan detail koneksi dan pengaturan. Kata sandi database, kata sandi SSH, kata sandi proxy, token tunnel HTTP, connection string, dan kunci API AI tetap lokal.",syncSecrets: "Sinkronkan rahasia terenkripsi",syncSecretsDescription: "Jika diaktifkan, DBX mengenkripsi kata sandi database, kata sandi SSH, kata sandi proxy, token tunnel HTTP, dan kunci API AI sebelum mengunggahnya ke penyimpanan jarak jauh.",diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.tsindex e575eaa4f4..4511913875 100644--- a/apps/desktop/src/i18n/locales/it.ts+++ b/apps/desktop/src/i18n/locales/it.ts@@ -7684,9 +7684,9 @@ export default withEnglishFallback({syncSavedPassword: "(salvata)",syncRememberWebDavPasswordDescription: "La password viene crittografata e memorizzata solo nell'istanza DBX corrente. Non viene sincronizzata su WebDAV e non sostituisce la password di sincronizzazione.",syncRemotePath: "Percorso snapshot remoto",- syncRemotePathDescription: "DBX creerà le cartelle superiori mancanti durante il caricamento.",+ syncRemotePathDescription: "DBX crea le cartelle superiori mancanti. Termina il percorso con .zip per caricare uno snapshot ZIP (ad esempio DBX/sync/snapshot.zip); gli altri percorsi usano JSON. Tutti i dispositivi devono usare lo stesso percorso e supportare il formato scelto.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Opzionale. Alcuni servizi WebDAV consentono l'accesso solo ad applicazioni client specifiche; inserisci lo User-Agent corrispondente (ad esempio Zotero/7.0.15). Se lasciato vuoto, non viene inviato alcuno User-Agent.",+ syncUserAgentDescription: "Opzionale. Alcuni servizi WebDAV richiedono uno User-Agent client compatibile (ad esempio Zotero/10.0.0) e possono anche limitare i tipi di file. Questa impostazione da sola non garantisce l'accesso. Lascia vuoto per non inviare User-Agent.",syncSecretNotice: "Per impostazione predefinita, DBX sincronizza solo i dettagli e le impostazioni di connessione. Le password dei database, le password SSH, le password proxy, le stringhe di connessione e le chiavi API AI rimangono locali.",syncSecrets: "Sincronizza i segreti crittografati",syncSecretsDescription: "Se abilitato, DBX crittografa le password del database, le password SSH e le chiavi API AI prima di caricarle su WebDAV.",diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.tsindex 1be26f5ed0..4feb8d3632 100644--- a/apps/desktop/src/i18n/locales/ja.ts+++ b/apps/desktop/src/i18n/locales/ja.ts@@ -7698,9 +7698,9 @@ export default withEnglishFallback({syncSavedPassword: "(保存済み)",syncRememberWebDavPasswordDescription: "パスワードは暗号化され、現在のDBXインスタンスにのみ保存されます。WebDAVには同期されず、同期パスワードを置き換えるものでもありません。",syncRemotePath: "リモートスナップショットパス",- syncRemotePathDescription: "アップロード時に不足している親フォルダーをDBXが作成します。",+ syncRemotePathDescription: "DBX は不足している親フォルダーを作成します。パスを .zip で終えると ZIP スナップショットをアップロードします(例:DBX/sync/snapshot.zip)。他のパスは JSON を使用します。すべての端末で同じパスを設定し、選択した形式に対応している必要があります。",syncUserAgent: "User-Agent",- syncUserAgentDescription: "省略可。一部の WebDAV サービスは特定のクライアントアプリのみ許可します。該当する User-Agent(例:Zotero/7.0.15)を入力してください。空欄の場合は User-Agent を送信しません。",+ syncUserAgentDescription: "省略可。一部の WebDAV サービスは対応するクライアント User-Agent(例:Zotero/10.0.0)を要求し、ファイル形式も制限する場合があります。この設定だけではアクセスを保証しません。空欄の場合は User-Agent を送信しません。",syncSecretNotice: "デフォルトでは、DBXは接続詳細と設定のみを同期します。データベースパスワード、SSHパスワード、プロキシパスワード、接続文字列、AI APIキーはローカルに保持されます。",syncSecrets: "暗号化されたシークレットを同期",syncSecretsDescription: "有効時、DBXはデータベースパスワード、SSHパスワード、AI APIキーを暗号化してからWebDAVにアップロードします。",diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.tsindex 13b2e53eed..a9cb8c6231 100644--- a/apps/desktop/src/i18n/locales/ko.ts+++ b/apps/desktop/src/i18n/locales/ko.ts@@ -7522,9 +7522,9 @@ export default withEnglishFallback({syncSavedPassword: "(저장됨)",syncRememberWebDavPasswordDescription: "비밀번호는 현재 DBX 인스턴스에만 암호화되어 저장됩니다. WebDAV에 동기화되지 않으며 동기화 비밀번호를 대체하지 않습니다.",syncRemotePath: "원격 스냅샷 경로",- syncRemotePathDescription: "DBX가 업로드 시 누락된 상위 폴더를 만듭니다.",+ syncRemotePathDescription: "DBX가 누락된 상위 폴더를 만듭니다. 경로를 .zip으로 끝내면 ZIP 스냅샷을 업로드합니다(예: DBX/sync/snapshot.zip). 다른 경로는 JSON을 사용합니다. 모든 기기는 같은 경로를 사용하고 선택한 형식을 지원해야 합니다.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "선택 사항. 일부 WebDAV 서비스는 특정 클라이언트 앱만 허용합니다. 해당하는 User-Agent(예: Zotero/7.0.15)를 입력하세요. 비워 두면 User-Agent를 전송하지 않습니다.",+ syncUserAgentDescription: "선택 사항. 일부 WebDAV 서비스는 일치하는 클라이언트 User-Agent(예: Zotero/10.0.0)를 요구하며 파일 형식도 제한할 수 있습니다. 이 설정만으로 접근이 보장되지는 않습니다. 비워 두면 User-Agent를 전송하지 않습니다.",syncSecretNotice: "기본적으로 DBX는 연결 세부 정보와 설정만 동기화합니다. 데이터베이스 비밀번호, SSH 비밀번호, 프록시 비밀번호, HTTP 터널 토큰, 연결 문자열 및 AI API 키는 로컬에 유지됩니다.",syncSecrets: "암호화된 비밀 동기화",syncSecretsDescription: "활성화하면 DBX가 데이터베이스 비밀번호, SSH 비밀번호, 프록시 비밀번호, HTTP 터널 토큰 및 AI API 키를 암호화하여 원격 저장소에 업로드합니다.",diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.tsindex d10fad73a7..55cbe4af13 100644--- a/apps/desktop/src/i18n/locales/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/pt-BR.ts@@ -7685,9 +7685,9 @@ export default withEnglishFallback({syncSavedPassword: "(salva)",syncRememberWebDavPasswordDescription: "A senha é criptografada e armazenada apenas na instância DBX atual. Ela não é sincronizada para o WebDAV e não substitui a senha de sincronização.",syncRemotePath: "Caminho remoto do snapshot",- syncRemotePathDescription: "O DBX criará as pastas pai ausentes ao enviar.",+ syncRemotePathDescription: "O DBX cria as pastas pai ausentes. Termine o caminho com .zip para enviar um snapshot ZIP (por exemplo, DBX/sync/snapshot.zip); os demais caminhos usam JSON. Todos os dispositivos devem usar o mesmo caminho e suportar o formato escolhido.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Opcional. Alguns serviços WebDAV permitem apenas aplicativos cliente específicos; preencha o User-Agent correspondente (por exemplo, Zotero/7.0.15). Se deixado vazio, nenhum User-Agent é enviado.",+ syncUserAgentDescription: "Opcional. Alguns serviços WebDAV exigem um User-Agent de cliente compatível (por exemplo, Zotero/10.0.0) e também podem restringir tipos de arquivo. Essa configuração sozinha não garante acesso. Deixe vazio para não enviar User-Agent.",syncSecretNotice: "Por padrão, o DBX sincroniza apenas detalhes de conexão e configurações. Senhas de banco de dados, senhas SSH, senhas de proxy, strings de conexão e chaves de API de IA permanecem locais.",syncSecrets: "Sincronizar segredos criptografados",syncSecretsDescription: "Quando ativado, o DBX criptografa senhas de banco de dados, senhas SSH e chaves de API de IA antes de enviá-las para o WebDAV.",diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.tsindex 3c412970de..9e27f7231a 100644--- a/apps/desktop/src/i18n/locales/ru.ts+++ b/apps/desktop/src/i18n/locales/ru.ts@@ -8937,9 +8937,9 @@ export default withEnglishFallback({syncSavedPassword: "(сохранён)",syncRememberWebDavPasswordDescription: "Пароль шифруется и хранится только в текущем экземпляре DBX. Он не синхронизируется с WebDAV и не заменяет пароль синхронизации.",syncRemotePath: "Путь к удалённому снимку",- syncRemotePathDescription: "DBX создаст отсутствующие родительские папки при загрузке.",+ syncRemotePathDescription: "DBX создаёт отсутствующие родительские папки. Путь с окончанием .zip включает загрузку ZIP-снимка (например, DBX/sync/snapshot.zip); остальные пути используют JSON. Все устройства должны использовать один путь и поддерживать выбранный формат.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "Необязательно. Некоторые службы WebDAV разрешают доступ только определённым клиентским приложениям; укажите соответствующий User-Agent (например, Zotero/7.0.15). Если оставить пустым, User-Agent отправляться не будет.",+ syncUserAgentDescription: "Необязательно. Некоторые службы WebDAV требуют подходящий User-Agent клиента (например, Zotero/10.0.0) и могут ограничивать типы файлов. Одной этой настройки недостаточно для гарантированного доступа. Оставьте пустым, чтобы не отправлять User-Agent.",syncSecretNotice: "По умолчанию DBX синхронизирует только параметры подключений и настройки. Пароли баз данных, пароли SSH, пароли прокси, токены HTTP-туннелей, строки подключения и ключи AI API остаются локально.",syncSecrets: "Синхронизировать зашифрованные секреты",syncSecretsDescription: "Если включено, DBX шифрует пароли баз данных, пароли SSH, пароли прокси, токены HTTP-туннелей и ключи AI API перед загрузкой в удалённое хранилище.",diff --git a/apps/desktop/src/i18n/locales/tr.ts b/apps/desktop/src/i18n/locales/tr.tsindex 393069f8c0..a6e7e358d8 100644--- a/apps/desktop/src/i18n/locales/tr.ts+++ b/apps/desktop/src/i18n/locales/tr.ts@@ -7485,9 +7485,9 @@ export default withEnglishFallback({syncSavedPassword: "(kaydedildi)",syncRememberWebDavPasswordDescription: "Parola şifrelenir ve yalnızca geçerli DBX örneğinde saklanır. WebDAV'a eşitlenmez ve eşitleme parolasının yerine geçmez.",syncRemotePath: "Uzak anlık görüntü yolu",- syncRemotePathDescription: "DBX, yükleme sırasında eksik üst klasörleri oluşturur.",+ syncRemotePathDescription: "DBX eksik üst klasörleri oluşturur. ZIP anlık görüntüsü yüklemek için yolu .zip ile bitirin (örneğin DBX/sync/snapshot.zip); diğer yollar JSON kullanır. Tüm cihazlar aynı yolu kullanmalı ve seçilen biçimi desteklemelidir.",syncUserAgent: "User-Agent",- syncUserAgentDescription: "İsteğe bağlı. Bazı WebDAV hizmetleri yalnızca belirli istemci uygulamalarına izin verir; eşleşen User-Agent değerini girin (örneğin Zotero/7.0.15). Boş bırakılırsa User-Agent gönderilmez.",+ syncUserAgentDescription: "İsteğe bağlı. Bazı WebDAV hizmetleri eşleşen bir istemci User-Agent değeri ister (örneğin Zotero/10.0.0) ve dosya türlerini de kısıtlayabilir. Bu ayar tek başına erişimi garanti etmez. User-Agent göndermemek için boş bırakın.",syncSecretNotice: "DBX varsayılan olarak yalnızca bağlantı ayrıntılarını ve ayarları eşitler. Veritabanı parolaları, SSH parolaları, proxy parolaları, HTTP tünel belirteçleri, bağlantı dizeleri ve yapay zekâ API anahtarları yerelde kalır.",syncSecrets: "Şifreli gizli bilgileri eşitle",syncSecretsDescription: "Etkinleştirildiğinde DBX; veritabanı parolalarını, SSH parolalarını, proxy parolalarını, HTTP tünel belirteçlerini ve yapay zekâ API anahtarlarını uzak depolamaya yüklemeden önce şifreler.",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex 47c0424855..91c7da2ca7 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -8642,9 +8642,9 @@ export default withEnglishFallback({syncSavedPassword: "(已保存)",syncRememberWebDavPasswordDescription: "密码会加密保存在当前 DBX 实例中,不会同步到 WebDAV,也不会替代同步密码。",syncRemotePath: "远端快照路径",- syncRemotePathDescription: "上传时 DBX 会自动创建缺失的父目录。",+ syncRemotePathDescription: "DBX 会自动创建缺失的父目录。路径以 .zip 结尾时上传 ZIP 快照(如 DBX/sync/snapshot.zip),其他路径仍使用 JSON。所有设备需使用相同路径并支持所选格式。",syncUserAgent: "User-Agent",- syncUserAgentDescription: "可选。部分 WebDAV 服务仅允许特定客户端应用访问,填写对应的 User-Agent(例如 Zotero/7.0.15)即可。留空则不发送 User-Agent。",+ syncUserAgentDescription: "可选。部分 WebDAV 服务要求匹配客户端 User-Agent(例如 Zotero/10.0.0),还可能限制文件类型,仅设置此项不保证能够访问。留空则不发送 User-Agent。",syncSecretNotice: "默认只同步连接信息和设置,不会同步数据库密码、SSH 密码、代理密码、HTTP 隧道 Token、连接串或 AI API Key。",syncSecrets: "同步加密后的敏感信息",syncSecretsDescription: "开启后,DBX 会先加密数据库密码、SSH 密码、代理密码、HTTP 隧道 Token 和 AI API Key,再上传到远端存储。",diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.tsindex a335884f38..e55d1de59e 100644--- a/apps/desktop/src/i18n/locales/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/zh-TW.ts@@ -7033,9 +7033,9 @@ export default withEnglishFallback({syncSavedPassword: "(已儲存)",syncRememberWebDavPasswordDescription: "密碼會加密儲存在目前 DBX 執行個體中,不會同步到 WebDAV,也不會取代同步密碼。",syncRemotePath: "遠端快照路徑",- syncRemotePathDescription: "上傳時 DBX 會自動建立缺失的父目錄。",+ syncRemotePathDescription: "DBX 會自動建立缺失的父目錄。路徑以 .zip 結尾時上傳 ZIP 快照(如 DBX/sync/snapshot.zip),其他路徑仍使用 JSON。所有裝置需使用相同路徑並支援所選格式。",syncUserAgent: "User-Agent",- syncUserAgentDescription: "選填。部分 WebDAV 服務僅允許特定用戶端應用程式存取,填寫對應的 User-Agent(例如 Zotero/7.0.15)即可。留空則不傳送 User-Agent。",+ syncUserAgentDescription: "選填。部分 WebDAV 服務要求匹配用戶端 User-Agent(例如 Zotero/10.0.0),還可能限制檔案類型,僅設定此項不保證能夠存取。留空則不傳送 User-Agent。",syncSecretNotice: "預設只同步連線詳細資料和設定。資料庫密碼、SSH 密碼、代理伺服器密碼、連線字串和 AI API Key 會保留在本機。",syncSecrets: "同步加密後的敏感資訊",syncSecretsDescription: "開啟後,DBX 會先加密資料庫密碼、SSH 密碼和 AI API Key,再上傳到 WebDAV。",diff --git a/crates/dbx-core/src/persistence/cloud_sync.rs b/crates/dbx-core/src/persistence/cloud_sync.rsindex 8f5331dd76..870109a37d 100644--- a/crates/dbx-core/src/persistence/cloud_sync.rs+++ b/crates/dbx-core/src/persistence/cloud_sync.rs@@ -12,6 +12,8 @@ use std::collections::{HashMap, HashSet};use std::fs;use std::net::{IpAddr, Ipv4Addr};+mod webdav_snapshot;+use crate::ai::AiConfigItem;use crate::connection_secrets::{plugin_connection_secret_key, CASSANDRA_KEYSTORE_PASSWORD_KEY, CASSANDRA_TRUSTSTORE_PASSWORD_KEY,@@ -1819,22 +1821,23 @@ impl WebDavClient {pub async fn put_snapshot(&self, snapshot: &SyncSnapshot) -> Result<WebDavSyncSummary, String> {let remote_path = self.remote_path();+ let (bytes, content_type) = webdav_snapshot::encode(snapshot, &remote_path)?;+ let byte_count = bytes.len();self.ensure_parent_collections(&remote_path).await?;- let bytes = serde_json::to_vec_pretty(snapshot).map_err(|e| e.to_string())?;let response = self.request(Method::PUT, &remote_path)?- .header(header::CONTENT_TYPE, "application/json")- .body(bytes.clone())+ .header(header::CONTENT_TYPE, content_type)+ .body(bytes).send().await.map_err(|e| e.to_string())?;let status = response.status();if !status.is_success() {- return Err(format!("WebDAV upload failed with HTTP {status}"));+ return Err(webdav_snapshot::upload_error(status, content_type));}Ok(WebDavSyncSummary {remote_path,- bytes: bytes.len(),+ bytes: byte_count,exported_at: Some(snapshot.exported_at.clone()),app_version: Some(snapshot.app_version.clone()),})@@ -1847,8 +1850,8 @@ impl WebDavClient {if !status.is_success() {return Err(format!("WebDAV download failed with HTTP {status}"));}- let bytes = response.bytes().await.map_err(|e| e.to_string())?;- let snapshot: SyncSnapshot = serde_json::from_slice(&bytes).map_err(|e| e.to_string())?;+ let bytes = webdav_snapshot::read_response(response).await?;+ let snapshot = webdav_snapshot::decode(&bytes)?;let summary = WebDavSyncSummary {remote_path,bytes: bytes.len(),diff --git a/crates/dbx-core/src/persistence/cloud_sync/webdav_snapshot.rs b/crates/dbx-core/src/persistence/cloud_sync/webdav_snapshot.rsnew file mode 100644index 0000000000..1d585bb610--- /dev/null+++ b/crates/dbx-core/src/persistence/cloud_sync/webdav_snapshot.rs@@ -0,0 +1,394 @@+use std::io::{Cursor, Read, Write};++use reqwest::{Response, StatusCode};+use zip::{write::SimpleFileOptions, CompressionMethod, ZipArchive, ZipWriter};++use super::SyncSnapshot;++const SNAPSHOT_ENTRY: &str = "snapshot.json";+const MAX_ZIP_SNAPSHOT_BYTES: u64 = 100 * 1024 * 1024;+const ZIP_SIZE_ERROR: &str = "WebDAV ZIP snapshot exceeds the 100 MiB archive or uncompressed size limit";++pub(super) fn encode(snapshot: &SyncSnapshot, remote_path: &str) -> Result<(Vec<u8>, &'static str), String> {+ let json = serde_json::to_vec_pretty(snapshot).map_err(|error| error.to_string())?;+ if !remote_path.rsplit_once('.').is_some_and(|(_, extension)| extension.eq_ignore_ascii_case("zip")) {+ return Ok((json, "application/json"));+ }+ if json.len() as u64 > MAX_ZIP_SNAPSHOT_BYTES {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ let mut archive = ZipWriter::new(Cursor::new(Vec::new()));+ let options = SimpleFileOptions::default().compression_method(CompressionMethod::Deflated).unix_permissions(0o600);+ archive+ .start_file(SNAPSHOT_ENTRY, options)+ .map_err(|error| format!("Cannot create WebDAV ZIP snapshot: {error}"))?;+ archive.write_all(&json).map_err(|error| format!("Cannot write WebDAV ZIP snapshot: {error}"))?;+ let bytes = archive.finish().map_err(|error| format!("Cannot finish WebDAV ZIP snapshot: {error}"))?.into_inner();+ if bytes.len() as u64 > MAX_ZIP_SNAPSHOT_BYTES {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ Ok((bytes, "application/zip"))+}++pub(super) async fn read_response(response: Response) -> Result<Vec<u8>, String> {+ read_response_with_limit(response, MAX_ZIP_SNAPSHOT_BYTES).await+}++async fn read_response_with_limit(mut response: Response, archive_limit: u64) -> Result<Vec<u8>, String> {+ let mut bytes = Vec::new();+ while let Some(chunk) = response.chunk().await.map_err(|error| error.to_string())? {+ bytes.extend_from_slice(&chunk);+ if is_zip(&bytes) && bytes.len() as u64 > archive_limit {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ }+ Ok(bytes)+}++pub(super) fn decode(bytes: &[u8]) -> Result<SyncSnapshot, String> {+ if !is_zip(bytes) {+ return serde_json::from_slice(bytes).map_err(|error| error.to_string());+ }+ if bytes.len() as u64 > MAX_ZIP_SNAPSHOT_BYTES {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ decode_zip(bytes, MAX_ZIP_SNAPSHOT_BYTES)+}++fn is_zip(bytes: &[u8]) -> bool {+ bytes.starts_with(b"PK")+}++fn decode_zip(bytes: &[u8], uncompressed_limit: u64) -> Result<SyncSnapshot, String> {+ let mut archive =+ ZipArchive::new(Cursor::new(bytes)).map_err(|error| format!("Invalid WebDAV ZIP snapshot: {error}"))?;+ if archive.len() != 1 {+ return Err("WebDAV ZIP snapshot must contain only snapshot.json".to_string());+ }+ let mut entry = archive.by_index(0).map_err(|error| format!("Invalid WebDAV ZIP snapshot entry: {error}"))?;+ if entry.name() != SNAPSHOT_ENTRY || entry.unix_mode().is_some_and(|mode| mode & 0o170000 == 0o120000) {+ return Err("WebDAV ZIP snapshot must contain a regular snapshot.json file".to_string());+ }+ if entry.size() > uncompressed_limit {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ let mut json = Vec::new();+ entry+ .by_ref()+ .take(uncompressed_limit + 1)+ .read_to_end(&mut json)+ .map_err(|error| format!("Cannot read WebDAV ZIP snapshot: {error}"))?;+ if json.len() as u64 > uncompressed_limit {+ return Err(ZIP_SIZE_ERROR.to_string());+ }+ serde_json::from_slice(&json).map_err(|error| format!("Invalid WebDAV ZIP snapshot JSON: {error}"))+}++pub(super) fn upload_error(status: StatusCode, content_type: &str) -> String {+ let mut message = format!("WebDAV upload failed with HTTP {status}");+ if matches!(status, StatusCode::FORBIDDEN | StatusCode::METHOD_NOT_ALLOWED | StatusCode::UNSUPPORTED_MEDIA_TYPE) {+ message.push_str(". Check the account's write permissions, allowed client applications and file types.");+ if content_type == "application/json" {+ message.push_str(" If the service requires ZIP files, use a remote snapshot path ending in .zip (for example DBX/sync/snapshot.zip).");+ }+ }+ message+}++#[cfg(test)]+mod tests {+ use super::super::{EncryptedSecretsBlob, SyncSelection, WebDavClient, WebDavConfig, SNAPSHOT_SCHEMA_VERSION};+ use super::*;++ fn snapshot() -> SyncSnapshot {+ SyncSnapshot {+ schema_version: SNAPSHOT_SCHEMA_VERSION,+ exported_at: "2026-10-09T00:00:00Z".to_string(),+ app_version: "test-version".to_string(),+ connections: Vec::new(),+ mqtt_subscriptions: Some(Vec::new()),+ tunnel_profiles: Some(Vec::new()),+ sidebar_layout: None,+ pinned_tree_node_ids: Vec::new(),+ saved_sql: Default::default(),+ desktop_settings: Default::default(),+ editor_settings: Some(serde_json::json!({"theme": "dark", "label": "测试"})),+ encrypted_secrets: Some(EncryptedSecretsBlob {+ version: 2,+ kdf: "argon2id".to_string(),+ cipher: "aes-256-gcm".to_string(),+ salt: "test-salt".to_string(),+ nonce: "test-nonce".to_string(),+ ciphertext: "opaque-encrypted-payload".to_string(),+ payload_type: Some("dbx-sync-secrets".to_string()),+ aad: Some("test-context".to_string()),+ }),+ selection: Some(SyncSelection::default()),+ }+ }++ fn archive(entries: &[(&str, &[u8])]) -> Vec<u8> {+ let mut archive = ZipWriter::new(Cursor::new(Vec::new()));+ for (name, contents) in entries {+ archive+ .start_file(*name, SimpleFileOptions::default().compression_method(CompressionMethod::Stored))+ .unwrap();+ archive.write_all(contents).unwrap();+ }+ archive.finish().unwrap().into_inner()+ }++ #[test]+ fn webdav_zip_round_trip_preserves_snapshot_metadata_and_encrypted_payload() {+ let snapshot = snapshot();+ for remote_path in ["DBX/sync/snapshot.zip", "DBX/sync/snapshot.ZIP"] {+ let (bytes, content_type) = encode(&snapshot, remote_path).unwrap();+ assert_eq!(content_type, "application/zip");+ assert!(bytes.starts_with(b"PK\x03\x04"));+ let mut archive = ZipArchive::new(Cursor::new(&bytes)).unwrap();+ assert_eq!(archive.len(), 1);+ let entry = archive.by_index(0).unwrap();+ assert_eq!(entry.name(), SNAPSHOT_ENTRY);+ assert_eq!(entry.compression(), CompressionMethod::Deflated);+ assert_eq!(+ serde_json::to_value(decode(&bytes).unwrap()).unwrap(),+ serde_json::to_value(&snapshot).unwrap()+ );+ }+ }++ #[test]+ fn webdav_non_zip_paths_keep_the_existing_json_payload() {+ let snapshot = snapshot();+ let expected = serde_json::to_vec_pretty(&snapshot).unwrap();+ for remote_path in ["DBX/sync/snapshot.json", "snapshot.backup", "zip", "folder.zip/snapshot"] {+ let (bytes, content_type) = encode(&snapshot, remote_path).unwrap();+ assert_eq!(content_type, "application/json");+ assert_eq!(bytes, expected);+ assert_eq!(+ serde_json::to_value(decode(&bytes).unwrap()).unwrap(),+ serde_json::to_value(&snapshot).unwrap()+ );+ }+ }++ #[test]+ fn webdav_zip_rejects_invalid_structure_and_json() {+ let json = serde_json::to_vec(&snapshot()).unwrap();+ for bytes in [+ b"PK-invalid-archive".to_vec(),+ archive(&[]),+ archive(&[("other.json", &json)]),+ archive(&[("../snapshot.json", &json)]),+ archive(&[("snapshot.json", &json), ("extra.json", &json)]),+ archive(&[("snapshot.json", b"not-json")]),+ ] {+ assert!(decode(&bytes).is_err());+ }+ let mut archive = ZipWriter::new(Cursor::new(Vec::new()));+ archive.add_symlink(SNAPSHOT_ENTRY, "target.json", SimpleFileOptions::default()).unwrap();+ assert!(decode(&archive.finish().unwrap().into_inner()).unwrap_err().contains("regular snapshot.json"));+ }++ #[test]+ fn webdav_zip_checks_uncompressed_size_and_checksum() {+ let json = serde_json::to_vec(&snapshot()).unwrap();+ let mut bytes = archive(&[(SNAPSHOT_ENTRY, &json)]);+ assert_eq!(decode_zip(&bytes, json.len() as u64 - 1).unwrap_err(), ZIP_SIZE_ERROR);+ assert!(decode_zip(&bytes, json.len() as u64).is_ok());+ let payload_offset = bytes.windows(json.len()).position(|window| window == json).unwrap();+ bytes[payload_offset + 2] ^= 1;+ assert!(decode(&bytes).unwrap_err().contains("Cannot read WebDAV ZIP snapshot"));+ }++ #[test]+ fn webdav_upload_errors_suggest_zip_without_hiding_failures() {+ for status in [StatusCode::FORBIDDEN, StatusCode::METHOD_NOT_ALLOWED, StatusCode::UNSUPPORTED_MEDIA_TYPE] {+ let json_error = upload_error(status, "application/json");+ assert!(json_error.starts_with(&format!("WebDAV upload failed with HTTP {status}")));+ assert!(json_error.contains("snapshot.zip"));+ let zip_error = upload_error(status, "application/zip");+ assert!(zip_error.contains("write permissions"));+ assert!(!zip_error.contains("snapshot.zip"));+ }+ assert_eq!(+ upload_error(StatusCode::UNAUTHORIZED, "application/json"),+ "WebDAV upload failed with HTTP 401 Unauthorized"+ );+ }++ struct CapturedRequest {+ headers: String,+ body: Vec<u8>,+ }++ async fn spawn_round_trip_server(+ request_count: usize,+ zip_only: bool,+ mut stored: Vec<u8>,+ ) -> (String, tokio::task::JoinHandle<Vec<CapturedRequest>>) {+ use tokio::io::{AsyncReadExt, AsyncWriteExt};++ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();+ let address = listener.local_addr().unwrap();+ let server = tokio::spawn(async move {+ let mut captured = Vec::new();+ for _ in 0..request_count {+ let (mut socket, _) =+ tokio::time::timeout(std::time::Duration::from_secs(5), listener.accept()).await.unwrap().unwrap();+ let mut request = Vec::new();+ let mut chunk = [0; 4096];+ let header_end = loop {+ let count = socket.read(&mut chunk).await.unwrap();+ assert!(count > 0);+ request.extend_from_slice(&chunk[..count]);+ if let Some(offset) = request.windows(4).position(|window| window == b"\r\n\r\n") {+ break offset + 4;+ }+ };+ let headers = String::from_utf8(request[..header_end].to_vec()).unwrap();+ let content_length = headers+ .lines()+ .find_map(|line| {+ let (name, value) = line.split_once(':')?;+ name.eq_ignore_ascii_case("content-length").then(|| value.trim().parse::<usize>().unwrap())+ })+ .unwrap_or(0);+ while request.len() < header_end + content_length {+ let count = socket.read(&mut chunk).await.unwrap();+ assert!(count > 0);+ request.extend_from_slice(&chunk[..count]);+ }+ let body = request[header_end..header_end + content_length].to_vec();+ let mut request_line = headers.lines().next().unwrap().split_whitespace();+ let method = request_line.next().unwrap();+ let target = request_line.next().unwrap();+ let (status, response_body) = match method {+ "MKCOL" => ("201 Created", Vec::new()),+ "PUT" if zip_only && !target.to_ascii_lowercase().ends_with(".zip") => {+ ("405 Method Not Allowed", b"Only .zip/.prop uploads allowed".to_vec())+ }+ "PUT" => {+ stored = body.clone();+ ("201 Created", Vec::new())+ }+ "GET" => ("200 OK", stored.clone()),+ _ => panic!("Unexpected method: {method}"),+ };+ captured.push(CapturedRequest { headers, body });+ socket+ .write_all(+ format!(+ "HTTP/1.1 {status}\r\nContent-Length: {}\r\nConnection: close\r\n\r\n",+ response_body.len()+ )+ .as_bytes(),+ )+ .await+ .unwrap();+ socket.write_all(&response_body).await.unwrap();+ }+ captured+ });+ (format!("http://{address}/dav/"), server)+ }++ fn config(endpoint: String, remote_path: &str) -> WebDavConfig {+ WebDavConfig {+ endpoint,+ username: Some("test-user".to_string()),+ password: Some("test-password".to_string()),+ remote_path: Some(remote_path.to_string()),+ user_agent: Some("Zotero/10.0.0".to_string()),+ }+ }++ #[tokio::test]+ async fn webdav_zip_resolves_upload_rejection_and_round_trips_over_http() {+ use base64::Engine;++ let snapshot = snapshot();+ let (endpoint, server) = spawn_round_trip_server(7, true, Vec::new()).await;+ let json_client = WebDavClient::new(config(endpoint.clone(), "DBX/sync/snapshot.json"));+ let error = json_client.put_snapshot(&snapshot).await.unwrap_err();+ assert!(error.contains("405 Method Not Allowed"));+ assert!(error.contains("snapshot.zip"));+ let zip_client = WebDavClient::new(config(endpoint, "DBX/sync/snapshot.zip"));+ let uploaded = zip_client.put_snapshot(&snapshot).await.unwrap();+ let (restored, downloaded) = zip_client.get_snapshot().await.unwrap();+ assert_eq!(serde_json::to_value(restored).unwrap(), serde_json::to_value(&snapshot).unwrap());+ assert_eq!(uploaded.bytes, downloaded.bytes);+ assert_eq!(uploaded.remote_path, "DBX/sync/snapshot.zip");+ assert_eq!(downloaded.app_version.as_deref(), Some("test-version"));+ let requests = server.await.unwrap();+ let authorization = format!(+ "authorization: Basic {}",+ base64::engine::general_purpose::STANDARD.encode("test-user:test-password")+ );+ for request in &requests {+ assert!(request.headers.lines().any(|line| line.eq_ignore_ascii_case("user-agent: Zotero/10.0.0")));+ assert!(request.headers.lines().any(|line| line.eq_ignore_ascii_case(&authorization)));+ }+ let json_upload = &requests[2];+ assert!(json_upload.headers.starts_with("PUT /dav/DBX/sync/snapshot.json "));+ assert!(json_upload.headers.to_ascii_lowercase().contains("content-type: application/json"));+ let zip_upload = &requests[5];+ assert!(zip_upload.headers.starts_with("PUT /dav/DBX/sync/snapshot.zip "));+ assert!(zip_upload.headers.to_ascii_lowercase().contains("content-type: application/zip"));+ assert_eq!(zip_upload.body.len(), uploaded.bytes);+ assert!(zip_upload.body.starts_with(b"PK\x03\x04"));+ }++ #[tokio::test]+ async fn webdav_json_upload_and_download_remain_unchanged() {+ let snapshot = snapshot();+ let (endpoint, server) = spawn_round_trip_server(2, false, Vec::new()).await;+ let mut config = config(endpoint, "snapshot.json");+ config.user_agent = None;+ let client = WebDavClient::new(config);+ let uploaded = client.put_snapshot(&snapshot).await.unwrap();+ let (restored, downloaded) = client.get_snapshot().await.unwrap();+ assert_eq!(serde_json::to_value(restored).unwrap(), serde_json::to_value(&snapshot).unwrap());+ assert_eq!(uploaded.bytes, downloaded.bytes);+ let requests = server.await.unwrap();+ assert_eq!(requests[0].body, serde_json::to_vec_pretty(&snapshot).unwrap());+ assert!(requests.iter().all(|request| !request.headers.to_ascii_lowercase().contains("user-agent:")));+ }++ #[tokio::test]+ async fn webdav_download_detects_content_instead_of_trusting_the_path() {+ let snapshot = snapshot();+ for (remote_path, body) in [+ ("legacy.zip", serde_json::to_vec_pretty(&snapshot).unwrap()),+ ("snapshot.json", encode(&snapshot, "snapshot.zip").unwrap().0),+ ] {+ let (endpoint, server) = spawn_round_trip_server(1, false, body).await;+ let client = WebDavClient::new(config(endpoint, remote_path));+ let (restored, _) = client.get_snapshot().await.unwrap();+ assert_eq!(serde_json::to_value(restored).unwrap(), serde_json::to_value(&snapshot).unwrap());+ server.await.unwrap();+ }+ }++ #[tokio::test]+ async fn webdav_zip_download_enforces_archive_size_without_limiting_legacy_json() {+ let snapshot = snapshot();+ let zip = encode(&snapshot, "snapshot.zip").unwrap().0;+ let zip_size = zip.len() as u64;+ let json = serde_json::to_vec(&snapshot).unwrap();+ let http = reqwest::Client::builder().no_proxy().build().unwrap();+ for (body, limit, expected_success) in+ [(zip.clone(), zip_size - 1, false), (zip, zip_size, true), (json, 4, true)]+ {+ let (endpoint, server) = spawn_round_trip_server(1, false, body.clone()).await;+ let response = http.get(endpoint).send().await.unwrap();+ let result = read_response_with_limit(response, limit).await;+ if expected_success {+ assert_eq!(result.unwrap(), body);+ } else {+ assert_eq!(result.unwrap_err(), ZIP_SIZE_ERROR);+ }+ server.await.unwrap();+ }+ }+}diff --git a/docs/content/docs/cloud-sync.cn.mdx b/docs/content/docs/cloud-sync.cn.mdxindex d504cd6975..b2ba3f5019 100644--- a/docs/content/docs/cloud-sync.cn.mdx+++ b/docs/content/docs/cloud-sync.cn.mdx@@ -163,7 +163,11 @@ GitHub Gist、Gitee 和 GitLab 代码片段始终使用**代码片段加密密填写 WebDAV 服务地址、用户名、应用密码和远端快照路径。默认路径为 `DBX/sync/snapshot.json`。-部分 WebDAV 服务(如中国科技云)只允许特定客户端应用访问,会按 User-Agent 拦截未知客户端。遇到这类限制时,在 User-Agent 输入框填写服务允许的客户端标识(例如 `Zotero/7.0.15`);默认留空,表示不发送 User-Agent。+将远端快照路径改为 `DBX/sync/snapshot.zip` 可启用 ZIP 快照:DBX 会将同一份 JSON 快照压缩为仅包含 `snapshot.json` 的 ZIP 文件,并以 `application/zip` 上传。其他路径仍上传 JSON。下载按文件内容识别 JSON 或 ZIP,因此也能读取旧版本写入 `.zip` 路径的 JSON 快照。ZIP 文件及解压后的 JSON 均不得超过 100 MiB,且不会解压到本地文件系统。压缩不等于加密,敏感信息仍遵循原有同步加密设置。++部分 WebDAV 服务(如中国科技云数据胶囊)会同时限制客户端应用和上传文件类型。遇到客户端限制时,在 User-Agent 输入框填写服务允许的客户端标识(例如 `Zotero/10.0.0`);默认留空,表示不发送 User-Agent。Zotero 专用接口还可能仅允许 `.zip` / `.prop` 上传,仅修改 User-Agent 无法让 JSON 上传通过,此时可尝试 ZIP 快照。上传返回 403、405 或 415 时,也应核对账号写权限和服务端策略;ZIP 格式不会绕过权限检查。++切换格式会使用新的远端路径,不会删除原 JSON 快照。所有同步设备需配置同一路径;启用 ZIP 前请先升级所有设备到支持 ZIP 快照的 DBX 版本,旧版本仍需使用 JSON 路径。请使用 DBX 独立目录,不要与 Zotero 自身的同步目录混用。Web/Docker 模式下,WebDAV 请求由 DBX 服务端发起,因此不受浏览器 CORS 限制;WebDAV 应用密码会加密保存在当前 DBX 实例中,不会写入同步快照。diff --git a/docs/content/docs/cloud-sync.mdx b/docs/content/docs/cloud-sync.mdxindex e49d18b524..f12a3e8e52 100644--- a/docs/content/docs/cloud-sync.mdx+++ b/docs/content/docs/cloud-sync.mdx@@ -163,7 +163,11 @@ Neither password can be recovered. An encrypted snippet cannot be restored withoEnter the WebDAV endpoint, username, application password, and remote snapshot path. The default path is `DBX/sync/snapshot.json`.-Some WebDAV services (for example CSTCloud) only allow specific client applications and reject unknown clients based on the User-Agent. When you hit such a restriction, fill the User-Agent field with an identifier the service accepts (for example `Zotero/7.0.15`). It stays empty by default, which sends no User-Agent.+Set the remote snapshot path to `DBX/sync/snapshot.zip` to enable ZIP snapshots. DBX compresses the same JSON snapshot into a ZIP containing only `snapshot.json` and uploads it as `application/zip`. Other paths still upload JSON. Downloads detect JSON or ZIP from the content, including JSON snapshots that older versions stored at a `.zip` path. Both the ZIP archive and its uncompressed JSON are limited to 100 MiB, and no files are extracted to disk. Compression is not encryption; existing sensitive-data encryption settings still apply.++Some WebDAV services, including CSTCloud Capsule, restrict both client applications and upload file types. For a client restriction, set User-Agent to an identifier accepted by the service (for example `Zotero/10.0.0`). It stays empty by default, which sends no User-Agent. Zotero-specific endpoints may also accept only `.zip` / `.prop` uploads, so changing User-Agent alone does not make JSON uploads compatible; try a ZIP snapshot in this case. For upload errors 403, 405 or 415, also check account write permissions and server policies. ZIP support does not bypass permission checks.++Switching formats uses a new remote path and does not delete the original JSON snapshot. Configure the same path on all devices. Upgrade every device to a DBX version supporting ZIP snapshots before enabling ZIP; older versions must keep using a JSON path. Use a separate DBX directory, not Zotero's own synchronization directory.In Web/Docker mode, the DBX server sends WebDAV requests, so browser CORS restrictions do not apply. WebDAV application passwords are encrypted in the current DBX instance and are never included in sync snapshots.