diff --git a/README.md b/README.md index e7b9461..5ef317f 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,62 @@ -Lutim for YunoHost -================== +# Lutim for YunoHost -[Yunohost project](https://yunohost.org/#/) +[![Integration level](https://dash.yunohost.org/integration/lutim.svg)](https://ci-apps.yunohost.org/jenkins/job/lutim%20%28Community%29/lastBuild/consoleFull) +[![Install Lutim with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=lutim) -Application d'hébergement et de partage d'images anonyme. +*[Lire ce readme en français.](./README_fr.md)* -https://lut.im +> *This package allow you to install Lutim 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.* -Le script installe le module perl *carton* via cpan et les paquets *fonts-droid* *ghostscript* *gsfonts* *imagemagick-common* *libavahi-client3* *libavahi-common-data* *libavahi-common3* *libcups2* *libcupsimage2* *libgs9* *libgs9-common* *libijs-0.35* *libjasper1* *libjbig0* *libjbig2dec0* *liblcms2-2* *liblqr-1-0* *libmagickcore5* *libpaper-utils* *libpaper1* *libtiff4* *perlmagick* *poppler-data*. +## Overview -**Mise à jour du package:** -sudo yunohost app upgrade lutim -u https://github.com/YunoHost-Apps/lutim_ynh +Lutim stores images and allows you to see them, download them or share them on social networks. +Images are indefinitely stored unless you request that they will be deleted at first view or after 24 hours / one week / one month / one year. -**Multi-utilisateur:** Non, accessible par tout les utilisateurs. +**Shipped version:** 0.8.6 -**Voir l'état du package:** -*[Dernier rapport hebdomadaire](https://forum.yunohost.org/t/rapport-hebdomadaire-dintegration-continue/2297)* -*[Dernier test d'intégration continue](https://ci-apps.yunohost.org/jenkins/job/lutim%20%28Community%29/lastBuild/consoleFull)* +## Screenshots + +## Configuration + +Edit the file `/var/www/lutim/lutim.conf` to edit the configuration of Lutim. +Then reload the lutim service. + +## Documentation + + * Official documentation: https://framagit.org/luc/lutim/wikis/home + * YunoHost documentation: There no other documentations, feel free to contribute. + +## YunoHost specific features + +#### Multi-users support + +Not relevant. + +#### Supported architectures + +* Tested on x86_64 + +## Limitations + +## Additionnal informations + +## Links + + * Report a bug: https://github.com/YunoHost-Apps/lutim_ynh/issues + * Lutim website: https://lut.im/ + * YunoHost website: https://yunohost.org/ + +--- + +Developers infos +---------------- + +Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/lutim_ynh/tree/testing --verbose +or +sudo yunohost app upgrade lutim -u https://github.com/YunoHost-Apps/lutim_ynh/tree/testing --verbose +``` diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..3f37a03 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,62 @@ +# Lutim pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/lutim.svg)](https://ci-apps.yunohost.org/jenkins/job/lutim%20%28Community%29/lastBuild/consoleFull) +[![Installer Lutim avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=lutim) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Lutim rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.* + +## Résumé + +Lutim stocke les images et vous permet de les voir, de les télécharger ou de les partager sur les réseaux sociaux. +Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles soient effacées à la première vue ou après 24 heures / une semaine / un mois / un an. + +**Version embarquée:** 0.8.6 + +## Captures d'écran + +## Configuration + +Editez le fichier `/var/www/lutim/lutim. conf` pour éditer la configuration de Lutim. +Rechargez ensuite le service lutim. + +## Documentation + + * Documentation officielle: https://framagit.org/luc/lutim/wikis/home + * Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer. + +## Fonctionnalités spécifiques à YunoHost + +#### Support multi-utilisateurs + +Non applicable. + +#### Architectures supportées. + +* Testé sur x86_64 + +## Limitations + +## Informations additionnelles + +## Liens + + * Reporter un bug: https://github.com/YunoHost-Apps/lutim_ynh/issues + * Site de Lutim: https://lut.im/ + * Site de YunoHost: https://yunohost.org/ + +--- + +Informations à l'intention des développeurs +---------------- + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). + +Pour tester la branche testing, merci de procéder ainsi. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/lutim_ynh/tree/testing --verbose +ou +sudo yunohost app upgrade lutim -u https://github.com/YunoHost-Apps/lutim_ynh/tree/testing --verbose +``` diff --git a/YEP.md b/YEP.md new file mode 100644 index 0000000..eca840d --- /dev/null +++ b/YEP.md @@ -0,0 +1,117 @@ +#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0) +[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) +`Validated` +[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12) +`Validated` + +#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1) +[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22) +`Validated` +[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25) +`Don't know` +[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27) +`Validated` +[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215) +`Validated` + +#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2) +[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) +`Validated` +[YEP 2.18.2 - Gérer l'installation à la racine d’un nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182) +`Validated` - *Automatically verified.* +[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183) +`Validated` - *Automatically verified.* +[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184) +`Validated` - *Automatically verified.* +[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) +`Not applicable` - *Automatically verified.* + +#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3) +[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23) +`Validated` + +#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4) +[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41) +`Not applicable` +[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42) +`Not applicable` + +#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5) +[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13) +`Validated` +[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21) +`Validated` - *Automatically verified.* +[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212) +`Validated` +[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181) +`Not applicable` + +#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6) +[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14) +`Validated` +[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16) +`Validated` +[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17) +`Validated` - *Automatically verified.* +[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18) +`Validated` +[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19) +`Validated` +[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110) +`Don't know` +[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29) +`Validated` +[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33) +`Validated` +[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35) +`Validated` +[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36) +`Validated` +[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43) +`Validated` - *Automatically verified.* +[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44) +`Validated` - *Automatically verified.* + +#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7) +[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26) +`Validated` +[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32) +`Validated` + +#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8) +[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24) +`Validated` +[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28) +`Validated` +[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216) +`Not yet validated` - *Automatically verified.* +[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185) +`Validated` +[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34) +`Partially validated` +[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45) +`Not applicable` + +#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9) +[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210) +`Validated` +[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211) +`Validated` +[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213) +`Not yet validated` +[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214) +`Not yet validated` +[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217) +`Validated` +[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421) +`Don't know` + +#### Other YEP +[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31) +`Validated` +[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47) +`Not applicable` +[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48) +`Not applicable` + +State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`. diff --git a/check_process b/check_process index 9c498d8..712cdbe 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,7 @@ ;; Test complet - auto_remove=1 ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) - admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) always_encrypt=1 ; Checks @@ -14,19 +12,19 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=4c29aa94f9d9048411c6e165e122e03574fb9b8d backup_restore=1 multi_instance=0 incorrect_path=1 port_already_use=1 (8095) - change_url=0 + change_url=1 ;;; Levels Level 1=auto Level 2=auto Level 3=auto # Level 4: Pas de gestion des utilisateurs Level 4=na -# Level 5: https://github.com/YunoHost-Apps/lutim_ynh/issues/14 - Level 5=1 + Level 5=auto Level 6=auto Level 7=auto Level 8=0 @@ -35,3 +33,7 @@ ;;; Options Email= Notification=down +;;; Upgrade options + ; commit=4c29aa94f9d9048411c6e165e122e03574fb9b8d + name=08 Sep 2017 4c29aa94f9d9048411c6e165e122e03574fb9b8d + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&always_encrypt=1& diff --git a/conf/lutim.service b/conf/lutim.service deleted file mode 100644 index 5bcc908..0000000 --- a/conf/lutim.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Image hosting and sharing service -After=network.target - -[Service] -Type=simple -User=__APP__ -Group=__APP__ -RemainAfterExit=yes -WorkingDirectory=__FINALPATH__ -PIDFile=__FINALPATH__script/hypnotoad.pid -ExecStart=/usr/bin/carton exec hypnotoad script/lutim >> /var/log/lutim/production.log 2>&1 -ExecStop=/usr/bin/carton exec hypnotoad -s script/lutim >> /var/log/lutim/production.log 2>&1 -ExecReload=/usr/bin/carton exec hypnotoad script/lutim >> /var/log/lutim/production.log 2>&1 - -[Install] -WantedBy=multi-user.target diff --git a/conf/nginx.conf b/conf/nginx.conf index fa51eee..72fc88c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,28 +1,29 @@ location __PATH__ { + if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; - # This is important for user's privacy ! - access_log off; - error_log /var/log/nginx/lutim.error.log; + # This is important for user's privacy ! + access_log off; + error_log /var/log/nginx/lutim.error.log; - # This is important ! Make it OK with your Lutim configuration - client_max_body_size 40M; + # This is important ! Make it OK with your Lutim configuration + client_max_body_size 40M; - proxy_pass http://127.0.0.1:__PORT__; + proxy_pass http://127.0.0.1:__PORT__; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # Lutim reads this header and understands that the current session is actually HTTPS. - # Enable it if you run a HTTPS server (in this case, don't forgot to change the listen port $ - proxy_set_header X-Forwarded-Proto https; + # Lutim reads this header and understands that the current session is actually HTTPS. + # Enable it if you run a HTTPS server (in this case, don't forgot to change the listen port + proxy_set_header X-Forwarded-Proto https; - # We expect the downsteam servers to redirect to the right hostname, so don't do any rewrite$ - proxy_redirect off; + # We expect the downsteam servers to redirect to the right hostname, so don't do any rewrite + proxy_redirect off; } diff --git a/scripts/_apt b/scripts/_apt new file mode 100644 index 0000000..3a3b2aa --- /dev/null +++ b/scripts/_apt @@ -0,0 +1,37 @@ +#!/bin/bash + +# https://github.com/YunoHost/yunohost/pull/391 + +# Define and install dependencies with a equivs control file +# This helper can/should only be called once per app +# +# usage: ynh_install_app_dependencies dep [dep [...]] +# | arg: dep - the package name to install in dependence +ynh_install_app_dependencies () { + dependencies=$@ + manifest_path="../manifest.json" + if [ ! -e "$manifest_path" ]; then + manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place + fi + version=$(grep '\"version\": ' "$manifest_path" | cut -d '"' -f 4) # Retrieve the version number in the manifest file. + dep_app=${app//_/-} # Replace all '_' by '-' + +# if ynh_package_is_installed "${dep_app}-ynh-deps"; then +# echo "A package named ${dep_app}-ynh-deps is already installed" >&2 +# else + cat > /tmp/${dep_app}-ynh-deps.control << EOF # Make a control file for equivs-build +Section: misc +Priority: optional +Package: ${dep_app}-ynh-deps +Version: ${version} +Depends: ${dependencies// /, } +Architecture: all +Description: Fake package for ${app} (YunoHost app) dependencies + This meta-package is only responsible of installing its dependencies. +EOF + ynh_package_install_from_equivs /tmp/${dep_app}-ynh-deps.control \ + || ynh_die "Unable to install dependencies" # Install the fake package and its dependencies + rm /tmp/${dep_app}-ynh-deps.control + ynh_app_setting_set $app apt_dependencies $dependencies +# fi +} diff --git a/scripts/_common.sh b/scripts/_common.sh index 0c814ff..cac8bd1 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -78,6 +78,19 @@ node_version_path="/opt/node_n/n/versions/node" # N_PREFIX est le dossier de n, il doit être chargé dans les variables d'environnement pour n. export N_PREFIX="$n_install_dir" +ynh_install_n () { + echo "Installation of N - Node.js version management" >&2 + # Build an app.src for n + mkdir -p "../conf" + echo "SOURCE_URL=https://github.com/tj/n/archive/v2.1.7.tar.gz +SOURCE_SUM=2ba3c9d4dd3c7e38885b37e02337906a1ee91febe6d5c9159d89a9050f2eea8f" > "../conf/n.src" + # Download and extract n + ynh_setup_source "$n_install_dir/git" n + # Install n + (cd "$n_install_dir/git" + PREFIX=$N_PREFIX make install 2>&1) +} + ynh_use_nodejs () { nodejs_version=$(ynh_app_setting_get $app nodejs_version) @@ -113,9 +126,10 @@ ynh_install_nodejs () { test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n # If n is not previously setup, install it - n --version > /dev/null 2>&1 || \ - ( echo "Installation of N - Node.js version management" >&2; \ - curl -sL $n_install_script | N_PREFIX=$N_PREFIX bash -s -- -y - 2>&1 ) + if ! test n --version > /dev/null 2>&1 + then + ynh_install_n + fi # Modify the default N_PREFIX in n script ynh_replace_string "^N_PREFIX=\${N_PREFIX-.*}$" "N_PREFIX=\${N_PREFIX-$N_PREFIX}" "$n_install_dir/bin/n" @@ -219,3 +233,19 @@ EOF chmod +x "/etc/cron.daily/node_update" } + + +#================================================= +#============= FUTURE YUNOHOST HELPER ============ +#================================================= + +# Delete a file checksum from the app settings +# +# $app should be defined when calling this helper +# +# usage: ynh_remove_file_checksum file +# | arg: file - The file for which the checksum will be deleted +ynh_delete_file_checksum () { + local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' + ynh_app_setting_delete $app $checksum_setting_name +} diff --git a/scripts/install b/scripts/install index 5c2012e..f519d18 100644 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,15 @@ source _variables # MANAGE FAILURE OF THE SCRIPT #================================================= -ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée. +ynh_clean_setup () { +# Nettoyage des résidus d'installation non pris en charge par le script remove. + if test -n "$PID_TAIL" + then + SUPPRESS_WARNING kill -s 15 $PID_TAIL # Arrête l'exécution de tail. + ynh_secure_remove "$tempfile" + fi +} +ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST @@ -23,7 +31,6 @@ ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est dét domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH -admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC always_encrypt=$YNH_APP_ARG_ALWAYS_ENCRYPT @@ -48,7 +55,6 @@ ynh_webpath_register $app $domain $path_url # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set $app admin $admin ynh_app_setting_set $app domain $domain ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app always_encrypt $always_encrypt @@ -124,9 +130,8 @@ chmod +x $final_path/script/lutim #================================================= mkdir -p /var/log/$app/ -pushd $final_path # cd avec une stack pour revenir en arrière -carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log" -popd # Revient au dossier courant avant pushd +(cd $final_path +carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log") # Configure le path du dossier perl en fonction de l'architecture système arch_dir=$(ls -1 $final_path/local/lib/perl5/ | grep linux-gnu) diff --git a/scripts/upgrade b/scripts/upgrade index 2098c8d..0d7acb1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,6 +8,9 @@ source _common.sh source /usr/share/yunohost/helpers +# Load common variables for all scripts. +source _variables +source _apt #================================================= # LOAD SETTINGS @@ -55,6 +58,12 @@ fi # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { +# Nettoyage des résidus d'installation non pris en charge par le script remove. + if test -n "$PID_TAIL" + then + SUPPRESS_WARNING kill -s 15 $PID_TAIL # Arrête l'exécution de tail. + ynh_secure_remove "$tempfile" + fi # restore it if the upgrade fails ynh_restore_upgradebackup } @@ -75,6 +84,12 @@ path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du ynh_setup_source "$final_path" # Télécharge la source, décompresse et copie dans $final_path +#================================================= +# UPGRADE DEPENDENCIES +#================================================= + +ynh_install_app_dependencies $app_depencencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -119,9 +134,8 @@ ynh_replace_string "__FINALPATH__" "$final_path/" /etc/cron.d/$app # UPDATE LUTIM WITH CARTON #================================================= -pushd $final_path # cd avec une stack pour revenir en arrière -carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log" -popd # Revient au dossier courant avant pushd +(cd $final_path +carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log") #================================================= # SECURING FILES AND DIRECTORIES diff --git a/sources/ajouts/script/lutim b/sources/ajouts/script/lutim deleted file mode 100644 index 5bf30d2..0000000 --- a/sources/ajouts/script/lutim +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; - -use FindBin; -BEGIN { unshift @INC, "$FindBin::Bin/../lib" } -BEGIN { unshift @INC, "$FindBin::Bin/../local/lib/perl5" } -BEGIN { unshift @INC, "$FindBin::Bin/../local/lib/perl5/__ARCHDIR__" } - -# Start command line interface for application -require Mojolicious::Commands; -Mojolicious::Commands->start_app('Mounter');