update + fix contact form

This commit is contained in:
Parker M. 2023-11-25 23:40:30 -06:00
parent 34161990d0
commit 8f148ef919
No known key found for this signature in database
GPG Key ID: 95CD2E0C7E329F2A
5 changed files with 20 additions and 2 deletions

View File

@ -30,7 +30,7 @@
<a href="/" id="back-home">Back Home</a>
<div class="container">
<p id="attention">ATTENTION: To send any sensitive information, please email me at <a href="mailto:contact@pkrm.dev" id="contact-email">contact@pkrm.dev</a> and encrypt the message with my <a href="/static/contact.asc" id="pgp-key">PGP public key</a>. This form should not be thought of as a secure way of communication.</p>
<form actions="/contact" name="contact" onsubmit="event.preventDefault(); checkForm();">
<form actions="/contact" method="POST" name="contact" onsubmit="event.preventDefault(); checkForm();">
<input name="name" placeholder="Name">
<input name="email" placeholder="Email">
<textarea name="message" placeholder="Message"></textarea>

View File

@ -1,10 +1,12 @@
import flask
import os
import discord
import dotenv
app = flask.Flask(__name__)
app.secret_key = os.urandom(32)
webhook_url = os.environ.get('WEBHOOK_URL')
dotenv.load_dotenv()
webhook_url = os.getenv("WEBHOOK_URL")
@app.route('/', methods=['GET'])
def index():

14
pkrm.service Normal file
View File

@ -0,0 +1,14 @@
# Systemd service file, feel free to edit to your needs, this isnt needed though
[Unit]
Description=Keep PKRM.DEV Up and Running
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/parker/services/pkrm
ExecStart=/usr/bin/bash /home/parker/services/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:2121 run:app

1
run.py
View File

@ -1,4 +1,5 @@
from app.views import app as application
app=application
if __name__ == '__main__':
application.run(port="2121", debug=False)