Download templates/bot_proxy.html from ItsBounvy/bot_host: direct link, hf CLI and curl.
- Browser
- Download file 10.6 kB
-
https://huggingface.co/spaces/ItsBounvy/bot_host/resolve/main/templates/bot_proxy.html
- Command line
-
hf download hf://spaces/ItsBounvy/bot_host/templates/bot_proxy.html
-
curl -L -o bot_proxy.html https://huggingface.co/spaces/ItsBounvy/bot_host/resolve/main/templates/bot_proxy.html
10.6 kB
| {% extends "base.html" %} | |
| {% block title %}{{ _("Proxy") }} · {{ bot.name }}{% endblock %} | |
| {% block crumbs %} | |
| <a href="/bots" class="parent">{{ _("Bots") }}</a> | |
| <span class="sep">/</span> | |
| <a href="/bots/{{ bot.id }}" class="parent">{{ bot.name }}</a> | |
| <span class="sep">/</span> | |
| <h1>{{ _("Proxy") }}</h1> | |
| {% endblock %} | |
| {% block content %} | |
| <div class="page-header"> | |
| <div> | |
| <h1>{{ _("Host proxy") }}</h1> | |
| <div class="subtitle">{{ _("Every connection to this bot goes through the panel — one entry point, one audit trail.") }}</div> | |
| </div> | |
| </div> | |
| <div class="alert alert-info" style="margin-bottom: 18px;"> | |
| <span class="ico">{{ panel_icon('shield')|safe }}</span> | |
| <div class="alert-body"> | |
| <div class="alert-title">{{ _("Why a proxy?") }}</div> | |
| {{ _("The bot's HF Space can stay") }} <strong>{{ _("private") }}</strong>. {{ _("External callers (Telegram webhooks, integrations, scripts) hit") }} <code>/proxy/{{ bot.slug }}/…</code> {{ _("on this panel, and we forward to the bot. Every request is logged to the audit table.") }} | |
| </div> | |
| </div> | |
| <div class="grid-2"> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <div> | |
| <h2>{{ _("Public URL") }}</h2> | |
| <div class="desc">{{ _("What external services call.") }}</div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="detail-list"> | |
| <div class="detail-row"> | |
| <span class="label">{{ _("Telegram webhook") }}</span> | |
| <span class="value mono" style="font-size: 12.5px;"> | |
| <span data-copy="/proxy/{{ bot.slug }}/telegram/webhook">{{ request.url.scheme }}://{{ request.url.netloc }}/proxy/{{ bot.slug }}/telegram/webhook</span> | |
| <button type="button" class="icon-btn" style="display:inline-grid;width:24px;height:24px;margin-left:4px;" data-copy="/proxy/{{ bot.slug }}/telegram/webhook" title="{{ _("Copy") }}">{{ panel_icon('copy')|safe }}</button> | |
| </span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="label">{{ _("Health endpoint") }}</span> | |
| <span class="value mono" style="font-size: 12.5px;"> | |
| <a href="/proxy/{{ bot.slug }}/health" target="_blank">/proxy/{{ bot.slug }}/health</a> | |
| </span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="label">{{ _("Catch-all") }}</span> | |
| <span class="value mono" style="font-size: 12.5px;"> | |
| /proxy/{{ bot.slug }}/<{{ _("any-path") }}> | |
| </span> | |
| </div> | |
| </div> | |
| <hr> | |
| <h3 class="form-section-title"><span class="ico">{{ panel_icon('key')|safe }}</span> {{ _("Authentication") }}</h3> | |
| <p class="muted" style="font-size: 13px;">{{ _("Two ways to authenticate against the proxy:") }}</p> | |
| <ul style="margin: 0; padding-left: 18px; line-height: 1.7; color: var(--text-muted); font-size: 13px;"> | |
| <li><strong>{{ _("Session cookie") }}</strong> — {{ _("for browser access. Admin or bot owner only.") }}</li> | |
| <li><strong>{{ _("Bearer token") }}</strong> — <code>Authorization: Bearer <llm_proxy_token></code> {{ _("for machine-to-machine traffic.") }}</li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <div> | |
| <h2>{{ _("Health probe") }}</h2> | |
| <div class="desc">{{ _("Round-trip through the proxy to the bot's runtime.") }}</div> | |
| </div> | |
| <button type="button" class="btn btn-sm btn-outline" data-proxy-test>{{ panel_icon('refresh')|safe }} {{ _("Probe") }}</button> | |
| </div> | |
| <div class="card-body"> | |
| <div data-proxy-test-result> | |
| <p class="muted">{{ _("Click") }} <strong>{{ _("Probe") }}</strong> {{ _("to send a request through") }} <code>/proxy/{{ bot.slug }}/health</code>.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <div> | |
| <h2>{{ _("Upstream (Render) — legacy") }}</h2> | |
| <div class="desc">{{ _("If your bot uses a separate Render proxy for LLM traffic, its status is shown here.") }}</div> | |
| </div> | |
| <a href="/bots/{{ bot.id }}?edit=1" class="btn btn-sm btn-outline">{{ panel_icon('edit')|safe }} {{ _("Edit URL") }}</a> | |
| </div> | |
| <div class="card-body"> | |
| {% if not bot.render_url %} | |
| <p class="muted" style="margin: 0;">{{ _("No Render proxy URL configured. The bot either calls LLMs directly or uses the host's own proxy above.") }}</p> | |
| {% else %} | |
| <div class="detail-list"> | |
| <div class="detail-row"> | |
| <span class="label">{{ _("Status") }}</span> | |
| <span class="value"> | |
| {% if health.ok %} | |
| <span class="health-pill healthy"><span class="ico"></span> {{ _("Healthy") }} · {{ health.latency_ms }}ms · HTTP {{ health.status }}</span> | |
| {% elif health.status %} | |
| <span class="health-pill warn"><span class="ico"></span> HTTP {{ health.status }}</span> | |
| {% else %} | |
| <span class="health-pill down"><span class="ico"></span> {{ _("Unreachable") }}</span> | |
| {% endif %} | |
| </span> | |
| </div> | |
| <div class="detail-row"><span class="label">{{ _("URL") }}</span><span class="value mono" style="font-size: 12.5px;"><a href="{{ bot.render_url }}" target="_blank" rel="noopener">{{ bot.render_url }}</a></span></div> | |
| <div class="detail-row"><span class="label">{{ _("Path probed") }}</span><span class="value mono" style="font-size: 12.5px;">{{ health.path or '—' }}</span></div> | |
| {% if health.error %}<div class="detail-row"><span class="label">{{ _("Error") }}</span><span class="value muted" style="font-size: 12px;">{{ health.error }}</span></div>{% endif %} | |
| </div> | |
| {% endif %} | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <div> | |
| <h2>{{ _("Recent proxy traffic") }}</h2> | |
| <div class="desc">{{ _("Last requests routed through") }} <code>/proxy/{{ bot.slug }}/…</code>.</div> | |
| </div> | |
| <a href="/admin/audit?target_type=bot&target_id={{ bot.id }}" class="btn btn-sm btn-ghost">{{ _("Open audit log") }}</a> | |
| </div> | |
| <div class="card-body" style="padding: 0;"> | |
| <div class="table-wrap" style="border: 0; border-radius: 0;"> | |
| <table class="table"> | |
| <thead><tr><th>{{ _("When") }}</th><th>{{ _("Method") }}</th><th>{{ _("Path") }}</th><th>{{ _("Status") }}</th><th>{{ _("Latency") }}</th><th>{{ _("User") }}</th></tr></thead> | |
| <tbody data-proxy-audit-body> | |
| <tr><td colspan="6" class="muted" style="text-align:center; padding: 18px;">{{ _("Loading…") }}</td></tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| {% endblock %} | |
| {% block scripts %} | |
| <script> | |
| </script> | |
| {% endblock %} | |