Commit 96ab35a9 authored by Killian Lufau's avatar Killian Lufau Committed by Julien Muchembled

add OS identification of nodes

The main goal of this is to check if we should keep supporting
older distributions.

/reviewed-on nexedi/re6stnet!9
parent 8401ce4e
......@@ -19,7 +19,7 @@ Authenticated communication:
- the one of the last handshake (hello)
"""
import base64, hmac, hashlib, httplib, inspect, json, logging
import mailbox, os, random, select, smtplib, socket, sqlite3
import mailbox, os, platform, random, select, smtplib, socket, sqlite3
import string, struct, sys, threading, time, weakref, zlib
from collections import defaultdict, deque
from datetime import datetime
......@@ -259,6 +259,15 @@ class RegistryServer(object):
raise Exception("Wrong HMAC")
key = hashlib.sha1(key).digest()
session[:] = hashlib.sha1(key).digest(),
else:
logging.info("%s%s: %s, %s",
method,
'(' + utils.ipFromBin(x509.networkFromCa(self.cert.ca)
+ kw["client_prefix"])
+ ')' if method == 'hello' else '',
request.headers.get("X-Forwarded-For") or
request.headers.get("host"),
request.headers.get("user-agent"))
try:
result = m(**kw)
except HTTPError, e:
......@@ -640,7 +649,7 @@ class RegistryServer(object):
class RegistryClient(object):
_hmac = None
user_agent = "re6stnet/" + version.version
user_agent = "re6stnet/%s, %s" % (version.version, platform.platform())
def __init__(self, url, cert=None, auto_close=True):
self.cert = cert
......
import errno, json, logging, os, random, socket
import errno, json, logging, os, platform, random, socket
import subprocess, struct, sys, time, weakref
from collections import defaultdict, deque
from bisect import bisect, insort
......@@ -490,7 +490,7 @@ class BaseTunnelManager(object):
if ask:
return self._info(False)
else:
return version.version
return "%s, %s" % (version.version, platform.platform())
elif code == 5:
# the registry wants to know the topology for debugging purpose
if not peer or peer == self.cache.registry_prefix:
......
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