diff --git a/api/src/index.ts b/api/src/index.ts index 3eeb325f..2ba8c418 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -16,7 +16,8 @@ const app = new Elysia() scalarConfig: { sources: [ { slug: "kyoo", url: "/swagger/json" }, - { slug: "keibi", url: "http://localhost:4568/auth/swagger/doc.json" }, + { slug: "keibi", url: "/auth/swagger/doc.json" }, + { slug: "scanner", url: "/scanner/openapi.json" }, ], }, documentation: { diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d0cfb7ac..5e0290aa 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -107,6 +107,13 @@ services: volumes: - ./scanner:/app - ${LIBRARY_ROOT}:/video:ro + labels: + - "traefik.enable=true" + - "traefik.http.routers.scanner.rule=PathPrefix(`/scanner/`)" + - "traefik.http.routers.scanner.middlewares=phantom-token" + - "traefik.http.middlewares.phantom-token.forwardauth.address=http://auth:4568/auth/jwt" + - "traefik.http.middlewares.phantom-token.forwardauth.authRequestHeaders=Authorization,X-Api-Key" + - "traefik.http.middlewares.phantom-token.forwardauth.authResponseHeaders=Authorization" transcoder: <<: *transcoder-base diff --git a/scanner/scanner/__init__.py b/scanner/scanner/__init__.py index 48019fd2..2c4005a8 100644 --- a/scanner/scanner/__init__.py +++ b/scanner/scanner/__init__.py @@ -1,6 +1,11 @@ from fastapi import FastAPI -app = FastAPI() +app = FastAPI( + title="Scanner", + description="API to control the long running scanner or interacting with external databases (themoviedb, tvdb...)\n\n" + + "Most of those APIs are for admins only.", + openapi_prefix="/scanner", +) @app.get("/items/{item_id}")