Add Mastodon (#538)

* Add Mastodon

* Add Vapid Keys and Fix Internal Network

* Update Sidekiq

* Update Install

* Update Install CMDs

* Trying the LinuxServer Image

* Update port

* Change Path

* Remove Streaming

* traefik updates

* Remove Command

* Update docker-compose.yml

* Update docker-compose.yml

* Change Traefik

* Update

* Update config.json

* Update Configs

* Add Version Warning

* Update Local Domain

* Update Version

* Add ES

* Test ES

* Update Path

* Remove ES, Revert Final Build
This commit is contained in:
DrMxrcy 2023-05-23 16:07:33 -04:00 committed by GitHub
parent a6f5fe6b90
commit 34ab4a2a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 236 additions and 0 deletions

94
apps/mastodon/config.json Normal file
View File

@ -0,0 +1,94 @@
{
"$schema": "../schema.json",
"name": "Mastodon",
"port": 8210,
"available": true,
"exposable": true,
"force_expose": true,
"generate_vapid_keys": true,
"id": "mastodon",
"tipi_version": 1,
"version": "4.1.2",
"categories": ["social"],
"description": "Your self-hosted, globally interconnected microblogging community",
"short_desc": "Your self-hosted, globally interconnected microblogging community",
"author": "Mastodon",
"source": "https://github.com/mastodon/mastodon",
"form_fields": [
{
"type": "random",
"label": "Mastodon Redis Password",
"min": 32,
"max": 32,
"env_variable": "MASTODON_REDIS_PASSWORD"
},
{
"type": "random",
"label": "Mastodon Postgres Password",
"min": 32,
"max": 32,
"env_variable": "MASTODON_POSTGRES_PASSWORD"
},
{
"type": "random",
"label": "Mastodon Secret Key Base",
"min": 64,
"max": 64,
"env_variable": "MASTODON_SECRET_KEY_BASE"
},
{
"type": "random",
"label": "Mastodon OTP Secret",
"min": 64,
"max": 64,
"env_variable": "MASTODON_OTP_SECRET"
},
{
"type": "text",
"label": "SMTP Host",
"hint": "Your SMTP Server",
"placeholder": "smtp.example.com",
"required": true,
"env_variable": "MASTODON_SMTP_SERVER"
},
{
"type": "text",
"label": "SMTP Port",
"hint": "Your SMTP Port",
"placeholder": "25",
"required": true,
"env_variable": "MASTODON_SMTP_PORT"
},
{
"type": "text",
"label": "SMTP Username",
"hint": "Your SMTP Server User/Username",
"placeholder": "noreply@example.com",
"required": true,
"env_variable": "MASTODON_SMTP_LOGIN"
},
{
"type": "text",
"label": "SMTP Password",
"hint": "Your SMTP Server Password",
"required": true,
"env_variable": "MASTODON_SMTP_PASSWORD"
},
{
"type": "text",
"label": "SMTP From Address",
"hint": "Make sure the Format is like noreply@example.com",
"placeholder": "noreply@example.com",
"required": true,
"env_variable": "MASTODON_SMTP_FROM_ADDRESS"
},
{
"type": "text",
"label": "Mastodon Local domain",
"hint": "Could be the same of the Exposed Domain. Ex: social.example.com",
"placeholder": "example.com",
"required": true,
"env_variable": "MASTODON_LOCAL_DOMAIN"
}
]
}

View File

@ -0,0 +1,96 @@
version: "3"
services:
mastodon:
container_name: mastodon
image: lscr.io/linuxserver/mastodon:4.1.2
ports:
- 8209:80
- ${APP_PORT}:443
volumes:
- ${APP_DATA_DIR}/data/mastodon-config:/config
environment:
- PUID=1000
- PGID=1000
- TZ=${TZ}
- LOCAL_DOMAIN=${MASTODON_LOCAL_DOMAIN}
- WEB_DOMAIN=${APP_DOMAIN}
- VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY}
- VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY}
- REDIS_HOST=mastodon-redis
- REDIS_PASSWORD=${MASTODON_REDIS_PASSWORD}
- REDIS_PORT=6379
- DB_HOST=mastodon-db
- DB_USER=tipi
- DB_NAME=mastodon
- DB_PASS=${MASTODON_POSTGRES_PASSWORD}
- DB_PORT=5432
- ES_ENABLED=false
#- ES_HOST=mastodon-es
#- ES_PORT=9200
#- ES_USER=elastic
#- ES_PASS=${MASTODON_ELASTIC_PASSWORD}
- SECRET_KEY_BASE=${MASTODON_SECRET_KEY_BASE}
- OTP_SECRET=${MASTODON_OTP_SECRET}
- SMTP_SERVER=${MASTODON_SMTP_SERVER}
- SMTP_PORT=${MASTODON_SMTP_PORT}
- SMTP_LOGIN=${MASTODON_SMTP_LOGIN}
- SMTP_PASSWORD=${MASTODON_SMTP_PASSWORD}
- SMTP_FROM_ADDRESS=${MASTODON_SMTP_FROM_ADDRESS}
- S3_ENABLED=false
#- S3_BUCKET=files.example.com
# - AWS_ACCESS_KEY_ID=
#- AWS_SECRET_ACCESS_KEY=
#- S3_ALIAS_HOST=files.example.com
- SIDEKIQ_ONLY=false
- SIDEKIQ_DEFAULT=false
- SIDEKIQ_THREADS=5
restart: unless-stopped
networks:
- tipi_main_network
labels:
traefik.enable: ${APP_EXPOSED}
traefik.http.routers.mastodon.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.mastodon.entrypoints: websecure
traefik.http.routers.mastodon.service: mastodon
traefik.http.routers.mastodon.tls.certresolver: myresolver
traefik.http.services.mastodon.loadbalancer.server.port: 443
traefik.http.services.mastodon.loadbalancer.serverstransport: insecuretransport@file
traefik.http.services.mastodon.loadbalancer.server.scheme: https
depends_on:
mastodon-db:
condition: service_healthy
mastodon-redis:
condition: service_healthy
mastodon-db:
restart: always
container_name: mastodon-db
image: postgres:14-alpine
shm_size: 256mb
environment:
POSTGRES_PASSWORD: ${MASTODON_POSTGRES_PASSWORD}
POSTGRES_USER: tipi
POSTGRES_DB: mastodon
PG_DATA: /var/lib/postgresql/data
POSTGRES_HOST_AUTH_METHODL: trust
networks:
- tipi_main_network
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- ${APP_DATA_DIR}/data/postgres:/var/lib/postgresql/data
mastodon-redis:
restart: always
image: redis:7-alpine
command: redis-server --appendonly yes --replica-read-only no --requirepass "${MASTODON_REDIS_PASSWORD}"
container_name: mastodon-redis
networks:
- tipi_main_network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
volumes:
- ${APP_DATA_DIR}/data/redis:/data

