diff --git a/.env.production.sample b/.env.production.sample index 9ff63c49e..04a5d71a6 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -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 \ No newline at end of file diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb index 575aaf186..fdfa4b51f 100644 --- a/app/validators/status_length_validator.rb +++ b/app/validators/status_length_validator.rb @@ -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