Bookmark sync server for the xBrowserSync extensions. One Go binary, PostgreSQL or SQLite, wire-compatible with API 1.1.13. Holds your bookmarks without ever being able to read them.
  • Go 94.3%
  • Shell 4.1%
  • Dockerfile 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dixon D'Cunha c434ea89f3
All checks were successful
CI / lint (pull_request) Successful in 1m47s
CI / test (pull_request) Successful in 6m15s
CI / CI (pull_request) Successful in 15s
CI / lint (push) Successful in 57s
Release / Release (push) Successful in 20s
CI / test (push) Successful in 2m7s
CI / CI (push) Successful in 15s
ci: install only the Go check tools
2026-12-01 00:57:19 -05:00
.forgejo/workflows ci: install only the Go check tools 2026-12-01 00:57:19 -05:00
cmd/xbrowsersyncgo refactor: move the code onto armature's parts and wire layers, required-tests and scripts/test.sh 2026-11-06 21:16:43 -05:00
internal refactor: move the code onto armature's parts and wire layers, required-tests and scripts/test.sh 2026-11-06 21:16:43 -05:00
scripts chore: sync required-tests.sh with armature d20e9a1 2026-11-08 07:07:01 +00:00
.dockerignore feat: xBrowserSync-compatible sync server on PostgreSQL or SQLite 2026-10-27 00:50:34 -04:00
.gitignore chore: add armature plumbing (AGENTS.md, mise tasks, CI, release, Renovate) 2026-11-05 08:30:45 -05:00
AGENTS.md docs: rewrite markdown in plain English and require the simple-english skill for doc changes 2026-11-08 01:48:19 -05:00
CHANGELOG.md chore(main): release xbrowsersyncgo v0.3.1 2026-11-07 02:23:02 +00:00
CLAUDE.md chore: add armature plumbing (AGENTS.md, mise tasks, CI, release, Renovate) 2026-11-05 08:30:45 -05:00
Dockerfile fix(deps): Update all non-major dependencies (#22) 2026-11-30 05:30:03 +00:00
go.mod fix(deps): Update all non-major dependencies (#22) 2026-11-30 05:30:03 +00:00
go.sum fix(deps): Update all non-major dependencies (#22) 2026-11-30 05:30:03 +00:00
LICENSE feat: xBrowserSync-compatible sync server on PostgreSQL or SQLite 2026-10-27 00:50:34 -04:00
mise.toml fix(deps): Update all non-major dependencies (#21) 2026-11-23 05:28:44 +00:00
README.md docs: rewrite markdown in plain English and require the simple-english skill for doc changes 2026-11-08 01:48:19 -05:00
releasaurus.toml chore: add armature plumbing (AGENTS.md, mise tasks, CI, release, Renovate) 2026-11-05 08:30:45 -05:00
renovate.json chore: add armature plumbing (AGENTS.md, mise tasks, CI, release, Renovate) 2026-11-05 08:30:45 -05:00

xBrowserSyncGo

xBrowserSyncGo is a bookmark sync server for the xBrowserSync browser extensions. It uses the wire format (the exact requests and replies) of the xBrowserSync API 1.1.13, so the stock extensions work with it unchanged. It stores data in PostgreSQL or SQLite and ships as one static binary. It never sees your bookmarks, because the extension encrypts them before upload.

Run it

docker run -p 8080:8080 -v xbrowsersyncgo:/data git.dcunha.io/exikle/xbrowsersyncgo:0.2.0

Then set the service URL of the extension to the address of the server. The image runs as uid 65532 and works with a read-only root filesystem. The SQLite database is at /data/xbrowsersyncgo.db, unless XBROWSERSYNCGO_DATABASE_URL sets a different location.

Configuration

You set every option with an environment variable. xbrowsersyncgo help prints the full list.

Variable Default Meaning
XBROWSERSYNCGO_DATABASE_URL sqlite:///data/xbrowsersyncgo.db postgres://… or sqlite://… (a bare path also means SQLite)
XBROWSERSYNCGO_HTTP_PORT 8080 The port of the API. It replaces XBROWSERSYNCGO_LISTEN (0.2.0). The server now stops at startup if XBROWSERSYNCGO_LISTEN is set
XBROWSERSYNCGO_METRICS_ENABLED true Serve Prometheus metrics on their own port
XBROWSERSYNCGO_METRICS_PORT 8081 The metrics port: GET /metrics
XBROWSERSYNCGO_SHUTDOWN_TIMEOUT 15s How long a stop waits for requests that are in progress
XBROWSERSYNCGO_ALLOW_NEW_SYNCS true Accept new syncs. Set false after everyone has signed up
XBROWSERSYNCGO_MAX_SYNCS 5242 The maximum number of stored syncs. 0 means no maximum
XBROWSERSYNCGO_MAX_SYNC_SIZE 512000 The size limit of a request body, in bytes
XBROWSERSYNCGO_DAILY_NEW_SYNCS_LIMIT 3 New syncs for each client IP each day. 0 turns it off
XBROWSERSYNCGO_TRUST_PROXY false Take the client IP from the last X-Forwarded-For entry. Set it only behind exactly one reverse proxy
XBROWSERSYNCGO_THROTTLE_REQUESTS 1000 Requests for each IP in each window. 0 turns it off
XBROWSERSYNCGO_THROTTLE_WINDOW 5m The length of the throttle window
XBROWSERSYNCGO_SYNC_EXPIRY 0 Delete syncs that nobody read for this time, for example 504h. 0 keeps them forever
XBROWSERSYNCGO_ONLINE true false answers sync requests with 503
XBROWSERSYNCGO_MESSAGE / XBROWSERSYNCGO_LOCATION empty /info shows these values
XBROWSERSYNCGO_LOG_LEVEL info debug, info, warn or error

/healthz answers {"status":"ok"} when the process is up. /readyz gives the same answer, and it also checks the database. It answers 503 when the database is unreachable. The server writes logs as JSON lines on stdout. xbrowsersyncgo --version prints xbrowsersyncgo <version>.

Moving from xBrowserSync

Export the bookmarks collection as Extended JSON, with one document on each line. Then give the file to xbrowsersyncgo import. The import copies IDs, blobs, and timestamps exactly. The sync ID is the salt for the encryption key of the extension, so the browsers keep working with no change.

mongosh "$MONGO_URL" --quiet --eval \
  'db.getSiblingDB("xbrowsersync").bookmarks.find().forEach(d => print(EJSON.stringify(d)))' \
  > syncs.jsonl
xbrowsersyncgo import syncs.jsonl

xbrowsersyncgo import - reads standard input. You can run the import again safely. If a sync on xBrowserSyncGo is newer than the export, the import skips it. An old export cannot undo pushes that happened since. The import stamps each imported sync as just read. Then XBROWSERSYNCGO_SYNC_EXPIRY cannot delete a sync before a browser reaches it.

The extension switches sync off when it gets a 429 response. If many clients share one proxy IP, set XBROWSERSYNCGO_TRUST_PROXY or XBROWSERSYNCGO_THROTTLE_REQUESTS=0.

Where it differs from xBrowserSync 1.1.13

Clients cannot see these differences. They are fixes on the server:

  • The server checks and writes a conflicting PUT in one statement, so two writers that race cannot both win. A write also always moves lastUpdated forward, even within the same millisecond.
  • The daily new-sync limit resets each day. Upstream resets it only if the operator adds a MongoDB TTL index by hand.
  • Expiry of stale syncs is a setting (XBROWSERSYNCGO_SYNC_EXPIRY). Upstream needs a manual index.
  • With XBROWSERSYNCGO_TRUST_PROXY, the client IP is the last X-Forwarded-For hop. Upstream uses the first hop, which a caller can forge.
  • Error responses also carry the CORS header, so the browser sees the real status.
  • /favicon.ico answers instead of hanging, and health endpoints exist. GET / is a 404, not the docs page of upstream. There is no path-prefix setting.
  • Malformed JSON still returns 500 UnspecifiedException, as upstream does.

Develop

mise run ci

This command runs the format check, go vet, the layer rules, and the tests, as CI runs them. The database tests run against SQLite. They also run against a PostgreSQL that the tests start themselves. You need no setup, but the first run downloads PostgreSQL.

Releases

Releasaurus opens a release PR from the commit titles. When you merge it, it tags vX.Y.Z. Exikle/containers (apps/xbrowsersyncgo) builds and signs the image. It pushes the image to git.dcunha.io/exikle/xbrowsersyncgo and registry.dcunha.io/exikle/xbrowsersyncgo. Renovate picks up the new tag there.

Licence

GPL-3.0. The wire format and the behavior follow xbrowsersync/api (GPL-3.0).