Mastodon est un réseau social de micro-blogging libre et décentralisé. Il est une bonne alternative à Twitter. Voici comment tester un peu ses possibilités.
Prérequis
Avoir installé Docker.
Installation
Pour faire simple (bien que brutal) cloner le dépôt Github du projet.
1 |
$ git clone https://github.com/tootsuite/mastodon.git |
Ensuite copier et éditer le fichier de configuration.
1 |
$ cp .env.production.sample .env.production |
L’éditer et remplir les champs suivants :
1 2 |
LOCAL_DOMAIN=</code> # d'abord remplis avec localhost j'ai ensuite laissé vide parce que mon instance est locale (pour mes tests) LOCAL_HTTPS=false # true si certificat |
Pour la configuration SMTP utiliser Mailgun ou tout autre serveur SMTP.
1 2 3 4 5 6 |
SMTP_SERVER=smtp.mailgun.org SMTP_PORT=587 SMTP_LOGIN=toto SMTP_PASSWORD=1234 SMTP_FROM_ADDRESS=notifications@example.com <strong>SMTP_DOMAIN=example.com</strong> |
Ajouter l’option SMTP_DOMAIN ce qui vous évitera des heures de recherches.
Lancer ensuite un build
1 |
docker-compose build |
Puis générer la clé secrète
1 |
docker-compose run --rm web rake secret |
Si tout ce passe bien recopier la clé dans le fichier .env.production
Créer la base de données
1 2 |
docker-compose run --rm web rails db:migrate |
Et compiler les assets
1 2 |
docker-compose run --rm web rails assets:precompile |
Vous pouver lancer le monstre :
1 2 |
docker-compose up |
Ou en mode démon :
1 2 |
docker-compose up -d |
Connectez vous sur le port 3000 : http://localhost:3000
Exemple Configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# Service dependencies REDIS_HOST=redis REDIS_PORT=6379 DB_HOST=db DB_USER=postgres DB_NAME=postgres DB_PASS= DB_PORT=5432 # Federation LOCAL_DOMAIN= LOCAL_HTTPS=false # Application secrets # Generate each with the `rake secret` task (`docker-compose run --rm web rake secret` if you use docker compose) PAPERCLIP_SECRET= SECRET_KEY_BASE=<secret> OTP_SECRET= # Registrations # Single user mode will disable registrations and redirect frontpage to the first profile # SINGLE_USER_MODE=true # Prevent registrations with following e-mail domains # EMAIL_DOMAIN_BLACKLIST=example1.com|example2.de|etc # Only allow registrations with the following e-mail domains # EMAIL_DOMAIN_WHITELIST=example1.com|example2.de|etc # Optionally change default language DEFAULT_LOCALE=fr # E-mail configuration # Note: Mailgun and SparkPost (https://sparkpo.st/smtp) each have good free tiers SMTP_SERVER=smtp.mailgun.org SMTP_PORT=587 SMTP_LOGIN= SMTP_PASSWORD= SMTP_FROM_ADDRESS=notifications@example.com #SMTP_DELIVERY_METHOD=smtp # delivery method can also be sendmail #SMTP_AUTH_METHOD=plain #SMTP_OPENSSL_VERIFY_MODE=peer #SMTP_ENABLE_STARTTLS_AUTO=true # Optional asset host for multi-server setups # CDN_HOST=assets.example.com # S3 (optional) # S3_ENABLED=true # S3_BUCKET= # AWS_ACCESS_KEY_ID= # AWS_SECRET_ACCESS_KEY= # S3_REGION= # S3_PROTOCOL=http # S3_HOSTNAME=192.168.1.123:9000 # S3 (Minio Config (optional) Please check Minio instance for details) # S3_ENABLED=true # S3_BUCKET= # AWS_ACCESS_KEY_ID= # AWS_SECRET_ACCESS_KEY= # S3_REGION= # S3_PROTOCOL=https # S3_HOSTNAME= # S3_ENDPOINT= # Optional alias for S3 if you want to use Cloudfront or Cloudflare in front # S3_CLOUDFRONT_HOST= # Streaming API integration # STREAMING_API_BASE_URL= # Advanced settings # If you need to use pgBouncer, you need to disable prepared statements: # PREPARED_STATEMENTS=false |
Administration
Créer un utilisateur avec l’interface de création de compte et le définir comme administrateur.
1 |
docker-compose run --rm web rails mastodon:make_admin USERNAME=<user> |
Sources
https://angristan.fr/installer-instance-mastodon-debian-8/
https://blog.lertsenem.com/creer-son-instance-mastodon-perso-vite-fait-mal-fait-fr.html