Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
b6284bde4e build(deps): bump sqlalchemy-utils from 0.42.0 to 0.42.1 in /src
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.42.0 to 0.42.1.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.42.0...0.42.1)

---
updated-dependencies:
- dependency-name: sqlalchemy-utils
  dependency-version: 0.42.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 20:31:46 +00:00
3 changed files with 8 additions and 13 deletions

View File

@@ -18,18 +18,10 @@ def GetRemoteEndpoint() -> str:
@return: @return:
""" """
import socket import socket
try: with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: s.connect(("1.1.1.1", 80)) # Connecting to a public IP
s.connect(("1.1.1.1", 80)) # Connecting to a public IP
wgd_remote_endpoint = s.getsockname()[0] wgd_remote_endpoint = s.getsockname()[0]
return str(wgd_remote_endpoint) return str(wgd_remote_endpoint)
except (socket.error, OSError):
pass
try:
return socket.gethostbyname(socket.gethostname())
except (socket.error, OSError):
pass
return "127.0.0.1"
def StringToBoolean(value: str): def StringToBoolean(value: str):

View File

@@ -404,7 +404,6 @@ class WireguardConfiguration:
try: try:
if "[Peer]" not in content: if "[Peer]" not in content:
current_app.logger.info(f"{self.Name} config has no [Peer] section") current_app.logger.info(f"{self.Name} config has no [Peer] section")
self.Peers = []
return return
peerStarts = content.index("[Peer]") peerStarts = content.index("[Peer]")
@@ -666,8 +665,9 @@ class WireguardConfiguration:
if not self.__wgSave(): if not self.__wgSave():
return False, "Failed to save configuration through WireGuard" return False, "Failed to save configuration through WireGuard"
self.getRestrictedPeers()
self.getPeers() self.getPeers()
if numOfRestrictedPeers == len(listOfPublicKeys): if numOfRestrictedPeers == len(listOfPublicKeys):
return True, f"Restricted {numOfRestrictedPeers} peer(s)" return True, f"Restricted {numOfRestrictedPeers} peer(s)"
return False, f"Restricted {numOfRestrictedPeers} peer(s) successfully. Failed to restrict {numOfFailedToRestrictPeers} peer(s)" return False, f"Restricted {numOfRestrictedPeers} peer(s) successfully. Failed to restrict {numOfFailedToRestrictPeers} peer(s)"
@@ -783,7 +783,9 @@ class WireguardConfiguration:
) )
).mappings().fetchone() ).mappings().fetchone()
if cur_i is not None: if cur_i is not None:
# print(cur_i is None)
total_sent = cur_i['total_sent'] total_sent = cur_i['total_sent']
# print(cur_i is None)
total_receive = cur_i['total_receive'] total_receive = cur_i['total_receive']
cur_total_sent = float(data_usage[i][2]) / (1024 ** 3) cur_total_sent = float(data_usage[i][2]) / (1024 ** 3)
cur_total_receive = float(data_usage[i][1]) / (1024 ** 3) cur_total_receive = float(data_usage[i][1]) / (1024 ** 3)
@@ -1224,6 +1226,7 @@ class WireguardConfiguration:
def __validateOverridePeerSettings(self, key: str, value: str | int) -> tuple[bool, None] | tuple[bool, str]: def __validateOverridePeerSettings(self, key: str, value: str | int) -> tuple[bool, None] | tuple[bool, str]:
status = True status = True
msg = None msg = None
print(value)
if key == "DNS" and value: if key == "DNS" and value:
status, msg = ValidateDNSAddress(value) status, msg = ValidateDNSAddress(value)
elif key == "EndpointAllowedIPs" and value: elif key == "EndpointAllowedIPs" and value:

View File

@@ -9,7 +9,7 @@ gunicorn==23.0.0
requests==2.32.5 requests==2.32.5
tcconfig==0.30.1 tcconfig==0.30.1
sqlalchemy==2.0.44 sqlalchemy==2.0.44
sqlalchemy_utils==0.42.0 sqlalchemy_utils==0.42.1
psycopg[binary]==3.3.2 psycopg[binary]==3.3.2
PyMySQL==1.1.2 PyMySQL==1.1.2
tzlocal==5.3.1 tzlocal==5.3.1