1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diagramsnet_ynh.git synced 2024-09-03 18:26:33 +02:00

Force http parameter to disable 3rds parties

This commit is contained in:
Gofannon 2020-04-05 11:56:23 +02:00
parent 2846406ada
commit 26f9110717
2 changed files with 19 additions and 0 deletions

View file

@ -66,6 +66,16 @@ ynh_script_progression --message="Configuring nginx web server..." --weight=15
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# REMOVE CALLS TO THIRD PARTY WEBSITES
#=================================================
# Add "offline" parameter in index.html
# See https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported-
# and https://shelter.moe/@Neil/103928506546498078 [French]
sed_pattern='s/var params = window.location.search.slice(1).split('&');/&\n\t\t\tparams.push(\"offline=1\");/g'
sed -i "$sed_pattern" "$final_path/src/main/webapp/index.html"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -71,8 +71,17 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." -
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
# REMOVE CALLS TO THIRD PARTY WEBSITES
#================================================= #=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# Add "offline" parameter in index.html
# See https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported-
# and https://shelter.moe/@Neil/103928506546498078 [French]
sed_pattern='s/var params = window.location.search.slice(1).split('&');/&\n\t\t\tparams.push(\"offline=1\");/g'
sed -i "$sed_pattern" "$final_path/src/main/webapp/index.html"
fi
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES