Your self-hosted, globally interconnected microblogging community https://joinmastodon.org
This repository has been archived on 2021-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Renovate Bot bb3bcccb10 Update docker.elastic.co/elasticsearch/elasticsearch-oss Docker tag to v6.8.17 2021-07-08 07:02:28 +00:00
.drone.yml Use new image namespace 2021-06-21 12:28:43 +02:00
.env.sample Drop env vars, those will be secrets 2021-05-28 13:04:26 +02:00
.gitignore Initial commit 2021-05-07 13:34:21 +02:00
README.md Add secrets step 2021-05-28 15:36:00 +02:00
abra.sh Rip tabs, use env vars and drop old docs 2021-05-28 15:29:46 +02:00
compose.yml Update docker.elastic.co/elasticsearch/elasticsearch-oss Docker tag to v6.8.17 2021-07-08 07:02:28 +00:00
entrypoint.sh.tmpl Get the secret/entrypoint/config thing wired up 2021-05-28 11:49:12 +02:00
renovate.json Add renovate.json 2021-06-04 07:02:56 +00:00

README.md

Mastodon

Your self-hosted, globally interconnected microblogging community

Basic usage

  1. Set up Docker Swarm and abra
  2. Deploy coop-cloud/traefik
  3. abra app new mastodon
  4. Follow the secrets setup docs
  5. abra app YOURAPPDOMAIN config - be sure to change DOMAIN to something that resolves to your Docker swarm box
  6. abra app YOURAPPDOMAIN setup to setup the database and create the admin account (services will stop flapping shortly after)

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.

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 YOURAPPDOMAIN secret insert secret_key_base v1 $SECRET_KEY_BASE
$ abra app YOURAPPDOMAIN secret insert 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 YOURDOMAIN secret insert vapid_private_key v1 YOURVAPIDPRIVATEKEY

And finally, to end your whirlwind secrets loading adventure, get the DB_PASS and SMTP_PASSWORD loaded.

$ abra app YOURAPPDOMAIN secret generate db_password v1
$ abra app YOURDOMAIN secret insert smtp_password v1 YOURSMTPPASSWORD