From 612f5cb04e3258549ad96f4d8d2022b576440bd5 Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Sat, 17 Aug 2024 12:21:02 +0200 Subject: [PATCH] do stuff --- server/webhook-ingest/app/config.py | 1 + server/webhook-ingest/app/nats_client.py | 1 + server/webhook-ingest/nats-server.conf | 22 ++++++++-------------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/server/webhook-ingest/app/config.py b/server/webhook-ingest/app/config.py index 2a3ddb29..4541ef4c 100644 --- a/server/webhook-ingest/app/config.py +++ b/server/webhook-ingest/app/config.py @@ -4,6 +4,7 @@ class Settings(BaseSettings): NATS_URL: str = "localhost" + NATS_AUTH_TOKEN: str = "" WEBHOOK_SECRET: str = "" class Config: diff --git a/server/webhook-ingest/app/nats_client.py b/server/webhook-ingest/app/nats_client.py index 9590f4f5..e31c377d 100644 --- a/server/webhook-ingest/app/nats_client.py +++ b/server/webhook-ingest/app/nats_client.py @@ -9,6 +9,7 @@ def __init__(self): async def connect(self): await self.nc.connect( servers=settings.NATS_URL, + token=settings.NATS_AUTH_TOKEN, verbose=True, pedantic=True, max_reconnect_attempts=-1, diff --git a/server/webhook-ingest/nats-server.conf b/server/webhook-ingest/nats-server.conf index 53fb0e30..eedbc1b1 100644 --- a/server/webhook-ingest/nats-server.conf +++ b/server/webhook-ingest/nats-server.conf @@ -1,21 +1,15 @@ -# Port for internal connections (unencrypted and no auth) -listen: "0.0.0.0:5222" +listen: "0.0.0.0:4222" jetstream { store_dir: "/data" } -cluster { - # Port for external connections (encrypted and auth) - listen: "0.0.0.0:4222" - - tls { - cert_file: $TLS_CERT_FILE - key_file: $TLS_KEY_FILE - verify: false - } +tls { + cert_file: $TLS_CERT_FILE + key_file: $TLS_KEY_FILE + verify: false +} - authorization { - token: $NATS_AUTH_TOKEN - } +authorization { + token: $NATS_AUTH_TOKEN } \ No newline at end of file