feat(test): action 'debug' — показать переменные окружения (маскированно)
POST /test {"action":"debug"} → LLM_API_KEY, DB_*, etc.
This commit is contained in:
@@ -111,4 +111,15 @@ def test():
|
||||
return jsonify(result), 500
|
||||
return jsonify(result)
|
||||
|
||||
if action == "debug":
|
||||
# Показать переменные окружения (с маскировкой ключей)
|
||||
import os as _os
|
||||
vars_info = {}
|
||||
for k, v in sorted(_os.environ.items()):
|
||||
if any(x in k.upper() for x in ("KEY", "PASS", "SECRET", "TOKEN")):
|
||||
vars_info[k] = v[:6] + "..." if v else "(empty)"
|
||||
elif any(x in k.upper() for x in ("DB_", "LLM_", "FLASK", "PORT")):
|
||||
vars_info[k] = v
|
||||
return jsonify({"env": vars_info, "python": _os.sys.version})
|
||||
|
||||
return jsonify({"error": f"unknown action: {action}"}), 400
|
||||
|
||||
Reference in New Issue
Block a user