mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix scanner/api communications
This commit is contained in:
parent
c5d05d69aa
commit
0ef3348e9c
@ -103,7 +103,9 @@ services:
|
||||
ports:
|
||||
- "4389:4389"
|
||||
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
|
||||
- JWT_ISSUER=${PUBLIC_URL}
|
||||
volumes:
|
||||
|
@ -15,17 +15,15 @@ logger = getLogger(__name__)
|
||||
|
||||
class KyooClient(metaclass=Singleton):
|
||||
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(
|
||||
base_url=os.environ.get("KYOO_URL", "http://api:3567/api") + "/",
|
||||
headers={
|
||||
"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):
|
||||
return self
|
||||
|
Loading…
x
Reference in New Issue
Block a user