1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

Port for Glitch-Soc

This commit is contained in:
Tagada 2020-05-17 13:55:46 +02:00
parent 6b30109fc9
commit edaa25d408
12 changed files with 95 additions and 105 deletions

View file

@ -1,24 +1,21 @@
# Mastodon for YunoHost # Glitch-Soc for YunoHost
[![Integration level](https://dash.yunohost.org/integration/mastodon.svg)](https://dash.yunohost.org/appci/app/mastodon)
[![Install Mastodon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mastodon)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install Mastodon quickly and simply on a YunoHost server. > *This package allow you to install Glitch-Soc quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
## Overview ## Overview
Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly. Glitch-Soc is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Glitch-Soc instance and participate in the social network seamlessly.
**Shipped version:** 3.1.2 **Shipped version:** 3.1.4
## Important points to read before installing ## Important points to read before installing
1. **Mastodon** require a dedicated **root domain**, eg. mastodon.domain.tld 1. **Glitch-Soc** require a dedicated **root domain**, eg. glitch.domain.tld
1. The user choosen during the installation is automatically created in Mastodon with admin rights 1. The user choosen during the installation is automatically created in Glitch-Soc with admin rights
1. At the end of the installation a mail is sent to the user with the automatically generated password 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. 1. It seems important to close the inscriptions for your Glitch-Soc, 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.
## Screenshots ## Screenshots
@ -32,7 +29,7 @@ Mastodon is a free, open-source social network. A decentralized alternative to c
``` ```
$ sudo apt-get install screen $ sudo apt-get install screen
$ screen $ screen
$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git $ sudo yunohost app install https://github.com/Tagadda/glitch-soc_ynh.git
``` ```
Recover after disconnect: Recover after disconnect:
``` ```
@ -44,7 +41,7 @@ $ screen -r
#### Using __screen__ highly recommended #### Using __screen__ highly recommended
`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` `$ sudo yunohost app upgrade glitch-soc -u https://github.com/Tagadda/glitch-soc_ynh --debug `
## Documentation ## Documentation
@ -56,16 +53,11 @@ $ screen -r
LDAP authentication is activated. All YunoHost users can authenticate. LDAP authentication is activated. All YunoHost users can authenticate.
#### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/)
## Links ## Links
* Report a bug: https://github.com/YunoHost-Apps/mastodon_ynh/issues * Report a bug: https://github.com/Tagadda/glitch-soc_ynh/issues
* App website: https://joinmastodon.org/ * App website: https://glitch-soc.github.io/docs/
* Upstream app repository: https://github.com/tootsuite/mastodon * Upstream app repository: https://github.com/glitch-soc/mastodon
* YunoHost website: https://yunohost.org/ * YunoHost website: https://yunohost.org/
--- ---
@ -73,11 +65,11 @@ LDAP authentication is activated. All YunoHost users can authenticate.
Developers info Developers info
---------------- ----------------
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing). Please do your pull request to the [testing branch](https://github.com/Tagadda/glitch-soc_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug sudo yunohost app install https://github.com/Tagadda/glitch-soc_ynh/tree/testing --debug
or or
sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug sudo yunohost app upgrade glitch-soc -u https://github.com/Tagadda/glitch-soc_ynh/tree/testing --debug
``` ```

View file

@ -1,24 +1,21 @@
# Mastodon pour YunoHost # Glitch-Soc pour YunoHost
[![Integration level](https://dash.yunohost.org/integration/mastodon.svg)](https://dash.yunohost.org/appci/app/mastodon)
[![Install Mastodon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mastodon)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Mastodon rapidement et simplement sur un serveur Yunohost. > *Ce package vous permet d'installer Glitch-Soc rapidement et simplement sur un serveur Yunohost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble ## Vue d'ensemble
Mastodon est un réseau social gratuit et open source. Une alternative décentralisée aux plates-formes commerciales, elle évite les risques d'une seule société qui monopolise votre communication. Choisissez un serveur sur lequel vous faites confiance - selon votre choix, vous pouvez interagir avec tous les autres. N'importe qui peut exécuter sa propre instance de Mastodon et participer au réseau social de façon transparente. Glitch-Soc est un réseau social gratuit et open source. Une alternative décentralisée aux plates-formes commerciales, elle évite les risques d'une seule société qui monopolise votre communication. Choisissez un serveur sur lequel vous faites confiance - selon votre choix, vous pouvez interagir avec tous les autres. N'importe qui peut exécuter sa propre instance de Glitch-Soc et participer au réseau social de façon transparente.
**Version incluse:** 3.1.2 **Version incluse:** 3.1.2
## Points importants à lire avant l'installation ## Points importants à lire avant l'installation
1. **Mastodon** nécessite un **nom de domaine** dédié, par exemple: mastodon.domain.tld 1. **Glitch-Soc** nécessite un **nom de domaine** dédié, par exemple: glitch.domain.tld
1. L'utilisateur sélectionné pendant l'installation sera créé automatiquement dans Mastodon avec des droits d'administration. 1. L'utilisateur sélectionné pendant l'installation sera créé automatiquement dans Glitch-Soc avec des droits d'administration.
1. A la fin de l'installation, un mail est envoyé à cet utilisateur avec le mot de passe qui a été généré automatiquement. 1. A la fin de l'installation, un mail est envoyé à cet utilisateur avec le mot de passe qui a été généré automatiquement.
1. Il semble important de fermer les inscriptions pour votre Mastodon, pour que ça reste une instance privé. Nous vous invitons à bloquer les instances distantes malfaisantes depuis l'interface d'administration. Vous pouvez également ajouter un texte sur votre page d'accueil dans l'administration. 1. Il semble important de fermer les inscriptions pour votre Glitch-Soc, pour que ça reste une instance privé. Nous vous invitons à bloquer les instances distantes malfaisantes depuis l'interface d'administration. Vous pouvez également ajouter un texte sur votre page d'accueil dans l'administration.
## Captures d'écran ## Captures d'écran
@ -32,7 +29,7 @@ Mastodon est un réseau social gratuit et open source. Une alternative décentra
``` ```
$ sudo apt-get install screen $ sudo apt-get install screen
$ screen $ screen
$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git $ sudo yunohost app install https://github.com/Tagadda/glitch-soc_ynh.git
``` ```
Récuperer l'installation après une deconnection: Récuperer l'installation après une deconnection:
``` ```
@ -43,9 +40,9 @@ L'utilisateur admin est crée automatiquement comme: user@domain.tld
### Mise àjour ### Mise àjour
#### Utilisation de __screen__ fortement recommandé #### Utilisation de __screen__ fortement recommandée
`$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug ` `$ sudo yunohost app upgrade glitch-soc -u https://github.com/Tagadda/glitch-soc_ynh --debug `
## Documentation ## Documentation
@ -57,16 +54,11 @@ L'utilisateur admin est crée automatiquement comme: user@domain.tld
L'authentification LDAP est activée. Tous les utilisateurs YunoHost peuvent s'authentifier. L'authentification LDAP est activée. Tous les utilisateurs YunoHost peuvent s'authentifier.
#### Architectures supportées
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/)
## Links ## Links
* Signaler un bug: https://github.com/YunoHost-Apps/mastodon_ynh/issues * Signaler un bug: https://github.com/Tagadda/glitch-soc_ynh/issues
* Site de l'application: https://joinmastodon.org/ * Site de l'application: https://glitch-soc.github.io/docs/
* Dépôt de l'application principale: https://github.com/tootsuite/mastodon * Dépôt de l'application principale: https://github.com/glitch-soc/mastodon
* Site web YunoHost: https://yunohost.org/ * Site web YunoHost: https://yunohost.org/
--- ---
@ -74,11 +66,10 @@ L'authentification LDAP est activée. Tous les utilisateurs YunoHost peuvent s'a
Informations pour les développeurs Informations pour les développeurs
---------------- ----------------
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/Tagadda/glitch-soc_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug sudo yunohost app install https://github.com/Tagadda/glitch-soc_ynh/tree/testing
ou sudo yunohost app upgrade glitch-soc -u https://github.com/Tagadda/glitch-soc_ynh/tree/testing --debug
sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug
``` ```

View file

@ -261,3 +261,30 @@ LDAP_TLS_NO_VERIFY=true
# Only allow federation with whitelisted domains, see # Only allow federation with whitelisted domains, see
# https://docs.joinmastodon.org/admin/config/#whitelist_mode # https://docs.joinmastodon.org/admin/config/#whitelist_mode
# WHITELIST_MODE=true # WHITELIST_MODE=true
# Glitch-Soc Specifics
# Maximum allowed character count
# MAX_TOOT_CHARS=500
# Maximum number of pinned posts
# MAX_PINNED_TOOTS=5
# Maximum allowed bio characters
# MAX_BIO_CHARS=500
# Maximim number of profile fields allowed
# MAX_PROFILE_FIELDS=4
# Maximum allowed display name characters
# MAX_DISPLAY_NAME_CHARS=30
# Maximum image and video/audio upload sizes
# Units are in bytes
# 1048576 bytes equals 1 megabyte
# MAX_IMAGE_SIZE=8388608
# MAX_VIDEO_SIZE=41943040
# Maximum search results to display
# Only relevant when elasticsearch is installed
# MAX_SEARCH_RESULTS=20

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.2.tar.gz SOURCE_URL=https://github.com/glitch-soc/mastodon/archive/b7e178d2e4102bdaa1ea41dfd8ed50093cf3f60a.tar.gz
SOURCE_SUM=c12fd8c1b426861825d37d2eab1d6356be05b2b321eae0c1b87f80fcc11b0da7 SOURCE_SUM=ff33ac8a06e8701a21fda86a568e0c1a320419adebb03967102b73bf6b7aa929
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,2 +1,2 @@
RAILS_ENV=production RAILS_ENV=production
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.5/bin/bundle exec rake __USER__:media:remove_remote @daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.6/bin/bundle exec rake __USER__:media:remove_remote

View file

@ -9,7 +9,7 @@
Environment="RAILS_ENV=production" Environment="RAILS_ENV=production"
Environment="DB_POOL=25" Environment="DB_POOL=25"
Environment="MALLOC_ARENA_MAX=2" Environment="MALLOC_ARENA_MAX=2"
ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec sidekiq -c 25 ExecStart=/opt/rbenv/versions/2.6.6/bin/bundle exec sidekiq -c 25
TimeoutSec=15 TimeoutSec=15
Restart=always Restart=always
StandardError=syslog StandardError=syslog

View file

@ -8,7 +8,7 @@
WorkingDirectory=__FINALPATH__/live WorkingDirectory=__FINALPATH__/live
Environment="RAILS_ENV=production" Environment="RAILS_ENV=production"
Environment="PORT=__PORT_WEB__" Environment="PORT=__PORT_WEB__"
ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec puma -C config/puma.rb ExecStart=/opt/rbenv/versions/2.6.6/bin/bundle exec puma -C config/puma.rb
ExecReload=/bin/kill -SIGUSR1 $MAINPID ExecReload=/bin/kill -SIGUSR1 $MAINPID
TimeoutSec=15 TimeoutSec=15
Restart=always Restart=always

View file

@ -1,25 +1,17 @@
{ {
"name": "Mastodon", "name": "Glitch-Soc",
"id": "mastodon", "id": "glitch-soc",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "A libre and federated social network.", "en": "A libre and federated social network.",
"fr": "Un réseau social libre et fédéré." "fr": "Un réseau social libre et fédéré."
}, },
"version": "3.1.2~ynh3", "version": "2020-05-14~ynh1",
"url": "https://github.com/tootsuite/mastodon", "url": "https://glitch-soc.github.io/docs/",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": [ "maintainer": [
{ {
"name": "cyp", "name": "Tagada"
"email": "cyp@rouquin.me"
},
{
"name": "nemsia",
"email": "nemsia@nemsia.org"
},
{
"name": "yalh76"
} }
], ],
"requirements": { "requirements": {

View file

@ -10,9 +10,3 @@
- [ ] Fix or enhancement tested. - [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested. - [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested. - [ ] Can be reviewed and tested.
## Package_check results
---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mastodon_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mastodon_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -110,9 +110,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
mkdir $final_path mkdir $final_path
ynh_setup_source --dest_dir="$final_path/live" ynh_setup_source --dest_dir="$final_path/live"
# Temporary workaround for https://github.com/tootsuite/mastodon/issues/13292
ynh_replace_string --match_string="sidekiq-unique-jobs (6.0.18)" --replace_string="sidekiq-unique-jobs (6.0.20)" --target_file="$final_path/live/Gemfile.lock"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -153,9 +150,9 @@ ynh_add_swap --size=$swap_needed
#================================================= #=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424 ynh_script_progression --message="Installing Ruby..." --weight=424
ynh_install_ruby --ruby_version=2.6.5 ynh_install_ruby --ruby_version=2.6.6
/opt/rbenv/versions/2.6.5/bin/gem update --system /opt/rbenv/versions/2.6.6/bin/gem update --system
/opt/rbenv/versions/2.6.5/bin/gem install bundler:1.17.3 --no-document /opt/rbenv/versions/2.6.6/bin/gem install bundler:1.17.3 --no-document
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -185,20 +182,20 @@ ynh_replace_string --match_string="__OTP_SECRET__" --replace_string="$otp_secret
ynh_app_setting_set --app="$app" --key=otp_secret --value="$otp_secret" ynh_app_setting_set --app="$app" --key=otp_secret --value="$otp_secret"
#================================================= #=================================================
# INSTALLING MASTODON # INSTALLING Glitch-Soc
#================================================= #=================================================
ynh_script_progression --message="Installing Mastodon..." --weight=2230 ynh_script_progression --message="Installing Glitch-Soc..." --weight=2230
chown -R "$app": "$final_path" chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs ynh_use_nodejs
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.6/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails db:setup --quiet sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rails db:setup --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:precompile --quiet sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rails assets:precompile --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt
popd popd
@ -231,12 +228,12 @@ sudo cp -f ../conf/cron /etc/cron.d/$app
ynh_script_progression --message="Configuring a systemd service..." --weight=5 ynh_script_progression --message="Configuring a systemd service..." --weight=5
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/mastodon-web.service" ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/glitch-web.service"
ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/mastodon-streaming.service" ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/glitch-streaming.service"
ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/mastodon-streaming.service" ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/glitch-streaming.service"
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" ynh_add_systemd_config --service="$app-web" --template="glitch-web.service"
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" ynh_add_systemd_config --service="$app-sidekiq" --template="glitch-sidekiq.service"
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" ynh_add_systemd_config --service="$app-streaming" --template="glitch-streaming.service"
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # STORE THE CONFIG FILE CHECKSUM

View file

@ -174,7 +174,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=14 ynh_script_progression --message="Upgrading source files..." --weight=14
# Download Mastodon # Download Glitch-Soc
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
mkdir $tmpdir/system mkdir $tmpdir/system
@ -185,9 +185,6 @@ then
ynh_secure_remove --file="$final_path/live" ynh_secure_remove --file="$final_path/live"
ynh_setup_source --dest_dir="$final_path/live" ynh_setup_source --dest_dir="$final_path/live"
# Temporary workaround for https://github.com/tootsuite/mastodon/issues/13292
ynh_replace_string --match_string="sidekiq-unique-jobs (6.0.18)" --replace_string="sidekiq-unique-jobs (6.0.20)" --target_file="$final_path/live/Gemfile.lock"
if [ -d "$tmpdir/system" ]; then if [ -d "$tmpdir/system" ]; then
rsync -a "$tmpdir/system" "$final_path/live/public/." rsync -a "$tmpdir/system" "$final_path/live/public/."
fi fi
@ -277,19 +274,19 @@ ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "$final_p
ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "$final_path/live/.env.production" ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "$final_path/live/.env.production"
#================================================= #=================================================
# UPGRADE MASTODON # UPGRADE Glitch-Soc
#================================================= #=================================================
ynh_script_progression --message="Upgrading Mastodon..." --weight=2640 ynh_script_progression --message="Upgrading Glitch-Soc..." --weight=2640
chown -R "$app": "$final_path" chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs ynh_use_nodejs
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.6/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:clean sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rails db:migrate
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:precompile sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rails assets:clean
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails db:migrate sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.6/bin/bundle exec rails assets:precompile
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear
popd popd
@ -323,12 +320,12 @@ sudo cp -f ../conf/cron /etc/cron.d/$app
ynh_script_progression --message="Upgrading systemd configuration..." --weight=13 ynh_script_progression --message="Upgrading systemd configuration..." --weight=13
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/mastodon-web.service" ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/glitch-web.service"
ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/mastodon-streaming.service" ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/glitch-streaming.service"
ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/mastodon-streaming.service" ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/glitch-streaming.service"
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" ynh_add_systemd_config --service="$app-web" --template="glitch-web.service"
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" ynh_add_systemd_config --service="$app-sidekiq" --template="glitch-sidekiq.service"
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" ynh_add_systemd_config --service="$app-streaming" --template="glitch-streaming.service"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION