mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 08:57:55 +00:00
reserved username blacklist
This commit is contained in:
parent
cf6fae7d07
commit
a6975fcf52
1 changed files with 30 additions and 2 deletions
|
@ -29,8 +29,8 @@ if ($tld === "org") {
|
||||||
if (!$owner) {
|
if (!$owner) {
|
||||||
header("Location: https://codeberg.eu");
|
header("Location: https://codeberg.eu");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (strpos($owner, ".") === false) {
|
if (strpos($owner, ".") === false) {
|
||||||
$h = "Location: https://" . $owner . ".codeberg.eu/" . implode("/", $request_url_parts);
|
$h = "Location: https://" . $owner . ".codeberg.eu/" . implode("/", $request_url_parts);
|
||||||
if ($_SERVER['QUERY_STRING'] !== "")
|
if ($_SERVER['QUERY_STRING'] !== "")
|
||||||
$h .= "?" . $_SERVER['QUERY_STRING'];
|
$h .= "?" . $_SERVER['QUERY_STRING'];
|
||||||
|
@ -44,6 +44,34 @@ if ($tld === "org") {
|
||||||
send_response(200, "Pages not supported for user names with dots. Please rename your username to use Codeberg pages.");
|
send_response(200, "Pages not supported for user names with dots. Please rename your username to use Codeberg pages.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$reservedUsernames = array(
|
||||||
|
"abuse", "admin", "api", "app", "apt", "apps", "appserver", "archive", "archives", "assets", "attachments", "avatar", "avatars",
|
||||||
|
"bbs", "blog",
|
||||||
|
"cache", "cd", "cdn", "ci", "cloud", "cluster", "commits", "connect", "contact",
|
||||||
|
"dashboard", "debug", "deploy", "deployment", "dev", "dns", "dns0", "dns1", "dns2", "dns3", "dns4", "download",
|
||||||
|
"email", "error", "explore",
|
||||||
|
"forum", "ftp",
|
||||||
|
"ghost",
|
||||||
|
"help", "helpdesk", "host",
|
||||||
|
"i", "imap", "info", "install", "internal", "issues",
|
||||||
|
"less", "login",
|
||||||
|
"m", "mail", "mailserver", "manifest", "metrics", "milestones", "mx",
|
||||||
|
"new", "news", "notifications",
|
||||||
|
"official", "org", "ota", "owa",
|
||||||
|
"packages", "plugins", "poll", "polls", "pop", "pop3", "portal", "postmaster", "project", "projects", "pulls",
|
||||||
|
"raw", "remote", "repo", "robot", "robots",
|
||||||
|
"search", "secure", "server", "shop", "shopping", "smtp", "ssl", "stars", "store", "support",
|
||||||
|
"takeout", "template", "test", "testing",
|
||||||
|
"user",
|
||||||
|
"vote", "voting",
|
||||||
|
"web", "webmail", "webmaster", "webshop", "webstore", "www", "www0", "www1", "www2", "www3", "www4", "www5", "www6", "www7", "www8", "www9",
|
||||||
|
"ns", "ns0", "ns1", "ns2", "ns3", "ns4",
|
||||||
|
"vpn",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (in_array($owner, $reservedUsernames))
|
||||||
|
send_response(404, "Reserved user name '" . $owner . "' cannot have pages");
|
||||||
|
|
||||||
if ($owner == "codeberg-fonts" || $owner == "get-it-on")
|
if ($owner == "codeberg-fonts" || $owner == "get-it-on")
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue