feat: reimplements the captcha and related options

This commit is contained in:
Lewis Wynne 2026-04-09 19:11:45 +01:00
parent 726fe55eb8
commit 75f1644cc1
5 changed files with 242 additions and 30 deletions

View file

@ -25,16 +25,31 @@ BOOK_ENABLE_WEBSITE_LINKS=true
# Allow raw HTML/JS in entry names and message bodies. When false, HTML is escaped.
# Website URLs are always escaped regardless of this setting.
BOOK_ENABLE_HTML_INJECTION=true
BOOK_ENABLE_HTML_INJECTION=false
# Enable captcha on submission form.
BOOK_ENABLE_CAPTCHA=false
# Captcha question displayed as a label.
# BOOK_CAPTCHA_QUESTION=What is my name?
# Captcha answer to validate against.
# BOOK_CAPTCHA_ANSWER=lew
# Require exact match (true) or just "contains" (false).
BOOK_CAPTCHA_EXACT=false
# Require case-sensitive match.
BOOK_CAPTCHA_CASESENSITIVE=false
# Maximum length for names. 0 for unlimited.
BOOK_MAX_NAME_LENGTH=50
BOOK_MAX_NAME_LENGTH=0
# Maximum length for messages. 0 for unlimited.
BOOK_MAX_MESSAGE_LENGTH=1000
BOOK_MAX_MESSAGE_LENGTH=0
# Maximum length for website URLs. 0 for unlimited.
BOOK_MAX_WEBSITE_LENGTH=100
BOOK_MAX_WEBSITE_LENGTH=0
# Separator between guestbook entries.
BOOK_SEPARATOR=------------------------------------------------------------
@ -49,7 +64,7 @@ BOOK_SEPARATOR=------------------------------------------------------------
# BOOK_STYLE=
# Text shown above the form.
BOOK_FORM_PROMPT=If you visited my site, please sign my guestbook!
BOOK_FORM_PROMPT=Thanks for visiting. Sign the guestbook!
# Submit button text.
BOOK_BUTTON_TEXT=sign