Add MAX_STATUS_CHARS

This commit is contained in:
bgme 2026-01-30 23:56:31 +08:00
parent 9e67b74d66
commit de081c7930
2 changed files with 5 additions and 1 deletions

View file

@ -88,3 +88,7 @@ S3_ALIAS_HOST=files.example.com
# -----------------------
IP_RETENTION_PERIOD=31556952
SESSION_RETENTION_PERIOD=31556952
# Max status length limit
# Maximum allowed character count of one status
# MAX_STATUS_CHARS=500

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = (ENV['MAX_STATUS_CHARS'] || 500).to_i
URL_PLACEHOLDER_CHARS = 23
URL_PLACEHOLDER = 'x' * 23