View File

@ -0,0 +1,46 @@
## Installation Notice
- *Mastodon is a heavy app, and may take a bit longer to fully start up.*
- Must be on Tipi Version **1.4.0** for the expose app to work!
#### Local Domain Varibale
- The local domain variable ca be the same as the exposed domain (Ex: social.example.com). But you could have the exposed domain as social.example.com and the username url as example.com.
## Initial User Setup
1. SSH into your Tipi Server
2. Fill in your credentials (some_username,someone@example.org, some_very_good_password), then run the command:
```
sudo docker exec -it -w /app/www mastodon bin/tootctl accounts create some_username --email someone@example.org --confirmed --role Owner
```
---
Mastodon is a **free, open-source social network server** based on ActivityPub where users can follow friends and discover new ones. On Mastodon, users can publish anything they want: links, pictures, text, video. All Mastodon servers are interoperable as a federated network (users on one server can seamlessly communicate with users from another one, including non-Mastodon software that implements ActivityPub!)
Click below to **learn more** in a video:
[![Screenshot](https://camo.githubusercontent.com/d34a13f7f5e15d1ae46d5920f85973f19e1238adae8cbba5989e71b273179f37/68747470733a2f2f626c6f672e6a6f696e6d6173746f646f6e2e6f72672f323031382f30362f7768792d61637469766974797075622d69732d7468652d6675747572652f657a6769662d322d363066316230303430332e676966)](https://www.youtube.com/watch?v=IPSbNdBmWKE) [![Screenshot](https://camo.githubusercontent.com/d34a13f7f5e15d1ae46d5920f85973f19e1238adae8cbba5989e71b273179f37/68747470733a2f2f626c6f672e6a6f696e6d6173746f646f6e2e6f72672f323031382f30362f7768792d61637469766974797075622d69732d7468652d6675747572652f657a6769662d322d363066316230303430332e676966)](https://www.youtube.com/watch?v=IPSbNdBmWKE)[](https://www.youtube.com/watch?v=IPSbNdBmWKE)
## Features
[![](https://github.com/mastodon/mastodon/raw/main/app/javascript/images/elephant_ui_working.svg?raw=true)](https://github.com/mastodon/mastodon/blob/main/app/javascript/images/elephant_ui_working.svg?raw=true)
### No vendor lock-in: Fully interoperable with any conforming platform
It doesn't have to be Mastodon; whatever implements ActivityPub is part of the social network! [Learn more](https://blog.joinmastodon.org/2018/06/why-activitypub-is-the-future/)
### Real-time, chronological timeline updates
Updates of people you're following appear in real-time in the UI via WebSockets. There's a firehose view as well!
### Media attachments like images and short videos
Upload and view images and WebM/MP4 videos attached to the updates. Videos with no audio track are treated like GIFs; normal videos loop continuously!
### Safety and moderation tools
Mastodon includes private posts, locked accounts, phrase filtering, muting, blocking and all sorts of other features, along with a reporting and moderation system. [Learn more](https://blog.joinmastodon.org/2018/07/cage-the-mastodon/)
### OAuth2 and a straightforward REST API
Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Streaming APIs. This results in a rich app ecosystem with a lot of choices!

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB