feat: send song requests to Hermes via webhook

- Add Hermes webhook platform support on ntfy.hallsworth.ca
- Add /admin/settings form to configure webhook URL + HMAC secret
- Add /admin/request/<id>/send-to-hermes action
- POST request data to Hermes with V2 HMAC signature and callback URL
- Hermes can reply via chat or POST the Suno prompt back to /api/prompt/<id>
- Add test button, update README, bump version to 0.7.0
This commit is contained in:
Troll (Hermes Agent) 2026-08-24 22:49:08 +00:00
parent d058d8db1d
commit d7ed56f34e
6 changed files with 213 additions and 15 deletions

View file

@ -326,6 +326,9 @@
<div class="section">
<h2>1. Generate &amp; Save Suno Prompt</h2>
<button type="button" onclick="copyPromptForHermes()">Copy customer info for Hermes</button>
<form method="POST" action="{{ url_for('send_to_hermes', rid=req.id) }}" style="display:inline">
<button type="submit" onclick="return confirm('Send this request to Hermes to generate a Suno prompt?')">🚀 Send to Hermes</button>
</form>
<p class="copy-hint">Paste Hermes' Title, Style, and Lyrics directly into the fields below, then save.</p>
<form method="POST">

View file

@ -339,6 +339,37 @@
</form>
</div>
<!-- Hermes webhook integration -->
<div class="section">
<h2>Hermes Webhook</h2>
<p class="copy-hint">Push song request data to Hermes so it can generate Suno prompts automatically. The URL must include the route name (e.g. https://ntfy.hallsworth.ca/webhooks/trollgorithm-song-info). The secret is encrypted before storage.</p>
<form method="POST">
<input type="hidden" name="action" value="save_hermes_webhook">
<table class="meta-table">
<tr>
<td>Webhook URL</td>
<td><input type="text" id="hermes_webhook_url" name="hermes_webhook_url" value="{{ hermes_webhook.get('url', '') }}" placeholder="https://ntfy.hallsworth.ca/webhooks/trollgorithm-song-info"></td>
</tr>
<tr>
<td>HMAC Secret</td>
<td>
<input type="password" id="hermes_webhook_secret" name="hermes_webhook_secret" placeholder="{% if hermes_webhook.get('secret') %}Stored encrypted — type to replace{% else %}Enter secret{% endif %}">
<p class="copy-hint">From the Hermes webhook subscription. Leave blank to keep the existing stored secret.</p>
</td>
</tr>
</table>
<button type="submit">Save Hermes Webhook</button>
</form>
<hr style="border:none;border-top:1px solid var(--border);margin:1.5rem 0;">
<h3>Send Test Request</h3>
<form method="POST">
<input type="hidden" name="action" value="send_test_hermes_webhook">
<button type="submit">Send Test to Hermes</button>
</form>
</div>
<!-- Email / SMTP configuration -->
<div class="section">
<h2>Email (SMTP) Settings</h2>