diff --git a/.env.example b/.env.example index 2016955..670640c 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,15 @@ # Telegram chat ID for moderation messages. Required if bot token is set. # BOOK_TELEGRAM_CHAT_ID=0 +# Seconds between retry attempts for failed Telegram notifications. +# BOOK_TELEGRAM_RETRY_INTERVAL=20 + +# Maximum number of retry attempts for failed Telegram notifications. +# BOOK_TELEGRAM_RETRY_LIMIT=3 + +# Seconds between pending entry reminders. Set to 0 to disable. +# BOOK_TELEGRAM_REMINDER_INTERVAL=86400 + # Enable honeypot field for spam prevention. # BOOK_ENABLE_HONEYPOT=true diff --git a/README.md b/README.md index 6552ad0..cee5552 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,15 @@ Running `guestbook` with no env vars will give you a working guestbook on `local # Telegram chat ID for moderation messages. Required if bot token is set. # BOOK_TELEGRAM_CHAT_ID=0 +# Seconds between retry attempts for failed Telegram notifications. +# BOOK_TELEGRAM_RETRY_INTERVAL=20 + +# Maximum number of retry attempts for failed Telegram notifications. +# BOOK_TELEGRAM_RETRY_LIMIT=3 + +# Seconds between pending entry reminders. Set to 0 to disable. +# BOOK_TELEGRAM_REMINDER_INTERVAL=86400 + # Enable honeypot field for spam prevention. # BOOK_ENABLE_HONEYPOT=true @@ -142,16 +151,13 @@ Running `guestbook` with no env vars will give you a working guestbook on `local # Maximum length for website URLs. 0 for unlimited. # BOOK_MAX_WEBSITE_LENGTH=0 -# Separator between guestbook entries. -# BOOK_SEPARATOR=------------------------------------------------------------ - # Path to a CSS file. Takes precedence over BOOK_STYLE. Uses built-in default if unset. # BOOK_STYLE_FILE=./templates/default.css # Custom CSS injected into a style tag. # Classes: .guestbook-form, .guestbook-prompt, .guestbook-label, .guestbook-input, -# .guestbook-textarea, .guestbook-button, .entry-header, .entry-date, .entry-name, -# .entry-website, .entry-body, .entry-separator +# .guestbook-textarea, .guestbook-button, .entry, .entry-header, .entry-date, +# .entry-name, .entry-website, .entry-body # BOOK_STYLE= # Text shown above the form. @@ -239,6 +245,11 @@ services.guestbook = { enable = false; # botTokenFile = ; -- required when enabled # chatId = ; -- required when enabled + retry = { + interval = 20; + limit = 3; + }; + reminderInterval = 86400; }; security = { htmlInjection.enable = false; @@ -264,7 +275,6 @@ services.guestbook = { cssFile = null; templateFile = null; successTemplateFile = null; - separator = "------------------------------------------------------------"; greeting = "Thanks for visiting. Sign the guestbook!"; labels = { submit = "sign"; @@ -288,7 +298,7 @@ Set `BOOK_ENABLE_DRAWINGS=true` to add a drawing canvas to the form. Visitors dr Server-side validation checks the PNG magic bytes (`\x89PNG\r\n\x1a\n`), then reads width/height from the IHDR chunk and rejects anything that doesn't match `BOOK_CANVAS_WIDTH` x `BOOK_CANVAS_HEIGHT`. Max file size is derived from canvas dimensions (`w * h * 4`, the raw RGBA ceiling). A 2MB request body limit is enforced on all form submissions. -When Telegram moderation is enabled, drawings are sent as photos in the notification so you can see them before approving. +When Telegram moderation is enabled, the notification includes a `/drawing_` command to view the drawing on demand. --- @@ -298,7 +308,7 @@ Set `BOOK_ENABLE_VOICE_NOTES=true` to let visitors record a short audio clip alo Server-side validation checks the WebM magic bytes (`\x1a\x45\xdf\xa3`) and enforces a file size cap derived from the max duration (`duration * 10KB`). Voice notes are stored as WebM files in `{data_dir}/voice_notes/` and rendered as native `