This commit is contained in:
Tony Rewin 2023-10-06 05:30:48 +03:00
parent cff2530421
commit b87861345f
4 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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