From d79abf04ad8c5b58a09f61ae42cb3ff5fafd82cf Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sat, 7 Jun 2025 19:00:40 +0100 Subject: [PATCH] =?UTF-8?q?Add=20MAX=5FCHARS=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.sample | 4 ++++ compose.character-limit.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 compose.character-limit.yml diff --git a/.env.sample b/.env.sample index f720df6..91e3115 100644 --- a/.env.sample +++ b/.env.sample @@ -15,6 +15,10 @@ LETS_ENCRYPT_ENV=production COMPOSE_FILE="compose.yml" +# Set the maximum length for toots (posts). Longer posts from other servers will still be displayed, this limit only applies to users on this instance. +#MAX_CHARS=500 +#COMPOSE_FILE="$COMPOSE_FILE:compose.character-limit.yml" + # Federation # ---------- # DO NOT CHANGE DOMAIN VARIABLES AFTER DEPLOYMENT! WILL BREAK FEDERATION!! diff --git a/compose.character-limit.yml b/compose.character-limit.yml new file mode 100644 index 0000000..44ac2c1 --- /dev/null +++ b/compose.character-limit.yml @@ -0,0 +1,12 @@ +--- +version: "3.8" + +services: + app: + environment: + - MAX_CHARS + # NOTE: See [0] for background on why this is necessary + # [0]: See https://github.com/mastodon/mastodon/pull/30091 + user: root + command: > + /bin/sh -c 'set -x && ls && sed -i -e "s/500/$MAX_CHARS/g" app/javascript/mastodon/features/compose/components/compose_form.jsx && sed -i -e "s/500/$MAX_CHARS/g" app/validators/status_length_validator.rb && RAILS_ENV=production && rm -f /mastodon/tmp/pids/server.pid && su -c "bundle exec rails s -p 3000"'