vggonz hat die Gist bearbeitet 1 day ago. Zu Änderung gehen
1 file changed, 5 insertions
character_limit.sh
| @@ -3,9 +3,14 @@ | |||
| 3 | 3 | # Run from the same dir as the docker-compose.yaml file | |
| 4 | 4 | # https://gist.github.com/adlerweb/ccc6323b77148cad06fff98c232e6212 | |
| 5 | 5 | POST_LIMIT=${1:-2000} | |
| 6 | + | POLL_LIMIT=${2:-16} | |
| 7 | + | POLL_POST_LIMIT=${3:-100} | |
| 6 | 8 | ||
| 7 | 9 | 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 | |
| 8 | 10 | docker compose exec --user=root web sed -i "s/MAX_CHARS = [0-9]\+/MAX_CHARS = $POST_LIMIT/g" app/validators/status_length_validator.rb | |
| 11 | + | docker compose exec --user=root web sed -i "s/MAX_OPTIONS = [0-9]\+/MAX_OPTIONS = $POLL_LIMIT/g" app/validators/poll_options_validator.rb | |
| 12 | + | docker compose exec --user=root web sed -i "s/MAX_OPTION_CHARS = [0-9]\+/MAX_OPTION_CHARS = $POLL_POST_LIMIT/g" app/validators/poll_options_validator.rb | |
| 13 | + | ||
| 9 | 14 | docker compose exec --user=root web bundle exec rails assets:precompile | |
| 10 | 15 | ||
| 11 | 16 | docker compose restart web | |
vggonz hat die Gist bearbeitet 5 months ago. Zu Änderung gehen
1 file changed, 11 insertions
character_limit.sh(Datei erstellt)
| @@ -0,0 +1,11 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Increases post character limit on mastodon docker container | |
| 3 | + | # Run from the same dir as the docker-compose.yaml file | |
| 4 | + | # https://gist.github.com/adlerweb/ccc6323b77148cad06fff98c232e6212 | |
| 5 | + | POST_LIMIT=${1:-2000} | |
| 6 | + | ||
| 7 | + | 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 | |
| 8 | + | docker compose exec --user=root web sed -i "s/MAX_CHARS = [0-9]\+/MAX_CHARS = $POST_LIMIT/g" app/validators/status_length_validator.rb | |
| 9 | + | docker compose exec --user=root web bundle exec rails assets:precompile | |
| 10 | + | ||
| 11 | + | docker compose restart web | |