diff --git a/conf/nginx.conf b/conf/nginx.conf index 9ce815e..f1cf538 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,32 +1,33 @@ - location __PATH__ +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { { alias __FINALPATH__/; # Force https - if ($scheme = http) - + if ($scheme = http) + { rewrite ^ https://$server_name$request_uri? permanent; } - - if (!-e $request_filename) - + + if (!-e $request_filename) + { rewrite ^(.*)$ /index.php?req=$1; } - + client_max_body_size 20m; client_body_buffer_size 128k; - + # Default indexes and catch-all index index.php; charset utf-8; - + # Example PHP configuration - location ~* \.php$ + location ~* \.php$ { try_files $uri =404; - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; @@ -34,10 +35,10 @@ # make sure webfinger and other well known services aren't blocked # by denying dot files and rewrite request to the front controller - location ^~ /.well-known/ + location ^~ /.well-known/ { allow all; - if (!-e $request_filename) + if (!-e $request_filename) { rewrite ^(.*)$ /index.php?req=$1; } @@ -51,23 +52,22 @@ # expires 30d; # try_files $uri /index.php?q=$uri&$args; # } - + # block these file types - location ~* \.(tpl|md|tgz|log|out)$ + location ~* \.(tpl|md|tgz|log|out)$ { deny all; } - + # deny access to all dot files - location ~ /\. + location ~ /\. { deny all; } - + #deny access to store - location ~ /store + location ~ /store { deny all; } } - diff --git a/scripts/install b/scripts/install index 8841a46..69ba8fa 100755 --- a/scripts/install +++ b/scripts/install @@ -84,8 +84,8 @@ git clone https://codeberg.org/zot/osada.git "$final_path" # 2 - Osada Addons # Make addon Directory and unpack the Osada addons to this directory -ynh_script_progression --message="Create addon directory inside Osada root folder..." -mkdir $final_path/addon +# ynh_script_progression --message="Create addon directory inside Osada root folder..." +# mkdir $final_path/addon ynh_script_progression --message="Setting up Osada addons source files..." # ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" @@ -96,8 +96,9 @@ popd # 3 - Some extra folders ynh_script_progression --message="Creating smarty3 folder for personal data..." -mkdir -p "${final_path}/store/[data]/smarty3" -chmod -R 775 $final_path/store +mkdir -p "${final_path}/store" +mkdir -p "${final_path}/cache/smarty3" +chmod -R 777 $final_path/store $final_path/cache # Copy the template install/htconfig.sample.php to .htconfig.php ynh_script_progression --message="Moving .htconfig.php to root of Osada ..." diff --git a/scripts/upgrade b/scripts/upgrade index b03c94c..f4e22b0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,7 +91,7 @@ ynh_setup_source --dest_dir="$final_path" pushd "$final_path" util/udall popd -chmod -R 775 $final_path/store +chmod -R 777 $final_path/store $final_path/cache #================================================= # NGINX CONFIGURATION #=================================================