[Mastodon] How to change character limit?

TLDR: How do I change the Mastodon character limit when it’s installed by Yunohost? The steps I’ve found don’t work.

My YunoHost server

Hardware: VPS bought online
YunoHost version: (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:
If your request is related to an app, specify its name and version: Mastodon v4.1.3~ynh1

Description of my issue

I have set up my own Mastodon instance and it’s working fine, but my current server has a limit of 1000 characters rather than the default 500. This is what I’m used to, so I would like to have that limit on my own instance too.

I’ve found lots of guides online about how to do it, most of them are old but this one seems pretty current:

First hurdle is I’m not able to change to the Mastodon user (not even sure there is one?). If I run command “su - Mastodon”, it asks for a password and I don’t have one for that user. So I’ve tried the steps as my admin user, and as root.

I ignored the git checkout stuff and just edited the the files, I was able to follow the steps up until recompiling Mastodon. The command is:

RAILS_ENV=production bundle exec rails assets:precompile

This is supposed to be run from the “live” folder, and I couldn’t get there from my admin user (doesn’t have permission) so I ran it as root. The error I get is: “bundle: command not found”.

I’ve searched and can’t find anything that looks applicable.

How can I recompile Mastodon to incorporate the changes I made to the config files? Or is there another way to change the character limit?

1 Like

The trick is to log in as the correct user – mastodon. But just using su will fail because the user does not have a default shell.

So, do this, as root:
su - -s /bin/bash mastodon

Once you do that all the sweetmeat customizations will work.

1 Like

Thanks, but it asks for a password and I don’t seem to have one! It’s not the root password or my admin user’s password…

Be sure you “sudo su” to root BEFORE you execute that command, so you are not prompted for the nonexistent mastodon user password.

1 Like

Perfect, thank you!

Would you mind both of you testing this new command?

sudo yunohost app shell mastodon

It should bring up a shell where you are already logged in as mastodon and in its directory.

1 Like

It returned an error:

+ echo '! Helper used in legacy mode !'
+ set +x
+ [[ ! /bin/bash =~ /?bash$ ]]
++ yunohost app list --output-as json --quiet
++ jq -r '.apps[].id'
+ installed_apps_list=('mastodon' 'my_webapp' 'pixelfed')
+ local installed_apps_list
+ [[  mastodon my_webapp pixelfed  != *\ \m\a\s\t\o\d\o\n\ * ]]
+ id -u mastodon
++ ynh_app_setting_get --app=mastodon --key=install_dir
++ local _globalapp=mastodon
++ local legacy_args=ak
++ args_array=(['a']='app=' ['k']='key=')
++ local -A args_array
++ local app
++ local key
++ ynh_handle_getopts_args --app=mastodon --key=install_dir
++ set +o xtrace
++ app=mastodon
++ [[ install_dir =~ (unprotected|protected|skipped)_ ]]
++ ynh_app_setting get mastodon install_dir
++ set +o xtrace
+ local install_dir=
+ '[' -z '' ']'
+ ynh_print_err '--message=mastodon has no install_dir setting (does it use packaging format >=2?)'
+ local legacy_args=m
+ args_array=(['m']='message=')
+ local -A args_array
+ local message
+ ynh_handle_getopts_args '--message=mastodon has no install_dir setting (does it use packaging format >=2?)'
+ set +o xtrace
+ ynh_print_log '[Error] mastodon has no install_dir setting (does it use packaging format >=2?)'
+ echo -e '[Error] mastodon has no install_dir setting (does it use packaging format >=2?)'
[Error] mastodon has no install_dir setting (does it use packaging format >=2?)
+ exit 1

OK thanks! That will work when the app packaged is converted to packaging v2. :wink:

Carry on, and enjoy YunoHost. :innocent:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.