-
-
Save dmitriiweb/7264f0dd3daf6cd3ebd633aab46a0d1b to your computer and use it in GitHub Desktop.
Mastodon v4.3.x (<4.3.4) docker post character limit change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Mastodon v4.3.x docker character limit change | |
| # Does *NOT* word with >= 4.3.4 as the handling was changed | |
| # Based on https://mpp-service.de/en/mastodon-character-limit-increase-in-a-docker-environment/ | |
| # Based on https://fouquet.me/2024/10/10/mastodon-4-3-char-limit | |
| # ./postLimit.sh 2500 → change post limit to 2500 | |
| # Must be executed in the directory Mastodons docker-compose.yaml is located | |
| set -e | |
| POST_LIMIT=${1:-2500} | |
| export TMPDIR=/tmp | |
| docker-compose exec --user=root web sed -i "s/max_characters'], [0-9]\+/max_characters'], $POST_LIMIT)/g" app/javascript/mastodon/features/compose/containers/compose_form_container.js | |
| docker-compose exec --user=root web sed -i "s/MAX_CHARS = [0-9]\+/MAX_CHARS = $POST_LIMIT/g" app/validators/status_length_validator.rb | |
| docker-compose restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment