diff --git a/titanembeds/templates/administrate_guild.html.j2 b/titanembeds/templates/administrate_guild.html.j2 index 81aef22..84ed3d2 100644 --- a/titanembeds/templates/administrate_guild.html.j2 +++ b/titanembeds/templates/administrate_guild.html.j2 @@ -67,7 +67,7 @@ Username Discrim Last Visit - IP Address + IP Address Hash Banned Timestamp Banned by Banned Reason diff --git a/titanembeds/utils.py b/titanembeds/utils.py index d738e81..cfe9c93 100644 --- a/titanembeds/utils.py +++ b/titanembeds/utils.py @@ -6,15 +6,17 @@ from flask_limiter import Limiter from config import config import random import string +import hashlib discord_api = DiscordREST(config['bot-token']) cache = Cache() def get_client_ipaddr(): if "X-Real-IP" in request.headers: # pythonanywhere specific - return request.headers['X-Real-IP'] + ip = request.headers['X-Real-IP'] else: # general - return request.remote_addr + ip = request.remote_addr + return hashlib.sha512(config['app-secret'] + ip).hexdigest()[:15] def generate_session_key(): sess = session.get("sessionunique", None)