v1.5.0rc1 アップデートメモ
完全に俺メモです。os は gentoo で、非docker環境の v1.4.7 mastodonです。 v1.5.0rc1 で必要になると言われている libidn11-dev は gentoo 的には考えなくてよさそう。
# emerge -pv libidn libidn2 These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-dns/libidn-1.33::gentoo USE="nls -doc -emacs -java -mono -static-libs" 0 KiB [ebuild R ] net-dns/libidn2-0.16-r1::gentoo USE="-static-libs" 0 KiB Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB
とりあえず検証用インスタンスなので問答無用で停止する
# run_init /etc/init.d/nginx stop # run_init /etc/init.d/mastodon-web stop # run_init /etc/init.d/mastodon-streaming stop # run_init /etc/init.d/mastodon-sidekiq stop
バックアップ
# su - mastodon -s /bin/bash $ cd live $ cp .env.production ../
環境更新
$ git fetch $ git tag v0.1.0 v0.1.1 v0.1.2 v0.6 v0.7 v0.8 v0.9 v0.9.9 v1.0 v1.1 v1.1.1 v1.1.2 v1.2 v1.2.1 v1.2.2 v1.3 v1.3.1 v1.3.2 v1.3.3 v1.4.1 v1.4.2 v1.4.3 v1.4.4 v1.4.5 v1.4.6 v1.4.7 v1.4rc1 v1.4rc2 v1.4rc3 v1.4rc4 v1.4rc5 v1.4rc6 v1.5.0rc1 $ git checkout v1.5.0rc1
必要なものを揃える
$ bundle install : : The latest bundler is 1.15.3, but you are currently running 1.15.2. To update, run `gem install bundler`
そもそも bundler が古いとか文句言われた……
$ gem install bundler
つづいて yarn
$ yarn install
長い。
.env.production
環境変数が2つ追加。設定する SecureRandom 的な文字列を生成する。
$ RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key rake aborted! Errno::ENOSPC: No space left on device @ rb_sysopen - tmp/cache/bootsnap-load-path-cache.2999.tmp /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/store.rb:72:in `binwrite' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/store.rb:72:in `dump_data' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/store.rb:53:in `commit_transaction' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/store.rb:45:in `transaction' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/cache.rb:140:in `push_paths_locked' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/cache.rb:123:in `block in reinitialize' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/cache.rb:117:in `synchronize' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/cache.rb:117:in `reinitialize' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache/cache.rb:14:in `initialize' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache.rb:29:in `new' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap/load_path_cache.rb:29:in `setup' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.1/lib/bootsnap.rb:23:in `setup' /home/mastodon/live/config/boot.rb:6:in `<top (required)>' /home/mastodon/live/config/application.rb:1:in `require_relative' /home/mastodon/live/config/application.rb:1:in `<top (required)>' /home/mastodon/live/Rakefile:4:in `require' /home/mastodon/live/Rakefile:4:in `<top (required)>' /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>' /home/mastodon/.rbenv/versions/2.4.1/bin/bundle:22:in `load' /home/mastodon/.rbenv/versions/2.4.1/bin/bundle:22:in `<main>' (See full trace by running task with --trace)
落ちた……
$ df -h . Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg001-lv002 2.0G 1.5G 377M 80% /home/mastodon
なるほど、足してみる。
# lvextend /dev/vg001/lv002 -L2.5g Size of logical volume vg001/lv002 changed from 2.00 GiB (16 extents) to 2.50 GiB (20 extents). Logical volume lv002 successfully resized. # resize2fs /dev/vg001/lv002 resize2fs 1.43.3 (04-Sep-2016) Filesystem at /dev/vg001/lv002 is mounted on /home/mastodon; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/vg001/lv002 is now 655360 (4k) blocks long.
もう1回やってみる。
$ RAILS_ENV=production bundle exec rake mastodon:webpush:g enerate_vapid_key VAPID_PRIVATE_KEY=e-------------------------------------------= VAPID_PUBLIC_KEY=---------------------------------------------------------------------------------------=
通った……意外と容量食うのねw
db:migrate
$ RAILS_ENV=production bundle exec rails db:migrate
assets:precompile
落ちたw 今日はここまでかぐぬぬ……。
sw.js
location ~ ^/sw\.js { add_header Cache-Control "max-age=0"; }
nginx の設定にこんなのいれる。これちょっと要調査。
[修正] リクエストは /public/sw.js
ではなく /sw.js
に来るので location
を修正。