{"id":43327781,"url":"https://github.com/bcspragu/logseq-sync","last_synced_at":"2026-02-01T23:35:47.408Z","repository":{"id":203220672,"uuid":"708187748","full_name":"bcspragu/logseq-sync","owner":"bcspragu","description":"An open-source Logseq Sync backend implementation","archived":false,"fork":false,"pushed_at":"2024-02-03T17:12:11.000Z","size":67,"stargazers_count":118,"open_issues_count":4,"forks_count":2,"subscribers_count":25,"default_branch":"main","last_synced_at":"2024-06-21T18:54:06.540Z","etag":null,"topics":["logseq"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcspragu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-21T19:34:57.000Z","updated_at":"2024-06-17T05:07:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"73d85a02-b3ae-48dc-b4c1-b0cc0b6d52b0","html_url":"https://github.com/bcspragu/logseq-sync","commit_stats":null,"previous_names":["bcspragu/logseq-sync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bcspragu/logseq-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcspragu%2Flogseq-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcspragu%2Flogseq-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcspragu%2Flogseq-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcspragu%2Flogseq-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcspragu","download_url":"https://codeload.github.com/bcspragu/logseq-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcspragu%2Flogseq-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28995014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T23:10:54.274Z","status":"ssl_error","status_checked_at":"2026-02-01T23:10:47.298Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logseq"],"created_at":"2026-02-01T23:35:46.796Z","updated_at":"2026-02-01T23:35:47.402Z","avatar_url":"https://github.com/bcspragu.png","language":"Go","readme":"# Logseq Sync\n\nAn attempt at an open-source version of the [Logseq Sync](https://blog.logseq.com/how-to-setup-and-use-logseq-sync/) service, intended for individual, self-hosted use.\n\nIt's vaguely functional (see [What Works?](#user-content-what-works) below), but decidedly pre-alpha software. Definitely don't try to point a real, populated Logseq client at it, I have no idea what will happen.\n\n## What's Done/Exists?\n\nRight now, the repo contains (in [`cmd/server`](/cmd/server)) a mostly implemented version of the Logseq API, including credentialed blob uploads, signed blob downloads, a SQLite database for persistence, and most of the API surface at least somewhat implemented.\n\nCurrently, running any of this requires a modified version of the Logseq codebase ([here](https://github.com/logseq/logseq/blob/05a82a5f268fb77b01f9b8b2a454f5dc15573e70/src/main/frontend/config.cljs#L40-L41)), and [the `@logseq/rsapi` package](https://www.npmjs.com/package/@logseq/rsapi) ([here](https://github.com/logseq/rsapi/blob/18bd98cfc4d084182b534c1c72a6e473a7174b45/sync/src/sync.rs#L26-L28))\n\nOn that note, many thanks to the Logseq Team [for open-sourcing `rsapi` recently](https://github.com/logseq/logseq/issues/9311), it made this project significantly easier to work with.\n\n### What Works?\n\nWith a modified Logseq, you can use the local server to\n\n1. Create a graph\n2. Upload (passphrase-encrypted) encryption keys\n3. Get temporary AWS credentials to upload your encrypted files to your private S3 bucket\n4. Upload your encrypted files\n\nAnd that's basically the full end-to-end flow! The big remaining things are:\n\n- [ ] Implement the WebSockets protocol\n  - There's [some documentation](/docs/WEBSOCKET.md) for it\n- [ ] Figure out how/when to increment the transaction (`tx`) counter\n\n### API Documentation\n\nThere's some documentation for the API in [docs/API.md](/docs/API.md). This is the area I could benefit the most from having more information/help on, see [Contributing](#contributing) below\n\n## Open Questions\n\n### S3 API\n\nThe real Logseq Sync API gets temp S3 credentials and uploads files direct to S3. I haven't looked closely enough to see if we can swap this out for something S3-compatible like [s3proxy](https://github.com/gaul/s3proxy) or [MinIO](https://github.com/minio/minio), see [#2 for a bit more discussion](https://github.com/bcspragu/logseq-sync/issues/2).\n\nCurrently, [`amazonaws.com` is hardcoded in the client](https://docs.rs/crate/s3-presign/latest/source/src/lib.rs), so that'll be part of a larger discussion on how to make all of this configurable in the long run.\n\n## Associated Changes to Logseq\n\nBeing able to connect to a self-hosted sync server requires some changes to Logseq as well, namely to specify where your sync server can be accessed. Those changes are in a rough, non-functional state here: https://github.com/logseq/logseq/compare/master...bcspragu:logseq:brandon/settings-hack\n\n## Adding a database migration\n\nThe self-hosted sync backend has rudimentary support for persistence in a SQLite database. We use [sqlc](https://sqlc.dev) to do Go codegen for SQL queries, and [Atlas](https://github.com/ariga/atlas) to manage generating diffs.\n\nThe process for changing the database schema looks like:\n\n1. Update [`db/sqlite/schema.sql`](/db/sqlite/schema.sql) with your desired changes\n2. Run `./scripts/add_migration.sh \u003cname of migration\u003e` to generate the relevant migration\n3. Run `./scripts/apply_migrations.sh` to apply the migrations to your SQLite database\n\n### Why do it this way?\n\nWith this workflow, the `db/sqlite/migrations/` directory is more or less unused by both `sqlc` and the actual server program. The reason it's structured this way is to keep a more reviewable audit log of the changes to a database, which a single `schema.sql` doesn't give you.\n\n## Contributing\n\nIf you're interested in contributing, thanks! I sincerely appreciate it. There's a few main avenues for contributions:\n\n### Getting official buy-in from Logseq\n\nThe main blocker right now is getting buy-in from the Logseq team, as I don't want to do the work to add self-hosting settings to the Logseq codebase if they won't be accepted upstream. I've [raised the question on the Logseq forums](https://discuss.logseq.com/t/building-a-self-hostable-sync-implementation/21850/17), as well as in [a GitHub Discussion on the Logseq repo](https://github.com/logseq/logseq/discussions/10733), but have received no official response.\n\n### Understanding/documenting the API\n\nOne area where I would love help is specifying the official API more accurately. My API docs are based on a dataset of one, my own account. So there are areas that are underspecified, unknown, or where I just don't understand the flow. Any help there would be great!\n\nSpecifically, I'd like to understand:\n\n1. The details of the WebSocket protocol ([doc started here](/docs/WEBSOCKET.md)), and\n2. How and when to update the transaction counter, `tx` in the API\n\n### Debugging S3 signature issues\n\nI believe there's a bug ([filed upstream](https://github.com/logseq/rsapi/issues/2), [initially here](https://github.com/bcspragu/logseq-sync/issues/1)) in the `s3-presign` crate used by [Logseq's `rsapi` component](https://github.com/logseq/rsapi), which handles the actual sync protocol bits (encryption, key generation, S3 upload, etc).\n\nThe bug causes flaky uploads with self-hosted, AWS-backed (i.e. S3 + STS) servers, but I haven't had the time to investigate the exact root cause. The source code for the `s3-presign` crate [is available here](https://docs.rs/s3-presign/latest/src/s3_presign/lib.rs.html), [the GitHub repo itself](https://github.com/andelf/s3-presign) doesn't appear to be public.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcspragu%2Flogseq-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcspragu%2Flogseq-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcspragu%2Flogseq-sync/lists"}