Divert from GitHub Pages -> Flask

Self host the website because of issues that came up when getting a Synapse server running.
This commit is contained in:
Parker M. 2023-09-10 19:17:16 -05:00
parent 8e362f1407
commit 174a575759
No known key found for this signature in database
GPG Key ID: 95CD2E0C7E329F2A
14 changed files with 172 additions and 10 deletions

View File

@ -1,3 +0,0 @@
{
"m.server": "matrix.pkrm.dev:443"
}

1
CNAME
View File

@ -1 +0,0 @@
pkrm.dev

17
pkrm.service Normal file
View File

@ -0,0 +1,17 @@
# Make sure to move this to /etc/systemd/system
# For Debian systems you then run `sudo systemctl enable pkrm` and `sudo systemctl start pkrm`
# Make sure to change the `WorkingDirectory` and `ExecStart` paths, as it is most likely not correct
# for your setup.
[Unit]
Description=Keep PKRM.DEV Up and Running
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/parker/pkrm
ExecStart=/usr/bin/bash /home/parker/pkrm/pkrm.sh
Restart=always
[Install]
WantedBy=multi-user.target

1
pkrm.sh Normal file
View File

@ -0,0 +1 @@
gunicorn -b 0.0.0.0:6767 wsgi:app

25
serve.py Normal file
View File

@ -0,0 +1,25 @@
import flask
app = flask.Flask(__name__)
@app.route('/')
def home():
return flask.render_template('home.html')
@app.route('/contact')
def contact():
return flask.render_template('contact.html')
@app.route('/contact.asc')
def pgp_key():
return flask.render_template('contact.asc.html')
@app.route('/.well-known/matrix/server')
def server():
data = {
"m.server": "matrix.pkrm.dev:443"
}
return data
if __name__ == '__main__':
app.run()

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -6,7 +6,7 @@
body{
overflow-x: hidden;
background-image: url(/bg.png);
background-image: url(/static/bg.png);
background-size: cover;
color: #fff;
will-change: transform;

121
templates/contact.asc.html Normal file
View File

@ -0,0 +1,121 @@
<!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">
<link href="https://fonts.googleapis.com/css2?family=Kanit:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<title>Contact | pkrm.dev</title>
<meta name="robots" content="index, follow">
<meta name="theme-color" content="#000" />
<meta name="apple-mobile-web-app-title" content="Parker M. | Contact" />
<meta property="og:title" content="Parker M. | Contact" />
<meta property="og:url" content="https://pkrm.dev" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Fill out this form in order to contact me." />
<meta name="description" content="Fill out this form in order to contact me." />
<meta name="robots" content="index, follow" />
<meta name="http-equiv" content="X-Robots-Tag : index, follow" />
<meta name="googlebot" content="index, follow" />
<meta name="twitter:card" content="summary" />
</head>
<body>
<a href="/" id="back-home">Back Home</a>
<div class="container">
<p>
-----BEGIN PGP PUBLIC KEY BLOCK-----
xjMEZI06YRYJKwYBBAHaRw8BAQdAxymP7jguJxjtKKqGQ/fSXGwZVzOiix6iRS1F
6BVMu+3NG1BhcmtlciBNIDxjb250YWN0QHBrcm0uZGV2PsKTBBMWCgA7FiEEWLdr
i7q4eU0h4leclc0uDH4ynyoFAmSNOmECGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC
HgcCF4AACgkQlc0uDH4ynyrBIAEAu7y2oebvsBb+tJXPUOZkjqE+rsAwiDgHLj3U
gYMM4XUBALPsZ4IgA5mWhTDTV00QLHmVtybCJzCdc7LzyvQH78cHzjgEZI06YRIK
KwYBBAGXVQEFAQEHQLBpSX+qSOtSFVrp9+VfJGHsoPaIhoxIjz44byrtLXZ4AwEI
B8J4BBgWCgAgFiEEWLdri7q4eU0h4leclc0uDH4ynyoFAmSNOmECGwwACgkQlc0u
DH4ynyqQhAEAuo1HGXEKkBUzji+cCW3wF/oqg0cQklQzfKUkifLhiC8A/2gdilxS
AYHKY0lEJandkOjid/otDdiIZCUBt5mXjncL
=ni8o
<br>
-----END PGP PUBLIC KEY BLOCK-----
</p>
<br><br><br>
<p>
Or, download the .asc file <a href="/static/contact.asc">here</a>.
</p>
</div>
</body>
</html>
<style>
* {
font-family: 'Kanit', sans-serif;
margin: 0;
scroll-behavior: smooth;
}
body{
overflow-x: hidden;
background-image: url(/static/bg.png);
background-size: cover;
color: #fff;
}
#back-home {
font-weight: bold;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
padding-top: 2.604vw;
font-size: 2.083vw;
color: #fff;
text-decoration: none;
}
a:hover {
cursor: pointer;
opacity: 0.6;
}
/* "Back Home" media query for mobile */
@media only screen and (max-width: 600px) {
#back-home {
font-size: 3.125vw;
padding-top: 4.167vw;
width: 90%;
display: flex;
justify-content: center;
align-items: center;
}
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Container media query for mobile */
@media only screen and (max-width: 600px) {
.container {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
}
}
p {
font-size: 1.302vw;
line-height: 1.5;
text-decoration: none;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/@mojs/curve-editor"></script>
<script src="https://cdn.jsdelivr.net/npm/@mojs/core"></script>

View File

@ -22,7 +22,7 @@
<meta name="googlebot" content="index, follow" />
<meta name="twitter:card" content="summary" />
<script src="/contact/script.js" defer></script>
<script src="/static/contact.js" defer></script>
</head>
<body>
<a href="/" id="back-home">Back Home</a>
@ -48,7 +48,7 @@
body{
overflow-x: hidden;
background-image: url(/bg.png);
background-image: url(/static/bg.png);
background-size: cover;
color: #fff;
}

View File

@ -31,8 +31,8 @@
<meta name="twitter:card" content="summary" />
<link rel="stylesheet" href="/style.css">
<script src="/script.js" defer></script>
<link rel="stylesheet" href="/static/style.css">
<script src="/static/home.js" defer></script>
</head>
<body>

2
wsgi.py Normal file
View File

@ -0,0 +1,2 @@
from serve import app as application
app = application