-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5ab124
commit 1740c28
Showing
3 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:edge | ||
|
||
RUN apk add --no-cache squid bash | ||
|
||
COPY squid.conf /etc/squid/squid.conf | ||
|
||
HEALTHCHECK --interval=1s --retries=600 CMD nc -z localhost 3128 | ||
EXPOSE 3128 | ||
|
||
CMD ["squid", "--foreground"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN) | ||
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN) | ||
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN) | ||
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines | ||
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN) | ||
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN) | ||
acl localnet src fc00::/7 # RFC 4193 local private network range | ||
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines | ||
|
||
# Authenticates only one user named "proxy" with the password "testing" | ||
auth_param basic program /bin/bash -c 'while IFS= read -r L; do [[ "$L" =~ "proxy testing" ]] && echo OK || echo ERR; done;' | ||
|
||
# Allows only authenticated requests from localnet to specific ports on localhost | ||
acl auth proxy_auth REQUIRED | ||
acl to_ports port 9200 | ||
http_access allow auth localnet to_localhost to_ports | ||
|
||
# Denies otherwise | ||
http_access deny all | ||
|
||
# General settings | ||
http_port 3128 | ||
dns_timeout 3 seconds |