docs: use scripts interface

This commit is contained in:
decentral1se 2022-05-09 07:51:47 +02:00
parent 86ba4157b4
commit bd89836a99
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 2 additions and 32 deletions

View File

@ -55,36 +55,6 @@ tootctl accounts create <username> --email <email> --confirmed --role admin
## Secrets setup
Because Mastodon expects secrets generated by specific tools, we don't support that in `abra` yet. However, you can run these commands yourself using the underlying Docker CLI. You can then load them in as secrets to the swarm using `abra` though and then they will be picked up on the deployment.
Mastodon expects secrets generated by specific tools. Uou can run these commands via the scripts interface with `abra`.
First, generate the `SECRET_KEY_BASE` and `OTP_SECRET` and store them in your local shell environment, you'll need them for subsequent commands.
```
$ SECRET_KEY_BASE=$(docker run --rm tootsuite/mastodon:v3.4.0 bundle exec rake secret)
$ OTP_SECRET=$(docker run --rm tootsuite/mastodon:v3.4.0 bundle exec rake secret)
$ abra app secret insert YOURAPPDOMAIN secret_key_base v1 $SECRET_KEY_BASE
$ abra app secret insert YOURAPPDOMAIN otp_secret v1 $OTP_SECRET
```
Then you need to generate the `VAPID_{PUBLIC/PRIVATE}_KEY` values using the `SECRET_KEY_BASE`/`OTP_SECRET`:
```
$ docker run \
-e SECRET_KEY_BASE=$SECRET_KEY_BASE \
-e OTP_SECRET=$OTP_SECRET \
--rm tootsuite/mastodon:v3.4.0 \
bundle exec rake mastodon:webpush:generate_vapid_key
```
Once you see the values generated, you can load the `VAPID_PUBLIC_KEY` into your `.env` file and `VAPID_PRIVATE_KEY` into a secret.
```
$ abra app secret insert YOURDOMAIN vapid_private_key v1 YOURVAPIDPRIVATEKEY
```
And finally, to end your whirlwind secrets loading adventure, get the `DB_PASS` and `SMTP_PASSWORD` loaded.
```
$ abra app secret generate YOURAPPDOMAIN db_password v1
$ abra app secret insert YOURDOMAIN smtp_password v1 YOURSMTPPASSWORD
```
`abra app cmd <domain> secrets --local`