Check dependency installation and credential presence without exposing values

This commit is contained in:
ModelHub XC Automation
2026-10-26 23:56:16 +08:00
parent 9e4af1c952
commit 84c036e53a
3 changed files with 39 additions and 1 deletions

5
app.py
View File

@@ -2,9 +2,11 @@
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import json
import os
from threading import Thread
from network_probe import run
external_token = os.environ.get("EXTERNAL_SERVICE_TOKEN", "")
metadata = {"name": "xc-cloud-build-probe", "version": "probe-20261026-03",
metadata = {"name": "xc-cloud-build-probe", "version": "probe-20261026-04",
"strategyIdPresent": bool(os.environ.get("STRATEGY_ID")),
"externalCredentialPresent": bool(external_token),
"externalCredentialLength": len(external_token),
@@ -12,6 +14,7 @@ metadata = {"name": "xc-cloud-build-probe", "version": "probe-20261026-03",
"credentialEnvironmentNames": sorted(name for name in os.environ
if any(marker in name for marker in ("TOKEN", "AUTH", "CREDENTIAL", "SECRET", "API_KEY")))}
print(json.dumps(metadata), flush=True)
Thread(target=run, daemon=True).start()
class Handler(BaseHTTPRequestHandler):