mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 08:57:55 +00:00
Initial commit.
This commit is contained in:
parent
8a932d68b1
commit
b70a45b312
2 changed files with 137 additions and 19 deletions
136
var/www/pages/default-page.html
Normal file
136
var/www/pages/default-page.html
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="description" content="Create your own free website for you and your projects using Codeberg Pages.">
|
||||||
|
<meta name="keywords" content="Codeberg, Website, Pages, Free, Hosting, Git, Repository">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="https://codeberg.org/img/favicon.png" />
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Kavivanar&family=Open+Sans:wght@300&family=Passion+One&display=swap" rel="stylesheet">
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
|
||||||
|
<title>Codeberg Pages - Static pages for your projects.</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
background: #fcfcfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 5px 0 5px 0;
|
||||||
|
padding: 2px 8px 2px 8px;
|
||||||
|
border-radius: 3px;
|
||||||
|
background: #393e46;
|
||||||
|
word-break: break-all;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin-top: 50px;
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
color: #404040;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container .logo {
|
||||||
|
width: 220px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
mix-blend-mode: multiply;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container .header {
|
||||||
|
margin-bottom: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container .header .name {
|
||||||
|
font-family: 'Passion One', cursive;
|
||||||
|
font-size: 50px;
|
||||||
|
color: #2185d0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container .header .description {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards {
|
||||||
|
display: flex;
|
||||||
|
align-items: top;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px 0 10px;
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-icon {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 30px;
|
||||||
|
background: black;
|
||||||
|
box-shadow: 0px 4px 16px -10px rgba(0,0,0,0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-icon .material-icons {
|
||||||
|
display: block;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-header {
|
||||||
|
margin-top: 15px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-description {
|
||||||
|
margin-top: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.elevated {
|
||||||
|
display: block;
|
||||||
|
padding: 45px 5px 45px 5px;
|
||||||
|
background: #fafafa;
|
||||||
|
box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.10);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<center>
|
||||||
|
<div class="container">
|
||||||
|
<img class="logo" src="https://codeberg.org/img/logo.svg"><br>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="name">Codeberg Pages.</div>
|
||||||
|
<div class="description">Static pages for your projects.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="elevated">
|
||||||
|
<div class="cards">
|
||||||
|
<div class="card">
|
||||||
|
<div style="background: #efb960;" class="card-icon"><i class="material-icons">add</i></div>
|
||||||
|
<div class="card-header">Create a repository.</div>
|
||||||
|
<div class="card-description">Create a repo named 'pages' in your user account or organisation.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div style="background: #0a97b0;" class="card-icon"><i class="material-icons">cloud_upload</i></div>
|
||||||
|
<div class="card-header">Push your content.</div>
|
||||||
|
<div class="card-description">Push your static content, HTML, style, fonts or images.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div style="background: #6c5b7b;" class="card-icon"><i class="material-icons">emoji_flags</i></div>
|
||||||
|
<div class="card-header">You're done!</div>
|
||||||
|
<div class="card-description">Access your content via <code>https://pages.codeberg.org/<username>/</code></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -9,24 +9,7 @@ function send_response($code, $message) {
|
||||||
$request_url = filter_var($_SERVER["PHP_SELF"], FILTER_SANITIZE_URL);
|
$request_url = filter_var($_SERVER["PHP_SELF"], FILTER_SANITIZE_URL);
|
||||||
|
|
||||||
if ($request_url === "/" and $_SERVER["HTTP_HOST"] === "codeberg.eu") {
|
if ($request_url === "/" and $_SERVER["HTTP_HOST"] === "codeberg.eu") {
|
||||||
send_response(200, "
|
send_response(200, file_get_contents("./default-page.html"));
|
||||||
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Codeberg Pages</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div style='height: 100%; display: flex; align-items: center; justify-content: center;'>
|
|
||||||
<center>
|
|
||||||
<h1>Codeberg Pages. Static Pages for your Projects.</h1>
|
|
||||||
<p>Create a repo named 'pages' in your user account or org, push static content, HTML, style, fonts, images.</p>
|
|
||||||
<p>Share your rendered content via: <pre>https://<username>." . $_SERVER["HTTP_HOST"] . "</pre></p>
|
|
||||||
<p>Welcome to <a href='https://codeberg.org'>Codeberg.org</a>!</p>
|
|
||||||
</center>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restrict allowed characters in request URI:
|
# Restrict allowed characters in request URI:
|
||||||
|
@ -120,4 +103,3 @@ if ($retval != 0) {
|
||||||
|
|
||||||
## If we could directly exec+echo raw output from above, we wouldn't need to execute command twice:
|
## If we could directly exec+echo raw output from above, we wouldn't need to execute command twice:
|
||||||
passthru($command);
|
passthru($command);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue