{"id":31,"date":"2025-05-18T03:32:35","date_gmt":"2025-05-18T03:32:35","guid":{"rendered":"https:\/\/godseyonline.net\/?p=31"},"modified":"2025-05-18T03:32:36","modified_gmt":"2025-05-18T03:32:36","slug":"mastodon-permission-error-and-increase-post-limit","status":"publish","type":"post","link":"https:\/\/godseyonline.net\/index.php\/2025\/05\/18\/mastodon-permission-error-and-increase-post-limit\/","title":{"rendered":"Mastodon: Permission error and increase post limit"},"content":{"rendered":"\n<p>After upgrading to Mastodon 4.3.7 on Yunohost 12, I started having an issue with images not displaying. I tried everything and finally stumbled on this solution. <\/p>\n\n\n\n<p>It seems an older bug has creeped into the system. So, here is how I fixed the issue.<\/p>\n\n\n\n<p>First of all, mastodon was not in the www-data group. Not sure why, but this matters for some reason. I fixed that by using the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>sudo su -<\/code><code>usermod -aG mastodon www-data<\/code><code>nginx -s reload<\/code><\/code><\/pre>\n\n\n\n<p>Then to finish the permission error, I ran the following inside \/var\/www\/mastodon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>chmod -R 750 \/var\/www\/mastodon<\/code><\/code><\/pre>\n\n\n\n<p>Now the images display as expected. Not sure if this is a wide-spread problem, but good to know for the future if anyone else has this issue.<\/p>\n\n\n\n<p>To increase the character limit on Mastodon, I used the following instructions. (This works on Yunohost install of Mastodon up to 4.3.8)<\/p>\n\n\n\n<p><strong>1. Switch to your Mastodon user<\/strong><\/p>\n\n\n\n<p>Start by logging into your server and going into the root access using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su -<\/code><\/pre>\n\n\n\n<p>Then use the following to become Mastodon user. It will not work unless you are root user first. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - mastodon<\/code><\/pre>\n\n\n\n<p>and switch to your Mastodon installation directory. For most people, this should be \/home\/mastodon.<\/p>\n\n\n\n<p><strong>2. Edit the file compose_form_container.js<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano -w live\/app\/javascript\/mastodon\/features\/compose\/containers\/compose_form_container.js<\/code><\/pre>\n\n\n\n<p>Look for the line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>maxChars: state.getIn(&#91;'server', 'server', 'configuration', 'statuses', 'max_characters'], 500),<\/code><\/pre>\n\n\n\n<p>and change the number 500 to 2500.<\/p>\n\n\n\n<p><strong>3. Edit the file status_length_validator.rb<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano -w live\/app\/validators\/status_length_validator.rb<\/code><\/pre>\n\n\n\n<p>Find the line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAX_CHARS = 500<\/code><\/pre>\n\n\n\n<p>and change the number to 2500.<\/p>\n\n\n\n<p><strong>4. (Optionally, to change the poll limit) Edit the file poll_options_validator.rb<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano -w live\/app\/validators\/poll_options_validator.rb<\/code><\/pre>\n\n\n\n<p>Find the line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAX_OPTIONS = 4\n<\/code><\/pre>\n\n\n\n<p>and change the number to your desired limit.<\/p>\n\n\n\n<p><strong>5. Rebuild assets and restart services<\/strong><\/p>\n\n\n\n<p>You are now done editing and can rebuild the live assets. Do so with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd live\nRAILS_ENV=production bundle exec rails assets:precompile <strong>&lt;- DOES NOT WORK. No idea why, it just doesn't.<\/strong><\/code><\/pre>\n\n\n\n<p>Afterwards, exit the mastodon user, and restart the Mastodon services as root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart mastodon-sidekiq\nsystemctl reload mastodon-web\nsystemctl restart mastodon-streaming\n<\/code><\/pre>\n\n\n\n<p>Congratulations, you should now have an increased character (and poll) limit on your instance. Have fun posting!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading to Mastodon 4.3.7 on Yunohost 12, I started having an issue with images not displaying. I tried everything and finally stumbled on this solution. It seems an older bug has creeped into the system. So, here is how I fixed the issue. First of all, mastodon was not in the www-data group. Not &#8230; <a title=\"Mastodon: Permission error and increase post limit\" class=\"read-more\" href=\"https:\/\/godseyonline.net\/index.php\/2025\/05\/18\/mastodon-permission-error-and-increase-post-limit\/\" aria-label=\"Read more about Mastodon: Permission error and increase post limit\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":1,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":32,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions\/32"}],"wp:attachment":[{"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/godseyonline.net\/index.php\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}