mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-15 16:06:17 +00:00
Update to Python 3.14-alpine and refactor IP parsing
Bump Dockerfile base image from python:3.13.3-alpine to python:3.14-alpine for both build and runtime stages. Refactor IP address parsing in dashboard.py for improved clarity and variable naming.
This commit is contained in:
@@ -55,7 +55,7 @@ RUN make && chmod +x wg*
|
||||
#
|
||||
|
||||
# Use the python-alpine image for building pip dependencies
|
||||
FROM python:3.13.3-alpine AS pip-builder
|
||||
FROM python:3.14-alpine AS pip-builder
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
@@ -91,7 +91,7 @@ RUN . /opt/wgdashboard/src/venv/bin/activate && \
|
||||
#
|
||||
|
||||
# Running with the python-alpine image.
|
||||
FROM python:3.13.3-alpine AS final
|
||||
FROM python:3.14-alpine AS final
|
||||
LABEL maintainer="dselen@nerthus.nl"
|
||||
|
||||
# Install only the runtime dependencies
|
||||
|
||||
@@ -1238,8 +1238,9 @@ def API_ping_getAllPeersIpAddress():
|
||||
ip = ipaddress.ip_network(x, strict=False)
|
||||
except ValueError as e:
|
||||
app.logger.error(f"Failed to parse IP address of {p.id} - {c.Name}")
|
||||
if len(list(ip.hosts())) == 1:
|
||||
parsed.append(str(ip.hosts()[0]))
|
||||
host = list(ip.hosts())
|
||||
if len(host) == 1:
|
||||
parsed.append(str(host[0]))
|
||||
endpoint = p.endpoint.replace(" ", "").replace("(none)", "")
|
||||
if len(p.name) > 0:
|
||||
cips[f"{p.name} - {p.id}"] = {
|
||||
|
||||
Reference in New Issue
Block a user