Help us understand the problem. What is going on with this article?

備忘録的Mastodonのバージョンアップやメンテナンス時に使うコマンド等(non-Docker版)

一先ずシステムのアップデート

# apt update && apt upgrade -y

自インスタンス用master追従用コマンド

# su - mastodon
mastodon@xxx$ cd live
mastodon@xxx/live$ git pull
mastodon@xxx/live$ git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
mastodon@xxx/live$ git fetch && git checkout vX.X.X
mastodon@xxx/live$ bundle install
mastodon@xxx/live$ yarn install
mastodon@xxx/live$ RAILS_ENV=production bundle exec rails db:migrate
mastodon@xxx/live$ RAILS_ENV=production bundle exec rails assets:precompile
mastodon@xxx/live$ sudo systemctl restart mastodon-*.service
mastodon@xxx/live$ RAILS_ENV=production bin/tootctl cache clear

※下記コマンドでgithubを最新に同期するのを忘れずに

mastodon@xxx/live$ git checkout master
mastodon@xxx/live$ git pull
mastodon@xxx/live$ git push https://github.com/syumari/mastodon.git master:master

Rubyの更新(2.5.4→2.6.5の場合)

mastodon@xxx:~$ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.5
ruby-build: definition not found: 2.6.5
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
  cd /home/mastodon/.rbenv/plugins/ruby-build && git pull && cd -

2.6.5なんてリストにそんな新しいのないわよ!と怒られますが
しょうがないわね、リスト更新してあげるからこのコマンド使いなさいと優しく教えてくれるUbuntuちゃんはツンデレです。

mastodon@xxx:~$ cd /home/mastodon/.rbenv/plugins/ruby-build && git pull && cd -
remote: Enumerating objects: 50, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 50 (delta 24), reused 28 (delta 9), pack-reused 0
Unpacking objects: 100% (50/50), done.
From https://github.com/rbenv/ruby-build
   d2a7eef..786b89f  master     -> origin/master
 * [new tag]         v20191002  -> v20191002
Updating d2a7eef..786b89f
Fast-forward
 bin/ruby-build         | 4 ++--
 share/ruby-build/2.4.8 | 2 ++
 share/ruby-build/2.4.9 | 2 ++
 share/ruby-build/2.5.7 | 2 ++
 share/ruby-build/2.6.5 | 2 ++
 5 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 share/ruby-build/2.4.8
 create mode 100644 share/ruby-build/2.4.9
 create mode 100644 share/ruby-build/2.5.7
 create mode 100644 share/ruby-build/2.6.5
/home/mastodon

mastodon@1xxx:~$ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.5
Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...

mastodon@1xxx:~$ rbenv global 2.6.5
mastodon@xxx:~$ rbenv versions
  2.6.1
  2.6.4
* 2.6.5 (set by /home/mastodon/.rbenv/version)
mastodon@xxx:~$

その他、森野 くますん様のMastodon 保守メモめっちゃ助かってます。多謝です。

Mastodonのアップデート
http://imoimo2010.blogspot.jp/2017/05/mastodon_34.html
ほぼほぼ上記の方法でアップデートできるはず。

Mastodonマストドンのアップデート方法メモ
https://www.webdb.co.jp/~atsumi/skimemo/index.php?skimemo%20-%20%C6%FC%B5%AD%2F2017-04-20%2FMastodon%A5%DE%A5%B9%A5%C8%A5%C9%A5%F3%A4%CE%A5%A2%A5%C3%A5%D7%A5%C7%A1%BC%A5%C8%CA%FD%CB%A1%A5%E1%A5%E2
ちょっと気になった時に

[備忘録]Mastodonアップデートの時のメモと注意
http://qiita.com/plainbanana/items/8cecc9c0b6805559b157
gitコマンドの場合

アップデートした後
Mastodon のデイリーJOBが異常終了する解消方法
http://fnya.cocolog-nifty.com/blog/2017/04/mastodon-job-13.html
これをしないと(bundle exec)rake mastodon:dailyが出来ない場合がある。

db:migradeの前に
RAILS_ENV=production bundle exec rails mastodon:maintenance:prepare_for_foreign_keys
v1.4.7→v1.5.0rc1
RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key

・メディアファイル アップロード上限緩和(※リモートでの他サーバに対する負荷を考慮すべし)

app/models/media_attachment.rb

45行目付近
  IMAGE_STYLES = {
    original: {
#     pixels: 1_638_400, # 1280x1280px
      pixels: 67_108_864, # 8192x8192px

100行目付近
  VIDEO_FORMAT = {
    format: 'mp4',
    content_type: 'video/mp4',
    convert_options: {
      output: {
        'loglevel' => 'fatal',
        'movflags' => 'faststart',
        'pix_fmt' => 'yuv420p',
        'vf' => 'scale=\'trunc(iw/2)*2:trunc(ih/2)*2\'',
        'vsync' => 'cfr',
        'c:v' => 'h264',
#       'maxrate' => '1300K',
#       'bufsize' => '1300K',
        'maxrate' => '5000K',
        'bufsize' => '5000K',

127行目付近
#  IMAGE_LIMIT = 10.megabytes
#  VIDEO_LIMIT = 40.megabytes
  IMAGE_LIMIT = 100.megabytes
  VIDEO_LIMIT = 100.megabytes
app/javascript/mastodon/utils/resize_image.js

3行目
const MAX_IMAGE_PIXELS = 13107200; // 3840x3840px
./etc/nginx/nginx.conf or ./etc/nginx/sutes-enable/*.conf

client_max_body_size 100m;
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした