From a8af62fb43d7ef61102e89c445d85d2899629ae2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 8 Jun 2022 03:24:51 +0200 Subject: [PATCH 01/12] Apply last example_ynh --- .project | 11 - check_process | 26 +-- conf/app.src | 10 +- conf/conf-dist.php | 102 ++++++++++ conf/index_source.php | 6 +- conf/nginx.conf | 15 +- conf/php-fpm.conf | 430 +++++++++++++++++++++++++++++++++++++++ doc/.gitkeep | 0 doc/DESCRIPTION.md | 5 + doc/DISCLAIMER.md | 4 + doc/screenshots/.gitkeep | 0 manifest.json | 61 ++---- scripts/_common.sh | 19 +- scripts/backup | 48 +++-- scripts/install | 176 +++++++++------- scripts/remove | 63 +++--- scripts/restore | 98 ++++----- scripts/upgrade | 234 ++++++++++----------- 18 files changed, 923 insertions(+), 385 deletions(-) delete mode 100644 .project create mode 100644 conf/conf-dist.php create mode 100644 conf/php-fpm.conf create mode 100644 doc/.gitkeep create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/screenshots/.gitkeep diff --git a/.project b/.project deleted file mode 100644 index 42dc69a..0000000 --- a/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - emailpoubelle_ynh - - - - - - - - diff --git a/check_process b/check_process index 321fbee..ac7ba8c 100644 --- a/check_process +++ b/check_process @@ -1,30 +1,30 @@ -;; Complete Test -# Comment ignored +;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/poubelle" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) - password="password" + domain="domain.tld" + path="/poubelle" + is_public=1 + admin="john" + password="1Strong-Password" ; Checks pkg_linter=1 setup_sub_dir=1 setup_root=1 + setup_nourl=0 setup_private=1 setup_public=1 -# upgrade=1 from_commit=1d375c45011ad5ab92c038120c7275580479fbc6 upgrade=1 + # 2.0~ynh3 + upgrade=1 from_commit=1d375c45011ad5ab92c038120c7275580479fbc6 + # 2.0~ynh5 + upgrade=1 from_commit=d83328c3e0d7dbbc317ded2924ac08ba3cc51d3e backup_restore=1 multi_instance=0 - incorrect_path=1 - port_already_use=0 (XXXX) + port_already_use=0 change_url=0 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none ;;; Upgrade options ; commit=1d375c45011ad5ab92c038120c7275580479fbc6 name=2.0~ynh3 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=0& \ No newline at end of file + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=0 diff --git a/conf/app.src b/conf/app.src index 9c13023..5a82027 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,3 +1,7 @@ -SOURCE_URL=https://github.com/kepon85/emailPoubelle.php/archive/d9f444c7687e3d4597d6d95c33fa96fd1332c1de.zip -SOURCE_SUM=3ab236748b1b912c03ddf4e09c4e7f0304467adadc0012c9b8f434353fe26e46 -SOURCE_FORMAT=zip \ No newline at end of file +SOURCE_URL=https://framagit.org/kepon/emailPoubellePhp/-/archive/d25ae5b243f5dbd8c2b023b80b6406c110843586/emailPoubellePhp-d25ae5b243f5dbd8c2b023b80b6406c110843586.tar.gz +SOURCE_SUM=4b96d268ecf81684a91c31416b16f2b79a7409416dfd67cdd720d4d13b2ae1d8 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/conf-dist.php b/conf/conf-dist.php new file mode 100644 index 0000000..e946a69 --- /dev/null +++ b/conf/conf-dist.php @@ -0,0 +1,102 @@ +/dev/null 2>&1 +define('CRON', false); + +// Fichier d'alias postfix +define('FICHIERALIAS', DATA.'/virtual'); +define('BIN_POSTMAP', '/usr/sbin/postmap'); + +define('URLPAGE', 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]); + +// Email +define('EMAILTAGSUJET', '[EmailPoubelle]'); +// From de l'email +define('EMAILFROM', '"NO REPLAY emailPoubelle" '); +define('EMAILEND', 'emailPoubelle.zici.fr'); + +// Alisas interdit : (regex ligne par ligne) - commenter pour désactiver +define('ALIASDENY', DATA.'/aliasdeny.txt'); + +// Blackliste d'email : (regex ligne par ligne) - commenter pour désactiver +define('BLACKLIST', DATA.'/blacklist.txt'); + +// Depend pear Net/DNS2 +define('CHECKMX', false); +if (CHECKMX) { + require_once('Net/DNS2.php'); + // Serveur DNS pour la résolution/vérification du nom de domaine + define('NS1', 'ns1.fdn.org'); + define('NS2', '8.8.8.8'); +} + +// A indiquer si vous utiliser les URL's rewriting +// Exemple avec un htaccess +// RewriteRule ^ep-([a-z]+)-([a-zA-Z0-9+/=]+)\.html$ switch.php?page=emailPoubelle&act=$1&value=$2 [L] +//define('URLREWRITE_START', 'http://poubelle.zici.fr/ep-'); +//define('URLREWRITE_MIDDLE', '-'); +//define('URLREWRITE_END', '.html'); +// Désactiver +define('URLREWRITE_START', false); +define('URLREWRITE_MIDDLE', false); +define('URLREWRITE_END', false); + +// check update : +// enable : in seconds +// disable : false +define('CHECKUPDATE', 86400); + +// Maintenance mode +define('MAINTENANCE_MODE', false); +// No maintenance for this ip (admin ip) +define('MAINTENANCE_IP', '10.0.0.1'); + + +// Mot de passe par défaut "admin" : +define('ADMIN_PASSWORD', '__PASSWORD__'); + + +?> diff --git a/conf/index_source.php b/conf/index_source.php index 587c8d5..4d2cd0f 100644 --- a/conf/index_source.php +++ b/conf/index_source.php @@ -1,12 +1,12 @@ -emailPoubelle - Template-exemple +emailPoubelle - __DOMAIN__ - - + + -[![Integration level](https://dash.yunohost.org/integration/emailpoubelle.svg)](https://ci-apps.yunohost.org/jenkins/job/emailpoubelle%20%28Community%29/lastBuild/consoleFull) -[![Install emailpoubelle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=emailpoubelle) +# EmailPoubelle for YunoHost + +[![Integration level](https://dash.yunohost.org/integration/emailpoubelle.svg)](https://dash.yunohost.org/appci/app/emailpoubelle) ![Working status](https://ci-apps.yunohost.org/ci/badges/emailpoubelle.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/emailpoubelle.maintain.svg) +[![Install EmailPoubelle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=emailpoubelle) + +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install EmailPoubelle quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* + +## Overview A Yunohost version of [Email Poubelle](http://www.mercereau.info/sortie-de-la-version-1-0-demailpoubelle-php-email-jetable-auto-hebergeable/) by David Mercereau. EmailPoubelle (Trash email) is a script to create temporay email adresses that aims to your real email address -All thanks to David. +All thanks to David. + + +**Shipped version:** 2022.06.08~ynh1 + +**Demo:** https://poubelle.zici.fr +## Disclaimers / important information ## WARNING Using this will cause to disable the Yunohost ldap aliases ! Once installed, you won't be able to use the aliasses settings that you can see when you modify your personnal settings in the SSOWAT pannel. -Of course, once uninstalled, everything get back to normal. +Of course, once uninstalled, everything get back to normal. -## Links +## Documentation and resources - * Report a bug: https://github.com/YunoHost-Apps/emailpoubelle_ynh/issues - * App website: https://github.com/kepon85/emailPoubelle.php - * YunoHost website: https://yunohost.org/ +* Official app website: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ---- +## Developer info -Developers info ----------------- - -Please do your pull request to the [testing branch](https://github.com/Yunohost-Apps/emailpoubelle_ynh/tree/Testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing). To try the testing branch, please proceed like that. -``` -sudo yunohost app install https://github.com/Yunohost-Apps/emailpoubelle_ynh/tree/Testing --debug + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing --debug or -sudo yunohost app upgrade emailpoubelle -u https://github.com/Yunohost-Apps/emailpoubelle_ynh/tree/Testing --debug +sudo yunohost app upgrade emailpoubelle -u https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing --debug ``` -## LICENCE - -Package and software are GPL 3.0 \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..586c816 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,54 @@ + + +# EmailPoubelle pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/emailpoubelle.svg)](https://dash.yunohost.org/appci/app/emailpoubelle) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/emailpoubelle.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/emailpoubelle.maintain.svg) +[![Installer EmailPoubelle avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=emailpoubelle) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer EmailPoubelle 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.* + +## Vue d'ensemble + +A Yunohost version of [Email Poubelle](http://www.mercereau.info/sortie-de-la-version-1-0-demailpoubelle-php-email-jetable-auto-hebergeable/) by David Mercereau. + +EmailPoubelle (Trash email) is a script to create temporay email adresses that aims to your real email address + +All thanks to David. + + +**Version incluse :** 2022.06.08~ynh1 + +**Démo :** https://poubelle.zici.fr +## Avertissements / informations importantes + +## WARNING + +Using this will cause to disable the Yunohost ldap aliases ! Once installed, you won't be able to use the aliasses settings that you can see when you modify your personnal settings in the SSOWAT pannel. +Of course, once uninstalled, everything get back to normal. + +## Documentations et ressources + +* Site officiel de l'app : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing --debug +ou +sudo yunohost app upgrade emailpoubelle -u https://github.com/YunoHost-Apps/emailpoubelle_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** From c4d80105e3f27439060404909f92d4ab2070ddd0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 Jun 2022 20:52:48 +0200 Subject: [PATCH 03/12] Fix --- conf/conf-dist.php | 2 +- conf/index_source.php | 6 +++--- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- scripts/install | 18 ++++-------------- scripts/restore | 2 +- scripts/upgrade | 13 +++---------- 7 files changed, 14 insertions(+), 31 deletions(-) diff --git a/conf/conf-dist.php b/conf/conf-dist.php index e946a69..f0a35df 100644 --- a/conf/conf-dist.php +++ b/conf/conf-dist.php @@ -50,7 +50,7 @@ define('CRON', false); define('FICHIERALIAS', DATA.'/virtual'); define('BIN_POSTMAP', '/usr/sbin/postmap'); -define('URLPAGE', 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]); +define('URLPAGE', 'https://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]); // Email define('EMAILTAGSUJET', '[EmailPoubelle]'); diff --git a/conf/index_source.php b/conf/index_source.php index 4d2cd0f..3065f03 100644 --- a/conf/index_source.php +++ b/conf/index_source.php @@ -5,8 +5,8 @@ - - + +
- EmailPoubelle + EmailPoubelle
diff --git a/conf/nginx.conf b/conf/nginx.conf index d9fdc4e..1b27d14 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/; + alias __FINALPATH__/www/ ; index index.php; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab1a471..92c8066 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -358,7 +358,7 @@ request_terminate_timeout = 1d ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot -chdir = __FINALPATH__ +chdir = __FINALPATH__/www ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs. diff --git a/scripts/install b/scripts/install index 6537081..6c77ac1 100644 --- a/scripts/install +++ b/scripts/install @@ -59,7 +59,7 @@ ynh_install_app_dependencies $pkg_dependencies #install locale (nginx will restart at the end of the install) for i in $lang ; do - ynh_replace_string "# $i" "$i" /etc/locale.gen + ynh_replace_string --match_string="# $i" --replace_string="$i" --target_file="/etc/locale.gen" done locale-gen @@ -91,24 +91,14 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" ynh_add_config --template="../conf/index_source.php" --destination="$final_path/www/index.php" +ynh_secure_remove --file="$final_path/www/admin.php" -#Temporaire - mettre en config -ln -s $final_path/lang/fr $final_path/lang/fr_FR -ln -s $final_path/lang/it $final_path/lang/it_IT -ln -s $final_path/www/template-exemple $final_path/template-exemple +ln -s $final_path/lib $final_path/www/lib chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -145,7 +135,7 @@ yunohost tools regen-conf postfix # Create the virtual aliases file touch $final_path/var/virtual postmap $final_path/var/virtual -chown -R www-data:www-data $final_path +chown -R $app:www-data "$final_path" # Create an alias for deleted junk adresses cp /etc/aliases /etc/aliases.emailpoubelle.bak #backup it diff --git a/scripts/restore b/scripts/restore index 4915cfd..1cc8432 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,7 +72,7 @@ ynh_install_app_dependencies $pkg_dependencies #Check & regen local for i in $lang ; do - ynh_replace_string "# $i" "$i" /etc/locale.gen + ynh_replace_string --match_string="# $i" --replace_string="$i" --target_file="/etc/locale.gen" done locale-gen diff --git a/scripts/upgrade b/scripts/upgrade index 3ec8164..e9401e5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -106,18 +106,11 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --keep="conf.php" ynh_add_config --template="../conf/index_source.php" --destination="$final_path/www/index.php" + ynh_secure_remove --file="$final_path/www/admin.php" - test -e $final_path/template-exemple + test -e $final_path/www/lib if [[ ! $? -eq 0 ]]; then - ln -s $final_path/www/template-exemple $final_path/template-exemple - fi - - #Temporaire - mettre en config - if [ ! -e $final_path/lang/fr_FR ]; then - ln -s $final_path/lang/fr $final_path/lang/fr_FR - fi - if [ ! -e $final_path/lang/it_IT ]; then - ln -s $final_path/lang/it $final_path/lang/it_IT + ln -s $final_path/lib $final_path/www/lib fi fi From 97313dc1bac8c38d59d43344d0165f07810d39ca Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 13 Jun 2022 15:50:57 +0200 Subject: [PATCH 04/12] CLeanup is_public --- scripts/upgrade | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e9401e5..bc253de 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,15 +59,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) From 252b25214c74835dd0cd94950703fa99f44d0ffc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 13 Jun 2022 15:51:56 +0200 Subject: [PATCH 05/12] Fix missing phpversion --- scripts/backup | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/backup b/scripts/backup index 2caf213..d07b87c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -27,6 +27,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP From baf84a56f96282f2aacb4963ab576b6875052696 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 16 Jun 2022 03:07:11 +0200 Subject: [PATCH 06/12] Fix backup --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index d07b87c..049cff2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -73,4 +73,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 14a4272388c8fb37c8a3483c5f1e26e7b9f87928 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 18 Jun 2022 15:31:20 +0200 Subject: [PATCH 07/12] Fix password --- scripts/install | 1 + scripts/upgrade | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6c77ac1..04736eb 100644 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=password --value=$password #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index bc253de..503e49f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +password=$(ynh_app_setting_get --app=$app --key=password) #================================================= # CHECK VERSION @@ -73,11 +74,18 @@ fi if [ -z $db_pwd ]; then #c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat /var/www/$app/conf.php | grep DBPASS) + t=$(cat $final_path/conf.php | grep DBPASS) db_pwd=${t:26:24} ynh_app_setting_set --app=$app --key=mysqlpwd --value=$db_pwd fi +if [ -z $password ]; then +#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell + t=$(cat $final_path/conf.php | grep ADMIN_PASSWORD) + password=${t:26:24} + ynh_app_setting_set --app=$app --key=password --value=$password +fi + #================================================= # CREATE DEDICATED USER #================================================= From 99ee915a06085d3f92f2faeda4c701a569ac56c7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 18 Jun 2022 15:32:33 +0200 Subject: [PATCH 08/12] less messages --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 503e49f..67ba336 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,7 +103,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="conf.php" + ynh_setup_source --dest_dir="$final_path" --keep="conf.php www/index.php" ynh_add_config --template="../conf/index_source.php" --destination="$final_path/www/index.php" ynh_secure_remove --file="$final_path/www/admin.php" From 915fd1647e5c7047e240c25c18148525a8a6c308 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 20 Jun 2022 20:06:58 +0200 Subject: [PATCH 09/12] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index ac7ba8c..5e4508f 100644 --- a/check_process +++ b/check_process @@ -27,4 +27,4 @@ Notification=none ;;; Upgrade options ; commit=1d375c45011ad5ab92c038120c7275580479fbc6 name=2.0~ynh3 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=0 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&public_site=0 From 889491796e65cf3e342c42c4fbbfdeb72aed70de Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 23 Jun 2022 01:41:56 +0200 Subject: [PATCH 10/12] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 5e4508f..3e758c2 100644 --- a/check_process +++ b/check_process @@ -27,4 +27,4 @@ Notification=none ;;; Upgrade options ; commit=1d375c45011ad5ab92c038120c7275580479fbc6 name=2.0~ynh3 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&public_site=0 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&public_site=Yes& From 6794ec6918f11c653579ffe258a93cabcf7368bb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 23 Jun 2022 21:09:09 +0200 Subject: [PATCH 11/12] Fix upgrade --- check_process | 6 ------ scripts/upgrade | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/check_process b/check_process index 3e758c2..4152b6e 100644 --- a/check_process +++ b/check_process @@ -13,8 +13,6 @@ setup_private=1 setup_public=1 upgrade=1 - # 2.0~ynh3 - upgrade=1 from_commit=1d375c45011ad5ab92c038120c7275580479fbc6 # 2.0~ynh5 upgrade=1 from_commit=d83328c3e0d7dbbc317ded2924ac08ba3cc51d3e backup_restore=1 @@ -24,7 +22,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=1d375c45011ad5ab92c038120c7275580479fbc6 - name=2.0~ynh3 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&public_site=Yes& diff --git a/scripts/upgrade b/scripts/upgrade index 67ba336..0d3fbef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,10 +107,7 @@ then ynh_add_config --template="../conf/index_source.php" --destination="$final_path/www/index.php" ynh_secure_remove --file="$final_path/www/admin.php" - test -e $final_path/www/lib - if [[ ! $? -eq 0 ]]; then - ln -s $final_path/lib $final_path/www/lib - fi + ln -s $final_path/lib $final_path/www/lib fi chmod 750 "$final_path" From c7d2d8992edb2de1115db6bac3df7a8c83d6f0ce Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 26 Jun 2022 16:13:25 +0200 Subject: [PATCH 12/12] Fix variables retrieval --- scripts/upgrade | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0d3fbef..747c1ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,16 +73,12 @@ if [ -z "$final_path" ]; then fi if [ -z $db_pwd ]; then -#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat $final_path/conf.php | grep DBPASS) - db_pwd=${t:26:24} + db_pwd=$(grep DBPASS $final_path/conf.php | cut -d"'" -f4) ynh_app_setting_set --app=$app --key=mysqlpwd --value=$db_pwd fi if [ -z $password ]; then -#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat $final_path/conf.php | grep ADMIN_PASSWORD) - password=${t:26:24} + password=$(grep ADMIN_PASSWORD $final_path/conf.php | cut -d"'" -f4) ynh_app_setting_set --app=$app --key=password --value=$password fi