mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Fix scanner/api communications
This commit is contained in:
parent
c5d05d69aa
commit
0ef3348e9c
@ -103,7 +103,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "4389:4389"
|
- "4389:4389"
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://api:3567/api}
|
# Use this env var once we use mTLS for auth
|
||||||
|
# - KYOO_URL=${KYOO_URL:-http://api:3567/api}
|
||||||
|
- KYOO_URL=${KYOO_URL:-http://traefik:8901/api}
|
||||||
- JWKS_URL=http://auth:4568/.well-known/jwks.json
|
- JWKS_URL=http://auth:4568/.well-known/jwks.json
|
||||||
- JWT_ISSUER=${PUBLIC_URL}
|
- JWT_ISSUER=${PUBLIC_URL}
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -15,17 +15,15 @@ logger = getLogger(__name__)
|
|||||||
|
|
||||||
class KyooClient(metaclass=Singleton):
|
class KyooClient(metaclass=Singleton):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
api_key = os.environ.get("KYOO_APIKEY")
|
|
||||||
if not api_key:
|
|
||||||
print("Missing environment variable 'KYOO_APIKEY'.")
|
|
||||||
exit(2)
|
|
||||||
self._client = ClientSession(
|
self._client = ClientSession(
|
||||||
base_url=os.environ.get("KYOO_URL", "http://api:3567/api") + "/",
|
base_url=os.environ.get("KYOO_URL", "http://api:3567/api") + "/",
|
||||||
headers={
|
headers={
|
||||||
"User-Agent": "kyoo scanner v5",
|
"User-Agent": "kyoo scanner v5",
|
||||||
"X-API-KEY": api_key,
|
"Content-type": "application/json",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
if api_key := os.environ.get("KYOO_APIKEY"):
|
||||||
|
self._client.headers["X-API-KEY"] = api_key
|
||||||
|
|
||||||
async def __aenter__(self):
|
async def __aenter__(self):
|
||||||
return self
|
return self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user