Make Digital Beautiful.

und schnell

Mastodon character limit increase – in a Docker environment

For the Docker Mastodon admin newbies.

With the script, you increase the character limit to 5000 characters for your instance.


#!/bin/bash
docker-compose exec web sed -i ‘s/500/5000/g’ app/javascript/mastodon/features/compose/components/compose_form.js
docker-compose exec web sed -i ‘s/500/5000/g’ app/validators/status_length_validator.rb
docker-compose exec web sed -i ‘s/:registrations/:registrations, :max_toot_chars /g’ app/serializers/rest/instance_serializer.rb
docker-compose exec web sed -i ‘s/private/def max_toot_charsn 5000n endnn private/g’ app/serializers/rest/instance_serializer.rb
docker-compose exec web bundle exec rails assets:precompile && echo “pass” || echo “fail”

docker-compose restart


Save the whole thing as 5000.sh.
Then with
Chmod +x 5000.sh
to make it executable. Now you can execute the script with
./5000.sh
wait a moment and you have 5000 characters.

Tested with Mastodon v4.1.0rc3

I myself have only slightly modified the script from this forum post here
https://forums.unraid.net/topic/74350-request-mastodon/

#mastodon #mastoadmin #characterlimit #docker #vps #linux #dockerizedmastodon

Mastdon 4.2 and newer update

#!/bin/bash
docker-compose exec web sed -i ‘s/500/5000/g’ app/javascript/mastodon/features/compose/components/compose_form.jsx
docker-compose exec web sed -i ‘s/500/5000/g’ app/validators/status_length_validator.rb
docker-compose exec web sed -i ‘s/:registrations/:registrations, :max_toot_chars /g’ app/serializers/rest/instance_serializer.rb
docker-compose exec web sed -i ‘s/private/def max_toot_charsn 5000n endnn private/g’ app/serializers/rest/instance_serializer.rb
docker-compose exec web bundle exec rails assets:precompile && echo “pass” || echo “fail”

docker-compose restart

The difference is that the compose_form.js is now named compose_form.jsx

Leave a Comment