Skip to content

feat: add WebDAV cloud sync (pull from Clash Verge backups) - #790

Open
muzi-xiaoren wants to merge 3 commits into
MetaCubeX:mainfrom
muzi-xiaoren:feat/webdav-sync
Open

muzi-xiaoren wants to merge 3 commits into
MetaCubeX:mainfrom
muzi-xiaoren:feat/webdav-sync

Conversation

@muzi-xiaoren

@muzi-xiaoren muzi-xiaoren commented Jun 29, 2026 •

Copy link
Copy Markdown

Summary

Add a "WebDAV Sync" settings screen that pulls the latest Clash Verge backup from the same WebDAV server and applies its subscriptions, like a restore in Clash Verge. Pull-only, so it never changes desktop state.

Changed

  • WebDavClient: PROPFIND list + GET download (OkHttp, Basic auth) against Clash Verge's fixed clash-verge-rev-backup/ directory
  • VergeBackup: unzip + parse profiles.yaml (SnakeYAML); remote (subscription) profiles are applied, local/enhancement profiles are skipped
  • Sync mirrors Verge's restore: the local list ends up holding exactly the backup's subscriptions, and the profile Verge had selected becomes active. Existing subscriptions (matched by Verge uid → URL → name) are updated in place, keeping their uuid and proxy selections; other local profiles are deleted. An empty backup is ignored.
  • Progress dialog with a per-subscription log while syncing
  • Settings entry, credentials in UiStore, EN/zh strings, SnakeYAML R8 keep rules

Testing

  • Synced against a real Clash Verge WebDAV backup on device: subscriptions updated in place, removed ones deleted, desktop's current profile activated
  • Progress dialog shows each subscription's result and stays open until dismissed

Add a "WebDAV Sync" settings screen that connects to the same WebDAV server
Clash Verge backs up to, downloads the latest backup zip and applies its
subscription profiles, like a restore in Clash Verge.

- WebDavClient: PROPFIND list + GET download (OkHttp, Basic auth) against the
  fixed `clash-verge-rev-backup/` directory Clash Verge uses.
- VergeBackup: unzip + parse profiles.yaml (SnakeYAML); remote (subscription)
  profiles are applied, local/enhancement profiles are skipped.
- Sync mirrors Verge's restore, which replaces the whole profile list: the local
  list ends up holding exactly the backup's subscriptions and the profile Verge
  had selected becomes active. Existing subscriptions (matched by Verge uid, then
  URL, then name) are updated in place so their uuid and proxy selections
  survive; other local profiles are deleted. An empty backup is ignored.
- A dialog shows progress and a per-subscription log while syncing.
- Credentials stored in UiStore, EN/zh strings, SnakeYAML R8 keep rules.

Pull-only (no upload), so it never changes desktop state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
muzi-xiaoren and others added 2 commits October 9, 2026 16:07
…bscriptions

- "Test connection" lists the backup directory and reports the backup count
  and latest file, or an auth or network error.
- The sync dialog's cancel button stops after the current subscription; a
  cancelled sync skips deleting and switching profiles.
- When subscriptions fail, the dialog offers "Retry failed (N)", which
  re-applies only those subscriptions in the same dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant