diff --git a/models/user/user.go b/models/user/user.go index c1e3d5d1c76c8..6e104f62b1369 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -565,37 +565,38 @@ var ( ".", "..", ".well-known", - "api", - "assets", - "attachments", - "avatar", - "avatars", + + "api", // gitea api + "metrics", // prometheus metrics api + "v2", // container registry api + + "assets", // static asset files + "attachments", // issue attachments + + "avatar", // avatar by email hash + "avatars", // user avatars by file name + "repo-avatars", + "captcha", - "commits", - "debug", - "error", + "login", // oauth2 login + "org", // org create/manage, or "/org/{org}", BUT if an org is named as "invite" then it goes wrong + "user", // user login/activate/settings, etc + "repo", // repo create/migrate, etc + "explore", - "favicon.ico", - "ghost", "issues", - "login", - "manifest.json", - "metrics", + "pulls", "milestones", - "new", "notifications", - "org", - "pulls", - "raw", - "repo", - "repo-avatars", - "robots.txt", - "search", - "serviceworker.js", - "ssh_info", + + "favicon.ico", + "manifest.json", // web app manifests + "robots.txt", // search engine robots + "sitemap.xml", // search engine sitemap + "ssh_info", // agit info "swagger.v1.json", - "user", - "v2", + + "ghost", // reserved name for deleted users "gitea-actions", } diff --git a/tests/integration/user_test.go b/tests/integration/user_test.go index 2ba16b3d36283..617d776d5bc22 100644 --- a/tests/integration/user_test.go +++ b/tests/integration/user_test.go @@ -98,36 +98,7 @@ func TestRenameReservedUsername(t *testing.T) { reservedUsernames := []string{ // ".", "..", ".well-known", // The names are not only reserved but also invalid "api", - "assets", - "attachments", - "avatar", - "avatars", - "captcha", - "commits", - "debug", - "error", - "explore", - "favicon.ico", - "ghost", - "issues", - "login", - "manifest.json", - "metrics", - "milestones", - "new", - "notifications", - "org", - "pulls", - "raw", - "repo", - "repo-avatars", - "robots.txt", - "search", - "serviceworker.js", - "ssh_info", - "swagger.v1.json", - "user", - "v2", + "name.keys", } session := loginUser(t, "user2")