feat: show masked config/secrets on dashboard for deployment debugging
All checks were successful
Deploy / deploy (push) Successful in 12s
All checks were successful
Deploy / deploy (push) Successful in 12s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
21
webui.py
21
webui.py
@@ -495,6 +495,17 @@ async def dashboard():
|
|||||||
pull_html = _sync_entry_html(s["last_pull"])
|
pull_html = _sync_entry_html(s["last_pull"])
|
||||||
push_html = _sync_entry_html(s["last_push"])
|
push_html = _sync_entry_html(s["last_push"])
|
||||||
|
|
||||||
|
def _mask(val: str) -> str:
|
||||||
|
if not val:
|
||||||
|
return '<span style="color:#dc3545">NOT SET</span>'
|
||||||
|
if len(val) <= 10:
|
||||||
|
return "***"
|
||||||
|
return f'<code>{val[:6]}***{val[-4:]}</code>'
|
||||||
|
|
||||||
|
outline_url = os.environ.get("OUTLINE_URL", "")
|
||||||
|
outline_tok = _mask(os.environ.get("OUTLINE_TOKEN", ""))
|
||||||
|
ts_authkey = _mask(os.environ.get("TS_AUTHKEY", ""))
|
||||||
|
|
||||||
body = f"""
|
body = f"""
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Vault Status</h2>
|
<h2>Vault Status</h2>
|
||||||
@@ -511,6 +522,16 @@ async def dashboard():
|
|||||||
<a href="/changes" class="btn btn-secondary">Preview Changes</a>
|
<a href="/changes" class="btn btn-secondary">Preview Changes</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
|
</div>
|
||||||
|
<div class="card" style="margin-top:12px">
|
||||||
|
<h2>Config</h2>
|
||||||
|
<table>
|
||||||
|
<tr><th>Key</th><th>Value</th></tr>
|
||||||
|
<tr><td>OUTLINE_URL</td><td><code>{outline_url or '<span style="color:#dc3545">NOT SET</span>'}</code></td></tr>
|
||||||
|
<tr><td>OUTLINE_TOKEN</td><td>{outline_tok}</td></tr>
|
||||||
|
<tr><td>TS_AUTHKEY</td><td>{ts_authkey}</td></tr>
|
||||||
|
<tr><td>APP_VERSION</td><td><code>{APP_VERSION}</code></td></tr>
|
||||||
|
</table>
|
||||||
</div>"""
|
</div>"""
|
||||||
return HTMLResponse(_page("Dashboard", body))
|
return HTMLResponse(_page("Dashboard", body))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user