Skip to content

xiaohanqing/simple_sync

Repository files navigation

Simple Sync

A lightweight WebDAV sync tool with a native desktop UI. Periodically downloads changed files from your WebDAV server to local folders — set it and forget it.

Built with Go (backend) + Tauri v2 (desktop UI) + Vue 3 (frontend).

Features

  • One-way sync — downloads remote changes to your local machine
  • Multiple tasks — each with its own WebDAV server, remote/local path, and sync interval
  • Daemon mode — runs in the background on a configurable interval per task
  • Real-time progress — SSE-powered sync progress modal with per-file status
  • Dry-run test — preview what would sync without downloading anything
  • Connection check — verify WebDAV connectivity for any task
  • Password encryption — AES-256-GCM with machine-bound keys; enc: prefix auto-decrypts
  • Password files — store credentials in ~/.credentials/simple-sync/ with mode 600
  • Auto-start on login — via Tauri autostart plugin
  • System tray — minimize to tray, right-click to show/quit
  • Light/dark themes — purple-accented, keyboard-friendly
  • Cross-platform — Linux and Windows builds from a single machine

Quick Start

Download

Grab the latest release from the Releases page.

Linux

# Extract
tar xzf SimpleSync-Linux-x64.tar.gz

# First run — generates an example config if none found
./simple-sync-ui
# → Edit the generated config.json with your server details
# → Run again

# Or use the CLI directly
./simple-sync -config config.json api :8080

Windows

# Extract
Expand-Archive SimpleSync-Windows-x64.zip

# Run
.\simple-sync-ui.exe

On first launch, if config.json is not found next to the binary, an example config is automatically generated. Edit it with your WebDAV server details and restart.

Configuration

Copy config.example.json as a starting point:

cp config.example.json config.json

Example

{
  "servers": {
    "my_nas": {
      "url": "https://your-nas.example.com:5005",
      "username": "your_username",
      "password_file": "~/.credentials/simple-sync/my_nas"
    },
    "nextcloud": {
      "url": "https://nextcloud.example.com/dav",
      "username": "admin",
      "password": "enc:your_encrypted_password_here"
    }
  },
  "tasks": [
    {
      "name": "documents",
      "server": "nextcloud",
      "remote_path": "/documents",
      "local_path": "./sync/documents",
      "interval": 300,
      "delete": false,
      "concurrent": 3
    }
  ]
}

Password handling

Method Config field How it works
Plaintext "password": "secret" Stored as-is. Not recommended for shared machines.
Encrypted "password": "enc:abc123..." AES-256-GCM encrypted. Use the Encrypt tool in Settings UI, or CLI: simple-sync encrypt <plaintext>
Password file "password_file": "~/.credentials/simple-sync/my_nas" Read from file at startup. Set file mode to 600. Use the Password File button in the Servers UI.

On startup, passwords are resolved in this order: password_file → read file → enc: prefix → auto-decrypt → plaintext fallback.

Config upgrades

When a new version adds config fields, existing config.json files are never overwritten. Missing fields get Go zero-values, and setDefaults() fills in sensible defaults. Just keep your config and upgrade the binary.

CLI

simple-sync [-config path] <command>

Commands:
  init          Generate example config file
  check         Verify WebDAV connectivity for all tasks
  sync          Run a one-shot sync for all tasks
  daemon        Run periodic sync (foreground)
  api :8080     Start HTTP API server (used by UI)
  encrypt <pw>  Encrypt a password for config use

API

The UI communicates with the Go backend over HTTP on localhost:8080:

Method Path Description
GET /api/status Daemon state, task statuses, version
GET /api/config Current config (passwords masked)
PUT /api/config Update config (preserves existing passwords)
POST /api/start Start the sync daemon
POST /api/stop Stop the sync daemon
POST /api/sync Sync all tasks now
POST /api/sync/:name Sync a single task
POST /api/check Check connectivity for all tasks
POST /api/check/:name Check connectivity for one task
POST /api/test-sync/:name Dry-run: list files that would sync
GET /api/events SSE stream of sync progress events
GET /api/logs Recent log lines
POST /api/encrypt Encrypt a password string
POST /api/password-file Write a password file (mode 600)

Building from Source

Prerequisites

  • Go 1.21+
  • Node.js 18+
  • Rust + Cargo (via rustup)
  • For Windows cross-compile: mingw-w64-gcc

Build

# Linux only
./build.sh

# Windows cross-compile
./build.sh windows

# Both platforms
./build.sh all

# Custom version
SIMPLESYNC_VERSION=1.2.3 ./build.sh all

Output goes to dist/.

Development

cd ui
npm install
npx tauri dev

This starts the Vite dev server with hot-reload and opens the Tauri window. The Go backend is found and started automatically.

License

MIT

About

simple sync , webdav

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors