Solution
The Lemmy server appears to have a database limit of 255 characters [2]; however, individual instances appear to put their own limits on username length though the frontend [3] and/or the API [4.1][4.2].
Original Post
If you know, please also provide relevant documentation.
UPDATE (2025-02-02T06:06Z): I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50, and the maximum password length is 60 [1].
References
- “Sign Up”. sh.itjust.works. Lemmy. Accessed: 2025-02-02T08:49Z. https://sh.itjust.works/signup.
- When creating an account on sh.itjust.works, the sign-up form will throw this error if the provided password is greater than 60 characters in length.
- @[email protected] To: [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.]. Published: 2025-02-02T05:57:26Z. Accessed: 2025-02-03T00:44Z. https://sh.itjust.works/post/32085936/16442382.
- They pointed to code on GitHub for the Lemmy server which outlines the length of the username data in the SQL database.
- “[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. Accessed: 2025-02-03T00:46Z. https://sh.itjust.works/post/32085936.
- §“Original Post”. ¶2.
[…] I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50 […]
- The maximum username length for sh.itjust.works was found to be 50 characters by brute-force testing the length limit.
- §“Original Post”. ¶2.
- “Andrew” @[email protected] To [“[SOLVED] What is the maximum username length for a Lemmy account?”. “Kalcifer” @[email protected]. “Lemmy Support” [email protected]. sh.itjust.works. Lemmy. Published: 2025-02-03T00:54:51Z. https://sh.itjust.works/post/32085936.] Published: 2025-02-02T19:57:49Z. Accessed: 2025-02-03T00:59Z. https://sh.itjust.works/post/32085936/16453656.
-
curl -L http://lemmy.world/api/v3/site | jq -r .site_view.local_site.actor_name_max_length
(26)- The maximum username length for Lemmy.world was found to be 26 characters via an API request.
-
curl -L http://sh.itjust.works/api/v3/site | jq -r .site_view.local_site.actor_name_max_length
(50)- The maximum username length for sh.itjust.works was found to be 50 characters via an API request.
-
What exactly do you think is unscientific about it?
I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce, it only applies to one instance, it’s a test on someone else’s in-production system that you have no control over, and the error that returns isn’t necessarily from the backend. It looks more like a Form Validation error (i.e. from the frontend). It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.
I don’t dispute your concern; however, for my needs, in all practical purposes, if the frontend did place its own unique restrictions on the username length, it wouldn’t matter, as the uncertainty of the length of the username when creating an account through the frontend is why I created this post.
That being said, I think it’s worth distinguishing between the two (API and frontend) in the solution section of my post. I will update it.
This is obviously an argument of definitions, but, at any rate, I disagree that a qualification for something to be scientific is that it must be easily reproducible; for something to be scientific it simply simply must be reproducible [1[2[3]]].
References
Hm, I think what’s confusing things a bit in this conversation is that my original question is a bit of an XY problem — I asked about the maximum username length of a Lemmy account, yet I was, in reality, looking for the username length limits imposed by my instance (the answer for one instance may or may not apply to other instances). So that’s my fault for not being accurate/clear enough in my initial question.