mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Update reserved usernames list (#18438)
Adding additional usernames which are already routes, remove unused ones. In future, avoid reserving names as much as possible, use `/-/` in path instead.
This commit is contained in:
		@@ -75,23 +75,41 @@ func TestRenameReservedUsername(t *testing.T) {
 | 
				
			|||||||
	defer prepareTestEnv(t)()
 | 
						defer prepareTestEnv(t)()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	reservedUsernames := []string{
 | 
						reservedUsernames := []string{
 | 
				
			||||||
 | 
							".",
 | 
				
			||||||
 | 
							"..",
 | 
				
			||||||
 | 
							".well-known",
 | 
				
			||||||
		"admin",
 | 
							"admin",
 | 
				
			||||||
		"api",
 | 
							"api",
 | 
				
			||||||
 | 
							"assets",
 | 
				
			||||||
		"attachments",
 | 
							"attachments",
 | 
				
			||||||
 | 
							"avatar",
 | 
				
			||||||
		"avatars",
 | 
							"avatars",
 | 
				
			||||||
 | 
							"captcha",
 | 
				
			||||||
 | 
							"commits",
 | 
				
			||||||
 | 
							"debug",
 | 
				
			||||||
 | 
							"error",
 | 
				
			||||||
		"explore",
 | 
							"explore",
 | 
				
			||||||
		"help",
 | 
							"favicon.ico",
 | 
				
			||||||
		"install",
 | 
							"ghost",
 | 
				
			||||||
		"issues",
 | 
							"issues",
 | 
				
			||||||
		"login",
 | 
							"login",
 | 
				
			||||||
 | 
							"manifest.json",
 | 
				
			||||||
		"metrics",
 | 
							"metrics",
 | 
				
			||||||
 | 
							"milestones",
 | 
				
			||||||
 | 
							"new",
 | 
				
			||||||
		"notifications",
 | 
							"notifications",
 | 
				
			||||||
		"org",
 | 
							"org",
 | 
				
			||||||
		"pulls",
 | 
							"pulls",
 | 
				
			||||||
 | 
							"raw",
 | 
				
			||||||
		"repo",
 | 
							"repo",
 | 
				
			||||||
		"template",
 | 
							"repo-avatars",
 | 
				
			||||||
		"user",
 | 
							"robots.txt",
 | 
				
			||||||
		"search",
 | 
							"search",
 | 
				
			||||||
 | 
							"serviceworker.js",
 | 
				
			||||||
 | 
							"ssh_info",
 | 
				
			||||||
 | 
							"swagger.v1.json",
 | 
				
			||||||
 | 
							"user",
 | 
				
			||||||
 | 
							"v2",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	session := loginUser(t, "user2")
 | 
						session := loginUser(t, "user2")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -576,6 +576,7 @@ var (
 | 
				
			|||||||
		"api",
 | 
							"api",
 | 
				
			||||||
		"assets",
 | 
							"assets",
 | 
				
			||||||
		"attachments",
 | 
							"attachments",
 | 
				
			||||||
 | 
							"avatar",
 | 
				
			||||||
		"avatars",
 | 
							"avatars",
 | 
				
			||||||
		"captcha",
 | 
							"captcha",
 | 
				
			||||||
		"commits",
 | 
							"commits",
 | 
				
			||||||
@@ -584,10 +585,7 @@ var (
 | 
				
			|||||||
		"explore",
 | 
							"explore",
 | 
				
			||||||
		"favicon.ico",
 | 
							"favicon.ico",
 | 
				
			||||||
		"ghost",
 | 
							"ghost",
 | 
				
			||||||
		"help",
 | 
					 | 
				
			||||||
		"install",
 | 
					 | 
				
			||||||
		"issues",
 | 
							"issues",
 | 
				
			||||||
		"less",
 | 
					 | 
				
			||||||
		"login",
 | 
							"login",
 | 
				
			||||||
		"manifest.json",
 | 
							"manifest.json",
 | 
				
			||||||
		"metrics",
 | 
							"metrics",
 | 
				
			||||||
@@ -595,15 +593,15 @@ var (
 | 
				
			|||||||
		"new",
 | 
							"new",
 | 
				
			||||||
		"notifications",
 | 
							"notifications",
 | 
				
			||||||
		"org",
 | 
							"org",
 | 
				
			||||||
		"plugins",
 | 
					 | 
				
			||||||
		"pulls",
 | 
							"pulls",
 | 
				
			||||||
		"raw",
 | 
							"raw",
 | 
				
			||||||
		"repo",
 | 
							"repo",
 | 
				
			||||||
 | 
							"repo-avatars",
 | 
				
			||||||
		"robots.txt",
 | 
							"robots.txt",
 | 
				
			||||||
		"search",
 | 
							"search",
 | 
				
			||||||
		"serviceworker.js",
 | 
							"serviceworker.js",
 | 
				
			||||||
		"stars",
 | 
							"ssh_info",
 | 
				
			||||||
		"template",
 | 
							"swagger.v1.json",
 | 
				
			||||||
		"user",
 | 
							"user",
 | 
				
			||||||
		"v2",
 | 
							"v2",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user