RestrictedNames.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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. 'browse',
  119. 'c',
  120. 'cdn',
  121. 'circle',
  122. 'circles',
  123. 'checkpoint',
  124. 'collection',
  125. 'collections',
  126. 'community',
  127. 'communities',
  128. 'contact',
  129. 'contact-us',
  130. 'contact_us',
  131. 'costar',
  132. 'costars',
  133. 'css',
  134. 'd',
  135. 'dashboard',
  136. 'delete',
  137. 'deleted',
  138. 'deleting',
  139. 'dmca',
  140. 'db',
  141. 'deck',
  142. 'dev',
  143. 'developer',
  144. 'developers',
  145. 'discover',
  146. 'discovers',
  147. 'dj',
  148. 'doc',
  149. 'docs',
  150. 'docs',
  151. 'drive',
  152. 'drives',
  153. 'driver',
  154. 'e',
  155. 'embed',
  156. 'email',
  157. 'emails',
  158. 'emoji',
  159. 'emojis',
  160. 'error',
  161. 'explore',
  162. 'export',
  163. 'exports',
  164. 'external',
  165. 'f',
  166. 'fedi',
  167. 'fediverse',
  168. 'feed',
  169. 'featured',
  170. 'font',
  171. 'fonts',
  172. 'follow',
  173. 'follows',
  174. 'followme',
  175. 'follow-me',
  176. 'follow_me',
  177. 'g',
  178. 'go',
  179. 'gdpr',
  180. 'graph',
  181. 'ghost',
  182. 'ghosts',
  183. 'global',
  184. 'group',
  185. 'groups',
  186. 'h',
  187. 'header',
  188. 'headers',
  189. 'home',
  190. 'help',
  191. 'helpcenter',
  192. 'help-center',
  193. 'help_center',
  194. 'help_center_',
  195. 'help-center-',
  196. 'help-center_',
  197. 'help_center-',
  198. 'i',
  199. 'instance',
  200. 'inbox',
  201. 'img',
  202. 'imgs',
  203. 'image',
  204. 'images',
  205. 'invite',
  206. 'invites',
  207. 'import',
  208. 'imports',
  209. 'j',
  210. 'join',
  211. 'js',
  212. 'k',
  213. 'key',
  214. 'l',
  215. 'lang',
  216. 'language',
  217. '_lang',
  218. '_language',
  219. 'lab',
  220. 'labs',
  221. 'legal',
  222. 'link',
  223. 'live',
  224. 'look',
  225. 'look-back',
  226. 'loop',
  227. 'loops',
  228. 'location',
  229. 'locations',
  230. 'login',
  231. 'logout',
  232. 'm',
  233. 'media',
  234. 'mini',
  235. 'micro',
  236. 'menu',
  237. 'music',
  238. 'my2020',
  239. 'my2021',
  240. 'my2022',
  241. 'my2023',
  242. 'my2024',
  243. 'my2025',
  244. 'my2026',
  245. 'my2027',
  246. 'my2028',
  247. 'my2029',
  248. 'my2030',
  249. 'my',
  250. 'n',
  251. 'news',
  252. 'new',
  253. 'news',
  254. 'news',
  255. 'newsfeed',
  256. 'newsroom',
  257. 'newsrooms',
  258. 'news-room',
  259. 'news-rooms',
  260. 'network',
  261. 'networks',
  262. 'o',
  263. 'oauth',
  264. 'official',
  265. 'p',
  266. 'page',
  267. 'pages',
  268. 'pin',
  269. 'pins',
  270. 'photo',
  271. 'photos',
  272. 'password',
  273. 'portfolio',
  274. 'portfolios',
  275. 'pre',
  276. 'post',
  277. 'privacy',
  278. 'private',
  279. 'q',
  280. 'quote',
  281. 'query',
  282. 'r',
  283. 'redirect',
  284. 'redirects',
  285. 'register',
  286. 'registers',
  287. 'review',
  288. 'reviews',
  289. 'reset',
  290. 'report',
  291. 'results',
  292. 'reports',
  293. 'robot',
  294. 'robots',
  295. 's',
  296. 'sc',
  297. 'search',
  298. 'sell',
  299. 'send',
  300. 'settings',
  301. 'short',
  302. 'shortcode',
  303. 'status',
  304. 'statuses',
  305. 'site',
  306. 'sites',
  307. 'stage',
  308. 'static',
  309. 'story',
  310. 'stories',
  311. 'support',
  312. 'svg',
  313. 'svgs',
  314. 't',
  315. 'terms',
  316. 'telescope',
  317. 'timeline',
  318. 'timelines',
  319. 'tour',
  320. 'tv',
  321. 'u',
  322. 'user',
  323. 'users',
  324. 'username',
  325. 'usernames',
  326. 'v',
  327. 'valet',
  328. 'video',
  329. 'videos',
  330. 'vendor',
  331. 'w',
  332. 'waiter',
  333. 'wall',
  334. 'whats-new',
  335. 'whatsnew',
  336. 'whatnew',
  337. 'whats-news',
  338. 'web',
  339. 'ws',
  340. 'wss',
  341. 'www',
  342. 'x',
  343. 'y',
  344. 'year',
  345. 'year-in-review',
  346. 'z',
  347. '400',
  348. '401',
  349. '403',
  350. '404',
  351. '500',
  352. '503',
  353. '504',
  354. ];
  355. public static function get()
  356. {
  357. $banned = [];
  358. if(config('instance.username.banned')) {
  359. $banned = array_map('trim', explode(',', config('instance.username.banned')));
  360. }
  361. $additional = self::$additional;
  362. $reserved = self::$reserved;
  363. $res = array_merge($additional, $reserved, $banned);
  364. $res = array_unique($res);
  365. sort($res);
  366. return $res;
  367. }
  368. }