@@ -565,41 +565,43 @@ var (
565
565
"." ,
566
566
".." ,
567
567
".well-known" ,
568
- "api" ,
569
- "assets" ,
570
- "attachments" ,
571
- "avatar" ,
572
- "avatars" ,
568
+
569
+ "api" , // gitea api
570
+ "metrics" , // prometheus metrics api
571
+ "v2" , // container registry api
572
+
573
+ "assets" , // static asset files
574
+ "attachments" , // issue attachments
575
+
576
+ "avatar" , // avatar by email hash
577
+ "avatars" , // user avatars by file name
578
+ "repo-avatars" ,
579
+
573
580
"captcha" ,
574
- "commits" ,
575
- "debug" ,
576
- "error" ,
581
+ "login" , // oauth2 login
582
+ "org" , // org create/manage, or "/org/{org}", BUT if an org is named as "invite" then it goes wrong
583
+ "repo" , // repo create/migrate, etc
584
+ "user" , // user login/activate/settings, etc
585
+
577
586
"explore" ,
578
- "favicon.ico" ,
579
- "ghost" ,
580
587
"issues" ,
581
- "login" ,
582
- "manifest.json" ,
583
- "metrics" ,
588
+ "pulls" ,
584
589
"milestones" ,
585
- "new" ,
586
590
"notifications" ,
587
- "org" ,
588
- "pulls" ,
589
- "raw" ,
590
- "repo" ,
591
- "repo-avatars" ,
592
- "robots.txt" ,
593
- "search" ,
594
- "serviceworker.js" ,
595
- "ssh_info" ,
591
+
592
+ "favicon.ico" ,
593
+ "manifest.json" , // web app manifests
594
+ "robots.txt" , // search engine robots
595
+ "sitemap.xml" , // search engine sitemap
596
+ "ssh_info" , // agit info
596
597
"swagger.v1.json" ,
597
- "user" ,
598
- "v2" ,
599
- "gitea-actions" ,
598
+
599
+ "ghost" , // reserved name for deleted users (id: -1)
600
+ "gitea-actions" , // gitea builtin user (id: -2)
600
601
}
601
602
602
- // DON'T ADD ANY NEW STUFF, WE SOLVE THIS WITH `/user/{obj}` PATHS!
603
+ // These names are reserved for user accounts: user's keys, user's rss feed, user's avatar, etc.
604
+ // DO NOT add any new stuff! The paths with these names are processed by `/{username}` handler (UsernameSubRoute) manually.
603
605
reservedUserPatterns = []string {"*.keys" , "*.gpg" , "*.rss" , "*.atom" , "*.png" }
604
606
)
605
607
0 commit comments