diff --git a/Dockerfile b/Dockerfile index f1f16b3..2d2283e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11.4-bullseye AS builder +FROM python:3.11.5-bullseye AS builder RUN apt-get update && apt-get install -y apt-transport-https curl gnupg \ && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >/usr/share/keyrings/bazel-archive-keyring.gpg \ @@ -15,7 +15,7 @@ RUN ["bazel", "build", "//wgkex/broker:app"] RUN ["bazel", "build", "//wgkex/worker:app"] RUN ["cp", "-rL", "bazel-bin", "bazel"] -FROM python:3.11.3-bullseye +FROM python:3.11.5-bullseye WORKDIR /wgkex COPY --from=builder /wgkex/bazel /wgkex/ diff --git a/Docs/architecture-dark.png b/Docs/architecture-dark.png new file mode 100644 index 0000000..19aa424 Binary files /dev/null and b/Docs/architecture-dark.png differ diff --git a/README.md b/README.md index dcf2540..36498c0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,11 @@ wgkex is a WireGuard key exchange and management tool designed and run by FFMUC. WireGuard Key Exchange is a tool consisting of two parts: a frontend (broker) and a backend (worker). These components communicate to each other via MQTT - a messaging bus. -![](Docs/architecture.png) + + + + Architectural Diagram + ### Frontend broker diff --git a/requirements.txt b/requirements.txt index 5279a8b..a485480 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ flask-mqtt pyroute2 PyYAML Flask +waitress # Common ipaddress diff --git a/wgkex/broker/BUILD b/wgkex/broker/BUILD index dbe99be..780f340 100644 --- a/wgkex/broker/BUILD +++ b/wgkex/broker/BUILD @@ -29,6 +29,7 @@ py_binary( deps=[ requirement("flask"), requirement("flask-mqtt"), + requirement("waitress"), "//wgkex/config:config", "//wgkex/common:mqtt", ":metrics" diff --git a/wgkex/broker/app.py b/wgkex/broker/app.py index bbf962a..eb81a76 100644 --- a/wgkex/broker/app.py +++ b/wgkex/broker/app.py @@ -9,6 +9,7 @@ from flask.app import Flask as Flask_app from flask_mqtt import Mqtt +from waitress import serve from wgkex.config import config from wgkex.common import logger from wgkex.common.utils import is_valid_domain @@ -277,4 +278,4 @@ def join_host_port(host: str, port: str) -> str: listen_host = listen_config.host listen_port = listen_config.port - app.run(host=listen_host, port=listen_port) + serve(app, host=listen_host, port=listen_port)