Organization name cannot end with dash (-) symbol #14924

Open
opened 2025-11-02 11:25:56 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @canfoderiskii on GitHub (Sep 5, 2025).

Description

I'm trying to mirror some repositories from Github. I want to create a new org with same name to represent the original owner name without creating any new user which may conflict with the locally registered user in Gitea instance.

When I was trying to mirror https://github.com/kuba--/zip, I encountered this issue:
when trying to create a new organization with a name ends with dash symbol, system pops up an error.

Image

The same org cannot be created via HTTP API as well, the Curl response shows:

{"message":"[UserName]: invalid username","url":"http://git-mirror.lab.com/api/swagger"}

Is there any chance that to loosen or delete the It cannot begin or end with non-alphanumeric chars limit?

Gitea Version

1.24.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 22.04

How are you running Gitea?

Official Docker Image with recommended docker-compose configuration.

Database

SQLite

Originally created by @canfoderiskii on GitHub (Sep 5, 2025). ### Description I'm trying to mirror some repositories from Github. I want to create a new org with same name to represent the original owner name without creating any new user which may conflict with the locally registered user in Gitea instance. When I was trying to mirror <https://github.com/kuba--/zip>, I encountered this issue: when trying to create a new organization with a name ends with dash symbol, system pops up an error. <img width="807" height="403" alt="Image" src="https://github.com/user-attachments/assets/02960b03-989e-49bd-855f-dbbb85a78298" /> The same org cannot be created via HTTP API as well, the Curl response shows: ```text {"message":"[UserName]: invalid username","url":"http://git-mirror.lab.com/api/swagger"} ``` Is there any chance that to loosen or delete the `It cannot begin or end with non-alphanumeric chars` limit? ### Gitea Version 1.24.5 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Ubuntu 22.04 ### How are you running Gitea? Official Docker Image with recommended docker-compose configuration. ### Database SQLite
GiteaMirror added the type/proposal label 2025-11-02 11:25:56 -06:00
Author
Owner

@silverwind commented on GitHub (Sep 5, 2025):

Also see https://github.com/go-gitea/gitea/issues/4150 on some research on what is allowed for user/org/repo names. More testing is needed, and then we should update these validations to match GitHub.

@silverwind commented on GitHub (Sep 5, 2025): Also see https://github.com/go-gitea/gitea/issues/4150 on some research on what is allowed for user/org/repo names. More testing is needed, and then we should update these validations to match GitHub.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14924