Raise request form rate limit from 5/min to 60/min (booth shares one IP)

This commit is contained in:
Troll (Hermes Agent) 2026-09-20 16:14:41 +00:00
parent 868b59077f
commit 6067b668ac
3 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
# Theme Song Booth (MusicGPT Edition) # Theme Song Booth (MusicGPT Edition)
![Version](https://img.shields.io/badge/version-v0.9.3-blue) ![Version](https://img.shields.io/badge/version-v0.9.4-blue)
A Flask web application for running a convention booth where visitors request a custom AI-generated theme song. Operators manage the queue from an admin dashboard, generate prompts via Hermes, queue generations through the MusicGPT API, and deliver final songs by email. A Flask web application for running a convention booth where visitors request a custom AI-generated theme song. Operators manage the queue from an admin dashboard, generate prompts via Hermes, queue generations through the MusicGPT API, and deliver final songs by email.
@ -42,7 +42,7 @@ The MusicGPT fork automates song generation: instead of manually creating songs
| Page | Path | Purpose | | Page | Path | Purpose |
|------|------|---------| |------|------|---------|
| Request form | `/request` | Visitors enter email, name, pronouns, hobbies, notable facts, and extra requests. The music style is picked from three dropdowns: **Decade** (required), **Basic style** (required), and **Additional style** (optional). Decades and genres are loaded from `/mnt/Storage/Decades.txt` and `/mnt/Storage/music_genres_grouped.txt` (a grouped file where section headings are rendered as non-selectable dropdown groups). Rate limited to 5 submissions per minute per IP. | | Request form | `/request` | Visitors enter email, name, pronouns, hobbies, notable facts, and extra requests. The music style is picked from three dropdowns: **Decade** (required), **Basic style** (required), and **Additional style** (optional). Decades and genres are loaded from `/mnt/Storage/Decades.txt` and `/mnt/Storage/music_genres_grouped.txt` (a grouped file where section headings are rendered as non-selectable dropdown groups). Rate limited to 60 submissions per minute per IP (a shared booth IP means many visitors hit the same address). |
| Closed page | `/request` (when booth is closed) | Shows a friendly closed banner instead of the form when the operator marks the booth closed. | | Closed page | `/request` (when booth is closed) | Shows a friendly closed banner instead of the form when the operator marks the booth closed. |
| Thanks | `/thanks/<id>` | Confirmation page shown after a request is submitted. | | Thanks | `/thanks/<id>` | Confirmation page shown after a request is submitted. |
| Order status | `/status` | Customers enter their email to see all their requests and statuses. | | Order status | `/status` | Customers enter their email to see all their requests and statuses. |

View file

@ -1 +1 @@
0.9.3 0.9.4

4
app.py
View file

@ -167,14 +167,14 @@ def index():
@app.route('/request', methods=['GET', 'POST']) @app.route('/request', methods=['GET', 'POST'])
@limiter.limit("5 per minute") @limiter.limit("60 per minute")
def request_form(): def request_form():
""" """
Public request form. Public request form.
GET -> shows the form with the banner image, or a closed message if the booth is closed. GET -> shows the form with the banner image, or a closed message if the booth is closed.
POST -> validates the email, creates a database record, sends a POST -> validates the email, creates a database record, sends a
confirmation email, and redirects to the thanks page. confirmation email, and redirects to the thanks page.
Rate limited to 5 submissions per minute per IP. Rate limited to 60 submissions per minute per IP (a shared booth IP means many visitors hit the same address).
""" """
if not get_booth_open(): if not get_booth_open():
return render_template('closed.html') return render_template('closed.html')