pub / pastesrv

Paste service setup for paste.jayvii.de
git clone https://https://src.jayvii.de/pub/pastesrv.git
Home | Log | Files | Exports | Refs | README | RSS

commit 3e88577f92b6822339eabb23948c31f09e18efa8
parent 16131703d49971ba2ef40193115d5fc0552fda7a
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sat, 29 Jun 2024 12:30:12 +0200

feat: add index and 404 page

Diffstat:
A404.html | 186+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MREADME | 5+++++
Aindex.html | 186+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpastesrv-apache.conf | 2++
4 files changed, 379 insertions(+), 0 deletions(-)

diff --git a/404.html b/404.html @@ -0,0 +1,186 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Error - 404</title> + </head> + <body> + <header> + <div class="heading"> + <h1 style="display:inline-block;">Error: 404</h1> + </div> + </header> + <section class="home"> + + <div class="content"> + <h1>Bad news!</h1> + <p>This content does not appear to exist!</p> + <br> + <a href="#" class="btn" onclick="window.history.back();">Go back!</a> + <br> + </div> + + </section> + </body> + <style> + /* Default Colours */ + :root { + /* Default Colours */ + --bg: #FFFFFF; + --fg: #333333; + --hl: #4F4F4F; + } + /* Dark Mode */ + @media (prefers-color-scheme: dark) { + :root{ + --bg: #171717; + --fg: #BBBBBB; + --hl: #999999; + } + } + *{ + margin: 0; + padding:0%; + box-sizing: border-box; + font-family: Sans; + } + + section{ + padding: 0 77px; + } + html{ + font-size: 62.5%; + background-color: var(--bg); + } + p, h1, h2, h3, h4, h5, h6, span, a { + color: var(--fg); + } + + header{ + padding: 4rem 77px; + } + + header h1{ + font-size: 24px; + letter-spacing: -2px; + cursor: pointer; + } + + + .home{ + padding-top: 6rem; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 5rem; + } + + .home .image{ + flex: 1 1 45rem; + } + + .home img{ + width: 100%; + max-width: 1000px; + } + + .home .content{ + flex: 1 1 60rem; + } + + + .home .content h1{ + font-family: 'Space Mono', monospace; + font-size: 64px; + font-weight: 700; + line-height: 95px; + letter-spacing: -0.035em; + padding-bottom: 1rem; + color: var(--fg); + } + + .home .content p{ + font-size: 24px; + font-weight: normal; + font-style: normal; + font-family: 'Space Mono', monospace; + line-height: 36px; + letter-spacing: -0.035em; + padding-bottom: 5rem; + max-width: 50rem; + color: var(--hl); + } + + .home .content a{ + padding: 2rem 3rem; + background-color: var(--fg); + color: var(--bg); + font-family: Space Mono; + font-style: normal; + font-weight: bold; + font-size: 14px; + line-height: 21px; + letter-spacing: -0.035em; + text-transform: uppercase; + transition: 0.2s; + } + + .home .content a:hover{ + background-color: #4F4F4F; + text-decoration: none; + } + + + /* Media Queries */ + @media (max-width: 991px){ + html{ + font-size: 55%; + } + + header{ + padding: 2rem; + } + } + + @media (max-width: 768px){ + + .home .content h1 { + font-size: 48px; + line-height: 71px; + padding-bottom: 2rem; + } + + .home .content p{ + font-size: 18px; + line-height: 27px; + } + + } + @media (max-width: 450px){ + html{ + font-size: 50%; + } + + .home .content h1 { + font-size: 40px; + line-height: 55px; + padding-bottom: 2rem; + } + + .home .content p{ + font-size: 18px; + line-height: 27px; + } + + .home .content a{ + margin-bottom: 5rem; + } + section{ + padding: 0 1.5rem; + } + + } + </style> +</html> diff --git a/README b/README @@ -28,6 +28,11 @@ Copy the apache-config and edit it accordingly # now edit it accordingly a2ensite pastesrv-apache +Copy the index and 404 page to the web-root: + + cp index.html /var/www/pastesrv/paste/index.html + cp 404.html /var/www/pastesrv/paste/404.html + The service is ready now. Next, setup your client accordingly. The codemadness blog has a nifty bash-function (https://www.codemadness.org/paste-service.html), which I adapted a little bit. You can also find it in this repository as diff --git a/index.html b/index.html @@ -0,0 +1,186 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>pastesrv</title> + </head> + <body> + <header> + <div class="heading"> + <h1 style="display:inline-block;">pastesrv</h1> + </div> + </header> + <section class="home"> + + <div class="content"> + <p>Super simple selfhosted paste server inspired / copy-cat'ed from:</p> + <a href="https://www.codemadness.org/paste-service.html">https://www.codemadness.org/paste-service.html</a> + <br><br><br> + <p>Find more info here:</p> + <a href="https://src.jayvii.de/pub/pastesrv">https://src.jayvii.de/pub/pastesrv</a><br> + </div> + + </section> + </body> + <style> + /* Default Colours */ + :root { + /* Default Colours */ + --bg: #FFFFFF; + --fg: #333333; + --hl: #4F4F4F; + } + /* Dark Mode */ + @media (prefers-color-scheme: dark) { + :root{ + --bg: #171717; + --fg: #BBBBBB; + --hl: #999999; + } + } + *{ + margin: 0; + padding:0%; + box-sizing: border-box; + font-family: Sans; + } + + section{ + padding: 0 77px; + } + html{ + font-size: 62.5%; + background-color: var(--bg); + } + p, h1, h2, h3, h4, h5, h6, span, a { + color: var(--fg); + } + + header{ + padding: 4rem 77px; + } + + header h1{ + font-size: 24px; + letter-spacing: -2px; + cursor: pointer; + } + + + .home{ + padding-top: 6rem; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 5rem; + } + + .home .image{ + flex: 1 1 45rem; + } + + .home img{ + width: 100%; + max-width: 1000px; + } + + .home .content{ + flex: 1 1 60rem; + } + + + .home .content h1{ + font-family: 'Space Mono', monospace; + font-size: 64px; + font-weight: 700; + line-height: 95px; + letter-spacing: -0.035em; + padding-bottom: 1rem; + color: var(--fg); + } + + .home .content p{ + font-size: 24px; + font-weight: normal; + font-style: normal; + font-family: 'Space Mono', monospace; + line-height: 36px; + letter-spacing: -0.035em; + padding-bottom: 5rem; + max-width: 50rem; + color: var(--hl); + } + + .home .content a{ + padding: 2rem 3rem; + background-color: var(--fg); + color: var(--bg); + font-family: Space Mono; + font-style: normal; + font-weight: bold; + font-size: 14px; + line-height: 21px; + letter-spacing: -0.035em; + text-transform: uppercase; + transition: 0.2s; + } + + .home .content a:hover{ + background-color: #4F4F4F; + text-decoration: none; + } + + + /* Media Queries */ + @media (max-width: 991px){ + html{ + font-size: 55%; + } + + header{ + padding: 2rem; + } + } + + @media (max-width: 768px){ + + .home .content h1 { + font-size: 48px; + line-height: 71px; + padding-bottom: 2rem; + } + + .home .content p{ + font-size: 18px; + line-height: 27px; + } + + } + @media (max-width: 450px){ + html{ + font-size: 50%; + } + + .home .content h1 { + font-size: 40px; + line-height: 55px; + padding-bottom: 2rem; + } + + .home .content p{ + font-size: 18px; + line-height: 27px; + } + + .home .content a{ + margin-bottom: 5rem; + } + section{ + padding: 0 1.5rem; + } + + } + </style> +</html> diff --git a/pastesrv-apache.conf b/pastesrv-apache.conf @@ -2,6 +2,8 @@ ServerName paste.example.com DocumentRoot /var/www/pastesrv/paste + ErrorDocument 404 /404.html + <Directory /var/www/paste.example.com> AllowOverride All </Directory>