From 596dabfc47fa2fc1fe00a3488a6c05bcd5be4cb9 Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Sun, 19 Nov 2023 23:47:22 +0000 Subject: [PATCH] Updated login --- README.md | 6 ++++-- login/login.py => account/account.py | 9 +++------ account/templates/confirm.html | 21 +++++++++++++++++++++ {login => account}/templates/dashboard.html | 6 +++--- {login => account}/templates/index.html | 4 ++-- public/index.html | 2 +- signup/templates/captcha_err.html | 2 +- signup/templates/err.html | 2 +- signup/templates/expired.html | 2 +- signup/templates/index.html | 2 +- signup/templates/num.html | 2 +- signup/templates/ok.html | 2 +- 12 files changed, 40 insertions(+), 20 deletions(-) rename login/login.py => account/account.py (87%) create mode 100644 account/templates/confirm.html rename {login => account}/templates/dashboard.html (65%) rename {login => account}/templates/index.html (90%) diff --git a/README.md b/README.md index dda8a2b..517e5f7 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,11 @@ Copy config.ini.example to config.ini and edit accordingly Use your web server to host everything in public, and run app.py with python. -Reverse-proxy signup/signup.py to /register, and run as an a normal user with doas permissions for maddy +Reverse-proxy signup/signup.py to /register -Reverse-proxy login/login.py to /login, and run as the maddy user to have r/w access to the db +Reverse-proxy account/account.py to /account + +Run both scripts as a user with access to the Maddy DB and CLI tools ## Dependencies diff --git a/login/login.py b/account/account.py similarity index 87% rename from login/login.py rename to account/account.py index a33f2dc..fa676fd 100644 --- a/login/login.py +++ b/account/account.py @@ -8,18 +8,15 @@ from waitress import serve config = configparser.ConfigParser() config.read("../config.ini") -secretkey = config.get("Login", "secretkey") -database = config.get("Login", "database") -runport = config.get("Login", "port") +database = config.get("Account", "database") +runport = config.get("Account", "port") # Status report -print("HectaMail Login Service is starting up...") -print("Your secret key is:", secretkey) +print("HectaMail Account Service is starting up...") print("Your database is located at:", database) app = Flask(__name__) -app.secret_key = secretkey def fetch_hash_from_database(key): conn = sqlite3.connect(database) diff --git a/account/templates/confirm.html b/account/templates/confirm.html new file mode 100644 index 0000000..948e18c --- /dev/null +++ b/account/templates/confirm.html @@ -0,0 +1,21 @@ + + + + HectaMail + + + +
+ HectaMail + Sign up + Account +
+
+

Are you SURE you would like to delete your account?

+ +
+ + +
+ + diff --git a/login/templates/dashboard.html b/account/templates/dashboard.html similarity index 65% rename from login/templates/dashboard.html rename to account/templates/dashboard.html index 086b5c9..37c2e2b 100644 --- a/login/templates/dashboard.html +++ b/account/templates/dashboard.html @@ -8,12 +8,12 @@
HectaMail Sign up - Account + Account

Account management

- - + +
diff --git a/login/templates/index.html b/account/templates/index.html similarity index 90% rename from login/templates/index.html rename to account/templates/index.html index 3f8821b..4e2717a 100644 --- a/login/templates/index.html +++ b/account/templates/index.html @@ -8,12 +8,12 @@
HectaMail Sign up - Login + Account

Login to your Email Account

Warning! This is only a proof of concept and has no actual use! - +
diff --git a/public/index.html b/public/index.html index 8775a2b..17baf34 100755 --- a/public/index.html +++ b/public/index.html @@ -8,7 +8,7 @@

Welcome to HectaMail!

diff --git a/signup/templates/captcha_err.html b/signup/templates/captcha_err.html index 26fd23f..81b87d6 100644 --- a/signup/templates/captcha_err.html +++ b/signup/templates/captcha_err.html @@ -8,7 +8,7 @@

Error!

diff --git a/signup/templates/err.html b/signup/templates/err.html index 4479e94..d518f11 100644 --- a/signup/templates/err.html +++ b/signup/templates/err.html @@ -8,7 +8,7 @@

Error!

diff --git a/signup/templates/expired.html b/signup/templates/expired.html index a643aa3..e4c4995 100644 --- a/signup/templates/expired.html +++ b/signup/templates/expired.html @@ -8,7 +8,7 @@

Error!

diff --git a/signup/templates/index.html b/signup/templates/index.html index 19eb91a..3f481af 100644 --- a/signup/templates/index.html +++ b/signup/templates/index.html @@ -8,7 +8,7 @@

Register an Email Account

diff --git a/signup/templates/num.html b/signup/templates/num.html index 28f63cd..237c39c 100644 --- a/signup/templates/num.html +++ b/signup/templates/num.html @@ -8,7 +8,7 @@

Error!

diff --git a/signup/templates/ok.html b/signup/templates/ok.html index bf974ca..75cef4a 100644 --- a/signup/templates/ok.html +++ b/signup/templates/ok.html @@ -8,7 +8,7 @@

Done!