mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
Apply example_ynh
This commit is contained in:
parent
cc4c8e73e6
commit
f028b7f2af
11 changed files with 346 additions and 113 deletions
94
README.md
94
README.md
|
@ -1,5 +1,13 @@
|
||||||
# Mastodon for YunoHost
|
# Mastodon 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)*
|
||||||
|
|
||||||
|
> *This package allow you to install mastodon 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.*
|
||||||
|
|
||||||
[![Latest Version](https://img.shields.io/badge/version-2.7.1-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
[![Latest Version](https://img.shields.io/badge/version-2.7.1-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||||
[![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
|
[![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
|
||||||
[![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
|
[![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
|
||||||
|
@ -7,59 +15,22 @@
|
||||||
[![Yunohost version](https://img.shields.io/badge/yunohost-2.7.12_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost)
|
[![Yunohost version](https://img.shields.io/badge/yunohost-2.7.12_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost)
|
||||||
[![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues)
|
[![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues)
|
||||||
|
|
||||||
[![Install Mastodon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=mastodon)
|
|
||||||
|
|
||||||
:warning: MAJ 05/06/17 :Cette application peut maintenant fonctionner sur ARM, mais l'installation prend plusieurs heures et il faut ajouter un swapfile de 1Go.
|
|
||||||
|
|
||||||
:warning: Cette application utilise les packages backports de Debian, nous vous recommendons de ne pas installer cette application directement en production
|
|
||||||
|
|
||||||
:warning: UPDATE 05/06/17 :This app can work now on ARM, but installation takes several hours and you must add a swapfile of 1GB.
|
:warning: UPDATE 05/06/17 :This app can work now on ARM, but installation takes several hours and you must add a swapfile of 1GB.
|
||||||
|
|
||||||
:warning: This application uses the Debian backports packages, do not install this application directly in production
|
:warning: This application uses the Debian backports packages, do not install this application directly in production
|
||||||
|
|
||||||
## Mastodon c'est quoi ?
|
## Overview
|
||||||
|
|
||||||
|
**Shipped version:** 2.7.4
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|
![](https://framalibre.org/sites/default/files/mastodon.png)
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
[Source code](https://github.com/tootsuite/mastodon)
|
[Source code](https://github.com/tootsuite/mastodon)
|
||||||
|
|
||||||
#### Ajout d'un "swapfile" si vous avez moins de 2Go de RAM
|
## Configuration
|
||||||
```
|
|
||||||
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000
|
|
||||||
sudo chmod 600 /swapfile
|
|
||||||
sudo mkswap /swapfile
|
|
||||||
sudo swapon /swapfile
|
|
||||||
```
|
|
||||||
ajouter cette ligne dans /etc/fstab
|
|
||||||
```
|
|
||||||
/swapfile none swap sw 0 0
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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écuperer l'installation après une deconnection:
|
|
||||||
```
|
|
||||||
$ screen -d
|
|
||||||
$ screen -r
|
|
||||||
```
|
|
||||||
L'utilisateur admin est crée automatiquement comme: user@domain.tld
|
|
||||||
|
|
||||||
### Mise à jour
|
|
||||||
#### Utilisation de __screen__ fortement recommandé
|
|
||||||
|
|
||||||
`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
|
||||||
|
|
||||||
## Recommandations
|
|
||||||
|
|
||||||
Vous ne pouvez pas installer Mastodon en subdirectory, vous devez obligatoirement utiliser un domaine ou un sous-domaine pour cette application.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## What is Mastodon?
|
## What is Mastodon?
|
||||||
|
|
||||||
|
@ -103,3 +74,36 @@ The admin user is automatically created as: user@domain.tld
|
||||||
You can't install Mastodon in subdirectory, you must use a domain or subdomain for this application.
|
You can't install Mastodon in subdirectory, you must use a domain or subdomain for this application.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
* Official documentation: https://docs.joinmastodon.org/
|
||||||
|
|
||||||
|
## YunoHost specific features
|
||||||
|
|
||||||
|
#### Supported architectures
|
||||||
|
|
||||||
|
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
|
||||||
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/)
|
||||||
|
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/mastodon%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/mastodon/)
|
||||||
|
|
||||||
|
## Links
|
||||||
|
|
||||||
|
* Report a bug: https://github.com/YunoHost-Apps/mastodon_ynh/issues
|
||||||
|
* App website: Link to the official website of this app
|
||||||
|
* YunoHost website: https://yunohost.org/
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Developers info
|
||||||
|
----------------
|
||||||
|
|
||||||
|
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
|
||||||
|
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing).
|
||||||
|
|
||||||
|
To try the testing branch, please proceed like that.
|
||||||
|
```
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug
|
||||||
|
or
|
||||||
|
sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug
|
||||||
|
```
|
||||||
|
|
103
README_fr.md
Normal file
103
README_fr.md
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
# Mastodon 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)*
|
||||||
|
|
||||||
|
> *Ce package vous permet d'installer mastodon 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.*
|
||||||
|
|
||||||
|
[![Latest Version](https://img.shields.io/badge/version-2.7.1-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||||
|
[![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
|
||||||
|
[![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
|
||||||
|
[![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE)
|
||||||
|
[![Yunohost version](https://img.shields.io/badge/yunohost-2.7.12_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost)
|
||||||
|
[![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues)
|
||||||
|
|
||||||
|
:warning: MAJ 05/06/17 :Cette application peut maintenant fonctionner sur ARM, mais l'installation prend plusieurs heures et il faut ajouter un swapfile de 1Go.
|
||||||
|
|
||||||
|
:warning: Cette application utilise les packages backports de Debian, nous vous recommendons de ne pas installer cette application directement en production
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
**Version incluse:** 2.7.4
|
||||||
|
|
||||||
|
## Captures d'écran
|
||||||
|
|
||||||
|
![](https://framalibre.org/sites/default/files/mastodon.png)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
#### Ajout d'un "swapfile" si vous avez moins de 2Go de RAM
|
||||||
|
```
|
||||||
|
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000
|
||||||
|
sudo chmod 600 /swapfile
|
||||||
|
sudo mkswap /swapfile
|
||||||
|
sudo swapon /swapfile
|
||||||
|
```
|
||||||
|
ajouter cette ligne dans /etc/fstab
|
||||||
|
```
|
||||||
|
/swapfile none swap sw 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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écuperer l'installation après une deconnection:
|
||||||
|
```
|
||||||
|
$ screen -d
|
||||||
|
$ screen -r
|
||||||
|
```
|
||||||
|
L'utilisateur admin est crée automatiquement comme: user@domain.tld
|
||||||
|
|
||||||
|
### Mise à jour
|
||||||
|
#### Utilisation de __screen__ fortement recommandé
|
||||||
|
|
||||||
|
`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
||||||
|
|
||||||
|
## Recommandations
|
||||||
|
|
||||||
|
Vous ne pouvez pas installer Mastodon en subdirectory, vous devez obligatoirement utiliser un domaine ou un sous-domaine pour cette application.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
* Documentation officielle: https://docs.joinmastodon.org/
|
||||||
|
* Documentation YunoHost: Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer.
|
||||||
|
|
||||||
|
## Caractéristiques spécifiques YunoHost
|
||||||
|
|
||||||
|
#### Supported architectures
|
||||||
|
|
||||||
|
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/)
|
||||||
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/)
|
||||||
|
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/mastodon%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/mastodon/)
|
||||||
|
|
||||||
|
## Links
|
||||||
|
|
||||||
|
* Signaler un bug: https://github.com/YunoHost-Apps/mastodon_ynh/issues
|
||||||
|
* Site de l'application: Lien vers le site officiel de cette application
|
||||||
|
* Site web YunoHost: https://yunohost.org/
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Informations pour les développeurs
|
||||||
|
----------------
|
||||||
|
|
||||||
|
**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.**
|
||||||
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing).
|
||||||
|
|
||||||
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
|
```
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug
|
||||||
|
ou
|
||||||
|
sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing --debug
|
||||||
|
```
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.7.1.tar.gz
|
SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.7.4.tar.gz
|
||||||
SOURCE_SUM=d0a9d6f4514f78fcdc76943ce2518ce5008378c65b5ecbb3644026dc97c18ec1
|
SOURCE_SUM=0e542c57228d482a068b05f639d8fe53dd9d413f7e7ce93cd1a088bd4d8d8366
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20181225.tar.gz
|
SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20190314.tar.gz
|
||||||
SOURCE_SUM=5ace4787ace47384dc419b20f5eb5a59f1174e00bfabcfed74a175033cd0b18a
|
SOURCE_SUM=2cc0f9fdb232042e71edad93a5c3ae108bcd090ea0b6db4e5bb6325547e07968
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -2,20 +2,20 @@
|
||||||
"name": "Mastodon",
|
"name": "Mastodon",
|
||||||
"id": "mastodon",
|
"id": "mastodon",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"requirements": {
|
|
||||||
"yunohost": ">= 2.7.1"
|
|
||||||
},
|
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Mastodon is a free, open-source social network.",
|
"en": "Mastodon is a free, open-source social network.",
|
||||||
"fr": "Mastodon est un réseau social gratuit et open source."
|
"fr": "Mastodon est un réseau social gratuit et open source."
|
||||||
},
|
},
|
||||||
"version": "2.6.5",
|
"version": "2.7.4",
|
||||||
"url": "https://github.com/tootsuite/mastodon",
|
"url": "https://github.com/tootsuite/mastodon",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "cyp, nemsia",
|
"name": "cyp, nemsia",
|
||||||
"email": "cyp@rouquin.me, nemsia@nemsia.org"
|
"email": "cyp@rouquin.me, nemsia@nemsia.org"
|
||||||
},
|
},
|
||||||
|
"requirements": {
|
||||||
|
"yunohost": ">= 3.4"
|
||||||
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx"
|
"nginx"
|
||||||
|
|
|
@ -1,5 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# COMMON VARIABLES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# dependencies used by the app
|
||||||
|
pkg_dependencies="deb1 deb2"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# PERSONAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# EXPERIMENTAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FUTURE OFFICIAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Execute a command as another user
|
# Execute a command as another user
|
||||||
# usage: exec_as USER COMMAND [ARG ...]
|
# usage: exec_as USER COMMAND [ARG ...]
|
||||||
|
|
|
@ -26,8 +26,8 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
# Get multi-instances specific variables
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Retrieve app settings
|
# Retrieve app settings
|
||||||
|
@ -47,18 +47,21 @@ yunohost service stop "$app-streaming"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up the main app directory..."
|
||||||
|
|
||||||
ynh_backup "$final_path"
|
ynh_backup "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up nginx web server configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up the PostgreSQL database..."
|
||||||
|
|
||||||
ynh_psql_dump_db "$db_name" > db.sql
|
ynh_psql_dump_db "$db_name" > db.sql
|
||||||
ynh_backup "db.sql"
|
ynh_backup "db.sql"
|
||||||
|
@ -68,6 +71,7 @@ ynh_backup "db.sql"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up systemd configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/systemd/system/$app-web.service"
|
ynh_backup "/etc/systemd/system/$app-web.service"
|
||||||
ynh_backup "/etc/systemd/system/$app-sidekiq.service"
|
ynh_backup "/etc/systemd/system/$app-sidekiq.service"
|
||||||
|
@ -97,3 +101,9 @@ sleep 30
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
|
@ -17,25 +17,26 @@ source _future.sh
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
|
path_url="/"
|
||||||
admin_mastodon=$YNH_APP_ARG_ADMIN
|
admin_mastodon=$YNH_APP_ARG_ADMIN
|
||||||
admin_mastodon_mail=$(ynh_user_get_info $admin_mastodon 'mail')
|
|
||||||
language=$YNH_APP_ARG_LANGUAGE
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
|
||||||
|
admin_mastodon_mail=$(ynh_user_get_info $admin_mastodon 'mail')
|
||||||
port_web=$(ynh_find_port 3000)
|
port_web=$(ynh_find_port 3000)
|
||||||
port_stream=$(ynh_find_port 4000)
|
port_stream=$(ynh_find_port 4000)
|
||||||
|
|
||||||
path_url="/"
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Validating installation parameters..."
|
||||||
|
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||||
|
@ -51,6 +52,7 @@ ynh_webpath_register $app $domain $path_url
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set $app domain $domain
|
ynh_app_setting_set $app domain $domain
|
||||||
ynh_app_setting_set $app admin $admin_mastodon
|
ynh_app_setting_set $app admin $admin_mastodon
|
||||||
|
@ -67,6 +69,7 @@ ynh_app_setting_set $app port_stream $port_stream
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Installing dependencies..."
|
||||||
|
|
||||||
# TODO: add in a clean way backports and yarn
|
# TODO: add in a clean way backports and yarn
|
||||||
|
|
||||||
|
@ -103,9 +106,11 @@ ynh_install_app_dependencies \
|
||||||
`# Yarn ` \
|
`# Yarn ` \
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DATABASE SETUP
|
# CREATE A POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Creating a PostgreSQL database..."
|
||||||
|
|
||||||
# Create postgresql database
|
# Create postgresql database
|
||||||
db_name="${app}_production"
|
db_name="${app}_production"
|
||||||
|
@ -120,6 +125,7 @@ ynh_psql_execute_as_root \
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Setting up source files..."
|
||||||
|
|
||||||
# Creates the destination directory and stores its location.
|
# Creates the destination directory and stores its location.
|
||||||
ynh_app_setting_set "$app" final_path "$final_path"
|
ynh_app_setting_set "$app" final_path "$final_path"
|
||||||
|
@ -132,6 +138,7 @@ ynh_setup_source "$final_path/live" "app-mastodon"
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring nginx web server..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/nginx.conf"
|
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/nginx.conf"
|
||||||
|
@ -141,12 +148,19 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
adduser $app --home $final_path --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
|
adduser $app --home $final_path --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
|
||||||
|
|
||||||
chown -R "$app": "$final_path"
|
chown -R "$app": "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC SETUP
|
||||||
|
#=================================================
|
||||||
|
# ...
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# TODO: try to use ynh_install_ruby from https://github.com/YunoHost-Apps/Experimental_helpers
|
# TODO: try to use ynh_install_ruby from https://github.com/YunoHost-Apps/Experimental_helpers
|
||||||
# Install de rbenv
|
# Install de rbenv
|
||||||
(
|
(
|
||||||
|
@ -242,6 +256,7 @@ SETADMIN
|
||||||
admin_pass=$( cd $final_path/live && tail -1 acc.txt | head -1 | cut -c 15- )
|
admin_pass=$( cd $final_path/live && tail -1 acc.txt | head -1 | cut -c 15- )
|
||||||
|
|
||||||
(cd $final_path/live && rm -f acc.txt)
|
(cd $final_path/live && rm -f acc.txt)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -268,6 +283,7 @@ sudo cp -f ../conf/cron /etc/cron.d/$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring SSOwat..."
|
||||||
|
|
||||||
# TODO: all private install
|
# TODO: all private install
|
||||||
# Unprotected url
|
# Unprotected url
|
||||||
|
@ -276,6 +292,7 @@ ynh_app_setting_set "$app" unprotected_uris "/"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server..."
|
||||||
|
|
||||||
# Reload Nginx
|
# Reload Nginx
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
@ -291,3 +308,9 @@ The admin password is: $admin_pass
|
||||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/mastodon_ynh"
|
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/mastodon_ynh"
|
||||||
|
|
||||||
ynh_send_readme_to_admin "$message" "$admin_mastodon"
|
ynh_send_readme_to_admin "$message" "$admin_mastodon"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Installation of $app completed"
|
||||||
|
|
|
@ -15,6 +15,7 @@ source _future.sh
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -25,17 +26,9 @@ final_path=$(ynh_app_setting_get "$app" final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_remove_systemd_config "$app-web"
|
|
||||||
ynh_remove_systemd_config "$app-sidekiq"
|
|
||||||
ynh_remove_systemd_config "$app-streaming"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SERVICE FROM ADMIN PANEL
|
# REMOVE SERVICE FROM ADMIN PANEL
|
||||||
#==============================================
|
#=================================================
|
||||||
|
|
||||||
if yunohost service status | grep -q "$app-web"
|
if yunohost service status | grep -q "$app-web"
|
||||||
then
|
then
|
||||||
|
@ -56,22 +49,36 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# STOP AND REMOVE SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Stopping and removing the systemd service"
|
||||||
|
|
||||||
|
# Remove the dedicated systemd config
|
||||||
|
ynh_remove_systemd_config "$app-web"
|
||||||
|
ynh_remove_systemd_config "$app-sidekiq"
|
||||||
|
ynh_remove_systemd_config "$app-streaming"
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
ynh_remove_nodejs
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE PostgreSQL DATABASE
|
# REMOVE THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing the PostgreSQL database"
|
||||||
|
|
||||||
# delete postgresql database & user
|
# delete postgresql database & user
|
||||||
ynh_psql_remove_db "$db_name" "$app"
|
ynh_psql_remove_db "$db_name" "$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Removing dependencies"
|
||||||
|
|
||||||
|
# Remove metapackage and its dependencies
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
ynh_remove_nodejs
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing app main directory"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove "$final_path"
|
||||||
|
@ -79,11 +86,16 @@ ynh_secure_remove "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing nginx web server configuration"
|
||||||
|
|
||||||
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
# REMOVE THE CRON FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Remove a cron file
|
# Remove a cron file
|
||||||
ynh_secure_remove "/etc/cron.d/$app"
|
ynh_secure_remove "/etc/cron.d/$app"
|
||||||
|
@ -96,4 +108,13 @@ ynh_secure_remove "/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEDICATED USER
|
# REMOVE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing the dedicated system user"
|
||||||
|
|
||||||
|
# Delete a system user
|
||||||
ynh_system_user_delete $app
|
ynh_system_user_delete $app
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Removal of $app completed"
|
||||||
|
|
|
@ -26,10 +26,10 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Get old parameter of the app
|
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
path_url=$(ynh_app_setting_get $app path)
|
path_url=$(ynh_app_setting_get $app path)
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
|
@ -38,6 +38,7 @@ final_path=$(ynh_app_setting_get "$app" final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Validating restoration parameters..."
|
||||||
|
|
||||||
ynh_webpath_available $domain $path_url \
|
ynh_webpath_available $domain $path_url \
|
||||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
|
@ -55,12 +56,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore_file "$final_path"
|
ynh_restore_file "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Recreating the dedicated system user..."
|
||||||
|
|
||||||
adduser $app --home $final_path --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
|
adduser $app --home $final_path --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
|
||||||
|
|
||||||
|
@ -76,6 +79,7 @@ chown -R $app: $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reinstalling dependencies..."
|
||||||
|
|
||||||
# TODO: add in a clean way backports and yarn
|
# TODO: add in a clean way backports and yarn
|
||||||
|
|
||||||
|
@ -113,10 +117,9 @@ ynh_install_app_dependencies \
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PostgreSQL DATABASE
|
# RESTORE THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Restoring the PostgreSQL database..."
|
||||||
# Restore PostgreSQL database
|
|
||||||
|
|
||||||
db_name=$(ynh_app_setting_get "$app" db_name)
|
db_name=$(ynh_app_setting_get "$app" db_name)
|
||||||
db_pwd=$(ynh_app_setting_get "$app" db_pwd)
|
db_pwd=$(ynh_app_setting_get "$app" db_pwd)
|
||||||
|
@ -132,6 +135,7 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Restoring the systemd configuration..."
|
||||||
|
|
||||||
ynh_restore_file "/etc/systemd/system/$app-web.service"
|
ynh_restore_file "/etc/systemd/system/$app-web.service"
|
||||||
ynh_restore_file "/etc/systemd/system/$app-sidekiq.service"
|
ynh_restore_file "/etc/systemd/system/$app-sidekiq.service"
|
||||||
|
@ -155,10 +159,17 @@ ynh_restore_file "/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND services
|
# RELOAD NGINX AND SERVICES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server and services..."
|
||||||
|
|
||||||
systemctl restart "$app-web" "$app-sidekiq" "$app-streaming"
|
systemctl restart "$app-web" "$app-sidekiq" "$app-streaming"
|
||||||
# Waiting start all services
|
# Waiting start all services
|
||||||
sleep 30
|
sleep 30
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Restoration completed for $app"
|
||||||
|
|
111
scripts/upgrade
111
scripts/upgrade
|
@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
# See comments in install script
|
# See comments in install script
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -31,6 +32,7 @@ port_stream=$(ynh_app_setting_get "$app" port_stream)
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Ensuring downward compatibility..."
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
# If db_name doesn't exist, create it
|
||||||
if [ -z "$db_name" ]; then
|
if [ -z "$db_name" ]; then
|
||||||
|
@ -62,6 +64,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up the app before upgrading (may take a while)..."
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
|
@ -85,9 +88,54 @@ fi
|
||||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
|
||||||
|
# Stop Mastodon Services
|
||||||
|
# Restart Mastodon
|
||||||
|
yunohost service stop "$app-web"
|
||||||
|
yunohost service stop "$app-sidekiq"
|
||||||
|
yunohost service stop "$app-streaming"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading source files..."
|
||||||
|
|
||||||
|
# Download Mastodon
|
||||||
|
mv "$final_path/live" "$final_path/live_back"
|
||||||
|
ynh_setup_source "$final_path/live" "app-mastodon"
|
||||||
|
if [ -z $final_path/live_back/public/system ]; then
|
||||||
|
rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/."
|
||||||
|
fi
|
||||||
|
rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
|
||||||
|
rm -Rf "$final_path/live_back"
|
||||||
|
|
||||||
|
# Clean files which are not needed anymore
|
||||||
|
ynh_secure_remove $final_path/live/config/initializers/timeout.rb
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading nginx web server configuration..."
|
||||||
|
|
||||||
|
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/nginx.conf"
|
||||||
|
ynh_replace_string "__PORT_STREAM__" "$port_stream" "../conf/nginx.conf"
|
||||||
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
|
||||||
|
# Upgrade rbenv and ruby plugins
|
||||||
|
ynh_setup_source "$final_path/.rbenv" "app-rbenv"
|
||||||
|
ynh_setup_source "$final_path/.rbenv/plugins/ruby-build" "app-ruby-build"
|
||||||
|
|
||||||
|
chown -R "$app": "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPGRADE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading dependencies..."
|
||||||
|
|
||||||
ynh_install_nodejs 8
|
ynh_install_nodejs 8
|
||||||
|
|
||||||
# TODO: use the same mecanism with other files
|
# TODO: use the same mecanism with other files
|
||||||
|
@ -106,41 +154,18 @@ ynh_install_app_dependencies \
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Making sure dedicated system user exists..."
|
||||||
|
|
||||||
|
# Create a dedicated user (if not existing)
|
||||||
# Stop Mastodon Services
|
ynh_system_user_create $app
|
||||||
# Restart Mastodon
|
|
||||||
yunohost service stop "$app-web"
|
|
||||||
yunohost service stop "$app-sidekiq"
|
|
||||||
yunohost service stop "$app-streaming"
|
|
||||||
|
|
||||||
# Download Mastodon
|
|
||||||
mv "$final_path/live" "$final_path/live_back"
|
|
||||||
ynh_setup_source "$final_path/live" "app-mastodon"
|
|
||||||
if [ -z $final_path/live_back/public/system ]; then
|
|
||||||
rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/."
|
|
||||||
fi
|
|
||||||
rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
|
|
||||||
rm -Rf "$final_path/live_back"
|
|
||||||
|
|
||||||
# Clean files which are not needed anymore
|
|
||||||
ynh_secure_remove $final_path/live/config/initializers/timeout.rb
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# SPECIFIC UPGRADE
|
||||||
|
#=================================================
|
||||||
|
# ...
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/nginx.conf"
|
|
||||||
ynh_replace_string "__PORT_STREAM__" "$port_stream" "../conf/nginx.conf"
|
|
||||||
ynh_add_nginx_config
|
|
||||||
|
|
||||||
|
|
||||||
# Upgrade rbenv and ruby plugins
|
|
||||||
ynh_setup_source "$final_path/.rbenv" "app-rbenv"
|
|
||||||
ynh_setup_source "$final_path/.rbenv/plugins/ruby-build" "app-ruby-build"
|
|
||||||
|
|
||||||
chown -R "$app": "$final_path"
|
|
||||||
|
|
||||||
# Install ruby 2.6.0
|
# Install ruby 2.6.0
|
||||||
(
|
(
|
||||||
|
@ -193,6 +218,7 @@ chown -R "$app": "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading systemd configuration..."
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/mastodon-web.service"
|
ynh_replace_string "__PORT_WEB__" "$port_web" "../conf/mastodon-web.service"
|
||||||
|
@ -225,19 +251,36 @@ ynh_replace_string "__USER__" "$app" ../conf/cron
|
||||||
sudo cp -f ../conf/cron /etc/cron.d/$app
|
sudo cp -f ../conf/cron /etc/cron.d/$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
# Set permissions on app files
|
||||||
|
#chown -R root: $final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading SSOwat configuration..."
|
||||||
|
|
||||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD ssowatconf
|
# RELOAD SSOWATCONF
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RELOAD NGINX
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server..."
|
||||||
|
|
||||||
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Upgrade of $app completed"
|
||||||
|
|
Loading…
Reference in a new issue