I want to self-host lemmy and participate in federation. However, I wonder whether it’s possible to have a setup where only I, and trusted users, are allowed to browse federated-content.
Basically, guests should not be allowed to use my instance to browse other federated content. So requests to “mydomain.tld/c/whatever@otherdomain.tld” should not be possible. Only users, logged-in on my instance, should be able to do that.
Despite that, guests should be allowed to see posts of communities posted on my instance, and users of other instances should be allowed to comment.
I know I can choose with which other instances mine should link with, but this would make the experience inconvenient to me. Because then I would need to adjust the config if I want to subscribe to a community on an instance I have not yet linked with.
Is such setup possible? Could not find the answer in the docs unfortunately
The only thing I can think of is something like blocking UI requests, and allow them only from localhost (so I would create a “ssh -L” tunnel on the server). Federation API endpoints would not be blocked. But this seems shaky, does Lemmy support a cleaner, built-in solution?
Not OP, but I do feel dumb for not thinking of that assuming it would defederate me. Oh well, got a cool domain out of it
It would not affect federation as the endpoints are still open. But a word of caution. This only protects the
lemmy-ui
from being accessed without the basic auth credentials. If someone tries to access your instance via API, it will still work.You could also route any calls to /api through authentication. However I am not sure if that can cause any problems. Is there a list of endpoints that need to be reachable for federation to work?
It might. Some mods/instance admins might see your comments, decided to check your instance, and found it suspicious because it’s protected behind basic auth and decided to block your instance. You can see in the modlog that people sometimes bans private instance (instance that don’t let you see anything unless you’re logged in) out of suspicion that they are a source of bots traffics.
A better way is probably to only protect your search page behind basic auth so no one can hook in new communities in your instance.