Skip to content

Allow building custom standalone servers #2416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

m1guelpf
Copy link

@m1guelpf m1guelpf commented Mar 10, 2025

Description of Changes

Expands the spacetimedb-standalone crate to also serve as a library to build your own standalone servers with custom auth services and more. This is accomplished by:

  • Publishing some structs/properties to allow reusing the existing StandaloneEnv instead of having to recreate it from scratch.
  • Make StandaloneEnv abstract over any JwtAuthProvider and not just the default (but still default to DefaultJwtAuthProvider, so no API changes for existing clients)

API and ABI breaking changes

I don't believe this includes any breaking changes, other than some of the crate's API now being public. Since the crate is currently marked as unstable, this should be fine.

Expected complexity level and risk

Changes are very simple.

Testing

I'm using this branch locally to develop a custom SpacetimeDB server with stricter authentication requirements.

@jdetter jdetter added the community Used to mark PRs that were authored by the community (people outside of Clockwork Labs) label Mar 10, 2025
@m1guelpf m1guelpf changed the title Publish ControlDb and members of StandaloneEnv struct Allow building custom standalone servers Mar 11, 2025
@m1guelpf
Copy link
Author

@jdetter lmk how I can go about signing the CLA

@jdetter
Copy link
Collaborator

jdetter commented Mar 11, 2025

@m1guelpf Could you send me an email to [email protected]? Thanks, we'll keep an eye out for it 🙂

@bfops
Copy link
Collaborator

bfops commented Apr 4, 2025

@m1guelpf We're happy to move forward with this. Just a note: While we guarantee API/ABI stability for future 1.* versions of SpacetimeDB, we can't make the same guarantee for using SpacetimeDB as a library. Your code may get broken without notice!

@bfops
Copy link
Collaborator

bfops commented Apr 4, 2025

(also it looks like we have some merge conflicts now - if you can get those fixed, we should be good to go!)

@m1guelpf
Copy link
Author

m1guelpf commented Apr 7, 2025

@bfops resolved the conflicts! crate stability is not an issue for me, I was planning to pin to a commit anyways 😁

@bfops
Copy link
Collaborator

bfops commented Apr 7, 2025

Hey @m1guelpf - based on the test failures, it looks like some more crates need updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Used to mark PRs that were authored by the community (people outside of Clockwork Labs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants