diff --git a/README.md b/README.md index c0caee6..e4d5bde 100644 --- a/README.md +++ b/README.md @@ -382,8 +382,9 @@ The aims is to provide a ready-to-run recipes that you can just copy, paste and # Social -- [Monica](apps/social/monica.md) - [Etesync](apps/social/etesync.md) +- [Monica](apps/social/monica.md) +- [Mastodon](apps/social/mastodon.md) ### Other untested - [HumHub](https://www.humhub.com/en) 🔗 - Free social network software and framework. diff --git a/apps/social/mastodon.md b/apps/social/mastodon.md new file mode 100644 index 0000000..a380ca1 --- /dev/null +++ b/apps/social/mastodon.md @@ -0,0 +1,101 @@ +# Mastodon +Free, open-source social network server based on ActivityPub. + +
+ +- [Homepage](https://joinmastodon.org) +- [Docs](https://docs.joinmastodon.org/) +- [LinuxServer docs](https://docs.linuxserver.io/images/docker-mastodon) + + +## Prerequisites +- To generate keys for `SECRET_KEY_BASE` & `OTP_SECRET` run the following command once for each: +```sh +docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon generate-secret +``` + +- To generate keys for `VAPID_PRIVATE_KEY` & `VAPID_PUBLIC_KEY` run: + +```sh +docker run --rm -it --entrypoint /bin/bash lscr.io/linuxserver/mastodon generate-vapid +``` + +- To use `tootctl` run: +```sh +# create account +docker compose exec mastodon /tootctl accounts create \ + admin \ + --email admin@example.com \ + --role Owner \ + --confirmed + +# approve the account +docker compose exec mastodon /tootctl accounts approve admin +``` + + + +```yaml +--- +services: + redis: + image: redis:alpine + container_name: mastodon-redis + restart: unless-stopped + environment: + - TZ=Europe/Dublin + volumes: + - ./redis:/data + + db: + image: postgres:latest + environment: + - POSTGRES_DB=mastodon + - POSTGRES_USER=mastodon + - POSTGRES_PASSWORD=mastodon + + volumes: + - ./db:/var/lib/postgresql/data + + mastodon: + image: lscr.io/linuxserver/mastodon:latest + container_name: mastodon + restart: unless-stopped + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Dublin + - LOCAL_DOMAIN=example.com + - WEB_DOMAIN=mastodon.example.com #optional + - EMAIL_DOMAIN_ALLOWLIST=example.com|example.org + + - REDIS_HOST=redis + - REDIS_PORT=6379 + + - DB_HOST=db + - DB_USER=mastodon + - DB_NAME=mastodon + - DB_PASS=mastodon + - DB_PORT=5432 + + - SECRET_KEY_BASE= + - OTP_SECRET= + + - ES_ENABLED=false + - S3_ENABLED=false + + - VAPID_PRIVATE_KEY= + - VAPID_PUBLIC_KEY= + + - SMTP_SERVER= + - SMTP_PORT=25 + - SMTP_LOGIN= + - SMTP_PASSWORD= + - SMTP_FROM_ADDRESS=mastodon@example.com + + volumes: + - ./config:/config + ports: + - 3040:80 + - 3041:443 +```