summaryrefslogtreecommitdiffstats
path: root/ttun_server/__init__.py
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <tom@vanderlee.io>2026-07-03 15:49:08 +0200
committerGravatar Tom van der Lee <tom@vanderlee.io>2026-07-03 15:49:14 +0200
commit7784c60c03ec277b456db6e2709383e302d9382b (patch)
treea008def666f04041fe77740693d42cfef89af558 /ttun_server/__init__.py
parentfb28c648390464c75ba4903b0e1e0ff2642c8ffb (diff)
downloadserver-7784c60c03ec277b456db6e2709383e302d9382b.tar.gz
server-7784c60c03ec277b456db6e2709383e302d9382b.tar.bz2
server-7784c60c03ec277b456db6e2709383e302d9382b.zip
Added basic oauth flow
Diffstat (limited to 'ttun_server/__init__.py')
-rw-r--r--ttun_server/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py
index d54227a..4af6ca0 100644
--- a/ttun_server/__init__.py
+++ b/ttun_server/__init__.py
@@ -2,10 +2,11 @@ import logging
2import os 2import os
3 3
4from fastapi import FastAPI 4from fastapi import FastAPI
5from starlette.routing import Host, Route, WebSocketRoute 5from starlette.routing import Host, Route, WebSocketRoute, Mount
6 6
7from authentication.endpoints import authentication, oauth
7from proxy import app as proxy_app 8from proxy import app as proxy_app
8from ttun_server.endpoints import health, base_endpoints 9from ttun_server.endpoints import health
9from ttun_server.websockets import tunnel 10from ttun_server.websockets import tunnel
10 11
11logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) 12logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO')))
@@ -13,6 +14,8 @@ logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO')))
13app = FastAPI( 14app = FastAPI(
14 debug=True, 15 debug=True,
15 routes=[ 16 routes=[
17 Mount('/auth/', app=authentication),
18 Mount('/oauth/', app=oauth),
16 WebSocketRoute('/tunnel/', endpoint=tunnel), 19 WebSocketRoute('/tunnel/', endpoint=tunnel),
17 Route('/health/', endpoint=health), 20 Route('/health/', endpoint=health),
18 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) 21 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app)