A clean-room reimplementation of the Synology Drive server in Go
  • Go 78.9%
  • JavaScript 12.5%
  • CSS 5.5%
  • HTML 2.1%
  • Shell 0.8%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-12 20:35:25 +03:00
.github/workflows ci: run on Forgejo Actions and push the image to its registry 2026-09-12 20:35:25 +03:00
cmd web: enforce share expiry, add drive settings, split the drive UI into files 2026-09-12 20:18:24 +03:00
deploy ondemand: durable /data ownership + widen the pull_event rewind to the extension's real pull shape 2026-08-10 10:49:47 +03:00
internal repo: drop the reverse-engineering toolchain and untrack capture fixtures 2026-09-12 20:18:40 +03:00
scripts web: enforce share expiry, add drive settings, split the drive UI into files 2026-09-12 20:18:24 +03:00
.dockerignore Docker: Dockerfile + docker-compose for testing kreadrive individually 2026-08-08 21:50:30 +03:00
.gitignore repo: untrack the RE-era planning docs 2026-09-12 20:24:30 +03:00
docker-compose.yml Fix "stuck syncing" for real-client uploads (7 issues, root-caused via captures) 2026-08-08 23:09:31 +03:00
Dockerfile ondemand: durable /data ownership + widen the pull_event rewind to the extension's real pull shape 2026-08-10 10:49:47 +03:00
go.mod M8: hardening — PostgreSQL backend, cross-platform builds, soak, error conformance, CI 2026-08-08 21:44:48 +03:00
go.sum M8: hardening — PostgreSQL backend, cross-platform builds, soak, error conformance, CI 2026-08-08 21:44:48 +03:00
LICENSE repo: license the project under MIT 2026-09-12 20:30:00 +03:00
README.md repo: add a README 2026-09-12 20:31:13 +03:00

kreato Drive logo

kreato Drive

A clean-room reimplementation of the Synology Drive server in pure Go.


kreato Drive speaks enough of the Synology Drive protocol stack that the real Synology Drive desktop and mobile clients connect to it and behave as if they were talking to a NAS: the proprietary sproto sync protocol, the DSM web API (webapi/entry.cgi), the FileStation file API, and WebDAV. No Synology code was used — everything here was rebuilt from protocol observation and interface analysis.

Features

  • Native client support — the real Synology Drive clients (macOS/Windows/ mobile) can log in, browse, sync, upload, and download
  • sproto wire protocol — frame codec, session/channel handling, and the sync actions the client issues (connect, pull_event, list, query, upload, download, resume, locking)
  • Web file manager — a dependency-free single-page UI (list/grid views, preview, sharing, search, labels, teams, trash, versions, admin settings)
  • DSM web API — the broad SYNO.* endpoint surface the clients probe, including sharing links (passwords, privacy, expiry), users, tasks, notifications, metrics
  • WebDAV — mount the server as a network drive
  • Storage — SQLite (default) or PostgreSQL via GORM; content-addressed blob store on local disk
  • TLS — self-signed cert generated on first run, or bring your own PEM
  • Docker — image + compose file (with a Postgres service) included

Quick start

Build and run:

go build -o kreadrived ./cmd/kreadrived
./kreadrived -listen :6690 -web-listen :5001 -admin-user admin -admin-password secret

Then point the Synology Drive client at the host, or open the web UI at http://127.0.0.1:5001/drive.

Docker:

docker compose up --build

Configuration

Flags and environment variables (same names, KREADRIVE_ prefix):

Flag Env Meaning
-listen KREADRIVE_LISTEN sync protocol listen address (default :6690)
-web-listen KREADRIVE_WEB_LISTEN web API/UI address (default empty = disabled; e.g. :5001)
-data KREADRIVE_DATA data directory (TLS keys, database, blob store)
-dev KREADRIVE_DEV dev mode: accept any password and any 32-hex token
-cert / -key — PEM TLS pair; omit to self-sign into <data>/tls
-admin-user / -admin-password KREADRIVE_ADMIN_* seeded admin account
-db-driver / -db-dsn KREADRIVE_DB_* sqlite (default) or postgres
-identity KREADRIVE_IDENTITY kreadrive (default) or eris (mirror a real NAS for E2E tests)
-refuse-tls KREADRIVE_REFUSE_TLS answer encrypt_channel with an error (plaintext clients)
-disable-nasa-apod KREADRIVE_DISABLE_NASA_APOD disable the NASA APOD login background
-v KREADRIVE_VERBOSE debug logging

Seeding content

kreadrive-admin materializes a local directory as a Drive view:

go build -o kreadrive-admin ./cmd/kreadrive-admin
./kreadrive-admin seed-view -db <data>/kreadrive.sqlite -view "My Drive" -user admin -path ~/some/folder

Development

go test ./...     # full suite (protocol, actions, server, web, store)
go vet ./...
go build ./...    # also cross-compiles: CGO_ENABLED=0, pure Go

CI builds linux/amd64 and windows/amd64 and runs the tests (with -race on Linux) on every push.

Layout

internal/sproto     sproto frame codec and protocol primitives
internal/server     the sync-protocol server (sessions, dispatch)
internal/actions    client action implementations (list, upload, ...)
internal/web        DSM/FileStation web API, WebDAV, portal, drive UI
internal/store      GORM models and persistence (SQLite/Postgres)
internal/fs         filesystem/blob storage layer
internal/seed       view/file seeding used by the admin CLI
cmd/kreadrived      the server binary
cmd/kreadrive-admin administration CLI

Disclaimer

kreato Drive is an independent, clean-room project. It is not affiliated with, endorsed by, or connected to Synology in any way. "Synology" and "Drive" are trademarks of Synology Inc.

License

MIT — see LICENSE.