Update Debian docs

This commit is contained in:
Norm 2022-07-02 13:08:22 -04:00
parent 287291c986
commit d24c420740
2 changed files with 42 additions and 42 deletions

View File

@ -4,7 +4,7 @@
## Installation
This guide will assume you are on Debian 11 (“bullseye”) or later. This guide should also work with Ubuntu 18.04 (“Bionic Beaver”) and later. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
This guide will assume you are on Debian 11 (“bullseye”) or later. This guide should also work with Ubuntu 18.04 (“Bionic Beaver”) and later. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu akkoma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
{! backend/installation/generic_dependencies.include !}
@ -44,40 +44,40 @@ sudo apt install imagemagick ffmpeg libimage-exiftool-perl
* Add a new system user for the Akkoma service:
```shell
sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma
sudo useradd -r -s /bin/false -m -d /var/lib/akkoma -U akkoma
```
**Note**: To execute a single command as the Akkoma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you dont have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l pleroma -s $SHELL -c 'command'` and `su -l pleroma -s $SHELL` for starting a shell.
**Note**: To execute a single command as the Akkoma system user, use `sudo -Hu akkoma command`. You can also switch to a shell by using `sudo -Hu akkoma $SHELL`. If you dont have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l akkoma -s $SHELL -c 'command'` and `su -l akkoma -s $SHELL` for starting a shell.
* Git clone the AkkomaBE repository and make the Akkoma user the owner of the directory:
```shell
sudo mkdir -p /opt/pleroma
sudo chown -R pleroma:pleroma /opt/pleroma
sudo -Hu pleroma git clone -b stable https://git.pleroma.social/pleroma/pleroma /opt/pleroma
sudo mkdir -p /opt/akkoma
sudo chown -R akkoma:akkoma /opt/akkoma
sudo -Hu akkoma git clone https://akkoma.dev/AkkomaGang/akkoma.git /opt/akkoma
```
* Change to the new directory:
```shell
cd /opt/pleroma
cd /opt/akkoma
```
* Install the dependencies for Akkoma and answer with `yes` if it asks you to install `Hex`:
```shell
sudo -Hu pleroma mix deps.get
sudo -Hu akkoma mix deps.get
```
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
* Generate the configuration: `sudo -Hu akkoma MIX_ENV=prod mix pleroma.instance gen`
* Answer with `yes` if it asks you to install `rebar3`.
* This may take some time, because parts of pleroma get compiled first.
* This may take some time, because parts of akkoma get compiled first.
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
* Check the configuration and if all looks right, rename it, so Akkoma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances):
```shell
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
sudo -Hu akkoma mv config/{generated_config.exs,prod.secret.exs}
```
@ -90,13 +90,13 @@ sudo -Hu postgres psql -f config/setup_db.psql
* Now run the database migration:
```shell
sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate
sudo -Hu akkoma MIX_ENV=prod mix ecto.migrate
```
* Now you can start Akkoma already
```shell
sudo -Hu pleroma MIX_ENV=prod mix phx.server
sudo -Hu akkoma MIX_ENV=prod mix phx.server
```
### Finalize installation
@ -131,8 +131,8 @@ If that doesnt work, make sure, that nginx is not already running. If it stil
* Copy the example nginx configuration and activate it:
```shell
sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx
sudo ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx
sudo cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/sites-available/akkoma.nginx
sudo ln -s /etc/nginx/sites-available/akkoma.nginx /etc/nginx/sites-enabled/akkoma.nginx
```
* Before starting nginx edit the configuration and change it to your needs (e.g. change servername, change cert paths)
@ -150,21 +150,21 @@ sudo certbot certonly --email <your@emailaddress> -d <yourdomain> --webroot -w /
#### Other webserver/proxies
You can find example configurations for them in `/opt/pleroma/installation/`.
You can find example configurations for them in `/opt/akkoma/installation/`.
#### Systemd service
* Copy example service file
```shell
sudo cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
sudo cp /opt/akkoma/installation/akkoma.service /etc/systemd/system/akkoma.service
```
* Edit the service file and make sure that all paths fit your installation
* Enable and start `pleroma.service`:
* Enable and start `akkoma.service`:
```shell
sudo systemctl enable --now pleroma.service
sudo systemctl enable --now akkoma.service
```
#### Create your first user
@ -172,7 +172,7 @@ sudo systemctl enable --now pleroma.service
If your instance is up and running, you can create your first user with administrative rights with the following task:
```shell
sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
sudo -Hu akkoma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
```
#### Further reading

View File

