1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 17:26:43 +00:00
pixelfed/app/Util/Lexer/RestrictedNames.php

257 lines
3.8 KiB
PHP
Raw Normal View History

2018-04-29 16:27:15 +00:00
<?php
namespace App\Util\Lexer;
2018-08-28 03:07:36 +00:00
class RestrictedNames
{
public static $blacklist = [
'about',
'abuse',
'administrator',
'app',
'autoconfig',
'blog',
'broadcasthost',
'contact',
'contact-us',
'contact_us',
'copyright',
'download',
'domainadmin',
'domainadministrator',
'email',
'errors',
'events',
'example',
'faq',
'faqs',
'features',
'ftp',
'guest',
'guests',
'hostmaster',
'hostmaster',
'imap',
'info',
'info',
'is',
'isatap',
'it',
'localdomain',
'localhost',
'mail',
'mailer-daemon',
'mailerdaemon',
'marketing',
'me',
'mis',
'mx',
'no-reply',
'nobody',
'noc',
'noreply',
'ns0',
'ns1',
'ns2',
'ns3',
'ns4',
'ns5',
'ns6',
'ns7',
'ns8',
'ns9',
'owner',
'pop',
'pop3',
'postmaster',
'pricing',
'root',
'sales',
'security',
'signin',
'signout',
'smtp',
'src',
'ssladmin',
'ssladministrator',
'sslwebmaster',
'sys',
'sysadmin',
'system',
'tutorial',
'tutorials',
'usenet',
'uucp',
'webmaster',
'wpad',
2018-04-29 16:27:15 +00:00
];
2018-08-28 03:07:36 +00:00
public static $reserved = [
2018-05-23 00:45:13 +00:00
// Reserved for instance admin
2018-08-28 03:07:36 +00:00
'admin',
2018-09-16 05:15:45 +00:00
'administrator',
2018-05-23 00:45:13 +00:00
// Static Assets
2018-08-28 03:07:36 +00:00
'assets',
'storage',
2018-05-23 00:45:13 +00:00
// Laravel Horizon
2018-08-28 03:07:36 +00:00
'horizon',
2018-05-23 00:45:13 +00:00
// Reserved routes
2019-05-02 04:54:29 +00:00
'a',
2018-08-28 03:07:36 +00:00
'account',
'api',
2019-05-02 04:54:29 +00:00
'audio',
2018-08-28 03:07:36 +00:00
'auth',
2019-05-02 04:54:29 +00:00
'b',
2019-01-22 02:59:25 +00:00
'bartender',
2018-12-29 03:39:16 +00:00
'broadcast',
'broadcaster',
2019-01-22 02:59:25 +00:00
'booth',
'bouncer',
'c',
2018-08-28 03:07:36 +00:00
'css',
2019-05-02 04:54:29 +00:00
'circle',
'circles',
2018-09-16 05:15:45 +00:00
'checkpoint',
2019-05-02 04:54:29 +00:00
'community',
'communities',
2018-12-29 03:39:16 +00:00
'collection',
'collections',
2019-01-22 02:59:25 +00:00
'costar',
'costars',
2018-12-29 03:39:16 +00:00
'cdn',
2019-01-22 02:59:25 +00:00
'd',
2018-08-28 03:07:36 +00:00
'dashboard',
'deck',
2019-01-22 02:59:25 +00:00
'dev',
'developer',
'developers',
2018-08-28 03:07:36 +00:00
'discover',
2019-01-22 02:59:25 +00:00
'discovers',
'dj',
'doc',
2018-08-28 03:07:36 +00:00
'docs',
2019-01-22 02:59:25 +00:00
'docs',
'drive',
'driver',
2018-12-29 03:39:16 +00:00
'error',
'explore',
2019-05-02 04:54:29 +00:00
'feed',
2019-01-22 02:59:25 +00:00
'font',
2018-08-28 03:07:36 +00:00
'fonts',
2019-05-02 04:54:29 +00:00
'g',
2019-01-22 02:59:25 +00:00
'gdpr',
2019-05-02 04:54:29 +00:00
'group',
'groups',
2018-08-28 03:07:36 +00:00
'home',
2018-12-29 03:39:16 +00:00
'help',
'helpcenter',
2019-01-22 02:59:25 +00:00
'help-center',
'help_center',
'help_center_',
'help-center-',
'help-center_',
'help_center-',
2018-12-29 03:39:16 +00:00
'i',
2018-08-28 03:07:36 +00:00
'img',
2019-01-22 02:59:25 +00:00
'imgs',
'image',
'images',
2019-02-15 03:50:14 +00:00
'invite',
'invites',
2018-08-28 03:07:36 +00:00
'js',
2019-02-15 03:50:14 +00:00
'lab',
'labs',
2019-01-22 02:59:25 +00:00
'legal',
2018-12-29 03:39:16 +00:00
'live',
2018-08-28 03:07:36 +00:00
'login',
'logout',
2019-05-02 04:54:29 +00:00
'm',
2018-08-28 03:07:36 +00:00
'media',
2019-01-22 02:59:25 +00:00
'menu',
2019-05-02 04:54:29 +00:00
'music',
'n',
'news',
'new',
'news',
'news',
'newsfeed',
2019-01-31 21:00:39 +00:00
'oauth',
2018-12-29 03:39:16 +00:00
'official',
2018-08-28 03:07:36 +00:00
'p',
2019-01-31 21:00:39 +00:00
'page',
'pages',
2019-01-22 02:59:25 +00:00
'photo',
'photos',
2018-08-28 03:07:36 +00:00
'password',
2019-01-22 02:59:25 +00:00
'privacy',
2018-12-29 03:39:16 +00:00
'reset',
2018-08-28 03:07:36 +00:00
'report',
2019-02-22 19:31:09 +00:00
'results',
2018-08-28 03:07:36 +00:00
'reports',
2018-12-29 03:39:16 +00:00
'robot',
'robots',
2018-08-28 03:07:36 +00:00
'search',
2018-12-29 03:39:16 +00:00
'send',
2018-08-28 03:07:36 +00:00
'settings',
2018-12-29 03:39:16 +00:00
'status',
2018-08-28 03:07:36 +00:00
'statuses',
'site',
'sites',
2019-01-22 02:59:25 +00:00
'stage',
2018-12-29 03:39:16 +00:00
'static',
'story',
'stories',
'support',
2019-01-22 02:59:25 +00:00
'svg',
'svgs',
'terms',
2018-12-29 03:39:16 +00:00
'telescope',
2018-08-28 03:07:36 +00:00
'timeline',
'timelines',
'tour',
'user',
'users',
2019-01-04 06:07:54 +00:00
'username',
'usernames',
2019-05-02 04:54:29 +00:00
'v',
'video',
'videos',
2018-08-28 03:07:36 +00:00
'vendor',
2019-01-22 02:59:25 +00:00
'waiter',
2019-05-02 04:54:29 +00:00
'wall',
'whats-new',
'whatsnew',
'whatnew',
'whats-news'
2018-12-29 03:39:16 +00:00
'ws',
'wss',
'www',
2019-01-22 02:59:25 +00:00
'valet',
2018-08-28 03:07:36 +00:00
'400',
'401',
'403',
'404',
'500',
'503',
'504',
2018-05-23 00:45:13 +00:00
];
2018-08-28 03:07:36 +00:00
public static function get()
{
$reserved = $blacklist = [];
2018-05-23 00:45:13 +00:00
2018-08-28 03:07:36 +00:00
if (true == config('pixelfed.restricted_names.use_blacklist')) {
$blacklist = self::$blacklist;
}
2018-05-23 00:45:13 +00:00
2018-08-28 03:07:36 +00:00
if (true == config('pixelfed.restricted_names.reserved_routes')) {
$reserved = self::$reserved;
}
2018-04-29 16:27:15 +00:00
2018-08-28 03:07:36 +00:00
return array_merge($blacklist, $reserved);
}
}