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

Fix situations in which instance actor can be set to a Mastodon-incompatible name #22307

Merged
merged 4 commits into from
Jan 18, 2023

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #20820

  • instead of using instance-name@instance-name, use internal.actor@instance-name for the name of new instance actors, this still makes the instance actor use a name that can't be used by local user
  • validate actor name to catch such issues
  • automatically reset the instance actor name if it is found to include a :, as it would be incompatible with most of the existing fediverse

Copy link
Member

@Gargron Gargron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is : the only situation where the username would be incompatible? Since LOCAL_DOMAIN is supposed to be punycode, there should not be others. Perhaps we should add a check to LOCAL_DOMAIN to not allow port inclusion in production, or just exclude the port from the actor name? I'm not sure how I feel about the internal.actor username 😅

@ClearlyClaire
Copy link
Contributor Author

Is : the only situation where the username would be incompatible? Since LOCAL_DOMAIN is supposed to be punycode, there should not be others.

There might be other, it might indeed be better to check for the regexp, but i wanted something simple that matched the cases I'm aware of.

Perhaps we should add a check to LOCAL_DOMAIN to not allow port inclusion in production, or just exclude the port from the actor name?

localhost would be an issue since that can clash with a normal user, so i figure it's better if we use something fixed with a . in it

I'm not sure how I feel about the internal.actor username sweat_smile

mastodon.internal? mastodon.server? internal.mastodon? internal.server?

@ClearlyClaire ClearlyClaire changed the title Fix situation in whiches instance actor can be set to a Mastodon-incompatible name Fix situations in which instance actor can be set to a Mastodon-incompatible name Jan 15, 2023
@ClearlyClaire ClearlyClaire mentioned this pull request Jan 16, 2023
15 tasks
@Gargron Gargron merged commit d138757 into mastodon:main Jan 18, 2023
btrd pushed a commit to btrd/mastodon that referenced this pull request Feb 22, 2023
…patible name (mastodon#22307)

* Validate internal actor

* Use “internal.actor” by default for the server actor username

* Fix instance actor username on the fly if it includes ':'

* Change actor name from internal.actor to mastodon.internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USABILITY: init db before configuration is completed causes silent failures / broken instance
2 participants