1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
This commit is contained in:
ewilly 2019-11-18 12:30:42 +01:00
parent 17f9b951dd
commit 600d7f8ccd
4 changed files with 69 additions and 69 deletions

View file

@ -1,67 +1,67 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/; alias __FINALPATH__/;
# Force usage of https # Force usage of https
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
# Add headers to serve security related headers # Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000;"; more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff; more_set_headers "X-Content-Type-Options: nosniff";
add_header X-Frame-Options "SAMEORIGIN"; more_set_headers "X-XSS-Protection: 1; mode=block";
add_header X-XSS-Protection "1; mode=block"; more_set_headers "X-Robots-Tag: none";
add_header X-Robots-Tag none; more_set_headers "X-Download-Options: noopen";
add_header X-Download-Options noopen; more_set_headers "X-Permitted-Cross-Domain-Policies: none";
add_header X-Permitted-Cross-Domain-Policies none; more_set_headers "Referrer-Policy: no-referrer";
# Set max upload size # Set max upload size
client_max_body_size 10G; client_max_body_size 10G;
client_body_timeout 30m; fastcgi_buffers 64 4K;
proxy_read_timeout 30m; client_body_timeout 60m;
fastcgi_buffers 64 4K; proxy_read_timeout 60m;
# Disable gzip to avoid the removal of the ETag header # Disable gzip to avoid the removal of the ETag header
gzip off; gzip off;
index index.php; index index.php;
try_files $uri $uri/ index.php; try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
include fastcgi_params; include fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php7.0-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param REMOTE_USER $remote_user; fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
fastcgi_param modHeadersAvailable true; fastcgi_param modHeadersAvailable true;
fastcgi_intercept_errors on; fastcgi_intercept_errors on;
fastcgi_read_timeout 30m; fastcgi_read_timeout 60m;
fastcgi_send_timeout 30m; fastcgi_send_timeout 60m;
} }
location ^~ __PATH__/(uploads|thumbs){ location ^~ __PATH__/(uploads|thumbs){
deny all; deny all;
} }
location ^~ __PATH__/private { location ^~ __PATH__/private {
deny all; deny all;
location ~* __PATH__/private/temp/.*\.zip$ { location ~* __PATH__/private/temp/.*\.zip$ {
allow all; allow all;
} }
} }
location ^~ __PATH__/core { location ^~ __PATH__/core {
deny all; deny all;
location ~* __PATH__/core/.*\.js$ { location ~* __PATH__/core/.*\.js$ {
allow all; allow all;
} }
} }
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# to test the functionnality : # to test the functionnality :
# yunohost backup create -n "bozon-test" --apps bozon # yunohost backup create -n "bozon-test" --ignore-system --apps bozon
# yunohost backup delete bozon-test # yunohost backup delete bozon-test
set -eu set -eu

View file

@ -26,7 +26,7 @@ data_path="/home/yunohost.app/$app"
if [ $(yunohost app list -i -f "$app" | wc -l) -gt 1 ]; then if [ $(yunohost app list -i -f "$app" | wc -l) -gt 1 ]; then
ynh_app_setting_set "$app" backup_core_only 0 ynh_app_setting_set "$app" backup_core_only 0
app_bck=${app//_/-} app_bck=${app//_/-}
yunohost backup create --apps "$app" --name "${app_bck}_$(date '+%Y%m%d-%H%M%S')" yunohost backup create --ignore-system --apps "$app" --name "${app_bck}_$(date '+%Y%m%d-%H%M%S')"
echo "BoZon fully backuped." >&2 echo "BoZon fully backuped." >&2
fi fi

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# to test the functionnality : # to test the functionnality :
# yunohost backup create -n "bozon-test" --apps bozon # yunohost backup create -n "bozon-test" --ignore-system --apps bozon
# yunohost app remove bozon # yunohost app remove bozon
# yunohost backup restore "bozon-test" # yunohost backup restore "bozon-test"