Moved the /system directory to another place on disk #20252
Replies: 3 comments 1 reply
-
Thanks, this was helpful. A few notes: typo in the V4 nginx location it is missing a ; I used the V4 method, edited the .env.production file directly I ran into 1 user issue and that was trying to use the same path in nginx and .env.production, nginx only need to /public and .env needs to system/ when I realized that it all worked!! Thanks |
Beta Was this translation helpful? Give feedback.
-
As of the release of Mastodon 4.1.3 it is strongly suggested to add some additional headers for the |
Beta Was this translation helpful? Give feedback.
-
Thanks, this really helped fixed some issues. |
Beta Was this translation helpful? Give feedback.
-
I have a VM where the OS disk is small, and I don't want to use it for the /system directory, where a lot of files will be dropped.
Instead, I have a large disk mounted on
/datadrive
. Here are all the steps I have used to customize mastodon. I am completely new to nginx / sidekiq / systemd so there was certainly a simplier solution. Feel free to comment!Initial setup:
~/live
directory for the mastodon user/datadrive
mounted and created a/datadrive/mastodon-public/
directory owned by mastodon/mastodon with chmod 775Steps:
Give write access to systemd
Using your root user.
It's the main problem I have faced. Because systemd sandbox write access, the services won't have access to your datadrive. It's the reason why #20228 did not work. There is an explanation on a PR of the documentation about that: https://github.com/mastodon/documentation/pull/892/files
You have to do as suggested, and edit your
/etc/systemd/system/mastodon-web.service
and/etc/systemd/system/mastodon-sidekiq.service
to give write permission to/datadrive/mastodon-public/
.In my case :
ReadWritePaths=/home/mastodon/live /datadrive/mastodon-public
You have to restart all services and systemd after that:
RSync your files
You should start an initial copy of your files. Using your mastodon account.
rsync ~/live/public/system /datadrive/mastodon-public/system/ -r
Update nginx config
It's another tricky part, and the section where I am sure there are other most simple options.
Edit your nginx.conf to add the following parts (for v4):
For v3.5 (my case), it's more complex, because I wanted to keep the custom headers for some directories:
There are a lot of other changes in the v4 that could be applied here.
Edit PAPERCLIP settings
Paperclip is responsible to manage media.
Reload mastodon and nginx
Repeat a final rsync
To copy the remaining files
Rename system/ folder as system.bak/
Check that there is no error / 404
Erase system.bak
Beta Was this translation helpful? Give feedback.
All reactions