Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2992c62d69 | ||
|
|
48d002c1de | ||
|
|
633d4e1d09 |
12
Dockerfile
12
Dockerfile
@ -13,8 +13,8 @@ RUN echo "deb-src http://deb.debian.org/debian bookworm main contrib" >> /etc/ap
|
|||||||
--program-prefix= \
|
--program-prefix= \
|
||||||
--libdir=/usr/lib \
|
--libdir=/usr/lib \
|
||||||
--libexecdir=/usr/lib/squid \
|
--libexecdir=/usr/lib/squid \
|
||||||
--localstatedir=/var \
|
--localstatedir=/run \
|
||||||
--sharedstatedir=/usr/com \
|
--sharedstatedir=/var/lib \
|
||||||
--mandir=/usr/share/man \
|
--mandir=/usr/share/man \
|
||||||
--infodir=/usr/share/info \
|
--infodir=/usr/share/info \
|
||||||
--enable-icap-client \
|
--enable-icap-client \
|
||||||
@ -38,7 +38,7 @@ RUN echo "deb-src http://deb.debian.org/debian bookworm main contrib" >> /etc/ap
|
|||||||
--enable-ssl \
|
--enable-ssl \
|
||||||
--enable-ssl-crtd \
|
--enable-ssl-crtd \
|
||||||
--with-openssl \
|
--with-openssl \
|
||||||
--enable-storeio="aufs,diskd,ufs" \
|
--enable-storeio="aufs,diskd,ufs,rock" \
|
||||||
--exec-prefix=/usr \
|
--exec-prefix=/usr \
|
||||||
--enable-auth-basic="LDAP" \
|
--enable-auth-basic="LDAP" \
|
||||||
--enable-auth-digest="LDAP" \
|
--enable-auth-digest="LDAP" \
|
||||||
@ -51,7 +51,7 @@ RUN echo "deb-src http://deb.debian.org/debian bookworm main contrib" >> /etc/ap
|
|||||||
--with-filedescriptors=48000 \
|
--with-filedescriptors=48000 \
|
||||||
--enable-delay-pools \
|
--enable-delay-pools \
|
||||||
--with-large-files \
|
--with-large-files \
|
||||||
--with-pidfile=/squid/squid.pid \
|
--with-pidfile=/run/squid.pid \
|
||||||
--with-default-user=squid \
|
--with-default-user=squid \
|
||||||
--enable-removal-policies="lru,heap" \
|
--enable-removal-policies="lru,heap" \
|
||||||
&& make \
|
&& make \
|
||||||
@ -94,10 +94,12 @@ RUN adduser --no-create-home --uid 1161 --group --system squid \
|
|||||||
&& chown -Rf squid /usr/lib/squid \
|
&& chown -Rf squid /usr/lib/squid \
|
||||||
&& chown -Rf squid /var/log/squid \
|
&& chown -Rf squid /var/log/squid \
|
||||||
&& chown -Rf squid /var/cache/squid \
|
&& chown -Rf squid /var/cache/squid \
|
||||||
|
&& chown -Rf squid /run \
|
||||||
&& echo "cache_dir diskd /var/cache/squid/\${service_name} 130 51 51" >> /etc/squid/squid.conf \
|
&& echo "cache_dir diskd /var/cache/squid/\${service_name} 130 51 51" >> /etc/squid/squid.conf \
|
||||||
&& echo "access_log stdio:/var/log/squid/access.log" >> /etc/squid/squid.conf \
|
&& echo "access_log stdio:/var/log/squid/access.log" >> /etc/squid/squid.conf \
|
||||||
&& echo "cache_log /var/log/squid/cache.log" >> /etc/squid/squid.conf \
|
&& echo "cache_log /var/log/squid/cache.log" >> /etc/squid/squid.conf \
|
||||||
&& echo "cache_effective_user squid" >> /etc/squid/squid.conf \
|
&& echo "cache_effective_user squid" >> /etc/squid/squid.conf \
|
||||||
|
&& echo "pid_filename /var/run/squid.pid" >> /etc/squid/squid.conf \
|
||||||
# Removed in 5.8, needed for test
|
# Removed in 5.8, needed for test
|
||||||
&& sed -i '/http_access deny all/ihttp_access allow localnet' /etc/squid/squid.conf \
|
&& sed -i '/http_access deny all/ihttp_access allow localnet' /etc/squid/squid.conf \
|
||||||
# Packages dependencies installation for running and clean again
|
# Packages dependencies installation for running and clean again
|
||||||
@ -110,4 +112,4 @@ HEALTHCHECK CMD squidclient mgr:info | grep "HTTP/1.1 200 OK" || exit 1
|
|||||||
EXPOSE 3128
|
EXPOSE 3128
|
||||||
ENTRYPOINT ["dumb-init"]
|
ENTRYPOINT ["dumb-init"]
|
||||||
USER squid
|
USER squid
|
||||||
CMD ["bash", "-c", "/squid/run.sh && squid -N -n $HOSTNAME"]
|
CMD ["bash", "-c", "/squid/run.sh"]
|
||||||
|
|||||||
@ -1,196 +0,0 @@
|
|||||||
opyright (C) 1996-2022 The Squid Software Foundation and contributors
|
|
||||||
##
|
|
||||||
## Squid software is distributed under GPLv2+ license and includes
|
|
||||||
## contributions from numerous individuals and organizations.
|
|
||||||
## Please see the COPYING and CONTRIBUTORS files for details.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
# This file associates URL patterns for servers or services
|
|
||||||
# that don't automatically include Content-Type (like ftp) with a mime type
|
|
||||||
# and a graphical icon.
|
|
||||||
#
|
|
||||||
# Content-Encodings are taken from section 3.1 of RFC2068 (HTTP/1.1)
|
|
||||||
#
|
|
||||||
# This file has the format :
|
|
||||||
#
|
|
||||||
# regexp content-type icon encoding mode actions
|
|
||||||
#--------------------------------------------------------------------------------------------------------
|
|
||||||
\.gif$ image/gif silk/image.png - image +download
|
|
||||||
\.mime$ www/mime silk/page_white_text.png - ascii +download
|
|
||||||
^internal-dirup$ - silk/arrow_up.png - -
|
|
||||||
^internal-dir$ - silk/folder.png - -
|
|
||||||
^internal-link$ - silk/link.png - -
|
|
||||||
^internal-logo$ - SN.png - -
|
|
||||||
^internal-menu$ - silk/folder_table.png - -
|
|
||||||
^internal-text$ - silk/page_white_text.png - -
|
|
||||||
^internal-index$ - silk/folder_table.png - -
|
|
||||||
^internal-image$ - silk/image.png - -
|
|
||||||
^internal-sound$ - silk/music.png - -
|
|
||||||
^internal-movie$ - silk/film.png - -
|
|
||||||
^internal-telnet$ - silk/computer_link.png - -
|
|
||||||
^internal-binary$ - silk/application.png - -
|
|
||||||
^internal-unknown$ - silk/bullet_red.png - -
|
|
||||||
^internal-view$ - silk/page_white.png - -
|
|
||||||
^internal-download$ - silk/package_go.png - -
|
|
||||||
\.bin$ application/macbinary silk/application.png - image +download
|
|
||||||
\.oda$ application/oda silk/application.png - image +download
|
|
||||||
\.exe$ application/octet-stream silk/application.png - image +download
|
|
||||||
\.pdf$ application/pdf silk/page_white_acrobat.png - image +download
|
|
||||||
\.ai$ application/postscript silk/page_green.png - image +download +view
|
|
||||||
\.eps$ application/postscript silk/page_green.png - image +download +view
|
|
||||||
\.ps$ application/postscript silk/page_green.png - image +download +view
|
|
||||||
\.rtf$ text/rtf silk/page_white_picture.png - ascii +download +view
|
|
||||||
\.Z$ - silk/compress.png compress image +download
|
|
||||||
\.gz$ - silk/compress.png gzip image +download
|
|
||||||
\.bz2$ application/octet-stream silk/compress.png - image +download
|
|
||||||
\.bz$ application/octet-stream silk/compress.png - image +download
|
|
||||||
\.tgz$ application/x-tar silk/compress.png gzip image +download
|
|
||||||
\.csh$ application/x-csh silk/script.png - ascii +download +view
|
|
||||||
\.dvi$ application/x-dvi silk/page_white_text.png - image +download
|
|
||||||
\.hdf$ application/x-hdf silk/database.png - image +download
|
|
||||||
\.latex$ application/x-latex silk/page_white_text.png - ascii +download +view
|
|
||||||
\.lsm$ text/plain silk/page_white_text.png - ascii +download +view
|
|
||||||
\.nc$ application/x-netcdf silk/cd.png - image +download
|
|
||||||
\.cdf$ application/x-netcdf silk/cd.png - ascii +download
|
|
||||||
\.sh$ application/x-sh silk/script.png - ascii +download +view
|
|
||||||
\.tcl$ application/x-tcl silk/script.png - ascii +download +view
|
|
||||||
\.tex$ application/x-tex silk/page_white_text.png - ascii +download +view
|
|
||||||
\.texi$ application/x-texinfo silk/page_white_text.png - ascii +download +view
|
|
||||||
\.texinfo$ application/x-texinfo silk/page_white_text.png - ascii +download +view
|
|
||||||
\.t$ application/x-troff silk/page_white_text.png - ascii +download +view
|
|
||||||
\.roff$ application/x-troff silk/page_white_text.png - ascii +download +view
|
|
||||||
\.tr$ application/x-troff silk/page_white_text.png - ascii +download +view
|
|
||||||
\.man$ application/x-troff-man silk/page_white_magnify.png - ascii +download +view
|
|
||||||
\.me$ application/x-troff-me silk/page_white_text.png - ascii +download +view
|
|
||||||
\.ms$ application/x-troff-ms silk/page_white_text.png - ascii +download +view
|
|
||||||
\.src$ application/x-wais-source silk/script.png - ascii +download
|
|
||||||
\.zip$ application/zip silk/compress.png - image +download
|
|
||||||
\.bcpio$ application/x-bcpio silk/box.png - image +download
|
|
||||||
\.cpio$ application/x-cpio silk/box.png - image +download
|
|
||||||
\.gtar$ application/x-gtar silk/page_white_stack.png - image +download
|
|
||||||
\.rpm$ application/x-rpm silk/package.png - image +download
|
|
||||||
\.shar$ application/x-shar silk/script.png - image +download +view
|
|
||||||
\.sv4cpio$ application/x-sv4cpio silk/box.png - image +download
|
|
||||||
\.sv4crc$ application/x-sv4crc silk/box.png - image +download
|
|
||||||
\.tar$ application/x-tar silk/page_white_stack.png - image +download
|
|
||||||
\.ustar$ application/x-ustar silk/page_white_stack.png - image +download
|
|
||||||
\.au$ audio/basic silk/music.png - image +download
|
|
||||||
\.snd$ audio/basic silk/music.png - image +download
|
|
||||||
\.mp2$ audio/mpeg silk/music.png - image +download
|
|
||||||
\.mp3$ audio/mpeg silk/music.png - image +download
|
|
||||||
\.mpga$ audio/mpeg silk/music.png - image +download
|
|
||||||
\.aif$ audio/x-aiff silk/music.png - image +download
|
|
||||||
\.aiff$ audio/x-aiff silk/music.png - image +download
|
|
||||||
\.aifc$ audio/x-aiff silk/music.png - image +download
|
|
||||||
\.wav$ audio/x-wav silk/music.png - image +download
|
|
||||||
\.bmp$ image/bmp silk/image.png - image +download
|
|
||||||
\.ief$ image/ief silk/image.png - image +download
|
|
||||||
\.jpeg$ image/jpeg silk/photo.png - image +download
|
|
||||||
\.jpg$ image/jpeg silk/photo.png - image +download
|
|
||||||
\.jpe$ image/jpeg silk/photo.png - image +download
|
|
||||||
\.tiff$ image/tiff silk/photo.png - image +download
|
|
||||||
\.tif$ image/tiff silk/image.png - image +download
|
|
||||||
\.ras$ image/x-cmu-raster silk/image.png - image +download
|
|
||||||
\.pnm$ image/x-portable-anymap silk/image.png - image +download
|
|
||||||
\.pbm$ image/x-portable-bitmap silk/image.png - image +download
|
|
||||||
\.pgm$ image/x-portable-graymap silk/image.png - image +download
|
|
||||||
\.ppm$ image/x-portable-pixmap silk/image.png - image +download
|
|
||||||
\.rgb$ image/x-rgb silk/image.png - image +download
|
|
||||||
\.xbm$ image/x-xbitmap silk/image.png - image +download
|
|
||||||
\.xpm$ image/x-xpixmap silk/image.png - image +download
|
|
||||||
\.xwd$ image/x-xwindowdump silk/image.png - image +download
|
|
||||||
\.html$ text/html silk/page_world.png - ascii +download +view
|
|
||||||
\.htm$ text/html silk/page_world.png - ascii +download +view
|
|
||||||
\.css$ text/css silk/css.png - ascii +download +view
|
|
||||||
\.js$ application/x-javascript silk/script.png - ascii +download +view
|
|
||||||
\.c$ text/plain silk/page_white_c.png - ascii +download
|
|
||||||
\.h$ text/plain silk/page_white_c.png - ascii +download
|
|
||||||
\.cc$ text/plain silk/page_white_cplusplus.png - ascii +download
|
|
||||||
\.cpp$ text/plain silk/page_white_cplusplus.png - ascii +download
|
|
||||||
\.hh$ text/plain silk/page_white_c.png - ascii +download
|
|
||||||
\.m$ text/plain silk/script.png - ascii +download
|
|
||||||
\.f90$ text/plain silk/page_code.png - ascii +download
|
|
||||||
\.txt$ text/plain silk/page_white_text.png - ascii +download
|
|
||||||
\.asc$ text/plain silk/page_white_text.png - ascii +download
|
|
||||||
\.rtx$ text/richtext silk/page_white_picture.png - ascii +download +view
|
|
||||||
\.tsv$ text/tab-separated-values silk/script.png - ascii +download +view
|
|
||||||
\.etx$ text/x-setext silk/page_white_text.png - ascii +download +view
|
|
||||||
\.mpeg$ video/mpeg silk/film.png - image +download
|
|
||||||
\.mpg$ video/mpeg silk/film.png - image +download
|
|
||||||
\.mpe$ video/mpeg silk/film.png - image +download
|
|
||||||
\.qt$ video/quicktime silk/film.png - image +download
|
|
||||||
\.mov$ video/quicktime silk/film.png - image +download
|
|
||||||
\.avi$ video/x-msvideo silk/film.png - image +download
|
|
||||||
\.movie$ video/x-sgi-movie silk/film.png - image +download
|
|
||||||
\.cpt$ application/mac-compactpro silk/compress.png - image +download
|
|
||||||
\.hqx$ application/mac-binhex40 silk/page_white_zip.png - image +download
|
|
||||||
\.mwrt$ application/macwriteii silk/page_white_text.png - image +download
|
|
||||||
\.msw$ application/msword silk/script.png - image +download
|
|
||||||
\.doc$ application/msword silk/page_white_word.png - image +download +view
|
|
||||||
\.xls$ application/vnd.ms-excel silk/page_excel.png - image +download
|
|
||||||
\.ppt$ application/vnd.ms-powerpoint silk/page_white_powerpoint.png - image +download
|
|
||||||
\.wk[s1234]$ application/vnd.lotus-1-2-3 silk/script.png - image +download
|
|
||||||
\.mif$ application/vnd.mif silk/page_white_text.png - image +download
|
|
||||||
\.sit$ application/x-stuffit silk/compress.png - image +download
|
|
||||||
\.pict$ application/pict silk/picture.png - image +download
|
|
||||||
\.pic$ application/pict silk/picture.png - image +download
|
|
||||||
\.arj$ application/x-arj-compressed silk/compress.png - image +download
|
|
||||||
\.lzh$ application/x-lha-compressed silk/compress.png - image +download
|
|
||||||
\.lha$ application/x-lha-compressed silk/compress.png - image +download
|
|
||||||
\.zlib$ application/x-deflate silk/compress.png deflate image +download
|
|
||||||
README text/plain silk/information.png - ascii +download
|
|
||||||
^core$ application/octet-stream silk/bomb.png - image +download
|
|
||||||
\.core$ application/octet-stream silk/bomb.png - image +download
|
|
||||||
\.png$ image/png silk/image.png - image +download
|
|
||||||
\.cab$ application/octet-stream silk/compress.png - image +download +view
|
|
||||||
\.xpi$ application/x-xpinstall silk/plugin_add.png - image +download
|
|
||||||
\.class$ application/octet-stream silk/script_gear.png - image +download
|
|
||||||
\.java$ text/plain silk/cup.png - ascii +download
|
|
||||||
\.dcr$ application/x-director silk/script_palette.png - image +download
|
|
||||||
\.dir$ application/x-director silk/film.png - image +download
|
|
||||||
\.dxr$ application/x-director silk/film_key.png - image +download
|
|
||||||
\.djv$ image/vnd.djvu silk/image.png - image +download
|
|
||||||
\.djvu$ image/vnd.djvu silk/image.png - image +download
|
|
||||||
\.dll$ application/octet-stream silk/plugin.png - image +download
|
|
||||||
\.dms$ application/octet-stream silk/drive_disk.png - image +download
|
|
||||||
\.ez$ application/andrew-inset silk/bullet_red.png - image +download
|
|
||||||
\.ice$ x-conference/x-cooltalk silk/compress.png - image +download
|
|
||||||
\.iges$ model/iges silk/image.png - image +download
|
|
||||||
\.igs$ model/iges silk/image.png - image +download
|
|
||||||
\.kar$ audio/midi silk/music.png - image +download
|
|
||||||
\.mid$ audio/midi silk/music.png - image +download
|
|
||||||
\.midi$ audio/midi silk/music.png - image +download
|
|
||||||
\.mesh$ model/mesh silk/image.png - image +download
|
|
||||||
\.silo$ model/mesh silk/image.png - image +download
|
|
||||||
\.mxu$ video/vnd.mpegurl silk/film.png - image +download
|
|
||||||
\.pdb$ chemical/x-pdb silk/chart_line.png - image +download
|
|
||||||
\.pgn$ application/x-chess-pgn silk/bricks.png - image +download
|
|
||||||
\.ra$ audio/x-realaudio silk/music.png - image +download
|
|
||||||
\.ram$ audio/x-pn-realaudio silk/music.png - image +download
|
|
||||||
\.rm$ audio/x-pn-realaudio silk/music.png - image +download
|
|
||||||
\.sgml$ text/sgml silk/page_code.png - ascii +download
|
|
||||||
\.sgm$ text/sgml silk/page_code.png - ascii +download
|
|
||||||
\.skd$ application/x-koan silk/music.png - image +download
|
|
||||||
\.skm$ application/x-koan silk/music.png - image +download
|
|
||||||
\.skp$ application/x-koan silk/music.png - image +download
|
|
||||||
\.skt$ application/x-koan silk/music.png - image +download
|
|
||||||
\.smi$ application/smil silk/layers.png - image +download
|
|
||||||
\.smil$ application/smil silk/layers.png - image +download
|
|
||||||
\.so$ application/octet-stream silk/plugin.png - image +download
|
|
||||||
\.spl$ application/x-futuresplash silk/page_white_flash.png - image +download
|
|
||||||
\.swf$ application/x-shockwave-flash silk/page_white_flash.png - image +download
|
|
||||||
\.vcd$ application/x-cdlink silk/cd.png - image +download
|
|
||||||
\.vrml$ model/vrml silk/image.png - image +download
|
|
||||||
\.wbmp$ image/vnd.wap.wbmp silk/image.png - image +download
|
|
||||||
\.wbxml$ application/vnd.wap.wbxml silk/database_table.png - image +download
|
|
||||||
\.wmlc$ application/vnd.wap.wmlc silk/database_table.png - image +download
|
|
||||||
\.wmlsc$ application/vnd.wap.wmlscriptc silk/script.png - image +download
|
|
||||||
\.wmls$ application/vnd.wap.wmlscript silk/script.png - image +download
|
|
||||||
\.xht$ application/xhtml silk/page_world.png - ascii +download
|
|
||||||
\.xhtml$ application/xhtml silk/page_world.png - ascii +download
|
|
||||||
\.xml$ text/xml silk/page_world.png - ascii +download
|
|
||||||
\.xsl$ text/xml silk/layout.png - ascii +download
|
|
||||||
\.xyz$ chemical/x-xyz silk/chart_line.png - image +download
|
|
||||||
#
|
|
||||||
# the default
|
|
||||||
. text/plain silk/bullet_red.png - image +download +view
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
#
|
|
||||||
# Recommended minimum configuration:
|
|
||||||
#
|
|
||||||
|
|
||||||
# Example rule allowing access from your local networks.
|
|
||||||
# Adapt to list your (internal) IP networks from where browsing
|
|
||||||
# should be allowed
|
|
||||||
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 SSL_ports port 443
|
|
||||||
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
|
|
||||||
|
|
||||||
icap_enable on
|
|
||||||
icap_service service_req reqmod_precache bypass=off icap://e2guardian:1344/request
|
|
||||||
adaptation_access service_req deny manager
|
|
||||||
adaptation_access service_req allow all
|
|
||||||
icap_preview_enable off
|
|
||||||
icap_send_client_ip on
|
|
||||||
icap_send_client_username on
|
|
||||||
icap_service_failure_limit 80 in 5 seconds
|
|
||||||
icap_connect_timeout 60 seconds
|
|
||||||
icap_io_timeout 120 seconds
|
|
||||||
icap_service_revival_delay 30
|
|
||||||
|
|
||||||
#
|
|
||||||
# Recommended minimum Access Permission configuration:
|
|
||||||
#
|
|
||||||
# Deny requests to certain unsafe ports
|
|
||||||
http_access deny !Safe_ports
|
|
||||||
|
|
||||||
# Deny CONNECT to other than secure SSL ports
|
|
||||||
http_access deny CONNECT !SSL_ports
|
|
||||||
|
|
||||||
# Only allow cachemgr access from localhost
|
|
||||||
http_access allow localhost manager
|
|
||||||
http_access deny manager
|
|
||||||
|
|
||||||
# We strongly recommend the following be uncommented to protect innocent
|
|
||||||
# web applications running on the proxy server who think the only
|
|
||||||
# one who can access services on "localhost" is a local user
|
|
||||||
#http_access deny to_localhost
|
|
||||||
|
|
||||||
#
|
|
||||||
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
|
|
||||||
#
|
|
||||||
|
|
||||||
# Example rule allowing access from your local networks.
|
|
||||||
# Adapt localnet in the ACL section to list your (internal) IP networks
|
|
||||||
# from where browsing should be allowed
|
|
||||||
http_access allow localnet
|
|
||||||
http_access allow localhost
|
|
||||||
|
|
||||||
# And finally deny all other access to this proxy
|
|
||||||
http_access deny all
|
|
||||||
|
|
||||||
# Squid normally listens to port 3128
|
|
||||||
http_port 3128
|
|
||||||
|
|
||||||
# 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 ^gopher: 1440 0% 1440
|
|
||||||
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
|
|
||||||
refresh_pattern . 0 20% 4320
|
|
||||||
cache_dir diskd /var/cache/squid/${service_name} 130 51 51
|
|
||||||
access_log stdio:/var/log/squid/access.log
|
|
||||||
cache_log /var/log/squid/cache.log
|
|
||||||
cache_effective_user squid
|
|
||||||
follow_x_forwarded_for allow all
|
|
||||||
# Remove identifying headers
|
|
||||||
request_header_access Cache-Control deny all
|
|
||||||
request_header_access Via deny all
|
|
||||||
request_header_access X-Forwarded-For deny all
|
|
||||||
10
squid/run.sh
10
squid/run.sh
@ -1,8 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
USER=$( grep -m 1 ^cache_effective_user /etc/squid/squid.conf | awk '{ print ($2) }' )
|
||||||
|
PID=$( grep -m 1 ^pid_filename /etc/squid/squid.conf | awk '{ print ($2) }' )
|
||||||
|
|
||||||
if [ -e "/squid/squid.pid" ];then
|
if [ -e "$PID" ];then
|
||||||
echo "Squid pid: Already running ?"
|
echo "Squid pid: Already running ?"
|
||||||
rm /squid/squid.pid
|
rm $PÏD
|
||||||
pkill squid
|
pkill squid
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -17,7 +19,7 @@ else
|
|||||||
touch "/var/spool/squid/$HOSTNAME"
|
touch "/var/spool/squid/$HOSTNAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while test -e /tmp/$HOSTNAME.pid
|
while test -e $PID
|
||||||
do
|
do
|
||||||
echo "cache is generated/checked"
|
echo "cache is generated/checked"
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -42,4 +44,4 @@ fi
|
|||||||
echo "Starting: squid"
|
echo "Starting: squid"
|
||||||
# Run autoreload: IN BACKGROUND
|
# Run autoreload: IN BACKGROUND
|
||||||
/squid/autoreload.sh &
|
/squid/autoreload.sh &
|
||||||
|
squid -N -n "$HOSTNAME"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user