diff options
| author | 2026-07-22 17:37:10 +0200 | |
|---|---|---|
| committer | 2026-07-22 17:37:10 +0200 | |
| commit | f28781dd1dd718f45bf1cef82d1ce6eb4792b4ca (patch) | |
| tree | ed5bd923bca11cc75e0568245ea3518a6713041b /ttun_server | |
| parent | 498c79f434856aa68e9a883247ea69a22256fce6 (diff) | |
| download | server-f28781dd1dd718f45bf1cef82d1ce6eb4792b4ca.tar.gz server-f28781dd1dd718f45bf1cef82d1ce6eb4792b4ca.tar.bz2 server-f28781dd1dd718f45bf1cef82d1ce6eb4792b4ca.zip | |
Added management interface
Diffstat (limited to 'ttun_server')
| -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()) |
