lemmy
lemmy copied to clipboard
Can change instance to be private if federation is enabled
- [X] Did you check to see if this issue already exists?
- [X] Is this only a single bug? Do not put multiple bugs in one issue.
- [X] Is this a question or discussion? Don't use this, use https://lemmy.ml/c/lemmy_support .
- [X] Is this a UI / front end issue? Use the lemmy-ui repo.
Issue Summary
An instance can be made private even if federation is enabled. This will cause an issue when the instance is restarted as lemmy will check to see if an instance is both private and federated.
Steps to Reproduce
- As an admin, make a federated instance private. This should succeed without any issues/warnings.
- Restart the instance.
Actual behavior: There is an error about the instance being both private and federated. The instance will not start. The only way I was able to resolve this is by modifying the database manually. Expected behavior: This state should never exist, and we should surface this condition to the user better.
Technical details
I am about to post a simple PR to return an error if this specific case is attempted, but a better option may be converting the private_instance
and federation_enabled
fields to a single enum as they are mutually exclusive.