Move removals to the end to cover entire file

This commit is contained in:
Bob Mottram 2018-03-05 17:49:24 +00:00
parent eec34f4740
commit a7cdc5e7bf
1 changed files with 6 additions and 8 deletions

View File

@ -339,12 +339,6 @@ function fedwiki_setup_web {
function_check nginx_ssl
nginx_ssl "$FEDWIKI_DOMAIN_NAME" mobile
sed -i '/Content-Security-Policy/d' "$fedwiki_nginx_file"
sed -i '/X-XSS-Protection/d' "$fedwiki_nginx_file"
sed -i '/X-Robots-Tag/d' "$fedwiki_nginx_file"
sed -i '/X-Download-Options/d' "$fedwiki_nginx_file"
sed -i '/X-Permitted-Cross-Domain-Policies/d' "$fedwiki_nginx_file"
{ echo ' add_header X-Robots-Tag none;';
echo ' add_header X-Download-Options noopen;';
echo ' add_header X-Frame-Options DENY;';
@ -371,8 +365,6 @@ function fedwiki_setup_web {
echo " listen 127.0.0.1:$FEDWIKI_ONION_PORT default_server;";
echo " server_name $FEDWIKI_ONION_HOSTNAME;";
echo '';
echo ' add_header X-Robots-Tag none;';
echo ' add_header X-Download-Options noopen;';
echo ' add_header X-Frame-Options DENY;';
echo ' add_header X-Content-Type-Options nosniff;';
echo '';
@ -389,6 +381,12 @@ function fedwiki_setup_web {
echo ' }';
echo '}'; } >> "$fedwiki_nginx_file"
sed -i '/Content-Security-Policy/d' "$fedwiki_nginx_file"
sed -i '/X-XSS-Protection/d' "$fedwiki_nginx_file"
sed -i '/X-Robots-Tag/d' "$fedwiki_nginx_file"
sed -i '/X-Download-Options/d' "$fedwiki_nginx_file"
sed -i '/X-Permitted-Cross-Domain-Policies/d' "$fedwiki_nginx_file"
function_check create_site_certificate
create_site_certificate "$FEDWIKI_DOMAIN_NAME" 'yes'