diff options
Diffstat (limited to 'ttun_server/__init__.py')
| -rw-r--r-- | ttun_server/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py index f5d6b45..388dd9e 100644 --- a/ttun_server/__init__.py +++ b/ttun_server/__init__.py | |||
| @@ -7,6 +7,7 @@ from starlette.routing import Host, Route, WebSocketRoute, Mount | |||
| 7 | 7 | ||
| 8 | from authentication.backend import BearerTokenAuthBackend | 8 | from authentication.backend import BearerTokenAuthBackend |
| 9 | from authentication.endpoints import authentication, oauth | 9 | from authentication.endpoints import authentication, oauth |
| 10 | from management.endpoints import management | ||
| 10 | from proxy import app as proxy_app | 11 | from proxy import app as proxy_app |
| 11 | from ttun_server.endpoints import health | 12 | from ttun_server.endpoints import health |
| 12 | from ttun_server.websockets import tunnel | 13 | from ttun_server.websockets import tunnel |
| @@ -16,6 +17,7 @@ logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) | |||
| 16 | app = FastAPI( | 17 | app = FastAPI( |
| 17 | debug=True, | 18 | debug=True, |
| 18 | routes=[ | 19 | routes=[ |
| 20 | Mount('/management/', app=management), | ||
| 19 | Mount('/auth/', app=authentication), | 21 | Mount('/auth/', app=authentication), |
| 20 | Mount('/oauth/', app=oauth), | 22 | Mount('/oauth/', app=oauth), |
| 21 | WebSocketRoute( | 23 | WebSocketRoute( |
| @@ -24,7 +26,7 @@ app = FastAPI( | |||
| 24 | ), | 26 | ), |
| 25 | Route('/health/', endpoint=health), | 27 | Route('/health/', endpoint=health), |
| 26 | Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) | 28 | Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) |
| 27 | ] | 29 | ], |
| 28 | ) | 30 | ) |
| 29 | 31 | ||
| 30 | app.add_middleware(AuthenticationMiddleware, backend=BearerTokenAuthBackend()) | 32 | app.add_middleware(AuthenticationMiddleware, backend=BearerTokenAuthBackend()) |
