From a6532a40f5422d0f11d2190f0666a77a171338f9 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Thu, 21 Jun 2018 22:01:15 +0530 Subject: [PATCH 1/2] Fixes in nginx --- conf/nginx.conf | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index dff6a9a..5bb7945 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -48,7 +48,6 @@ location __PATH__ { #Default indexes and catch-all index index.php; - try_files $uri $uri/ /index.php?$args; # make sure webfinger and other well known services aren't blocked @@ -68,25 +67,14 @@ location __PATH__ { } - #statically serve these file types when possible - #otherwise fall back to front controller - #allow browser to cache them - #added .htm for advanced source code editor library - location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|ttf|woff|svg)$ { - expires 30d; - try_files $uri /index.php?pagename=$request_uri&$args; - } - - #Execute and serve PHP files - location ~ [^/]\.php(/|$) { + location ~* \.php$ { fastcgi_split_path_info ^(.+?\.php)(/.*)$; + try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } From 44920fad0225d3c54a24fc4ec92505ce54d5d2ab Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 24 Sep 2018 12:23:06 +0530 Subject: [PATCH 2/2] Fix admin email not getting replaced and added php-mbstring dependency --- scripts/install | 16 +++++++--------- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index e1c40b9..c847241 100644 --- a/scripts/install +++ b/scripts/install @@ -70,8 +70,7 @@ ynh_app_setting_set $app database $database #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' - +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 MYSQL DATABASE @@ -104,13 +103,12 @@ ynh_add_nginx_config # configure friendica - -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" -ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/.htconfig.php" -ynh_replace_string "['admin_email'] = '';" "['admin_email'] = '$admin_mail';" "$final_path/.htconfig.php" +sudo cp "../conf/htconfig.php" "/var/www/$app/.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" +ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/.htconfig.php" +ynh_replace_string "__ADMIN_EMAIL__" "$admin_mail" "$final_path/.htconfig.php" ynh_replace_string "die('The configuration you did manually contains some mistakes. Please have a look at your .htconfig.php file.');" "// die('The configuration you did manually contains some mistakes. Please have a look at your .htconfig.php file.');" "$final_path/.htconfig.php" diff --git a/scripts/restore b/scripts/restore index 41bf54d..879d349 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,7 @@ ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini" # REINSTALL DEPENDENCIES #================================================= -ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' +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)' # set permission diff --git a/scripts/upgrade b/scripts/upgrade index 005f5ac..fe5f4dc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,7 @@ ynh_clean_setup () { ynh_abort_if_errors # Add Dependencies -ynh_install_app_dependencies php5-cli 'php5-imagick|php-imagick' php5-gd php5-mcrypt 'php-xml|base-files(<<9.0)' +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