ui: remove Hermes API key regenerate button from admin settings

Key is now managed via HERMES_API_KEY env var only.
This commit is contained in:
Troll (Hermes Agent) 2026-08-03 22:55:55 +00:00
parent 107e558aea
commit a72da4c5da
3 changed files with 9 additions and 20 deletions

7
app.py
View file

@ -1173,11 +1173,8 @@ def admin_settings():
return redirect(url_for('admin_settings')) return redirect(url_for('admin_settings'))
elif action == 'regenerate_hermes_key': elif action == 'regenerate_hermes_key':
# Generate a new Hermes API key, persist it, and show it exactly once. # Legacy action: no longer exposed in UI. Key is managed via HERMES_API_KEY env var.
new_key = generate_hermes_api_key() flash('Hermes API key is managed via the HERMES_API_KEY environment variable.', 'info')
set_hermes_api_key(new_key)
session['hermes_key_just_generated'] = new_key
flash('Hermes API key regenerated. Copy it now — it will not be shown again.', 'success')
return redirect(url_for('admin_settings')) return redirect(url_for('admin_settings'))
return render_template( return render_template(

3
booth_settings_test.json Normal file
View file

@ -0,0 +1,3 @@
{
"hermes_api_key": "gAAAAABqcRfLNGwskLTnCfsDK7IQ8nCkUVfngkxSLq74yR9hlwSzO89MiEAZS7r1PU4Lmglq0S1ApjkonkjMEpE0NmT8oka8HfCov6X5Fpr8IJOa-DRJqOhnNL5WM98dsGoydBlGKstj"
}

View file

@ -262,26 +262,15 @@
</form> </form>
</div> </div>
<!-- Email / SMTP configuration --> <!-- Hermes API Key display (env var only; no regeneration) -->
<div class="section"> <div class="section">
<h2>Hermes API Key</h2> <h2>Hermes API Key</h2>
<p class="copy-hint">Hermes uses this key in the Authorization header when POSTing generated Suno prompts back to the callback endpoint.</p> <p class="copy-hint">Hermes uses this key in the Authorization header when POSTing generated Suno prompts back to the callback endpoint. The key is configured via the Portainer environment variable <code>HERMES_API_KEY</code>.</p>
<p><strong>Current key:</strong> <code>{{ hermes_key_masked }}</code></p> <p><strong>Current key:</strong> <code>{{ hermes_key_masked }}</code></p>
{% if hermes_key_just_generated %} {% if not hermes_key_set %}
<div class="flash success" style="background:#064e3b"> <p class="status-bad">⚠️ No Hermes API key is configured. Set the HERMES_API_KEY environment variable in Portainer before using the callback workflow.</p>
<p><strong>New key (copy it now — it will not be shown again):</strong></p>
<p class="path" id="new-hermes-key">{{ hermes_key_just_generated }}</p>
<button type="button" onclick="copyHermesKey()">Copy to clipboard</button>
</div>
{% elif not hermes_key_set %}
<p class="status-bad">⚠️ No Hermes API key is configured. Generate one before using the callback workflow.</p>
{% endif %} {% endif %}
<form method="POST" onsubmit="return confirm('Regenerating the key will invalidate the old one. Hermes will need the new key. Continue?')">
<input type="hidden" name="action" value="regenerate_hermes_key">
<button type="submit">Regenerate API Key</button>
</form>
</div> </div>
<!-- Email / SMTP configuration --> <!-- Email / SMTP configuration -->