puppet-mastodon/README.md
2024-02-16 18:48:17 +02:00

2.6 KiB

mastodon

This module install and manage Mastodon, Redis and PostgreSQL servers.

Table of Contents

  1. Description
  2. Setup - The basics of getting started with mastodon
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

Mastodon https://joinmastodon.org/ is a decrentralized social network using the ActivityPub protocol to federate. This module install and configure it with the required components (PostgreSQL and Redis).

Setup

What mastodon affects

This module will install PostgreSQL and Redis server.

Setup Requirements

You will need a host name registered in DNS.

Beginning with mastodon

You need to generate these secrets:

  • mastodon::db_password
  • mastodon::secret_key_base
  • mastodon::otp_secret
  • mastodon::vapid_private_key
  • mastodon::vapid_public_key

Usage

In your Puppetfile include:

mod 'mastodon',
    :git => 'https://codeberg.org/adelgado/puppet-mastodon.git',
    :branch => 'production'

Hiera data to set up the instance:

classes:
  - mastodon

mastodon::hostname: mastodon.example.org
mastodon::db_host: /var/run/postgresql
mastodon::db_port: 5432
mastodon::db_name: mastodon
mastodon::db_user: mastodon
mastodon::users:
  - username: my_custom_admin
    email: admin@example.org
    confirmed: true
    role: Owner
mastodon::config:
  SINGLE_USER_MODE: false
  REDIS_HOST: 127.0.0.1
  SMTP_SERVER: 127.0.0.1
  SMTP_PORT: 25
  SMTP_AUTH_METHOD: none
  SMTP_OPENSSL_VERIFY_MODE: none
  SMTP_ENABLE_STARTTLS: auto
  SMTP_FROM_ADDRESS: 'Mastodon <notifications@example.org>'

And some secrets in eyaml (you can do a first run that fails and then run RAILS_ENV=production bundle exec rake mastodon:setup to create this secrets).

mastodon::db_password: >
  ENC[PKCS7,]  

mastodon::secret_key_base: >
  ENC[PKCS7,]  

mastodon::otp_secret: >
  ENC[PKCS7,]  

mastodon::vapid_private_key: >
  ENC[PKCS7,]  

mastodon::vapid_public_key: >
  ENC[PKCS7,]  

Updating your instance

The module deploys a script to do updates. But many updates required extra steps that are not included in the script, so use it at your own risk. This script requires a Github token with access to read public repositories.

Limitations

Tested in Ubuntu

Development

Release Notes/Contributors/Etc.