<commit_before>#       WELCOME TO SQUID DEB PROXY
#       ------------------
#
#       This config file is a version of a squid proxy file optimized
#	as a configuration for a caching proxy for Debian/Ubuntu systems.
#
#       More information about squid and its configuration can be found here
#       http://www.squid-cache.org/ and in the FAQ

# settings that you may want to customize
# ---------------------------------------

# this file contains private networks (10.0.0.0/8, 172.16.0.0/12,
# 192.168.0.0/16) by default, you can add/remove additional allowed
# source networks in it to customize it for your setup
acl allowed_networks src "/etc/squid-deb-proxy/autogenerated/allowed-networks-src.acl"

# this file contains the archive mirrors by default,
# if you use a different mirror, add it there
acl to_archive_mirrors dstdomain "/etc/squid-deb-proxy/autogenerated/mirror-dstdomain.acl"

# this contains the package blacklist
acl blockedpkgs urlpath_regex "/etc/squid-deb-proxy/autogenerated/pkg-blacklist-regexp.acl"

# default to a different port than stock squid
http_port <%= @listeningPort %>

# -------------------------------------------------
# settings below probably do not need customization

# user visible name
visible_hostname squid-deb-proxy

# we need a big cache, some debs are huge
maximum_object_size 512 MB

# use a different dir than stock squid and default to 40G
cache_dir aufs <%= @diskCacheRoot %> 40000 16 256

# use different logs
cache_access_log /var/log/squid-deb-proxy/access.log
cache_log /var/log/squid-deb-proxy/cache.log
cache_store_log /var/log/squid-deb-proxy/store.log

# tweaks to speed things up
cache_mem 200 MB
maximum_object_size_in_memory 10240 KB

# pid
pid_filename /var/run/squid-deb-proxy.pid

# refresh pattern for debs and udebs
refresh_pattern deb$   129600 100% 129600
refresh_pattern udeb$   129600 100% 129600
refresh_pattern tar.gz$  129600 100% 129600
refresh_pattern tar.xz$  129600 100% 129600
refresh_pattern tar.bz2$  129600 100% 129600

# always refresh Packages and Release files
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims

# handle meta-release and changelogs.ubuntu.com special
# (fine to have this on debian too)
refresh_pattern changelogs.ubuntu.com/*  0  1% 1

# only allow connects to ports for http, https
acl Safe_ports port 80
acl Safe_ports port 443 563

# only allow ports we trust
http_access deny !Safe_ports
<commit_msg>Add ports as safe for caching/requesting<commit_after>#       WELCOME TO SQUID DEB PROXY
#       ------------------
#
#       This config file is a version of a squid proxy file optimized
#	as a configuration for a caching proxy for Debian/Ubuntu systems.
#
#       More information about squid and its configuration can be found here
#       http://www.squid-cache.org/ and in the FAQ

# settings that you may want to customize
# ---------------------------------------

# this file contains private networks (10.0.0.0/8, 172.16.0.0/12,
# 192.168.0.0/16) by default, you can add/remove additional allowed
# source networks in it to customize it for your setup
acl allowed_networks src "/etc/squid-deb-proxy/autogenerated/allowed-networks-src.acl"

# this file contains the archive mirrors by default,
# if you use a different mirror, add it there
acl to_archive_mirrors dstdomain "/etc/squid-deb-proxy/autogenerated/mirror-dstdomain.acl"

# this contains the package blacklist
acl blockedpkgs urlpath_regex "/etc/squid-deb-proxy/autogenerated/pkg-blacklist-regexp.acl"

# default to a different port than stock squid
http_port <%= @listeningPort %>

# -------------------------------------------------
# settings below probably do not need customization

# user visible name
visible_hostname squid-deb-proxy

# we need a big cache, some debs are huge
maximum_object_size 512 MB

# use a different dir than stock squid and default to 40G
cache_dir aufs <%= @diskCacheRoot %> 40000 16 256

# use different logs
cache_access_log /var/log/squid-deb-proxy/access.log
cache_log /var/log/squid-deb-proxy/cache.log
cache_store_log /var/log/squid-deb-proxy/store.log

# tweaks to speed things up
cache_mem 200 MB
maximum_object_size_in_memory 10240 KB

# pid
pid_filename /var/run/squid-deb-proxy.pid

# refresh pattern for debs and udebs
refresh_pattern deb$   129600 100% 129600
refresh_pattern udeb$   129600 100% 129600
refresh_pattern tar.gz$  129600 100% 129600
refresh_pattern tar.xz$  129600 100% 129600
refresh_pattern tar.bz2$  129600 100% 129600

# always refresh Packages and Release files
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims

# handle meta-release and changelogs.ubuntu.com special
# (fine to have this on debian too)
refresh_pattern changelogs.ubuntu.com/*  0  1% 1

# only allow connects to ports for http, https, and unregistered
acl Safe_ports port 80
acl Safe_ports port 443 563
acl Safe_ports port 1025-65535  # unregistered ports (e.g. PGP keyservers)

# only allow ports we trust
http_access deny !Safe_ports

{'fraction_non_alphanumeric': 0.11755666538609297, 'fraction_numerical': 0.05743373031117941, 'mean_word_length': 3.386689132266217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4737755', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1607, 'n_words': 578}