Updating Mastodon to the version 4.1.4
Why?
Because it's important to use the last version with the latest bug fixes and features.
What do I need to update?
You need a working mastodon, and we're expecting that you had followed our howto
How to upgrade
The Docker side
stop the containers
cd /opt/mastodon/docker
docker-compose down
edit the versions.env file
vim /opt/mastodon/docker/versions.env
and change the version to the latest
MASTODON_VERSION=v4.1.2
to
MASTODON_VERSION=v4.1.4
clear the web directories
rm -rf /opt/mastodon/data/web/public/*
rm -rf /opt/mastodon/data/web/config/*
rm -rf /opt/mastodon/data/web/app/*
rm -rf /opt/mastodon/data/web/system/*
and start all containers again
cd /opt/mastodon/docker
docker-compose up -d
and run the migration
cd /opt/mastodon/docker
docker-compose run --rm shell bundle exec rake db:migrate
customizations
you need to apply any customization to these directory files again if you had modified anything before.
/opt/mastodon/data/web/public/*
/opt/mastodon/data/web/config/*
/opt/mastodon/data/web/app/*
/opt/mastodon/data/web/system/*
The External Nginx side
Now we need to update the static files cache on our nginx reverse proxy.
nginx cache config
Edit your mastodon vhost filer
vim /etc/nginx/conf.d/mastodon.conf
fine the cache line
proxy_cache_path /var/cache/mastodon/public/4.1.2 levels=1:2 keys_zone=MASTODON_CACHE_v412:10m inactive=7d max_size=3g;
change the cache directory
proxy_cache_path /var/cache/mastodon/public/4.1.4 levels=1:2 keys_zone=MASTODON_CACHE_v412:10m inactive=7d max_size=3g;
create the new directory
mkdir -p /var/cache/mastodon/public/4.1.4
root directory
find the root directory line
root /var/www/mastodon/dev.bolha.us/public/4.1.2;
change it
root /var/www/mastodon/dev.bolha.us/public/4.1.4;
create the new directory
mkdir -p /var/www/mastodon/dev.bolha.us/public/4.1.4;
creating a docker volume to copy the new static files
docker volume create --opt type=none --opt device=/opt/www/mastodon/dev.bolha.us/public/4.1.4 --opt o=bind mastodon_public_4.1.4
copying the new static files from the new version to the volume
docker run --rm -v "mastodon_public_4.1.4:/static" tootsuite/mastodon:v4.1.4 bash -c "cp -r /opt/mastodon/public/* /static/"
checking the files
ls /opt/www/mastodon/dev.bolha.us/public/4.1.4
remove the temporary volume
docker volume rm mastodon_public_4.1.4
now verify your nginx config
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
now reload your nginx
systemctl restart nginx && systemctl status nginx
That's it!
Did you like our content?
We have a lot to share; visit our site!
Our fediverse services ;)
- mastodon => https://bolha.us
- mastopoet => https://poet.bolha.us
- elk => https://elk.bolha.us
- pinafore => https://pinafore.bolha.us
- pixelfed => https://bolha.photos
- lemmy => https://bolha.social
- writefreely => https://bolha.blog
- bookwyrm => https://bolha.review
- funkwhale => https://bolha.studio
- friendica => https://bolha.network
Chat and video? We have it!
- matrix => https://bolha.chat
- jitsi => https://bolha.video
Translation tools
- libretranslate => https://libretranslate.bolha.tools
- lingva => https://translate.bolha.tools
Video Platform Frontends
- invidious => https://bolha.in
Text Editors
- hedgeDoc => https://notes.bolha.tools
- wise Mapping => https://mindmap.bolha.tools
- overleaf => https://overleaf.bolha.tools
- mermaid => https://mermaid.bolha.tools
You can also visit our hacking space!
Follow our founder!
- https://bolha.us/@gutocarvalho
- https://bolha.photos/@gutocarvalho
- https://bolha.forum@gutocarvalho
- https://bolha.blog/@gutocarvalho
- https://bolha.review/@gutocarvalho
- https://bolha.studio/@gutocarvalho
- https://bolha.network/@gutocarvalho
- matrix => @bolha.chat@gutocarvalho
Follow the status of our tools
Do you want to support us? You can!
- https://www.patreon.com/bolha
- https://apoia.se/bolha
- pix@bolha.us (local brazilian wire transfer)
See you!
[s]