Enable a frontend through the CLI
For a while I've been avoiding using (and recommending) the switchable frontends feature. I tried it out once and was not sure it really worked.
Since maintaining my own fork, it turned out to be the perfect solution to shipping my own FE without merge conflicts. I actually just dumped the FE into instance/static/frontends/soapbox-fe/vendor
and checked it into git, then set it as the default for my fork:
# Set Soapbox FE as the default frontend
config :pleroma, :frontends, primary: %{"name" => "soapbox-fe", "ref" => "vendor"}
However, my repo has already grown to an unwieldy size because of it:
And I've accidentally messed up the static files in a release already, causing a white screen... https://gitlab.com/soapbox-pub/soapbox/-/issues/18#note_582296792
In order for me to continue doing releases, I think I need to make full use of switchable frontends so I don't have to check static files into the repo anymore.
The main barrier I see is the mix pleroma.frontend install
command. We have to instruct users to install the frontend during install/upgrade, but this command doesn't actually do what I expect.
The reason I believed it didn't work before is because it doesn't enable the frontend. It only downloads the frontend. There is no way to enable a frontend through the CLI. I'm surprised it's not called mix pleroma.frontend download
.
If configurable_from_database
is enabled, it should set the frontend when you run this task. Otherwise it should instruct the user on how to update their config.
Apart from that, installing the frontend could become a one-liner in the install guide. And maybe it would make releases easier for you guys too.