aboutsummaryrefslogtreecommitdiffstats
path: root/ttun_server/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ttun_server/__init__.py')
-rw-r--r--ttun_server/__init__.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py
index 388dd9e..6e1eabf 100644
--- a/ttun_server/__init__.py
+++ b/ttun_server/__init__.py
@@ -3,7 +3,7 @@ import os
3 3
4from fastapi import FastAPI 4from fastapi import FastAPI
5from starlette.middleware.authentication import AuthenticationMiddleware 5from starlette.middleware.authentication import AuthenticationMiddleware
6from starlette.routing import Host, Route, WebSocketRoute, Mount 6from starlette.routing import Host, Mount, Route, WebSocketRoute
7 7
8from authentication.backend import BearerTokenAuthBackend 8from authentication.backend import BearerTokenAuthBackend
9from authentication.endpoints import authentication, oauth 9from authentication.endpoints import authentication, oauth
@@ -12,20 +12,20 @@ from proxy import app as proxy_app
12from ttun_server.endpoints import health 12from ttun_server.endpoints import health
13from ttun_server.websockets import tunnel 13from ttun_server.websockets import tunnel
14 14
15logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) 15logging.basicConfig(level=getattr(logging, os.environ.get("LOG_LEVEL", "INFO")))
16 16
17app = FastAPI( 17app = FastAPI(
18 debug=True, 18 debug=True,
19 routes=[ 19 routes=[
20 Mount('/management/', app=management), 20 Mount("/management/", app=management),
21 Mount('/auth/', app=authentication), 21 Mount("/auth/", app=authentication),
22 Mount('/oauth/', app=oauth), 22 Mount("/oauth/", app=oauth),
23 WebSocketRoute( 23 WebSocketRoute(
24 '/tunnel/', 24 "/tunnel/",
25 endpoint=tunnel, 25 endpoint=tunnel,
26 ), 26 ),
27 Route('/health/', endpoint=health), 27 Route("/health/", endpoint=health),
28 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) 28 Host(f"{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}", app=proxy_app),
29 ], 29 ],
30) 30)
31 31
@@ -33,6 +33,7 @@ app.add_middleware(AuthenticationMiddleware, backend=BearerTokenAuthBackend())
33 33
34try: 34try:
35 from ._version import version 35 from ._version import version
36
36 __version__ = version 37 __version__ = version
37except ImportError: 38except ImportError:
38 __version__ = 'development' 39 __version__ = "development"