@ -5,13 +5,13 @@
## インストール
このガイドはDebian Stretchを利用することを想定しています。Ubuntu 16.04や18.04でもおそらく動作します。また、ユーザはrootもしくはsudoにより管理者権限を持っていることを前提とします。もし、以下の操作をrootユーザで行う場合は、 `sudo` を無視してください。ただし、`sudo -Hu pleroma` のようにユーザを指定している場合には `su <username> -s $SHELL -c 'command'` を代わりに使ってください。
このガイドはDebian Stretchを利用することを想定しています。Ubuntu 16.04や18.04でもおそらく動作します。また、ユーザはrootもしくはsudoにより管理者権限を持っていることを前提とします。もし、以下の操作をrootユーザで行う場合は、 `sudo` を無視してください。ただし、`sudo -Hu akkoma` のようにユーザを指定している場合には `su <username> -s $SHELL -c 'command'` を代わりに使ってください。
### 必要なソフトウェア
- PostgreSQL 9.6以上 (Ubuntu16.04では9.5しか提供されていないので,[](https://www.postgresql.org/download/linux/ubuntu/)こちらから新しいバージョンを入手してください)
- `postgresql-contrib` 9.6以上 (同上)
- Elixir 1.8 以上 ([Debianのリポジトリからインストールしないこと ここからインストールすること!](https://elixir-lang.org/install.html#unix-and-unix-like)。または [asdf](https://github.com/asdf-vm/asdf) をpleromaユーザーでインストールしてください)
- Elixir 1.8 以上 ([Debianのリポジトリからインストールしないこと ここからインストールすること!](https://elixir-lang.org/install.html#unix-and-unix-like)。または [asdf](https://github.com/asdf-vm/asdf) をakkomaユーザーでインストールしてください)
- `erlang-dev`
- `erlang-nox`
- `git`
@ -65,55 +65,55 @@ sudo apt install imagemagick ffmpeg libimage-exiftool-perl
* Akkoma用に新しいユーザーを作ります。
```
sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma
sudo useradd -r -s /bin/false -m -d /var/lib/akkoma -U akkoma
```
**注意**: Akkomaユーザとして単発のコマンドを実行したい場合はは、`sudo -Hu pleroma command` を使ってください。シェルを使いたい場合は `sudo -Hu pleroma $SHELL`です。もし `sudo` を使わない場合は、rootユーザで `su -l pleroma -s $SHELL -c 'command'` とすることでコマンドを、`su -l pleroma -s $SHELL` とすることでシェルを開始できます。
**注意**: Akkomaユーザとして単発のコマンドを実行したい場合はは、`sudo -Hu akkoma command` を使ってください。シェルを使いたい場合は `sudo -Hu akkoma $SHELL`です。もし `sudo` を使わない場合は、rootユーザで `su -l akkoma -s $SHELL -c 'command'` とすることでコマンドを、`su -l akkoma -s $SHELL` とすることでシェルを開始できます。
* Gitリポジトリをクローンします。
```
sudo mkdir -p /opt/pleroma
sudo chown -R pleroma:pleroma /opt/pleroma
sudo -Hu pleroma git clone -b stable https://git.pleroma.social/pleroma/pleroma /opt/pleroma
sudo mkdir -p /opt/akkoma
sudo chown -R akkoma:akkoma /opt/akkoma
sudo -Hu akkoma git clone https://akkoma.dev/AkkomaGang/akkoma.git /opt/akkoma
```
* 新しいディレクトリに移動します。
```
cd /opt/pleroma
cd /opt/akkoma
```
* Akkomaが依存するパッケージをインストールします。Hexをインストールしてもよいか聞かれたら、yesを入力してください。
```
sudo -Hu pleroma mix deps.get
sudo -Hu akkoma mix deps.get
```
* コンフィギュレーションを生成します。
```
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
sudo -Hu akkoma MIX_ENV=prod mix pleroma.instance gen
```
* rebar3をインストールしてもよいか聞かれたら、yesを入力してください。
* このときにpleromaの一部がコンパイルされるため、この処理には時間がかかります。
* このときにakkomaの一部がコンパイルされるため、この処理には時間がかかります。
* あなたのインスタンスについて、いくつかの質問されます。この質問により `config/generated_config.exs` という設定ファイルが生成されます。
* コンフィギュレーションを確認して、もし問題なければ、ファイル名を変更してください。
```
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
sudo -Hu akkoma mv config/{generated_config.exs,prod.secret.exs}
```
* 先程のコマンドで、すでに `config/setup_db.psql` というファイルが作られています。このファイルをもとに、データベースを作成します。
```
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
sudo -Hu akkoma MIX_ENV=prod mix pleroma.instance gen
```
* そして、データベースのマイグレーションを実行します。
```
sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate
sudo -Hu akkoma MIX_ENV=prod mix ecto.migrate
```
* これでAkkomaを起動できるようになりました。
```
sudo -Hu pleroma MIX_ENV=prod mix phx.server
sudo -Hu akkoma MIX_ENV=prod mix phx.server
```
### インストールの最終段階
@ -143,8 +143,8 @@ sudo certbot certonly --email <your@emailaddress> -d <yourdomain> --standalone
* nginxの設定ファイルサンプルをnginxフォルダーにコピーします。
```
sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx
sudo ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx
sudo cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/sites-available/akkoma.nginx
sudo ln -s /etc/nginx/sites-available/akkoma.nginx /etc/nginx/sites-enabled/akkoma.nginx
```
* nginxを起動する前に、設定ファイルを編集してください。例えば、サーバー名、証明書のパスなどを変更する必要があります。
@ -160,19 +160,19 @@ sudo certbot certonly --email <your@emailaddress> -d <yourdomain> --webroot -w /
```
#### 他のWebサーバやプロキシ
これに関してはサンプルが `/opt/pleroma/installation/` にあるので、探してみてください。
これに関してはサンプルが `/opt/akkoma/installation/` にあるので、探してみてください。
#### Systemd サービス
* サービスファイルのサンプルをコピーします。
```
sudo cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
sudo cp /opt/akkoma/installation/akkoma.service /etc/systemd/system/akkoma.service
```
* サービスファイルを変更します。すべてのパスが正しいことを確認してください
* サービスを有効化し `pleroma.service` を開始してください
* サービスを有効化し `akkoma.service` を開始してください
```
sudo systemctl enable --now pleroma.service
sudo systemctl enable --now akkoma.service
```
#### 初期ユーザの作成
@ -180,7 +180,7 @@ sudo systemctl enable --now pleroma.service
新たにインスタンスを作成したら、以下のコマンドにより管理者権限を持った初期ユーザを作成できます。
```
sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
sudo -Hu akkoma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress> --admin
```
#### その他の設定とカスタマイズ