Skip to content

Commit 04d9551

Browse files
committed
fix: last commit
1 parent 3798972 commit 04d9551

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

docker-entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/sh
22
set -e
33

4-
echo "[entrypoint] loading privoxy environment...";
4+
echo "[entrypoint] loading privoxy environment..."
55

66
privman --init
77

8+
89
if $ADBLOCK_NGINX_ENABLED && [ -n "$ADBLOCK_URLS" ]; then
9-
print "[entrypoint] launching nginx..."
10+
echo "[entrypoint] launching nginx..."
1011
envsubst '$NGINX_SERVER_NAME $NGINX_PORT $NGINX_PORT_SSL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
1112
nginx
1213
fi
@@ -20,8 +21,8 @@ if [ ! -e /usr/local/etc/privoxy/config ] || [ -z "$(ls -A /usr/local/etc/privox
2021
sed -i \
2122
-e 's/^confdir .*/confdir \/usr\/local\/etc\/privoxy/' \
2223
-e 's/^templdir .*/templdir \/usr\/local\/etc\/privoxy\/templates/' \
23-
-e '/^actionsfile user.action/a actionsfile privman-rules\/user.action\nactionsfile privman-rules\/common.action\nactionsfile ab2p.system.action\nactionsfile ab2p.action' \
24-
-e '/^filterfile user.filter/a filterfile privman-rules\/user.filter\nfilterfile privman-rules\/common.filter\nfilterfile ab2p.system.filter\nfilterfile ab2p.filter' \
24+
-e '/^actionsfile user.action/a actionsfile ab2p.system.action\nactionsfile ab2p.action\nactionsfile privman-rules\/user.action\nactionsfile privman-rules\/common.action' \
25+
-e '/^filterfile user.filter/a filterfile ab2p.system.filter\nfilterfile ab2p.filter\nfilterfile privman-rules\/user.filter\nfilterfile privman-rules\/common.filter' \
2526
-e 's/^listen-address .*/listen-address 0.0.0.0:'"${PRIVOXY_PORT}"'/' \
2627
-e 's/^enforce-blocks .*/#enforce-blocks 0/' \
2728
-e 's/^buffer-limit .*/buffer-limit 25600/' \

templates/nginx.conf.template

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ http {
4949
ssl_session_tickets off; # Disable session tickets for security
5050
# HSTS for 2 years, including subdomains
5151
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
52+
add_header Access-Control-Allow-Origin "*" always;
5253

5354
#root = --webDir parameter value
5455
root /usr/local/etc/adblock2privoxy/css;
@@ -74,7 +75,6 @@ http {
7475
default_type text/css;
7576
add_header X-Content-Type-Options nosniff;
7677
add_header Cache-Control "public, max-age=31536000, immutable";
77-
add_header Access-Control-Allow-Origin "*" always;
7878
try_files $uri $1;
7979
}
8080

@@ -83,7 +83,6 @@ http {
8383
default_type text/css;
8484
add_header X-Content-Type-Options nosniff;
8585
add_header Cache-Control "public, max-age=31536000, immutable";
86-
add_header Access-Control-Allow-Origin "*" always;
8786
rewrite ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css last;
8887
}
8988

@@ -93,7 +92,6 @@ http {
9392
default_type text/css;
9493
add_header X-Content-Type-Options nosniff;
9594
add_header Cache-Control "public, max-age=31536000, immutable";
96-
add_header Access-Control-Allow-Origin "*" always;
9795
try_files $uri $1ab2p.css;
9896
}
9997
}

0 commit comments

Comments
 (0)