This repository contains configuration (minus secrets) for the efnet.social Mastodon instance.
You can fork this repository and use it as a template for your own.
- Docker with
docker-compose
(latest) - Some kind of sh-compatible shell.
- Clone this repository:
git clone https://github.com/lsegal/efnet.social
- Run
sh scripts/setup.sh
to initialize.env.production
from the.env.production.sample
template file with configuration. This will also set up your database and initial certificates. - Continue editing
.env.production
and add your remaining secrets & settings. See the Mastodon documentation for available environment options. - Optional: if you are using your own certificates, you will need to replace
the files generated into
conf/certs
. See below for more information. - Finally, run
docker-compose up -d
to start the server. - If you configured everything correctly (and your domain is pointed at your
server), you should now be able to see your Mastodon instance running at the
LOCAL_DOMAIN
you configured in.env.production
.
You can sign up your first account via the web interface, but you may prefer
to directly configure your user via tootctl
(see below) in order to bypass
email confirmation if you have not configured SMTP.
Use the following command to create your first user and make yourself an admin:
sh scripts/tootctl.sh accounts create USERNAME --email EMAIL --role Admin --confirmed
You can disable signups via tootctl
as well with the following command:
sh scripts/tootctl.sh settings registrations close
This deploy relies on Cloudflare for SSL management. Specifically, we use the "Full" end-to-end setting in SSL/TLS > Overview. This means that you should ensure that Cloudflare is accessing your server on port 443. Failure to setup your service over HTTPS may result in a redirect loop.
If you are not using Cloudflare, you will need to generate your own certificates.
This can be done by replacing the certificates in conf/certs
and updating
config/nginx-templates/default.conf.template
.
The scripts
directory contains a few useful tools for managing your instance,
most of which are wrappers around docker-compose
commands available in
the standard Mastadon tool chain.
scripts/console.sh
provides access to the Rails console in your Mastodon instance.scripts/tootctl.sh
provides access to Mastoson's tootctl admin CLI.