Commit f251479f authored by Killian Lufau's avatar Killian Lufau

add OS identification of nodes

The main goal of this is to check if we should keep supporting
older distributions.
parent 8401ce4e
......@@ -259,6 +259,18 @@ class RegistryServer(object):
raise Exception("Wrong HMAC")
key = hashlib.sha1(key).digest()
session[:] = hashlib.sha1(key).digest(),
else:
x_forwarded_for = request.headers.get("X-Forwarded-For")
ipv6 = None
if method == "hello":
ipv6 = utils.ipFromBin(
x509.networkFromCa(self.cert.ca)
+ kw["client_prefix"])
logging.info("%s%s: %s, %s",
method,
'(' + ipv6 + ')' if method == "hello" else '',
x_forwarded_for or request.headers.get("host"),
request.headers.get("user-agent"))
try:
result = m(**kw)
except HTTPError, e:
......@@ -640,7 +652,7 @@ class RegistryServer(object):
class RegistryClient(object):
_hmac = None
user_agent = "re6stnet/" + version.version
user_agent = "re6stnet/%s, %s" % (version.version, version.os)
def __init__(self, url, cert=None, auto_close=True):
self.cert = cert
......
......@@ -490,7 +490,7 @@ class BaseTunnelManager(object):
if ask:
return self._info(False)
else:
return version.version
return "%s, %s" % (version.version, version.os)
elif code == 5:
# the registry wants to know the topology for debugging purpose
if not peer or peer == self.cache.registry_prefix:
......
import subprocess as _S
import platform
from os.path import dirname as _d
_d = _d(__file__)
......@@ -34,6 +35,7 @@ if dirty:
# a wish to force an update of nodes.
protocol = 4
min_protocol = 1
os = platform.platform()
if __name__ == "__main__":
print version
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment