- Go 78.9%
- JavaScript 12.5%
- CSS 5.5%
- HTML 2.1%
- Shell 0.8%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| cmd | ||
| deploy | ||
| internal | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
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
sprotowire 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.