Skip to content

Instantly share code, notes, and snippets.

#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodon ユーザになる
sudo su - mastodon
#今回の Ruby 2.6.0 のアップデートをするためにrbenvのおいてあるディレクトリに移り最新版をダウンロード
cd ~/.rbenv
git pull
@momoseijin
momoseijin / Upgrade PostgreSQL 9.5 to 10 , Mastodon on Ubuntu 16.04
Last active November 13, 2022 00:16
Upgrade PostgreSQL 9.5 to 10 , Mastodon on Ubuntu 16.04
#Mastodon を止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#まず PostgreSQL のリポジトリを追加して、アップデートする
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
sudo apt update
#今回は PostgreSQL 10 にするのでバージョンを指定してインストール
sudo apt install postgresql-10 postgresql-client-10 postgresql-contrib-10
$ cd /home/mastodon/live
$ mv yarn.lock ../ (うちではyarn.lockファイルをどかさないとgem install bundlerできないので、普通にできる人はやらなくていいです)
$ git branch
$ git checkout master
$ git pull
$ git checkout v2.0.0
$ gem install bundler
$ bundle install --deployment --without development test
# systemctl stop mastodon*
# su - mastodon
$ cd ~/.rbenv
$ git pull
$ cd ~/.rbenv/plugins/ruby-build
$ git pull
$ cd ~/.rbenv
$ rbenv install 2.4.2
$ rbenv global 2.4.2
#Mastodonユーザになる
sudo su - mastodon
#Mastodonのおいてあるディレクトリに移る
cd ~/live
#マスターに移り、最新版を持ってくる
git checkout master
git pull
git checkout v2.2.0
#Mastodonのおいてあるディレクトリに移る
cd ~/live
#マスターに移り、最新版を持ってくる
git checkout master
git pull
git checkout v2.2.0
#いつものようにインストール作業をする
gem install bundler
#Mastodonを止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodonユーザになる
sudo su - mastodon
#Rubyのアップデートをするためにrbenvのおいてあるディレクトリに移り最新版をダウンロード
cd ~/.rbenv
git pull
#同じようにプラグインのディレクトリに移り最新版をダウンロード
@momoseijin
momoseijin / Using S3 on Mastodon
Last active November 11, 2023 06:42
Using S3 on Mastodon
S3_ENABLED=true
S3_BUCKET=media.yourdomain.com ← 自分の作ったバケット名(mediaなどをつけてエイリアスを使う場合はOptionalも設定する)
AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST ← 設定されたアクセスキー
AWS_SECRET_ACCESS_KEY=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd ← 設定されたシークレットキー
S3_REGION=ap-northeast-1 ← 東京リージョンならこれ
S3_PROTOCOL=https
S3_ENDPOINT=https://s3-ap-northeast-1.amazonaws.com ← 東京リージョンならこれ
# Optional alias for S3 (e.g. to serve files on a custom domain, possibly using Cloudfront or Cloudflare)
S3_CLOUDFRONT_HOST=media.yourdomain.com ←ここに自分の設定した S3Bucket と Cloudflare で合わせた CNAME 入れる
#Mastodonを止める
systemctl stop mastodon-{web,sidekiq,streaming}.service
#Mastodonユーザになる
sudo su - mastodon
#Mastodonのおいてあるディレクトリに移る
cd ~/live
#git fetchで最新のデータを引いてくる
su - #kusanagi ユーザから root へ
kusanagi ssl --email <自分のメールアドレス>
#上のコマンドだけで設定が始まる
<中略>
#ずらずらいろいろとインストールや結果が出て
<中略>
- Congratulations! Your certificate and chain have been saved at: