Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to v2 #383

Merged
merged 36 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7903402
convert script
Tagadda May 19, 2023
282ae0c
v2
Tagadda May 19, 2023
7e9e890
Auto-update README
yunohost-bot May 19, 2023
976c4d7
Update documentation cc @panomaki
Tagadda May 19, 2023
f4715ad
Merge branch 'v2' of github.com:YunoHost-Apps/mastodon_ynh into v2
Tagadda May 19, 2023
012709e
Bump ruby version from 3.0.6 to 3.2.2
Tagadda May 19, 2023
83a62ff
v2
Tagadda May 19, 2023
4b59c52
Auto-update README
yunohost-bot May 19, 2023
2f0b5d5
woops
Tagadda May 19, 2023
0bcdd05
v2
Tagadda May 19, 2023
28ad658
v2
Tagadda May 19, 2023
e1a8a6e
s/final_path/install_dir
Tagadda May 19, 2023
a840baa
Update PRE_INSTALL.md
Tagadda May 19, 2023
85d4b38
too soon...
Tagadda May 19, 2023
13a1bdf
v2
Tagadda May 19, 2023
803bb86
v2
Tagadda May 19, 2023
837f6c5
v2
Tagadda May 19, 2023
0b51807
Update tests.toml
Tagadda May 29, 2023
89c3ecd
Update doc/PRE_INSTALL.md
Tagadda Jul 7, 2023
915c7a6
Update doc/PRE_INSTALL_fr.md
Tagadda Jul 7, 2023
d018415
Update tests.toml
Tagadda Jul 7, 2023
f76938c
Update tests.toml
Tagadda Jul 7, 2023
e406e90
Update doc/PRE_INSTALL.md
Tagadda Jul 7, 2023
766bcd8
Update doc/PRE_INSTALL_fr.md
Tagadda Jul 7, 2023
c7e785b
Apply suggestions
Tagadda Jul 7, 2023
a84aafe
Update manifest.toml
Tagadda Jul 7, 2023
3a8ed61
Merge branch 'testing' into v2
Tagadda Jul 7, 2023
cf0ef78
Merge branch 'testing' into v2
ericgaspar Jul 8, 2023
6015d50
Auto-update README
yunohost-bot Jul 8, 2023
ec7d940
Update manifest.toml
Tagadda Jul 8, 2023
a0da337
Update scripts
Tagadda Jul 8, 2023
2bc23a0
Auto-update README
yunohost-bot Jul 8, 2023
846dbc1
Remove SSO integration
Tagadda Jul 19, 2023
3a7b5b6
Use new mail mechanism
Tagadda Jul 19, 2023
8bd3461
cleaning
Tagadda Jul 19, 2023
862de28
Update manifest.toml
Tagadda Jul 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,6 @@ Mastodon is a free, open-source microblogging social network. It is a decentrali

![Screenshot of Mastodon](./doc/screenshots/mastodon.png)

## Disclaimers / important information

## Important points to read before installing

1. **Mastodon** require a dedicated **root domain**, eg. mastodon.domain.tld
1. The user choosen during the installation is automatically created in Mastodon with admin rights
1. At the end of the installation a mail is sent to the user with the automatically generated password
1. It seems important to close the inscriptions for your Mastodon, so that it remains a private body. We invite you to block remote malicious instances from the administration interface. You can also add text on your home page.

## Configuration

### Install

#### Using *screen* in case of disconnect
```
$ sudo apt-get install screen
$ screen
$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git
```
Recover after disconnect:
```
$ screen -d
$ screen -r
```

### Update

#### Using *screen* highly recommended

`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug `

### Administrate with tooctl

`$ (cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help)`

## YunoHost specific features

#### Multi-users support

LDAP authentication is activated. All YunoHost users can authenticate.

Log-out from YunoHost's portal doesn't log out from Mastodon. See https://github.com/YunoHost/issues/issues/501

## Documentation and resources

* Official app website: <https://joinmastodon.org/>
Expand Down
48 changes: 0 additions & 48 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,6 @@ Mastodon est un réseau social de microblog auto-hébergé et open source. C'est

![Capture d’écran de Mastodon](./doc/screenshots/mastodon.png)

## Avertissements / informations importantes

## Points importants à lire avant l'installation

1. **Mastodon** nécessite un **nom de domaine** dédié, par exemple : mastodon.domain.tld
1. L'utilisateur sélectionné pendant l'installation sera créé automatiquement dans Mastodon avec des droits d'administration.
1. À la fin de l'installation, un mail est envoyé à cet utilisateur avec un mot de passe généré automatiquement.
1. Pour que votre instance Mastodon reste privée, il est important de fermer les inscriptions. Nous vous invitons à bloquer les instances distantes indésirables depuis l'interface d'administration. Vous pouvez également ajouter un texte sur votre page d'accueil dans l'administration.

## Captures d'écran

![](https://framalibre.org/sites/default/files/mastodon.png)

## Configuration

### Installation

#### Utilisation de *screen* en cas de déconnection
```
$ sudo apt-get install screen
$ screen
$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git
```
Récupérer l'installation après une deconnection :
```
$ screen -d
$ screen -r
```
L'utilisateur admin est créé automatiquement comme : user@domain.tld

### Mise à jour

#### Utilisation de *screen* fortement recommandée

`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug `

### Administration avec tooctl

`$ (cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help)`

## Caractéristiques spécifiques YunoHost

#### Support multi-utilisateur

L'authentification LDAP est activée. Tous les utilisateurs YunoHost peuvent s'authentifier.

Se déconnecter depuis le portail YunoHost ne vous déconnecte pas de Mastodon. Voir https://github.com/YunoHost/issues/issues/501

## Documentations et ressources

* Site officiel de l’app : <https://joinmastodon.org/>
Expand Down
22 changes: 0 additions & 22 deletions check_process

This file was deleted.

41 changes: 21 additions & 20 deletions conf/.env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ DB_NAME=__DB_NAME__
DB_PASS=__DB_PWD__
DB_PORT=5432

# ElasticSearch (optional)
# Elasticsearch (optional)
# ------------------------
# ES_ENABLED=true
# ES_HOST=es
ES_ENABLED=false
# ES_HOST=localhost
# ES_PORT=9200
# Authentication for ES (optional)
# ES_USER=elastic
# ES_PASS=password

# Secrets
# -------
Expand All @@ -54,17 +57,12 @@ VAPID_PUBLIC_KEY=__VAPID_PUBLIC_KEY__
# ------------
SMTP_SERVER=localhost
SMTP_PORT=25
#SMTP_LOGIN=
#SMTP_PASSWORD=
Tagadda marked this conversation as resolved.
Show resolved Hide resolved
SMTP_FROM_ADDRESS=__ADMIN_MAIL__
#SMTP_REPLY_TO=
#SMTP_DOMAIN= # defaults to LOCAL_DOMAIN
SMTP_DELIVERY_METHOD=sendmail # delivery method can also be smtp
SMTP_AUTH_METHOD=none
#SMTP_CA_FILE=/etc/ssl/certs/ca-certificates.crt
SMTP_LOGIN=__APP__
SMTP_PASSWORD=__MAIL_PWD__
SMTP_FROM_ADDRESS=Mastodon <__APP__@__DOMAIN__>
SMTP_DELIVERY_METHOD=smtp
SMTP_AUTH_METHOD=plain
SMTP_OPENSSL_VERIFY_MODE=none
#SMTP_ENABLE_STARTTLS_AUTO=true
#SMTP_TLS=true

# Registrations
# ------------
Expand All @@ -80,16 +78,13 @@ DEFAULT_LOCALE=__LANGUAGE__

# File storage (optional)
# -----------------------
# S3_ENABLED=true
# S3_BUCKET=
S3_ENABLED=false
# S3_BUCKET=files.example.com
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_PROTOCOL=http
# S3_HOSTNAME=192.168.1.123:9000
# S3_ALIAS_HOST=
# S3_ALIAS_HOST=files.example.com

# LDAP authentication (optional)
# IP and session retention
# -----------------------
LDAP_ENABLED=true
LDAP_HOST=localhost
Expand All @@ -105,3 +100,9 @@ LDAP_UID_CONVERSION_ENABLED=true
LDAP_UID_CONVERSION_SEARCH=., -
LDAP_UID_CONVERSION_REPLACE=_
LDAP_TLS_NO_VERIFY=true

# Make sure to modify the scheduling of ip_cleanup_scheduler in config/sidekiq.yml
# to be less than daily if you lower IP_RETENTION_PERIOD below two days (172800).
# -----------------------
IP_RETENTION_PERIOD=1209600
SESSION_RETENTION_PERIOD=1209600
7 changes: 0 additions & 7 deletions conf/app.src

This file was deleted.

10 changes: 5 additions & 5 deletions conf/cron
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a system cron file, see crontab(5)
# m h dom mon dow user command
@daily __APP__ cd __FINAL_PATH__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl media remove
@monthly __APP__ cd __FINAL_PATH__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl media remove-orphans
@monthly __APP__ cd __FINAL_PATH__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl accounts cull
@monthly __APP__ cd __FINAL_PATH__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl statuses remove
@monthly __APP__ cd __FINAL_PATH__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl preview_cards remove
@daily __APP__ cd __INSTALL_DIR__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl media remove
@monthly __APP__ cd __INSTALL_DIR__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl media remove-orphans
@monthly __APP__ cd __INSTALL_DIR__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl accounts cull
@monthly __APP__ cd __INSTALL_DIR__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl statuses remove
@monthly __APP__ cd __INSTALL_DIR__/live && __YNH_RUBY_LOAD_PATH__ __LD_PRELOAD__ RAILS_ENV=production bin/tootctl preview_cards remove
4 changes: 2 additions & 2 deletions conf/mastodon-sidekiq.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ After=network.target
[Service]
Type=simple
User=__APP__
WorkingDirectory=__FINALPATH__/live
WorkingDirectory=__INSTALL_DIR__/live
Environment="__LD_PRELOAD__"
Environment="RAILS_ENV=production"
Environment="DB_POOL=25"
Environment="MALLOC_ARENA_MAX=2"
Environment="__YNH_RUBY_LOAD_PATH__"
ExecStart=__FINALPATH__/live/bin/bundle exec sidekiq -c 25
ExecStart=__INSTALL_DIR__/live/bin/bundle exec sidekiq -c 25
TimeoutSec=15
Restart=always
StandardError=syslog
Expand Down
2 changes: 1 addition & 1 deletion conf/mastodon-streaming.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
User=__APP__
WorkingDirectory=__FINALPATH__/live
WorkingDirectory=__INSTALL_DIR__/live
Environment="NODE_ENV=production"
Environment="PORT=__PORT_STREAM__"
Environment="STREAMING_CLUSTER_NUM=1"
Expand Down
4 changes: 2 additions & 2 deletions conf/mastodon-web.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ After=network.target
[Service]
Type=simple
User=__APP__
WorkingDirectory=__FINALPATH__/live
WorkingDirectory=__INSTALL_DIR__/live
Environment="__LD_PRELOAD__"
Environment="RAILS_ENV=production"
Environment="PORT=__PORT_WEB__"
Environment="__YNH_RUBY_LOAD_PATH__"
ExecStart=__FINALPATH__/live/bin/bundle exec puma -C config/puma.rb
ExecStart=__INSTALL_DIR__/live/bin/bundle exec puma -C config/puma.rb
ExecReload=/bin/kill -SIGUSR1 $MAINPID
TimeoutSec=15
Restart=always
Expand Down
2 changes: 1 addition & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
client_max_body_size 99m;

root __FINALPATH__/live/public;
root __INSTALL_DIR__/live/public;

location / {

Expand Down
36 changes: 36 additions & 0 deletions doc/ADMIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Administrate with tooctl

`$ (cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help)`

## Update

**`screen` (or `tmux`) can be used to make sure your session is not interrupted in case of connection problems.**
See [tutorial](https://www.howtogeek.com/662422/how-to-use-linuxs-screen-command/) for more background information.

```
$ screen
$ sudo yunohost app upgrade mastodon
```

## Backups

First of all: Mastodon uses a local cache to save media (such as posted images, videos etc.). This cache can grow huge.
You could consider cleaning up your local cache first as otherwise your backup will be very big and you might run out of disk space:

To check your space usage, on a command line run:

`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage`

If your cache is too big to backup, you can run the following command to clean up Attachments (the first line). Substitute X by the number of days you want to keep, e.g. 1 day. All older images will be deleted but will be refetched from the original server if necessary.

First dry-run to see how much space is freed up (without actually removing):

`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`

If all looks good commit the cleanup:

`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X `

## Known Bugs

- Log-out from YunoHost's portal doesn't log out from Mastodon. See https://github.com/YunoHost/issues/issues/501
34 changes: 34 additions & 0 deletions doc/ADMIN_fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Administration avec tooctl

`$ cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help`

## Mise à jour

**`screen` (ou `tmux`) peut être utilisé pour vous assurer que votre session n'est pas interrompue en cas de problème de connection.**
Consultez ce [tutoriel](https://www.howtogeek.com/662422/how-to-use-linuxs-screen-command/) pour plus de détails.

```
$ screen
$ sudo yunohost app upgrade mastodon
```

## Sauvegardes

Tout d'abord : Mastodon utilise un cache local pour sauvegarder les médias (comme les images, vidéos, etc). Ce cache peut devenir énorme.
Vous devriez réfléchir à vider votre cache local avant de faire une sauvegarde, qui pourrait être énorme et vous pourriez manquer d'espace de stockage.

Pour vérifier l'utilisation du stockage, en ligne de commande utilisez :

`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media usage`

Si le cache est trop gros pour être sauvegardé, vous pouvez lancer la commande suivante pour en supprimer les médias attachés. Changez `X` par le nombre de cache à conserver, par ex. 1 jour. Tous les médias plus anciens seront supprimés, mais ils pourront être rechargé du serveur d'origine si nécessaire.

En premier faite un essai à blanc pour voir combien de place sera libérée (sans rien supprimer):
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X --dry-run`

Si cela semble bon, effectuez le nettoyage :
`$ sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl media remove --days=X `

## Bugs connus

- Se déconnecter depuis le portail YunoHost ne vous déconnecte pas de Mastodon. Voir https://github.com/YunoHost/issues/issues/501
40 changes: 0 additions & 40 deletions doc/DISCLAIMER.md

This file was deleted.

Loading