superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.67k stars 311 forks source link

[bug] Could not create single letter account #1691

Closed saghul closed 1 year ago

saghul commented 1 year ago

Describe the bug with a clear and concise description of what the bug is.

After installing GtS for the first time I tried to create a user account with the single letter "s". It failed. Using a longer user account name like "saghul" worked though.

$ docker exec -it gotosocial /gotosocial/gotosocial admin account create --username 's' --email s@saghul.net --password '****'
timestamp="10/04/2023 10:05:24.738" func=bundb.sqliteConn level=INFO msg="connected to SQLITE database with address file:/gotosocial/storage/sqlite.db?_txlock=immediate"
timestamp="10/04/2023 10:05:24.740" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma journal_mode set to wal"
timestamp="10/04/2023 10:05:24.740" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma synchronous set to 1"
timestamp="10/04/2023 10:05:24.740" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma cache_size set to -8192"
timestamp="10/04/2023 10:05:24.740" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma busy_timeout set to 1800000"
timestamp="10/04/2023 10:05:24.742" func=bundb.doMigration level=INFO msg="there are no new migrations to run"
2023/04/10 10:05:24 error executing command: given username s was invalid: must contain only lowercase letters, numbers, and underscores, max 64 characters

$ docker exec -it gotosocial /gotosocial/gotosocial admin account create --username saghul --email s@saghul.net --password '****'
timestamp="10/04/2023 10:05:33.680" func=bundb.sqliteConn level=INFO msg="connected to SQLITE database with address file:/gotosocial/storage/sqlite.db?_txlock=immediate"
timestamp="10/04/2023 10:05:33.682" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma journal_mode set to wal"
timestamp="10/04/2023 10:05:33.682" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma synchronous set to 1"
timestamp="10/04/2023 10:05:33.682" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma cache_size set to -8192"
timestamp="10/04/2023 10:05:33.682" func=bundb.sqlitePragmas level=INFO msg="sqlite pragma busy_timeout set to 1800000"
timestamp="10/04/2023 10:05:33.683" func=bundb.doMigration level=INFO msg="there are no new migrations to run"
timestamp="10/04/2023 10:05:33.908" func=bundb.(*basicDB).Stop level=INFO msg="closing db connection"

What's your GoToSocial Version?

0.8.0 git-f28ed21

GoToSocial Arch

amd64 Docker

What happened?

The user account was NOT created.

What you expected to happen?

The account to be created.

How to reproduce it?

Just install GtS and try to create a single letter user account.

Anything else we need to know?

No response

paxcoder commented 1 year ago

why you wanted to make single letter account? it looks like spam.

saghul commented 1 year ago

Because it's my own instance, and I should get to set the rules.

I am using a single letter account on Pleroma / Rebased no problem.

My email address is s@ my GH handle and I'd like it to match.

If someone wants to consider that spam, so be it, I don't see why the software should prevent me from doing it.

discotag commented 1 year ago

I also want @i@servername account Please allow that