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:
Donald Zou
2025-12-13 16:05:12 +08:00
parent da4cec60e5
commit e5d1a64d7d
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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}"] = {