RestrictedNames.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <?php
  2. namespace App\Util\Lexer;
  3. class RestrictedNames
  4. {
  5. public static $additional = [
  6. 'autoconfig',
  7. 'blog',
  8. 'broadcasthost',
  9. 'copyright',
  10. 'download',
  11. 'domainadmin',
  12. 'domainadministrator',
  13. 'errors',
  14. 'events',
  15. 'example',
  16. 'faq',
  17. 'faqs',
  18. 'features',
  19. 'ftp',
  20. 'guest',
  21. 'guests',
  22. 'hostmaster',
  23. 'hostmaster',
  24. 'imap',
  25. 'info',
  26. 'information',
  27. 'is',
  28. 'isatap',
  29. 'it',
  30. 'localdomain',
  31. 'localhost',
  32. 'mail',
  33. 'mailer-daemon',
  34. 'mailerdaemon',
  35. 'marketing',
  36. 'me',
  37. 'mis',
  38. 'mx',
  39. 'no-reply',
  40. 'nobody',
  41. 'noc',
  42. 'noreply',
  43. 'ns0',
  44. 'ns1',
  45. 'ns2',
  46. 'ns3',
  47. 'ns4',
  48. 'ns5',
  49. 'ns6',
  50. 'ns7',
  51. 'ns8',
  52. 'ns9',
  53. 'owner',
  54. 'pop',
  55. 'pop3',
  56. 'postmaster',
  57. 'pricing',
  58. 'root',
  59. 'sales',
  60. 'security',
  61. 'signin',
  62. 'signout',
  63. 'smtp',
  64. 'src',
  65. 'ssladmin',
  66. 'ssladministrator',
  67. 'sslwebmaster',
  68. 'sys',
  69. 'sysadmin',
  70. 'system',
  71. 'tutorial',
  72. 'tutorials',
  73. 'usenet',
  74. 'uucp',
  75. 'webmaster',
  76. 'wpad',
  77. ];
  78. public static $reserved = [
  79. // Reserved for instance admin
  80. 'admin',
  81. 'administrator',
  82. // Federation
  83. 'authorize_interaction',
  84. // Static Assets
  85. 'assets',
  86. 'public',
  87. 'storage',
  88. 'htaccess',
  89. '.htaccess',
  90. 'favicon.ico',
  91. 'embed.js',
  92. 'index.php',
  93. 'manifest.json',
  94. 'mix-manifest.json',
  95. 'robots.txt',
  96. // Laravel Horizon
  97. 'horizon',
  98. // Reserved routes
  99. 'a',
  100. 'app',
  101. 'about',
  102. 'aboutus',
  103. 'about-us',
  104. 'abuse',
  105. 'actor',
  106. 'actors',
  107. 'account',
  108. 'admins',
  109. 'api',
  110. 'audio',
  111. 'auth',
  112. 'avatar',
  113. 'avatars',
  114. 'b',
  115. 'bartender',
  116. 'broadcast',
  117. 'broadcaster',
  118. 'booth',
  119. 'bouncer',
  120. 'browse',
  121. 'c',
  122. 'cdn',
  123. 'circle',
  124. 'circles',
  125. 'checkpoint',
  126. 'collection',
  127. 'collections',
  128. 'community',
  129. 'communities',
  130. 'contact',
  131. 'contact-us',
  132. 'contact_us',
  133. 'costar',
  134. 'costars',
  135. 'css',
  136. 'd',
  137. 'dashboard',
  138. 'delete',
  139. 'deleted',
  140. 'deleting',
  141. 'dmca',
  142. 'db',
  143. 'deck',
  144. 'dev',
  145. 'developer',
  146. 'developers',
  147. 'discover',
  148. 'discovers',
  149. 'dj',
  150. 'doc',
  151. 'docs',
  152. 'docs',
  153. 'drive',
  154. 'drives',
  155. 'driver',
  156. 'e',
  157. 'embed',
  158. 'email',
  159. 'emails',
  160. 'emoji',
  161. 'emojis',
  162. 'error',
  163. 'explore',
  164. 'export',
  165. 'exports',
  166. 'external',
  167. 'f',
  168. 'fedi',
  169. 'fediverse',
  170. 'feed',
  171. 'featured',
  172. 'font',
  173. 'fonts',
  174. 'follow',
  175. 'follows',
  176. 'followme',
  177. 'follow-me',
  178. 'follow_me',
  179. 'g',
  180. 'go',
  181. 'gdpr',
  182. 'graph',
  183. 'ghost',
  184. 'ghosts',
  185. 'global',
  186. 'group',
  187. 'groups',
  188. 'h',
  189. 'header',
  190. 'headers',
  191. 'home',
  192. 'help',
  193. 'help.center',
  194. 'helpcenter',
  195. 'help-center',
  196. 'help_center',
  197. 'help_center_',
  198. 'help-center-',
  199. 'help-center_',
  200. 'help_center-',
  201. 'i',
  202. 'instance',
  203. 'inbox',
  204. 'img',
  205. 'imgs',
  206. 'image',
  207. 'images',
  208. 'invite',
  209. 'invites',
  210. 'import',
  211. 'imports',
  212. 'intent',
  213. 'j',
  214. 'join',
  215. 'js',
  216. 'k',
  217. 'key',
  218. 'l',
  219. 'lang',
  220. 'language',
  221. '_lang',
  222. '_language',
  223. 'lab',
  224. 'labs',
  225. 'legal',
  226. 'link',
  227. 'live',
  228. 'look',
  229. 'look-back',
  230. 'loop',
  231. 'loops',
  232. 'location',
  233. 'locations',
  234. 'login',
  235. 'logout',
  236. 'm',
  237. 'media',
  238. 'mini',
  239. 'micro',
  240. 'menu',
  241. 'music',
  242. 'my2020',
  243. 'my2021',
  244. 'my2022',
  245. 'my2023',
  246. 'my2024',
  247. 'my2025',
  248. 'my2026',
  249. 'my2027',
  250. 'my2028',
  251. 'my2029',
  252. 'my2030',
  253. 'my',
  254. 'n',
  255. 'news',
  256. 'new',
  257. 'news',
  258. 'news',
  259. 'newsfeed',
  260. 'newsroom',
  261. 'newsrooms',
  262. 'news-room',
  263. 'news-rooms',
  264. 'network',
  265. 'networks',
  266. 'o',
  267. 'oauth',
  268. 'official',
  269. 'p',
  270. 'page',
  271. 'pages',
  272. 'pin',
  273. 'pins',
  274. 'photo',
  275. 'photos',
  276. 'password',
  277. 'portfolio',
  278. 'portfolios',
  279. 'pre',
  280. 'post',
  281. 'privacy',
  282. 'private',
  283. 'q',
  284. 'quote',
  285. 'query',
  286. 'r',
  287. 'redirect',
  288. 'redirects',
  289. 'register',
  290. 'registers',
  291. 'review',
  292. 'reviews',
  293. 'reset',
  294. 'report',
  295. 'results',
  296. 'reports',
  297. 'robot',
  298. 'robots',
  299. 's',
  300. 'sc',
  301. 'search',
  302. 'sell',
  303. 'send',
  304. 'settings',
  305. 'short',
  306. 'shortcode',
  307. 'status',
  308. 'statuses',
  309. 'site',
  310. 'sites',
  311. 'stage',
  312. 'static',
  313. 'story',
  314. 'stories',
  315. 'support',
  316. 'svg',
  317. 'svgs',
  318. 't',
  319. 'terms',
  320. 'telescope',
  321. 'timeline',
  322. 'timelines',
  323. 'tour',
  324. 'tv',
  325. 'u',
  326. 'user',
  327. 'users',
  328. 'username',
  329. 'usernames',
  330. 'v',
  331. 'valet',
  332. 'video',
  333. 'videos',
  334. 'vendor',
  335. 'w',
  336. 'waiter',
  337. 'wall',
  338. 'whats-new',
  339. 'whatsnew',
  340. 'whatnew',
  341. 'whats-news',
  342. 'web',
  343. 'ws',
  344. 'wss',
  345. 'www',
  346. 'x',
  347. 'y',
  348. 'year',
  349. 'year-in-review',
  350. 'z',
  351. '400',
  352. '401',
  353. '403',
  354. '404',
  355. '500',
  356. '503',
  357. '504',
  358. ];
  359. public static function get()
  360. {
  361. $banned = [];
  362. if (config('instance.username.banned')) {
  363. $banned = array_map('trim', explode(',', config('instance.username.banned')));
  364. }
  365. $additional = self::$additional;
  366. $reserved = self::$reserved;
  367. $res = array_merge($additional, $reserved, $banned);
  368. $res = array_unique($res);
  369. sort($res);
  370. return $res;
  371. }
  372. }