retreive real client IP

This commit is contained in:
Emmanuel Viennet 2021-09-18 21:32:52 +02:00
parent 3bc5de3afc
commit c4c37fedfb

View File

@ -138,6 +138,7 @@ def version():
""" """
echo -e "DATE\tIP\tSVN\tSERIAL\tOP" > installs.log; chown scodoc installs.log echo -e "DATE\tIP\tSVN\tSERIAL\tOP" > installs.log; chown scodoc installs.log
""" """
remote_addr = request.environ.get("HTTP_X_Real_IP", request.remote_addr)
mode = request.args.get("mode", "?") mode = request.args.get("mode", "?")
sn = request.args.get("sn", "-1") # serial number sn = request.args.get("sn", "-1") # serial number
svn = request.args.get("svn", "-") # installed subversion svn = request.args.get("svn", "-") # installed subversion
@ -152,7 +153,7 @@ def version():
"%s\t%s\t%s\t%s\t%s\n" "%s\t%s\t%s\t%s\t%s\n"
% ( % (
time.strftime("%Y-%m-%d %H:%M:%S"), time.strftime("%Y-%m-%d %H:%M:%S"),
request.remote_addr, remote_addr,
svn or commit, svn or commit,
serial, serial,
mode, mode,