From 6f223d2462df5e08856fb83fd76773a8af33acf9 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Wed, 7 Aug 2024 21:23:58 -0700 Subject: [PATCH] add server url for openapi spec, proxy headers spec --- Dockerfile | 2 +- kennel/main.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0101625..6a87f73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt COPY kennel /app/kennel COPY static /app/static COPY templates /app/templates -CMD ["uvicorn", "kennel.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "kennel.main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips", "*"] diff --git a/kennel/main.py b/kennel/main.py index 4ec9fca..183fb64 100644 --- a/kennel/main.py +++ b/kennel/main.py @@ -5,7 +5,11 @@ from fastapi import FastAPI, Request, Response from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates -app = FastAPI() +app = FastAPI( + servers = [ + {"url": "https://kennel.hatecomputers.club", "description": "prod"} + ] +) logger = structlog.get_logger()