Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

LevelCode reference Settings Sync server

A tiny, dependency-free implementation of the Code-OSS user-data-sync REST contract — the same protocol the editor's built-in Settings Sync speaks.

It exists to:

  • develop/test LevelCode Sync end-to-end with no cloud backend, and
  • self-host the free sync tier (bring your own storage).

LevelCode Cloud implements the same contract for managed sync.

Run

PORT=9595 node tools/sync-server/server.js
# → LevelCode reference sync server on http://localhost:9595

branding/product.overlay.jsonconfigurationSync.store.url points the editor here (http://localhost:9595) for dev. Before release, point it at the managed LevelCode Cloud host.

Test

node tools/sync-server/test.js     # round-trips the REST contract (manifest, ETags, isolation)

Contract (implemented)

Method · Path Behavior
GET /v1/manifest { session, ref, latest: { <type>: <ref> }, collections: {} }; If-None-Match304
GET /v1/resource/{type}/latest content + ETag; If-None-Match304; none → 204
POST /v1/resource/{type} write; If-Match precondition → 412 on mismatch; returns new ETag
GET /v1/resource/{type}/{ref} a historical version
GET/POST/DELETE /v1/collection[...] minimal (no real profiles in v1)

Notes

  • Auth: every /v1 request needs Authorization: Bearer <token> (the token comes from the levelcode auth provider in extensions/levelcode-sync). Storage is isolated per token.
  • Opaque bodies: the server never parses settings, so client-side E2E encryption can be added later with zero server changes.
  • Dev only: HTTP on localhost, file-backed storage under tools/sync-server/.data (gitignored). Not hardened for production — LevelCode Cloud is the managed implementation.