Dernière activité 1 day ago

Increases post character limit on mastodon docker container

character_limit.sh Brut
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
5POST_LIMIT=${1:-2000}
6POLL_LIMIT=${2:-16}
7POLL_POST_LIMIT=${3:-100}
8
9docker 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
10docker compose exec --user=root web sed -i "s/MAX_CHARS = [0-9]\+/MAX_CHARS = $POST_LIMIT/g" app/validators/status_length_validator.rb
11docker compose exec --user=root web sed -i "s/MAX_OPTIONS = [0-9]\+/MAX_OPTIONS = $POLL_LIMIT/g" app/validators/poll_options_validator.rb
12docker 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
14docker compose exec --user=root web bundle exec rails assets:precompile
15
16docker compose restart web