-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add squid proxy dockerfile and config
- Loading branch information
Showing
4 changed files
with
85 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/ash | ||
/usr/lib/squid/security_file_certgen -c -s /var/cache/squid/ssl_db -M 4MB | ||
chown -R squid:squid /var/cache/squid/ssl_db /var/log/squid | ||
squid -NYCd 1 -f /etc/squid/squid.conf |
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,15 @@ | ||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache \ | ||
squid \ | ||
gettext \ | ||
libressl \ | ||
ca-certificates && \ | ||
update-ca-certificates | ||
|
||
RUN mkdir -p /etc/squid/ssl_cert /var/cache/squid/ /var/spool/squid /var/log/squid/ && \ | ||
chown -R squid:squid /etc/squid/ssl_cert /var/cache/squid/ /var/log/squid/ /var/spool/squid | ||
|
||
EXPOSE 3128 | ||
ENTRYPOINT ["entrypoint/entrypoint.sh"] | ||
CMD ["squid", "-NYCd", "1"] |
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,65 @@ | ||
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 | ||
|
||
acl Safe_ports port 80 # http | ||
acl Safe_ports port 21 # ftp | ||
acl Safe_ports port 443 # https | ||
acl Safe_ports port 70 # gopher | ||
acl Safe_ports port 210 # wais | ||
acl Safe_ports port 1025-65535 # unregistered ports | ||
acl Safe_ports port 280 # http-mgmt | ||
acl Safe_ports port 488 # gss-http | ||
acl Safe_ports port 591 # filemaker | ||
acl Safe_ports port 777 # multiling http | ||
|
||
cache_mem 64 MB | ||
maximum_object_size_in_memory 512 KB | ||
|
||
http_port 3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl_cert/squid.pem key=/etc/squid/ssl_cert/squid.key | ||
|
||
http_access deny !Safe_ports | ||
|
||
acl step1 at_step SslBump1 | ||
|
||
acl ip_sni ssl::server_name_regex -i ^\d+\.\d+\.\d+\.\d+$ | ||
|
||
acl no_sni ssl::server_name none | ||
|
||
acl https_ip_url url_regex -i ^https?://([0-9]{1,3}\.){3}[0-9]{1,3} | ||
acl ip_url url_regex -i ^([0-9]{1,3}\.){3}[0-9]{1,3} | ||
|
||
ssl_bump peek step1 | ||
ssl_bump terminate ip_sni | ||
ssl_bump terminate no_sni | ||
ssl_bump splice all | ||
|
||
logfile_rotate 0 | ||
|
||
http_access deny https_ip_url | ||
http_access deny ip_url | ||
http_access deny ip_sni | ||
http_access deny no_sni | ||
|
||
http_access allow localnet | ||
http_access allow localhost | ||
|
||
http_access deny all | ||
|
||
# Uncomment and adjust the following to add a disk cache directory. | ||
#cache_dir ufs /var/cache/squid 100 16 256 | ||
|
||
# Leave coredumps in the first cache dir | ||
coredump_dir /var/cache/squid | ||
|
||
# | ||
# Add any of your own refresh_pattern entries above these. | ||
# | ||
refresh_pattern ^ftp: 1440 20% 10080 | ||
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 | ||
refresh_pattern . 0 20% 4320 |
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