From b87861345f5b9e8bede24d9a23dcf67ffdc67831 Mon Sep 17 00:00:00 2001 From: Tony Rewin Date: Fri, 6 Oct 2023 05:30:48 +0300 Subject: [PATCH] port=80 --- Dockerfile | 2 +- resolvers/unread.py | 3 --- services/auth.py | 6 +++++- settings.py | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9d28e1..3c56ab5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:slim WORKDIR /app -EXPOSE 8080 +EXPOSE 80 ADD nginx.conf.sigil ./ COPY requirements.txt . RUN apt-get update && apt-get install -y gcc && pip install -r requirements.txt diff --git a/resolvers/unread.py b/resolvers/unread.py index c19f30a..c1872a9 100644 --- a/resolvers/unread.py +++ b/resolvers/unread.py @@ -31,6 +31,3 @@ async def resolve_total_unread_counter(_, info): author_id = info.context["author_id"] return get_total_unread_counter(author_id) - - -unread_resolvers = {"Query": {"totalUnreadCounter": resolve_total_unread_counter}} diff --git a/services/auth.py b/services/auth.py index 5b8557e..62a9b76 100644 --- a/services/auth.py +++ b/services/auth.py @@ -19,7 +19,11 @@ async def check_auth(req): if response.status_code != 200: return False, None r = response.json() - user_id = r.get("data", {}).get("session", {}).get("user", {}).get("id", None) + user_id = ( + r.get("data", {}).get("getSession", {}).get("user", {}).get("id", None) + if INTERNAL_AUTH_SERVER + else r.get("data", {}).get("session", {}).get("user", {}).get("id", None) + ) is_authenticated = user_id is not None return is_authenticated, user_id diff --git a/settings.py b/settings.py index 29d0ebd..451aad0 100644 --- a/settings.py +++ b/settings.py @@ -1,6 +1,6 @@ from os import environ -PORT = 8080 +PORT = 80 REDIS_URL = environ.get("REDIS_URL") or "redis://127.0.0.1" API_BASE = environ.get("API_BASE") or "" AUTH_URL = environ.get("AUTH_URL") or ""