Mastodon developers insist on having the max post length being limited to 500 characters. While it’s their software and they can do whatever they want, it’s also open source, so I can do whatever I want with it.

Previously, that meant re-building both the frontend and the backend, because the limit was explicit in both.

With Masotodon 4.3.0, a new change landed, letting the fronted deduce the limit from the backend’s configuration. That means the patch is now much slimmer:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb
index dc841ded3..9cb1ec94b 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 = 5000
   URL_PLACEHOLDER_CHARS = 23
   URL_PLACEHOLDER = 'x' * 23

If you run mastodon on nixos, the simplest way to apply the patch would be to add the following to your configuration:

1
2
3
services.mastodon.package = pkgs.callPackage "${pkgs.path}/pkgs/servers/mastodon" {
  patches = [ ./charlimit.patch ];
};