mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Add isolation debug router with deployment verification endpoint
This commit is contained in:
parent
abbd5444d8
commit
0a9d0df15d
3 changed files with 20 additions and 13 deletions
|
|
@ -93,15 +93,3 @@ if __name__ == "__main__":
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def root():
|
async def root():
|
||||||
return {"Message": "Welcome to LearnHouse ✨"}
|
return {"Message": "Welcome to LearnHouse ✨"}
|
||||||
|
|
||||||
# Debug endpoint for deployment verification
|
|
||||||
@app.get("/debug/deployment")
|
|
||||||
async def debug_deployment():
|
|
||||||
import os
|
|
||||||
return {
|
|
||||||
"deployment_name": os.environ.get('DEPLOYMENT_NAME', 'NOT_SET'),
|
|
||||||
"cookie_domain": learnhouse_config.hosting_config.cookie_config.domain,
|
|
||||||
"api_domain": learnhouse_config.hosting_config.domain,
|
|
||||||
"database_host": learnhouse_config.database_config.sql_connection_string.split('@')[1].split('/')[0] if '@' in learnhouse_config.database_config.sql_connection_string else "unknown",
|
|
||||||
"redis_host": learnhouse_config.redis_config.redis_connection_string.split('@')[1].split(':')[0] if '@' in learnhouse_config.redis_config.redis_connection_string else "unknown"
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import os
|
||||||
from fastapi import APIRouter, Depends
|
from fastapi import APIRouter, Depends
|
||||||
from src.routers import health
|
from src.routers import health
|
||||||
from src.routers import usergroups
|
from src.routers import usergroups
|
||||||
from src.routers import dev, trail, users, auth, orgs, roles, search
|
from src.routers import dev, trail, users, auth, orgs, roles, search, debug
|
||||||
from src.routers.ai import ai
|
from src.routers.ai import ai
|
||||||
from src.routers.courses import chapters, collections, courses, assignments, certifications
|
from src.routers.courses import chapters, collections, courses, assignments, certifications
|
||||||
from src.routers.courses.activities import activities, blocks
|
from src.routers.courses.activities import activities, blocks
|
||||||
|
|
@ -49,6 +49,7 @@ if os.environ.get("CLOUD_INTERNAL_KEY"):
|
||||||
)
|
)
|
||||||
|
|
||||||
v1_router.include_router(health.router, prefix="/health", tags=["health"])
|
v1_router.include_router(health.router, prefix="/health", tags=["health"])
|
||||||
|
v1_router.include_router(debug.router, prefix="/debug", tags=["debug"])
|
||||||
|
|
||||||
# Dev Routes
|
# Dev Routes
|
||||||
v1_router.include_router(
|
v1_router.include_router(
|
||||||
|
|
|
||||||
18
apps/api/src/routers/debug.py
Normal file
18
apps/api/src/routers/debug.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import os
|
||||||
|
from fastapi import APIRouter
|
||||||
|
from config.config import get_learnhouse_config
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.get("/deployment")
|
||||||
|
async def debug_deployment():
|
||||||
|
"""Debug endpoint for deployment verification and isolation testing"""
|
||||||
|
learnhouse_config = get_learnhouse_config()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"deployment_name": os.environ.get('DEPLOYMENT_NAME', 'NOT_SET'),
|
||||||
|
"cookie_domain": learnhouse_config.hosting_config.cookie_config.domain,
|
||||||
|
"api_domain": learnhouse_config.hosting_config.domain,
|
||||||
|
"database_host": learnhouse_config.database_config.sql_connection_string.split('@')[1].split('/')[0] if '@' in learnhouse_config.database_config.sql_connection_string else "unknown",
|
||||||
|
"redis_host": learnhouse_config.redis_config.redis_connection_string.split('@')[1].split(':')[0] if '@' in learnhouse_config.redis_config.redis_connection_string else "unknown"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue