Open dessalines opened 1 year ago
While it would be simple (I already do this and can upstream my configuration) it adds scope (& complexity).
If we are wanting to start adding frontends & "extras" re: #174 the ansible code needs to be completely re-written to use proper roles. ref: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html
nginx, docker, each docker service, letsencrypt, etc would get their own role. Then in the lemmy.yml we call all the roles that need to be installed. It would call the variable file and we would have role_<rolename>: True
for every role. and if they said true or false that role would be installed, making it a modular installation.
It isn't impossible, it would take some time to re-write which (honestly) will be needed regardless at some point moving forward to better maintain the codebase.
Might be worth it at this point to make Lemmy an ansible collection and provide the various roles within. It will massively simplify deployment by users. I can potentially help covert to a collection
@db0 could you link an example or setup of that approach?
I can provide a PoC sure. It will be a bit hacky but can point out the way to go. As always I have only superficial docker knowledge so I'm not quite sure how I should handle the docker-compose.yml
(whether it has to be a single file or can be split into multiples is a relevant question for splitting into roles).
@dessalines PoC provided in #181. It will need further work from you peeps to complete, but this is the general approach. Unfortunately I don't have any more time to work on this right now.
That is an excellent example of the direction we should go. @ticoombs suggestion of using variables to determine role inclusion is wise, as it'll allow a single playbook to handle various instances with varying setups.
We need to reach some consensus on the docker-compose.yml
handling (EX, https://github.com/LemmyNet/lemmy-docs/issues/274) as we have too many varying opinions right now.
So just to make sure we’re on the same page, this would make it possible to host Lemmy with an alt-frontend on the instance’s root domain, right?
E.g. if I wanted my lemmyexample.com
site to use Photon as its default, this ansible change would allow me to serve the Photon frontend on the root lemmyexample.com
(instead of photon.lemmy example.com
), relegating the bundled UI to legacy.lemmyexample.com
.
Yes, the idea would be that you could choose what UI to install instead of assuming the default lemmy-ui.
I hadn't thought about it supporting multiple UIs and subdomains, though.
Standardized support for multiple UIs/subdomains would be a nice bonus, but not a necessity, since that’s obviously doable already with the alt-UI setups on subdomains that several instances are operating with already today.
I'd originally thought it would be optionally serving multiple front ends: alexandrite.instance.tld, photon.instance.tld, etc. But that you could plug in any one you want for the "main" one, and use nginx rerouting rules.
It's doable! I'd rather get it done right the first time :).
I've been slowly working on moving everything to roles similar to how @ticoombs suggested. I'd need to adjust the logic for certbot/etc, but that’s it.
I'll see if I can develop a functioning PoC to publish by next week.
Thanks for the feedback!
@codyro wrt certbot and for multiple frontends, we could choose to use/install the certbot-dns-* plugins, and then get a wildcard instead of one per domain. Or something like acme.sh could also be good.
If we move forward with changing the frontends, or selecting one to me the "main" then it needs to be "feature complete" compared to lemmy-ui imho, otherwise we would end up having more support issues rather than technical issues. For the defaults I would suggest we utilise the same choices as upstream (lemmu-ui), and then we can have a variable that people can decide for themselves.
Initial thoughts I think having a list like this cody:
frontends:
- { "app": lemmy-ui, "host": "*" }
- { "app": alexandrite, "host": "alexandrite" }
- { "app": photon, "host": "photon", "image": "ghcr.io/xyphyn/photon:latest" }
This will allow users to decide on the default, as well as give us everything as variables/options to loop through and setup.
Checking in on the status of this issue. @ticoombs would you have an idea whether this is likely to be on any release soon?
I had a PoC I worked on when this was discussed. Let me check the status of it and see if it's something we'd be interested in using.
Now that we have a configurable docker-compose.yml (and potentially the same for the nginx), it might be a good idea to add alternate lemmy web front ends, served at their respective names.
The main ones to me seem to be:
More context:
https://github.com/LemmyNet/lemmy-ui-leptos/issues/15
cc @erlend-sh