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 @@
-
-
+
+
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