v 0.7.6 (4565)

- Sync Plugin Updates
- Clean up tor v3 patch (#115)
    https://github.com/ZeroNetX/ZeroNet/pull/115
- Add More Default Plugins to Repo
- Doubled Site Publish Limits
- Update ZeroNet Repo Urls (#103)
- UI/UX: Increases Size of Notifications Close Button(#106)
- Moved Plugins to Seperate Repo
- Added `access_key` variable in Config, this used to access restrited plugins when multiuser plugin is enabled. When MultiUserPlugin is enabled we cannot access some pages like /Stats, this key will remove such restriction with access key.
- Added `last_connection_id_current_version` to ConnectionServer, helpful to estimate no of connection from current client version.
- Added current version:  connections to /Stats page. see the previous point.
This commit is contained in:
canewsin 2021-12-11 16:26:27 +05:30
parent 7078badefa
commit 5ee928852b
335 changed files with 177 additions and 74429 deletions

View file

@ -30,7 +30,8 @@ class ConnectionServer(object):
port = 15441
self.ip = ip
self.port = port
self.last_connection_id = 1 # Connection id incrementer
self.last_connection_id = 0 # Connection id incrementer
self.last_connection_id_current_version = 0 # Connection id incrementer for current client version
self.log = logging.getLogger("ConnServer")
self.port_opened = {}
self.peer_blacklist = SiteManager.peer_blacklist
@ -155,6 +156,9 @@ class ConnectionServer(object):
connection = Connection(self, ip, port, sock)
self.connections.append(connection)
rev = connection.handshake.get("rev", 0)
if rev > 0 and rev == config.rev:
self.last_connection_id_current_version += 1
if ip not in config.ip_local:
self.ips[ip] = connection
connection.handleIncomingConnection(sock)
@ -219,6 +223,10 @@ class ConnectionServer(object):
if not succ:
connection.close("Connection event return error")
raise Exception("Connection event return error")
else:
rev = connection.handshake.get("rev", 0)
if rev > 0 and rev == config.rev:
self.last_connection_id_current_version += 1
except Exception as err:
connection.close("%s Connect error: %s" % (ip, Debug.formatException(err)))