地味にバージョンアップするmasto丼
自分とこのMastodonもバージョンの追っかけをしてます。
やっぱこのインターネッツの世界は広いなと思いまして。。さてログ化を始めます。
そういえばDNSの設定とか書いてなかったですね。
Mastodon Production Guideに沿いながら書いていきますか。
※既に書いてあるものは省略します。
DNS
DNS records should be added before anything is done on the server.
DNSレコードは、サーバー上で何か処理が行われる前に追加する必要があります。
The records added are:
追加するレコードは次のとおりです。
A record (IPv4 address) for example.com
example.comのレコード(IPv4アドレス)
AAAA record (IPv6 address) for example.com
example.comのAAAAレコード(IPv6アドレス)
こちらDNSの設定も必要ですね。
その下にtmux使えば便利よ的な話もありますので、
使ったことのない人は、これを機会にインストールしても良いかもです。
Dependency Installation(依存関係のインストール)
node.js Repository
You will need to add an external repository so we can have the version of node.js required.
We run this script to add the repository:
外部リポジトリを追加する必要がありますので、node.jsのバージョンが必要です。リポジトリを追加するには、このスクリプトを実行します。
apt -y install curl curl -sL https://deb.nodesource.com/setup_8.x | bash -
Yarn Repository
Another repository needs to be added so we can get the version of Yarn used by Mastodon.
This is how you add the repository:
Mastodonによって使用されるYarnのバージョンを取得できるように、別のリポジトリを追加する必要があります。リポジトリを追加する方法は次のとおりです。
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list apt update
Various Other Dependencies(さまざまな他の依存関係)
Now you need to install Yarn plus some more software.
Yarnといくつかのソフトウェアをインストールする必要があります。
>>この辺はpart1に書いてます
- imagemagick – Mastodon uses imagemagick for image related operations
マストドンは、画像関連の操作にimagemagickを使用します。 - ffmpeg – Mastodon uses ffmpeg for conversion of GIFs to MP4s
MastodonはGIFからMP4への変換にffmpegを使用します - libprotobuf-dev and protobuf-compiler – Mastodon uses these for language detection
Mastodonはこれらを言語検出に使用します - nginx – nginx is our frontend web server
nginxは私たちのフロントエンドWebサーバーです - redis-* – Mastodon uses redis for its in-memory data structure store
メモリ内のデータ構造ストアにredisを使用します。 - postgresql-* – Mastodon uses PostgreSQL as its SQL database
MastodonはPostgreSQLをSQLデータベースとして使用します - nodejs – Node is used for Mastodon’s streaming API
ノードはMastodonのストリーミングAPIに使用されます - yarn – Yarn is a Node.js package manager
YarnはNode.jsパッケージマネージャです - Other -dev packages, g++ – these are needed for the compilation of Ruby using ruby-build.
これらはruby-buildを使ったRubyのコンパイルに必要です。
Dependencies That Need To Be Added As A Non-Root User
Let us create this user first:
最初にこのユーザーを作成しましょう。
>>この辺はpart1に書いてます
We will need to set up rbenv and ruby-build:
rbenvとruby-buildをセットアップする必要があります:
>>この辺はpart2に書いてます
node.js And Ruby Dependencies(node.jsとRubyの依存関係)
Now that Ruby is enabled, we will clone the Mastodon git repository and install the Ruby and node.js dependancies.
Rubyが有効になったので、Mastodonのgitリポジトリをクローンし、Rubyとnode.jsの依存関係をインストールします。
Run the following to clone and install:
クローンしてインストールするには、次のコマンドを実行します。
# Return to mastodon user's home directory cd ~ # Clone the mastodon git repository into ~/live git clone https://github.com/tootsuite/mastodon.git live # Change directory to ~/live cd ~/live # Checkout to the latest stable branch git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1) # Install bundler gem install bundler # Use bundler to install the rest of the Ruby dependencies bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test # Use yarn to install node.js dependencies yarn install --pure-lockfile
PostgreSQL Database Creation(PostgreSQLデータベースの作成)
あれ?Mastodon Production Guideにenv.productionの記述とか無いんだけど・・・元々なかったっけ?
とりあえず次回はnginxとか