server now listens on localhost. added xff ao app.py. ignore notes.txt

This commit is contained in:
gashapwn 2020-11-28 03:50:10 +00:00
parent 90e1a3a73b
commit da3a6cefd5
3 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ test_*.txt
*/p1.pl */p1.pl
*/p2.pl */p2.pl
user_list.txt user_list.txt
notes.txt

5
app.py
View File

@ -142,6 +142,7 @@ def signup():
pub_key = request.form["pub_key"].strip() pub_key = request.form["pub_key"].strip()
shell = request.form["shell"].strip() shell = request.form["shell"].strip()
rule_read = request.form["rule_read"].strip() rule_read = request.form["rule_read"].strip()
xff_header = request.headers["X-Forwarded-For"]
is_email_user = False; is_email_user = False;
@ -191,6 +192,9 @@ def signup():
print("key failed lib validation") print("key failed lib validation")
return handle_invalid_data(request) return handle_invalid_data(request)
if(len(xff_header) < 1):
xff_header = "NO_XFF"
# All users requests have a sequential ID # All users requests have a sequential ID
# The below picks the next ID based on # The below picks the next ID based on
# how many requests we already have saved # how many requests we already have saved
@ -215,6 +219,7 @@ def signup():
ident_file.write(str(email) + "\n") ident_file.write(str(email) + "\n")
ident_file.write(str(shell) + "\n") ident_file.write(str(shell) + "\n")
ident_file.write(str(pub_key) + "\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) return render_template("signup.html", is_email_user = is_email_user)

View File

@ -1,6 +1,6 @@
{ {
"site_name": "lingy.in", "site_name": "lingy.in",
"listen_ip": "104.248.118.130", "listen_ip": "127.0.0.1",
"shell": { "shell": {
"SHELL_BASH": "/usr/local/bin/bash", "SHELL_BASH": "/usr/local/bin/bash",
"SHELL_KSH": "/bin/ksh" "SHELL_KSH": "/bin/ksh"