NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.59k stars 13.74k forks source link

mastodon-streaming systemd unit templating #304368

Open jpds opened 5 months ago

jpds commented 5 months ago

Describe the bug

The Mastodon module should support the systemd unit templating that's provided by upstream at:

...and is also described in their documentation at: https://docs.joinmastodon.org/admin/scaling/#streaming . This is also particularly important for those of us that run their web applications in separate virtual machines to our frontend webservers.

Notify maintainers

@erictapen @happy-river @Izorkin @ghuntley


Add a :+1: reaction to issues you find important.

erictapen commented 5 months ago

The current setup was introducud in https://github.com/NixOS/nixpkgs/pull/251950#issuecomment-1732568492, see also the comment for why I didn't wan't to use the templating unit; I feel like on NixOS we have better tools for this.

What kind of additional benefits would you draw from the template unit over the current solution, except that it's just closer to upstream?

jpds commented 5 months ago

What kind of additional benefits would you draw from the template unit over the current solution

I separate all my web applications into their own virtual machines to provide security boundaries between them - in addition to my frontend webservers - so it's impossible for me to use a Unix socket for the streaming API (as the webserver requires a TCP connection for the reverse proxy).

Or to put it a different way: if you were given an entire datacenter rack of machines tomorrow - how would you separate the different components of Mastodon onto them? Because right now - everyone seems focused on deploying everything on a single box.

erictapen commented 5 months ago

Ah yeah I see the point for scaling. Would review a PR for being able to distribute streaming instances on other servers.

aanderse commented 5 months ago

@jpds are you able to work on this?