Sadeep Sachintha commited on
Commit ·
dc02f8a
1
Parent(s): 8ae4c35
diagnostics: include safe environment variables details
Browse files
main.py
CHANGED
|
@@ -157,7 +157,18 @@ async def telegram_webhook(request: Request):
|
|
| 157 |
@app.get("/api/diagnostics")
|
| 158 |
async def get_diagnostics():
|
| 159 |
"""Retrieve connection and network resolution diagnostic logs."""
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
@app.get("/health")
|
| 163 |
async def health_check():
|
|
|
|
| 157 |
@app.get("/api/diagnostics")
|
| 158 |
async def get_diagnostics():
|
| 159 |
"""Retrieve connection and network resolution diagnostic logs."""
|
| 160 |
+
import os
|
| 161 |
+
env_info = {
|
| 162 |
+
"DATABASE_URL_set": bool(os.getenv("DATABASE_URL")),
|
| 163 |
+
"WEBHOOK_URL_val": os.getenv("WEBHOOK_URL"),
|
| 164 |
+
"TELEGRAM_API_SERVER_val": os.getenv("TELEGRAM_API_SERVER"),
|
| 165 |
+
"BOT_TOKEN_set": bool(os.getenv("BOT_TOKEN")),
|
| 166 |
+
"FX_API_KEY_set": bool(os.getenv("FX_API_KEY"))
|
| 167 |
+
}
|
| 168 |
+
return {
|
| 169 |
+
"diagnostics": diagnostic_results,
|
| 170 |
+
"env_info": env_info
|
| 171 |
+
}
|
| 172 |
|
| 173 |
@app.get("/health")
|
| 174 |
async def health_check():
|