A CLI for publishing standard.site documents to ATProto sequoia.pub

Self-hosting as an option #18

Open heaths.dev
Open opened by heaths.dev

Stemming from our thread offline, I had an idea that maybe we could provide some self-hosting option as well. I still want to help make sequoia easy to deploy for non-technical people and happy to keep submitting PRs to that end. But since I also have my own Cloudflare account, I realized: why not self-host the web worker at least? I could use my own branding (colors, mainly), etc., and make the transition less jarring, not to mention can leave the default referrer-policy.

Off hand, I don't think much would be necessary. Maybe add a GET-only route for CSS and consolidate use to make things easier to update, define some CSS variables for most of the branding people would want, etc. Or maybe even a configuration value to override that with their own CSS path.

I dig this!! If we find a smooth way to do this I think we could make it a separate package like packages/worker or something like that. I used Cloudflare workers simply due to most of my other projects being hosted there, but I think with some tweaks we could make it way easier to self host. With our current worker you kinda have to use Cloudflare, but if we did a Hono API with Bun as the runtime, we could easily deploy to providers like Railway and make Docker images. The KV could be replaced by Bun's native Redis client.

Great idea! Docker is always a pretty good option for quick setup.

@heaths.dev Just added the ground work for this in PR #38! Will need some more work, and here's a few things off the top of my mind:

  • Consider switching from Redis to SQLite, while it does introduce a db it does make deployment much simpler
  • Deploy and test it e2e
  • Update how CSS works if we want to
  • Add CLI command to add the server package to someone's site repo?

Update: refactored to SQLite

I just noticed too that the server is duplicated between packages/server and docs. Might be good to make one source of truth so we don't diverge implementations, or is that the idea? In which case, we should consider branding. Looks like you did somewhat with color variables, but should also consider title, etc.

I’ll need to take another look at the implementation, but if I recall correctly, I did that because our docs are on a cloudflare worker, and the goal of the self hosted implementation was to be more agnostic. Totally open to a unified path though!

Just getting into Sequoia here so my opinion might not be worth a ton but the separation makes sense to me. If I'm understanding the intention of the self-hosting it would be just for the comments/recommends handling, right? So the /docs would be unnecessary.

@stevedylan.dev how hard would it be to host the /docs site myself on Cloudflare? The docker container is a good idea, still, but I was considering switching my SSG over to Cloudflare anyway. Mainly just to simplify cookies and maintain site stylesheets. Seems like wrangler with Cloudflare is a fairly inexpensive option.

Sorry totally missed this! Yeah cloudflare is what I use and its pretty straight forward

Sign up or Sign in to add to the discussion.