Skip to content
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

Include other lemmy front ends in this ansible. #180

Open
dessalines opened this issue Oct 5, 2023 · 14 comments
Open

Include other lemmy front ends in this ansible. #180

dessalines opened this issue Oct 5, 2023 · 14 comments
Labels
enhancement New feature or request

Comments

@dessalines
Copy link
Member

dessalines commented Oct 5, 2023

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:

LemmyNet/lemmy-ui-leptos#15

cc @erlend-sh

@ticoombs
Copy link
Collaborator

ticoombs commented Oct 5, 2023

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.

@db0
Copy link
Contributor

db0 commented Oct 5, 2023

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

@dessalines
Copy link
Member Author

@db0 could you link an example or setup of that approach?

@db0
Copy link
Contributor

db0 commented Oct 5, 2023

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).

@db0
Copy link
Contributor

db0 commented Oct 5, 2023

@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.

@codyro
Copy link
Collaborator

codyro commented Oct 5, 2023

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, LemmyNet/lemmy-docs#274) as we have too many varying opinions right now.

@erlend-sh
Copy link

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.

@codyro
Copy link
Collaborator

codyro commented Oct 22, 2023

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.

@erlend-sh
Copy link

erlend-sh commented Oct 22, 2023

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.

@dessalines
Copy link
Member Author

dessalines commented Oct 22, 2023

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.

@codyro
Copy link
Collaborator

codyro commented Oct 22, 2023

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!

@ticoombs
Copy link
Collaborator

@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.

@ticoombs ticoombs changed the title Include other lemmy front ends in this ansible. feature: Include other lemmy front ends Dec 16, 2023
@ticoombs ticoombs changed the title feature: Include other lemmy front ends Include other lemmy front ends in this ansible. Dec 16, 2023
@ticoombs ticoombs added the enhancement New feature or request label Dec 16, 2023
@tafiti
Copy link

tafiti commented Apr 11, 2024

Checking in on the status of this issue. @ticoombs would you have an idea whether this is likely to be on any release soon?

@codyro
Copy link
Collaborator

codyro commented Apr 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants