Add MAX_CHARS 🎉

This commit is contained in:
3wc 2025-06-07 19:00:40 +01:00
parent 72f3ac9af4
commit d79abf04ad
2 changed files with 16 additions and 0 deletions

View File

@ -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!!

View File

@ -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"'