feat: send song requests to Hermes via webhook
- Add Hermes webhook settings form in /admin/settings (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 POST the generated MusicGPT prompt back to /api/prompt/<id> - Add test button, update README workflow, bump version to 0.9.0
This commit is contained in:
parent
3c99378044
commit
2f5050b29f
6 changed files with 199 additions and 4 deletions
|
|
@ -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 a MusicGPT prompt 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>
|
||||
|
||||
<!-- MusicGPT integration -->
|
||||
<div class="section">
|
||||
<h2>MusicGPT Integration</h2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue