From da3a6cefd5d92ac04ee14c3182e3074704de807a Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sat, 28 Nov 2020 03:50:10 +0000 Subject: [PATCH] server now listens on localhost. added xff ao app.py. ignore notes.txt --- .gitignore | 1 + app.py | 5 +++++ lyadmin.conf.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2208975..a2d392a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ test_*.txt */p1.pl */p2.pl user_list.txt +notes.txt diff --git a/app.py b/app.py index a940bf5..eba45b7 100644 --- a/app.py +++ b/app.py @@ -142,6 +142,7 @@ def signup(): pub_key = request.form["pub_key"].strip() shell = request.form["shell"].strip() rule_read = request.form["rule_read"].strip() + xff_header = request.headers["X-Forwarded-For"] is_email_user = False; @@ -191,6 +192,9 @@ def signup(): print("key failed lib validation") return handle_invalid_data(request) + if(len(xff_header) < 1): + xff_header = "NO_XFF" + # All users requests have a sequential ID # The below picks the next ID based on # how many requests we already have saved @@ -215,6 +219,7 @@ def signup(): ident_file.write(str(email) + "\n") ident_file.write(str(shell) + "\n") ident_file.write(str(pub_key) + "\n") + ident_file.write(str(xff_header) + "\n") return render_template("signup.html", is_email_user = is_email_user) diff --git a/lyadmin.conf.json b/lyadmin.conf.json index 168bf53..5cb8ad7 100644 --- a/lyadmin.conf.json +++ b/lyadmin.conf.json @@ -1,6 +1,6 @@ { "site_name": "lingy.in", - "listen_ip": "104.248.118.130", + "listen_ip": "127.0.0.1", "shell": { "SHELL_BASH": "/usr/local/bin/bash", "SHELL_KSH": "/bin/ksh"