From 444c0dd68edc12528f3c0ddd14b26a4ef6c8e038 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 10 Jun 2018 07:51:22 +0530 Subject: [PATCH 1/5] Dependency changed to php-imagick for stretch fix --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index dee4871..8535c22 100644 --- a/scripts/install +++ b/scripts/install @@ -70,7 +70,7 @@ ynh_app_setting_set $app database $database #================================================= # INSTALL DEPENDENCIES #================================================= -pkg_dependencies="php5-cli php5-imagick php5-gd php5-mcrypt" +pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" if [ "$(lsb_release --codename --short)" != "jessie" ]; then pkg_dependencies="$pkg_dependencies php-xml" fi diff --git a/scripts/restore b/scripts/restore index 4c29748..c83f0ce 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,7 @@ ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" # REINSTALL DEPENDENCIES #================================================= -pkg_dependencies="php5-cli php5-imagick php5-gd php5-mcrypt" +pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" if [ "$(lsb_release --codename --short)" != "jessie" ]; then pkg_dependencies="$pkg_dependencies php-xml" fi diff --git a/scripts/upgrade b/scripts/upgrade index 05490ac..62df5fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,7 @@ ynh_clean_setup () { ynh_abort_if_errors # Add Dependencies -pkg_dependencies="php5-cli php5-imagick php5-gd php5-mcrypt" +pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" if [ "$(lsb_release --codename --short)" != "jessie" ]; then pkg_dependencies="$pkg_dependencies php-xml" fi From 2706331022719e7ed355baa85fd38a4ac9ba5e6c Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 10 Jun 2018 19:47:36 +0530 Subject: [PATCH 2/5] Added @Josue-T solution for dependencies --- scripts/install | 7 ++----- scripts/restore | 7 ++----- scripts/upgrade | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/scripts/install b/scripts/install index 8535c22..ee9cdfc 100644 --- a/scripts/install +++ b/scripts/install @@ -70,11 +70,8 @@ ynh_app_setting_set $app database $database #================================================= # INSTALL DEPENDENCIES #================================================= -pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" -if [ "$(lsb_release --codename --short)" != "jessie" ]; then - pkg_dependencies="$pkg_dependencies php-xml" -fi -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' + #================================================= # CREATE A MYSQL DATABASE diff --git a/scripts/restore b/scripts/restore index c83f0ce..880ee93 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,11 +80,8 @@ ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" # REINSTALL DEPENDENCIES #================================================= -pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" -if [ "$(lsb_release --codename --short)" != "jessie" ]; then - pkg_dependencies="$pkg_dependencies php-xml" -fi -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' + # set permission sudo chmod -R 777 $final_path/view/smarty3 diff --git a/scripts/upgrade b/scripts/upgrade index 62df5fc..916dc2d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,11 +33,8 @@ ynh_clean_setup () { ynh_abort_if_errors # Add Dependencies -pkg_dependencies="php5-cli php-imagick php5-gd php5-mcrypt" -if [ "$(lsb_release --codename --short)" != "jessie" ]; then - pkg_dependencies="$pkg_dependencies php-xml" -fi -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' + # Create a temporary directory tmpdir="$(mktemp -d)" From 00f36f3be2900a74bb4a22a2e310077e02a0556d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 11 Jun 2018 12:37:15 +0200 Subject: [PATCH 3/5] Fix crontab --- conf/poller-cron | 4 ++-- scripts/install | 3 ++- scripts/upgrade | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/poller-cron b/conf/poller-cron index 0e284be..8367ccd 100644 --- a/conf/poller-cron +++ b/conf/poller-cron @@ -1,2 +1,2 @@ -# Run poller periodically to update Hubzilla -*/10 * * * * cd YNH_WWW_PATH; /usr/bin/php bin/worker.php +# Run poller periodically to update Friendica +*/10 * * * * __USER__ cd __YNH_WWW_PATH__; /usr/bin/php bin/worker.php diff --git a/scripts/install b/scripts/install index ee9cdfc..5bb1bf5 100644 --- a/scripts/install +++ b/scripts/install @@ -143,7 +143,8 @@ sudo chmod -R 777 $final_path/view/smarty3 chown -R $app: $final_path # Set up poller -sed -i "s@YNH_WWW_PATH@$final_path@g" ../conf/poller-cron +ynh_replace_string "__YNH_WWW_PATH__" "$final_path" ../conf/poller-cron +ynh_replace_string "__USER__" "$app" ../conf/poller-cron sudo cp ../conf/poller-cron /etc/cron.d/$app #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 916dc2d..c4b9864 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,8 @@ ynh_backup_if_checksum_is_different "$final_path/.htconfig.php" ynh_store_file_checksum "$final_path/.htconfig.php" # Set up poller -sed -i "s@YNH_WWW_PATH@$final_path@g" ../conf/poller-cron +ynh_replace_string "__YNH_WWW_PATH__" "$final_path" ../conf/poller-cron +ynh_replace_string "__USER__" "$app" ../conf/poller-cron sudo cp ../conf/poller-cron /etc/cron.d/$app # Run composer From 2b28cc755112ef84c170993de66e800cb8749650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 11 Jun 2018 14:44:45 +0200 Subject: [PATCH 4/5] Fix multi-instance install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5bb1bf5..6f05068 100644 --- a/scripts/install +++ b/scripts/install @@ -104,7 +104,7 @@ ynh_add_nginx_config # configure friendica -sudo cp /var/www/friendica/htconfig.php /var/www/friendica/.htconfig.php +sudo cp "$final_path/htconfig.php" "$final_path/.htconfig.php" ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/.htconfig.php" ynh_replace_string "mysqlusername" "$db_name" "$final_path/.htconfig.php" ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/.htconfig.php" From 37580a7feba861195ea26af6cf99fb80f3faf1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 11 Jun 2018 15:31:03 +0200 Subject: [PATCH 5/5] Fix manifest --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 9315e95..39742f6 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "name": "aymhce", "email": "aymhce@gmail.com" }, - "multi_instance": "true", + "multi_instance": true, "services": [ "nginx", "php5-fpm",