Skip to content

Instantly share code, notes, and snippets.

@dmitriiweb
Forked from adlerweb/postLimit.sh
Created April 18, 2025 22:09
Show Gist options
  • Select an option

  • Save dmitriiweb/7264f0dd3daf6cd3ebd633aab46a0d1b to your computer and use it in GitHub Desktop.

Select an option

Save dmitriiweb/7264f0dd3daf6cd3ebd633aab46a0d1b to your computer and use it in GitHub Desktop.

Revisions

  1. @adlerweb adlerweb revised this gist Feb 27, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions postLimit.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    #!/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
  2. @adlerweb adlerweb revised this gist Dec 18, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion postLimit.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,8 @@
    # Mastodon v4.3.x docker character limit change
    # 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 original to 2500
    # ./postLimit.sh 2500 → change post limit to 2500
    # Must be executed in the directory Mastodons docker-compose.yaml is located

    set -e

  3. @adlerweb adlerweb created this gist Dec 18, 2024.
    15 changes: 15 additions & 0 deletions postLimit.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash
    # Mastodon v4.3.x docker character limit change
    # 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 original to 2500

    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