Merge pull request #880 from WGDashboard/v4.3-dev-docker

V4.3 dev docker
This commit is contained in:
Donald Zou
2025-09-16 16:59:09 +08:00
committed by GitHub
5 changed files with 222 additions and 162 deletions

View File

@@ -174,12 +174,18 @@ class AmneziaWireguardConfiguration(WireguardConfiguration):
def getPeers(self):
self.Peers.clear()
current_app.logger.info(f"Refreshing {self.Name} peer list")
if self.configurationFileChanged():
with open(self.configPath, 'r') as configFile:
p = []
pCounter = -1
content = configFile.read().split('\n')
try:
if "[Peer]" not in content:
current_app.logger.info(f"{self.Name} config has no [Peer] section")
return
peerStarts = content.index("[Peer]")
content = content[peerStarts:]
for i in content: