pull/1288/merge
Arctic 2026-05-29 01:14:58 +03:00 committed by GitHub
commit fdfc14e112
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,6 @@ def peerInformationBackgroundThread():
c.getPeersEndpoint() c.getPeersEndpoint()
c.getPeers() c.getPeers()
if DashboardConfig.GetConfig('WireGuardConfiguration', 'peer_tracking')[1] is True: if DashboardConfig.GetConfig('WireGuardConfiguration', 'peer_tracking')[1] is True:
print("[WGDashboard] Tracking Peers")
if delay == 6: if delay == 6:
if c.configurationInfo.PeerTrafficTracking: if c.configurationInfo.PeerTrafficTracking:
c.logPeersTraffic() c.logPeersTraffic()

View File

@ -83,7 +83,7 @@ class DashboardConfig:
}, },
"WireGuardConfiguration": { "WireGuardConfiguration": {
"autostart": "", "autostart": "",
"peer_tracking": "false" "peer_tracking": "true"
} }
} }

View File

@ -232,7 +232,7 @@ class WireguardConfiguration:
self.Status = self.getStatus() self.Status = self.getStatus()
def __dropDatabase(self): def __dropDatabase(self):
existingTables = [self.Name, f'{self.Name}_restrict_access', f'{self.Name}_transfer', f'{self.Name}_deleted'] existingTables = [self.Name, f'{self.Name}_restrict_access', f'{self.Name}_transfer', f'{self.Name}_deleted', f'{self.Name}_history_endpoint']
try: try:
with self.engine.begin() as conn: with self.engine.begin() as conn:
for t in existingTables: for t in existingTables:
@ -308,7 +308,8 @@ class WireguardConfiguration:
f'{dbName}_history_endpoint', self.metadata, f'{dbName}_history_endpoint', self.metadata,
sqlalchemy.Column('id', sqlalchemy.String(255), nullable=False), sqlalchemy.Column('id', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('endpoint', sqlalchemy.String(255), nullable=False), sqlalchemy.Column('endpoint', sqlalchemy.String(255), nullable=False),
sqlalchemy.Column('time', time_col_type) sqlalchemy.Column('time', time_col_type),
extend_existing=True
) )
self.infoTable = sqlalchemy.Table( self.infoTable = sqlalchemy.Table(
@ -322,7 +323,7 @@ class WireguardConfiguration:
def __dumpDatabase(self): def __dumpDatabase(self):
with self.engine.connect() as conn: with self.engine.connect() as conn:
tables = [self.peersTable, self.peersRestrictedTable, self.peersTransferTable, self.peersDeletedTable] tables = [self.peersTable, self.peersRestrictedTable, self.peersTransferTable, self.peersDeletedTable, self.peersHistoryEndpointTable]
for i in tables: for i in tables:
rows = conn.execute(i.select()).mappings().fetchall() rows = conn.execute(i.select()).mappings().fetchall()
for row in rows: for row in rows: