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"