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

Should we get rid of the admin.prose.org.local VirtualHost? #18

Open
RemiBardon opened this issue Jun 19, 2024 · 6 comments
Open

Should we get rid of the admin.prose.org.local VirtualHost? #18

RemiBardon opened this issue Jun 19, 2024 · 6 comments
Labels
question Further information is requested

Comments

@RemiBardon
Copy link
Member

@valeriansaliou Following some discussions with the Prosody team yesterday evening, I had a look at mod_groups_internal, which they recommended me over mod_groups. Here is a screenshot where they explain why mod_groups won’t suit our needs and the other one is better:

Screenshot 2024-06-19 at 11 32 09

mod_groups_internal doesn’t use a config file, but rather needs to be invoked from a plugin. We have mod_admin_rest for that, I just need to add a few routes. However, while looking at the code I noticed the exposed functions don’t take bare JIDs as arguments but just local parts (usernames). They use the current host to construct a JID. mod_admin_rest was exposed via the admin.prose.org.local VirtualHost… which means we won’t be able to use mod_groups_internal as we’d expect.

mod_admin_rest uses basic auth + prosody roles to authenticate insecure HTTP requests, and the “main” VirtualHost already exposes one http_port for mod_rest (sending stanzas via HTTP REST). Would it be okay if I migrate mod_admin_rest to the “main” VirtualHost (getting rid of admin.prose.org.local altogether) or should I modify mod_groups_internal to support bare JIDs? The latter seems very tricky, while the former doesn’t seem like a security breach since calls are authenticated… WDYT?

@RemiBardon RemiBardon added the question Further information is requested label Jun 19, 2024
@RemiBardon
Copy link
Member Author

I added support for mod_groups_internal in mod_admin_rest and I am migrating prose-pod-api from mod_groups to mod_groups_internal (via mod_admin_rest). As I was getting rid of the admin.prose.org.local VirtualHost, I realized we can't get rid of it because it's the only host we have during the Pod initialization phase.

@RemiBardon
Copy link
Member Author

mod_admin_rest doesn't enforce its user to be from the same host as the module runs on, as long as it has the appropriate permissions. When creating the "main" VirtualHost, Prose Pod API will grant those permissions to [email protected] and we should be able to use a second mod_admin_rest instance running on the "main" host without too much trouble. I'll try this out tonight.

@RemiBardon
Copy link
Member Author

Medium-term, we could also switch to the new implementation of mod_admin_rest which I proposed in prose-im/prose-pod-server#5 if it is accepted.

@valeriansaliou
Copy link
Member

valeriansaliou commented Jun 19, 2024

Short answer: yes (we should). Reading explanations from Zash, I believe we should. I'll be honest, I've initially been used mod_groups for proof-of-concept purposes only, although it's worked quite well so far.

@RemiBardon
Copy link
Member Author

RemiBardon commented Jun 19, 2024

We should "use mod_groups_internal" or we should "get rid of admin.prose.org.local"? I suppose it's the former since the latter wouldn't be possible1 but I want to make sure.

Footnotes

  1. We could but it would require a lot of issue-prone work to switch the admin account from a bootstrapping host to the "main" host.

@valeriansaliou
Copy link
Member

I was referring to the former indeed 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants