From dd81b5c8fda9378ba392a48e5ccfa641fb553a86 Mon Sep 17 00:00:00 2001
From: anmol26s <5068843+anmol26s@users.noreply.github.com>
Date: Thu, 27 Sep 2018 15:09:00 +0530
Subject: [PATCH 1/9] Updated to version 2018.09 (#11)
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Upgrade to 2018.09
* Fixed ldap plugin in 2018.09
* Removed name from ldap configuration
---
README.md | 2 +-
conf/addon.ini.php | 21 +++++++++++++++++++++
conf/addons.src | 4 ++--
conf/app.src | 4 ++--
conf/local.ini.php | 41 +++++++++++++++++++++++++++++++++++++++++
manifest.json | 2 +-
scripts/_common.sh | 34 ++++++++++++++++++++++++++++++++++
scripts/install | 21 +++++++++++----------
scripts/restore | 2 +-
scripts/upgrade | 33 +++++++++++++++++++++++++++------
10 files changed, 141 insertions(+), 23 deletions(-)
create mode 100644 conf/addon.ini.php
create mode 100644 conf/local.ini.php
diff --git a/README.md b/README.md
index c00f297..d1e2636 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[Friendica](http://friendi.ca/) integration for YunoHost
-**Version:2018.05**
+**Version:2018.09**
Current snapshot in *sources*:
diff --git a/conf/addon.ini.php b/conf/addon.ini.php
new file mode 100644
index 0000000..8098cb6
--- /dev/null
+++ b/conf/addon.ini.php
@@ -0,0 +1,21 @@
+> $final_path/.htconfig.php"
+sudo cp "../conf/addon.ini.php" "$final_path/config/."
#=================================================
# CREATE DEDICATED USER
@@ -138,7 +139,7 @@ ynh_add_fpm_config
sudo chown -R www-data:www-data $final_path
# 3 - some extra folders
sudo mkdir -p "${final_path}/view/smarty3"
-sudo chmod -R 777 $final_path/view/smarty3
+sudo chmod -R 775 $final_path/view/smarty3
chown -R $app: $final_path
# Set up poller
@@ -151,7 +152,7 @@ sudo cp ../conf/poller-cron /etc/cron.d/$app
#=================================================
# Calculate and store the config file checksum into the app settings
-ynh_store_file_checksum "$final_path/.htconfig.php"
+ynh_store_file_checksum "$final_path/config/local.ini.php"
# Run composer
(cd $final_path && sudo php bin/composer.phar install)
diff --git a/scripts/restore b/scripts/restore
index 879d349..5995bdf 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -84,7 +84,7 @@ ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-ima
# set permission
-sudo chmod -R 777 $final_path/view/smarty3
+chmod -R 775 $final_path/view/smarty3
#=================================================
# RESTORE THE CRON FILE
diff --git a/scripts/upgrade b/scripts/upgrade
index 2e85377..e920f3a 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -18,6 +18,9 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path)
final_path=$(ynh_app_setting_get $app final_path)
+db_name=$(ynh_app_setting_get $app db_name)
+db_pwd=$(ynh_app_setting_get $app mysqlpwd)
+admin_mail=$(ynh_app_setting_get $app email)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@@ -39,7 +42,22 @@ ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-ima
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
-cp -a "$final_path/.htconfig.php" "$tmpdir/.htconfig.php"
+cp -af "$final_path/.htaccess" "$tmpdir/."
+sudo mkdir -p "$tmpdir/view"
+cp -af "$final_path/view/smarty3" "$tmpdir/view/."
+if [ -f $final_path/.htconfig.php ]; then
+ rm "$final_path/.htconfig.php"
+ cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
+ ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
+ ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
+ ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
+ ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
+fi
+sudo mkdir -p "$tmpdir/config"
+cp -af "$final_path/config/local.ini.php" "$tmpdir/config/."
+rm -Rf "$final_path"
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
@@ -56,7 +74,11 @@ path_url=$(ynh_normalize_url_path $path_url)
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
-sudo cp -a "$tmpdir/.htconfig.php" "${final_path}"
+sudo cp -af "$tmpdir/.htaccess" "${final_path}/."
+sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/."
+sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/."
+sudo cp -af "../conf/addon.ini.php" "${final_path}/config/."
+
sudo rm -Rf "$tmpdir"
#Copy Addons
@@ -64,8 +86,7 @@ sudo mkdir $final_path/addon
ynh_setup_source "$final_path/addon" "addons"
# 3 - some extra folders
-sudo mkdir -p "${final_path}/view/smarty3"
-sudo chmod -R 777 $final_path/view/smarty3
+sudo chmod -R 775 $final_path/view/smarty3
#=================================================
# CREATE DEDICATED USER
@@ -89,9 +110,9 @@ ynh_add_nginx_config
ynh_add_fpm_config
# Verify the checksum and backup the file if it's different
-ynh_backup_if_checksum_is_different "$final_path/.htconfig.php"
+ynh_backup_if_checksum_is_different "$final_path/config/local.ini.php"
# Recalculate and store the config file checksum into the app settings
-ynh_store_file_checksum "$final_path/.htconfig.php"
+ynh_store_file_checksum "$final_path/config/local.ini.php"
# Set up poller
ynh_replace_string "__YNH_WWW_PATH__" "$final_path" ../conf/poller-cron
From ecfe97272d02d82714156f355c351159cc394cb2 Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Fri, 28 Sep 2018 21:23:46 +0530
Subject: [PATCH 2/9] Updation from previous version fix
---
scripts/upgrade | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/scripts/upgrade b/scripts/upgrade
index e920f3a..197040c 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -35,6 +35,8 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
+
+
# Add Dependencies
ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)'
@@ -45,25 +47,20 @@ tmpdir="$(mktemp -d)"
cp -af "$final_path/.htaccess" "$tmpdir/."
sudo mkdir -p "$tmpdir/view"
cp -af "$final_path/view/smarty3" "$tmpdir/view/."
-if [ -f $final_path/.htconfig.php ]; then
- rm "$final_path/.htconfig.php"
- cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
- ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
- ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
- ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
- ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
- ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
- ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
-fi
-sudo mkdir -p "$tmpdir/config"
-cp -af "$final_path/config/local.ini.php" "$tmpdir/config/."
rm -Rf "$final_path"
-
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path
fi
+ynh_setup_source "$final_path"
+cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
+ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
+ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
+ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
+ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
+ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
+ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
#=================================================
# CHECK THE PATH
@@ -76,7 +73,6 @@ path_url=$(ynh_normalize_url_path $path_url)
ynh_setup_source "$final_path"
sudo cp -af "$tmpdir/.htaccess" "${final_path}/."
sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/."
-sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/."
sudo cp -af "../conf/addon.ini.php" "${final_path}/config/."
sudo rm -Rf "$tmpdir"
From 0a7fcb672d36f94eb682eca773497ba3c422cb6f Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Fri, 28 Sep 2018 21:28:22 +0530
Subject: [PATCH 3/9] Updation from previous version fix
---
scripts/upgrade | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/upgrade b/scripts/upgrade
index 197040c..6a814ea 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -47,7 +47,9 @@ tmpdir="$(mktemp -d)"
cp -af "$final_path/.htaccess" "$tmpdir/."
sudo mkdir -p "$tmpdir/view"
cp -af "$final_path/view/smarty3" "$tmpdir/view/."
-rm -Rf "$final_path"
+if [ -f $final_path/.htconfig.php ]; then
+ rm "$final_path/.htconfig.php"
+fi
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
From fd4c0d92a4d8cda845447f07fb6dac014aed1bf0 Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Fri, 28 Sep 2018 21:40:58 +0530
Subject: [PATCH 4/9] Updation from previous version fix
---
scripts/upgrade | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/scripts/upgrade b/scripts/upgrade
index 6a814ea..245bd27 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -41,20 +41,16 @@ ynh_abort_if_errors
ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)'
-# Create a temporary directory
-tmpdir="$(mktemp -d)"
-# Backup the config file in the temp dir
-cp -af "$final_path/.htaccess" "$tmpdir/."
-sudo mkdir -p "$tmpdir/view"
-cp -af "$final_path/view/smarty3" "$tmpdir/view/."
-if [ -f $final_path/.htconfig.php ]; then
- rm "$final_path/.htconfig.php"
-fi
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path
fi
+if [ -f $final_path/.htconfig.php ]; then
+ rm "$final_path/.htconfig.php"
+fi
+
+# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
@@ -71,16 +67,9 @@ ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
-# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source "$final_path"
-sudo cp -af "$tmpdir/.htaccess" "${final_path}/."
-sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/."
-sudo cp -af "../conf/addon.ini.php" "${final_path}/config/."
-
-sudo rm -Rf "$tmpdir"
#Copy Addons
-sudo mkdir $final_path/addon
+rm -Rf "$final_path/addon"
ynh_setup_source "$final_path/addon" "addons"
# 3 - some extra folders
From 82bbdef4d7298c63245c114be49fd3c6d05f6d94 Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Fri, 28 Sep 2018 21:55:44 +0530
Subject: [PATCH 5/9] Put commenting at right palce
---
scripts/upgrade | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/scripts/upgrade b/scripts/upgrade
index 245bd27..0aab3ae 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -35,7 +35,12 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
+#=================================================
+# CHECK THE PATH
+#=================================================
+# Normalize the URL path syntax
+path_url=$(ynh_normalize_url_path $path_url)
# Add Dependencies
ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)'
@@ -52,7 +57,11 @@ fi
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
+
+# Copy config file for correct place
cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
+
+# Replace strings in config file
ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
@@ -60,13 +69,6 @@ ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path
ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
-#=================================================
-# CHECK THE PATH
-#=================================================
-
-# Normalize the URL path syntax
-path_url=$(ynh_normalize_url_path $path_url)
-
#Copy Addons
rm -Rf "$final_path/addon"
@@ -87,7 +89,6 @@ chown -R $app: $final_path
# Create a dedicated nginx config
ynh_add_nginx_config
-# configure friendica
#=================================================
# PHP-FPM CONFIGURATION
@@ -101,7 +102,7 @@ ynh_backup_if_checksum_is_different "$final_path/config/local.ini.php"
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config/local.ini.php"
-# Set up poller
+# Set up cron job
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
From 9685ab2c6c1578a35c37a05b83893bde219aae7f Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Wed, 3 Oct 2018 19:06:58 +0530
Subject: [PATCH 6/9] Remove ini file for php
---
conf/php-fpm.conf | 13 +++++++++++++
conf/php-fpm.ini | 11 -----------
scripts/backup | 1 -
scripts/restore | 1 -
4 files changed, 13 insertions(+), 13 deletions(-)
delete mode 100644 conf/php-fpm.ini
diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf
index 8affbc2..2e0dbb1 100644
--- a/conf/php-fpm.conf
+++ b/conf/php-fpm.conf
@@ -390,3 +390,16 @@ catch_workers_output = yes
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M
+
+; Common values to change to increase file upload limit
+; upload_max_filesize = 50M
+; post_max_size = 50M
+; mail.add_x_header = Off
+
+; Other common parameters
+; max_execution_time = 600
+; max_input_time = 300
+; memory_limit = 256M
+; short_open_tag = On
+register_argc_argv=1;
+
diff --git a/conf/php-fpm.ini b/conf/php-fpm.ini
deleted file mode 100644
index bf0f5e0..0000000
--- a/conf/php-fpm.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-; Common values to change to increase file upload limit
-; upload_max_filesize = 50M
-; post_max_size = 50M
-; mail.add_x_header = Off
-
-; Other common parameters
-; max_execution_time = 600
-; max_input_time = 300
-; memory_limit = 256M
-; short_open_tag = On
-register_argc_argv=1;
diff --git a/scripts/backup b/scripts/backup
index 1a3a9b4..392665c 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -49,7 +49,6 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
-ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
#=================================================
# BACKUP THE MYSQL DATABASE
diff --git a/scripts/restore b/scripts/restore
index 5995bdf..cd74c85 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -72,7 +72,6 @@ ynh_system_user_create $app
#=================================================
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
-ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
#=================================================
# SPECIFIC RESTORATION
From 18db4a1c4fb043f3d144b17d2d43a00e76490189 Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Wed, 10 Oct 2018 02:33:13 +0530
Subject: [PATCH 7/9] Updated the sources for 2018.09
---
README.md | 4 ++--
conf/addons.src | 4 ++--
conf/app.src | 4 ++--
conf/php-fpm.conf | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index d1e2636..5c95c50 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,8 @@
Current snapshot in *sources*:
-* https://github.com/friendica/friendica: 2018.05 (commit 2a760bb770c015703567caa91054bcb3c9422fc0)
-* https://github.com/friendica/friendica-addons: 2018.05 (commit 97108080c26ab7b98b30e4b6c61f057314b44577)
+* https://github.com/friendica/friendica: 2018.09 (commit c48fcd4a8f329946cdf09d214596ecf29e859cff)
+* https://github.com/friendica/friendica-addons: 2018.09 (commit 9c275a4185956fb2ca790263fb72f6da6311742f)
## Important Notes
diff --git a/conf/addons.src b/conf/addons.src
index baced9e..75ded5f 100644
--- a/conf/addons.src
+++ b/conf/addons.src
@@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/friendica/friendica-addons/archive/2018.09.zip
-SOURCE_SUM=9a9e4702419e369ffc7ecfd8fb5b5f97
-SOURCE_SUM_PRG=md5sum
+SOURCE_SUM=4862f5d8fb46375ea0232ab3bf6c012153371e51d6d1505bc25a696a7aefc82a
+SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
diff --git a/conf/app.src b/conf/app.src
index 5c1a65f..c922317 100644
--- a/conf/app.src
+++ b/conf/app.src
@@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/friendica/friendica/archive/2018.09.zip
-SOURCE_SUM=f127463d2c6c1c593b1f1ae5ea80dcf3
-SOURCE_SUM_PRG=md5sum
+SOURCE_SUM=02407b87da8d645faaa88429970617231d71bb7611ebe2770f5cca5c54e60e2e
+SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf
index 2e0dbb1..8c6b6a0 100644
--- a/conf/php-fpm.conf
+++ b/conf/php-fpm.conf
@@ -401,5 +401,5 @@ catch_workers_output = yes
; max_input_time = 300
; memory_limit = 256M
; short_open_tag = On
-register_argc_argv=1;
+register_argc_argv=1
From 86298dc406ce23a18da79e4ccc9894b38c0792d9 Mon Sep 17 00:00:00 2001
From: anmol26s
Date: Wed, 10 Oct 2018 02:37:39 +0530
Subject: [PATCH 8/9] Fixed php.conf error
---
conf/php-fpm.conf | 1 -
1 file changed, 1 deletion(-)
diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf
index 8c6b6a0..57affa6 100644
--- a/conf/php-fpm.conf
+++ b/conf/php-fpm.conf
@@ -401,5 +401,4 @@ catch_workers_output = yes
; max_input_time = 300
; memory_limit = 256M
; short_open_tag = On
-register_argc_argv=1
From 966344057ca006587a52bc51e518501e02ced68f Mon Sep 17 00:00:00 2001
From: anmol
Date: Fri, 2 Nov 2018 20:10:01 +0530
Subject: [PATCH 9/9] No admin after install
FIXED:https://github.com/YunoHost-Apps/friendica_ynh/issues/10
---
scripts/install | 3 ++-
scripts/upgrade | 12 +++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/scripts/install b/scripts/install
index 2a373a5..c4cf0a0 100644
--- a/scripts/install
+++ b/scripts/install
@@ -140,7 +140,6 @@ sudo chown -R www-data:www-data $final_path
# 3 - some extra folders
sudo mkdir -p "${final_path}/view/smarty3"
sudo chmod -R 775 $final_path/view/smarty3
-chown -R $app: $final_path
# Set up poller
ynh_replace_string "__YNH_WWW_PATH__" "$final_path" ../conf/poller-cron
@@ -157,6 +156,8 @@ ynh_store_file_checksum "$final_path/config/local.ini.php"
# Run composer
(cd $final_path && sudo php bin/composer.phar install)
+chown -R $app: $final_path
+
#=================================================
# SETUP SSOWAT
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index 0aab3ae..b8c9a98 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -21,6 +21,7 @@ final_path=$(ynh_app_setting_get $app final_path)
db_name=$(ynh_app_setting_get $app db_name)
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
admin_mail=$(ynh_app_setting_get $app email)
+admin=$(ynh_app_setting_get $app admin)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@@ -55,6 +56,11 @@ if [ -f $final_path/.htconfig.php ]; then
rm "$final_path/.htconfig.php"
fi
+if [ -z $admin_mail ]; then # If admin_mail setting doesn't exist
+ admin_mail=$(sudo yunohost user info $admin | grep "mail:" | cut -d' ' -f2)
+ ynh_app_setting_set $app email $admin_mail
+fi
+
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
@@ -84,9 +90,6 @@ sudo chmod -R 775 $final_path/view/smarty3
# Create a system user
ynh_system_user_create $app
-# Set app as owner
-chown -R $app: $final_path
-
# Create a dedicated nginx config
ynh_add_nginx_config
@@ -110,6 +113,9 @@ sudo cp ../conf/poller-cron /etc/cron.d/$app
# Run composer
(cd $final_path && sudo php bin/composer.phar install)
+# Set app as owner
+chown -R $app: $final_path
+
#=================================================
# SETUP SSOWAT
#=================================================