RestrictedNames.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. // Static Assets
  83. 'assets',
  84. 'public',
  85. 'storage',
  86. 'htaccess',
  87. '.htaccess',
  88. 'favicon.ico',
  89. 'embed.js',
  90. 'index.php',
  91. 'manifest.json',
  92. 'mix-manifest.json',
  93. 'robots.txt',
  94. // Laravel Horizon
  95. 'horizon',
  96. // Reserved routes
  97. 'a',
  98. 'app',
  99. 'about',
  100. 'aboutus',
  101. 'about-us',
  102. 'abuse',
  103. 'actor',
  104. 'actors',
  105. 'account',
  106. 'admins',
  107. 'api',
  108. 'audio',
  109. 'auth',
  110. 'avatar',
  111. 'avatars',
  112. 'b',
  113. 'bartender',
  114. 'broadcast',
  115. 'broadcaster',
  116. 'booth',
  117. 'bouncer',
  118. 'c',
  119. 'cdn',
  120. 'circle',
  121. 'circles',
  122. 'checkpoint',
  123. 'collection',
  124. 'collections',
  125. 'community',
  126. 'communities',
  127. 'contact',
  128. 'contact-us',
  129. 'contact_us',
  130. 'costar',
  131. 'costars',
  132. 'css',
  133. 'd',
  134. 'dashboard',
  135. 'dmca',
  136. 'db',
  137. 'deck',
  138. 'dev',
  139. 'developer',
  140. 'developers',
  141. 'discover',
  142. 'discovers',
  143. 'dj',
  144. 'doc',
  145. 'docs',
  146. 'docs',
  147. 'drive',
  148. 'drives',
  149. 'driver',
  150. 'e',
  151. 'embed',
  152. 'email',
  153. 'emails',
  154. 'error',
  155. 'explore',
  156. 'export',
  157. 'exports',
  158. 'f',
  159. 'feed',
  160. 'font',
  161. 'fonts',
  162. 'follow',
  163. 'follows',
  164. 'followme',
  165. 'follow-me',
  166. 'follow_me',
  167. 'g',
  168. 'gdpr',
  169. 'graph',
  170. 'ghost',
  171. 'ghosts',
  172. 'group',
  173. 'groups',
  174. 'h',
  175. 'home',
  176. 'help',
  177. 'helpcenter',
  178. 'help-center',
  179. 'help_center',
  180. 'help_center_',
  181. 'help-center-',
  182. 'help-center_',
  183. 'help_center-',
  184. 'i',
  185. 'instance',
  186. 'inbox',
  187. 'img',
  188. 'imgs',
  189. 'image',
  190. 'images',
  191. 'invite',
  192. 'invites',
  193. 'import',
  194. 'imports',
  195. 'j',
  196. 'js',
  197. 'k',
  198. 'key',
  199. 'l',
  200. 'lab',
  201. 'labs',
  202. 'legal',
  203. 'live',
  204. 'loop',
  205. 'loops',
  206. 'location',
  207. 'locations',
  208. 'login',
  209. 'logout',
  210. 'm',
  211. 'media',
  212. 'menu',
  213. 'music',
  214. 'my2020',
  215. 'my2021',
  216. 'my2022',
  217. 'my2023',
  218. 'my2024',
  219. 'my2025',
  220. 'my2026',
  221. 'my2027',
  222. 'my2028',
  223. 'my2029',
  224. 'my2030',
  225. 'n',
  226. 'news',
  227. 'new',
  228. 'news',
  229. 'news',
  230. 'newsfeed',
  231. 'newsroom',
  232. 'newsrooms',
  233. 'news-room',
  234. 'news-rooms',
  235. 'o',
  236. 'oauth',
  237. 'official',
  238. 'p',
  239. 'page',
  240. 'pages',
  241. 'pin',
  242. 'pins',
  243. 'photo',
  244. 'photos',
  245. 'password',
  246. 'privacy',
  247. 'private',
  248. 'q',
  249. 'quote',
  250. 'query',
  251. 'r',
  252. 'register',
  253. 'registers',
  254. 'review',
  255. 'reset',
  256. 'report',
  257. 'results',
  258. 'reports',
  259. 'robot',
  260. 'robots',
  261. 's',
  262. 'sc',
  263. 'search',
  264. 'sell',
  265. 'send',
  266. 'settings',
  267. 'short',
  268. 'shortcode',
  269. 'status',
  270. 'statuses',
  271. 'site',
  272. 'sites',
  273. 'stage',
  274. 'static',
  275. 'story',
  276. 'stories',
  277. 'support',
  278. 'svg',
  279. 'svgs',
  280. 't',
  281. 'terms',
  282. 'telescope',
  283. 'timeline',
  284. 'timelines',
  285. 'tour',
  286. 'tv',
  287. 'u',
  288. 'user',
  289. 'users',
  290. 'username',
  291. 'usernames',
  292. 'v',
  293. 'valet',
  294. 'video',
  295. 'videos',
  296. 'vendor',
  297. 'w',
  298. 'waiter',
  299. 'wall',
  300. 'whats-new',
  301. 'whatsnew',
  302. 'whatnew',
  303. 'whats-news',
  304. 'web',
  305. 'ws',
  306. 'wss',
  307. 'www',
  308. 'x',
  309. 'y',
  310. 'z',
  311. '400',
  312. '401',
  313. '403',
  314. '404',
  315. '500',
  316. '503',
  317. '504',
  318. ];
  319. public static function get()
  320. {
  321. $banned = [];
  322. if(config('instance.username.banned')) {
  323. $banned = array_map('trim', explode(',', config('instance.username.banned')));
  324. }
  325. $additional = self::$additional;
  326. $reserved = self::$reserved;
  327. $res = array_merge($additional, $reserved, $banned);
  328. $res = array_unique($res);
  329. sort($res);
  330. return $res;
  331. }
  332. }