<commit_before># This file generated from a Chef template.
# squid/templates/default.squid.conf.erb

<% if node['squid']['enable_ldap'] %>
auth_param basic program <%= node['squid']['ldap_program'] %> -v <%= node['squid']['ldap_version'] %> -b <%= node['squid']['ldap_basedn'] %> <%= "-D #{node['squid']['ldap_binddn']}" unless node['squid']['ldap_binddn'].nil? %> <%= "-w #{node['squid']['ldap_bindpassword']}" unless node['squid']['ldap_bindpassword'].nil? %> -f <%= node['squid']['ldap_searchfilter'] %> <%= node['squid']['ldap_host'] %>
auth_param basic children <%= node['squid']['ldap_authchildren'] %>
auth_param basic realm <%= node['squid']['ldap_authrealm'] %>
auth_param basic credentialsttl <%= node['squid']['ldap_authcredentialsttl'] %>
<% end %>

<% if node['squid']['cache_peer'] %>
    <%= node['squid']['cache_peer'] %>
<% end %>

<%= "acl all src" if @version.to_i < 3 %>
<%= "acl manager proto cache_object" if @version.to_f < 3.2 %>
<%= "acl localhost src 127.0.0.1/32" if @version.to_f < 3.2 %>
<%= "acl to_localhost dst 127.0.0.0/8 0.0.0.0/32" if @version.to_f < 3.2 %>
<% @localnets.each do |localnet| %>
acl localnet src <%= localnet %>
<% end %>

acl localnet src 10.0.0.0/8	# RFC1918 possible internal network
acl localnet src 172.16.0.0/12	# RFC1918 possible internal network
acl localnet src 192.168.0.0/16	# RFC1918 possible internal network
acl localnet src fc00::/7       # RFC4193 local private network range
acl localnet src fe80::/10      # RFC4291 link-local (directly-plugged) machine

<% @ssl_ports.each do |port| %>
acl SSL_ports port <%= port %>
<% end %>
<% @safe_ports.each do |port| %>
acl Safe_ports port <%= port %>
<% end %>
acl purge method PURGE
acl CONNECT method CONNECT

# Managed with Chef
<% @host_acl.each do |host| %>
acl <%= host[0] %> <%= host[1] %> <%= host[2] %>
<% end %>
<% @url_acl.each do |url| %>
acl <%= url[0] %> <%= url[1] %> <%= url[2] %>
<% end %>
<% @acls.each do |acl| %>
http_access <%= acl[0] %> <%= acl[1] %> <%= acl[2] %>
<% end %>

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
<%= "http_access allow localnet" if !@localnets.empty? %>
<%= "http_access deny all" if node['squid']['http_access_deny_all'] %>

<%= "icp_access allow localnet" if !@localnets.empty? %>
<%= "icp_access deny all" if node['squid']['icp_access_deny_all'] %>
<% if node['squid']['port'].kind_of?(Array) %>
  <% node['squid']['port'].each do |port| %>
http_port <%= port %>
  <% end %>
<% else %>
http_port <%= node['squid']['port'] %>
<% end %>

<%= "hierarchy_stoplist cgi-bin ?" if @version.to_f < 3.5 %>

<% node['squid']['logformats'].each do |name, format| %>
logformat <%= name %> <%= format %>
<% end -%>

access_log <%= !@log_module.nil? ? @log_module + ':' : '' %><%= node['squid']['log_dir'] %>/access.log <%= node['squid']['access_log_option'] %>
refresh_pattern	    ^ftp:			1440	20%	10080
refresh_pattern     ^gopher:			1440	0%	1440
refresh_pattern	    -i (/cgi-bin/|\?)		0	0%	0
refresh_pattern     (Release|Package(.gz)*)$	0	20%	2880
# refresh_pattern	    \.deb$			1440    20%	10080
# refresh_pattern	    \.rpm$			1440    20%	10080
# refresh_pattern	    \.iso$			1440    20%	10080
# refresh_pattern	    \.$			1440    20%	10080
# refresh_pattern	    .				0	20%	4320
hosts_file /etc/hosts
maximum_object_size <%= node['squid']['max_obj_size'] %> <%= node['squid']['max_obj_size_unit'] %>
<%- if node['squid']['enable_cache_dir'] %>
cache_dir ufs <%= node['squid']['cache_dir'] %> <%= node['squid']['cache_size'] %> 16 256
<%- end %>
coredump_dir <%= node['squid']['coredump_dir'] %>
cache_mem <%= node['squid']['cache_mem'] %> MB
<% @directives.each do |directive| %>
<%= directive %>
<% end %>

<% if node['squid']['config_include_dir'] %>
# Include additional configuration files
include <%= node['squid']['config_include_dir'] %>/*.conf
<% end %>
<commit_msg>Avoid overlapping network definition on startup<commit_after># This file generated from a Chef template.
# squid/templates/default.squid.conf.erb

<% if node['squid']['enable_ldap'] %>
auth_param basic program <%= node['squid']['ldap_program'] %> -v <%= node['squid']['ldap_version'] %> -b <%= node['squid']['ldap_basedn'] %> <%= "-D #{node['squid']['ldap_binddn']}" unless node['squid']['ldap_binddn'].nil? %> <%= "-w #{node['squid']['ldap_bindpassword']}" unless node['squid']['ldap_bindpassword'].nil? %> -f <%= node['squid']['ldap_searchfilter'] %> <%= node['squid']['ldap_host'] %>
auth_param basic children <%= node['squid']['ldap_authchildren'] %>
auth_param basic realm <%= node['squid']['ldap_authrealm'] %>
auth_param basic credentialsttl <%= node['squid']['ldap_authcredentialsttl'] %>
<% end %>

<% if node['squid']['cache_peer'] %>
    <%= node['squid']['cache_peer'] %>
<% end %>

<%= "acl all src" if @version.to_i < 3 %>
<%= "acl manager proto cache_object" if @version.to_f < 3.2 %>
<%= "acl localhost src 127.0.0.1/32" if @version.to_f < 3.2 %>
<%= "acl to_localhost dst 127.0.0.0/8 0.0.0.0/32" if @version.to_f < 3.2 %>
<% @localnets.each do |localnet| %>
acl localnet src <%= localnet %>
<% end %>

<% @ssl_ports.each do |port| %>
acl SSL_ports port <%= port %>
<% end %>
<% @safe_ports.each do |port| %>
acl Safe_ports port <%= port %>
<% end %>
acl purge method PURGE
acl CONNECT method CONNECT

# Managed with Chef
<% @host_acl.each do |host| %>
acl <%= host[0] %> <%= host[1] %> <%= host[2] %>
<% end %>
<% @url_acl.each do |url| %>
acl <%= url[0] %> <%= url[1] %> <%= url[2] %>
<% end %>
<% @acls.each do |acl| %>
http_access <%= acl[0] %> <%= acl[1] %> <%= acl[2] %>
<% end %>

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
<%= "http_access allow localnet" if !@localnets.empty? %>
<%= "http_access deny all" if node['squid']['http_access_deny_all'] %>

<%= "icp_access allow localnet" if !@localnets.empty? %>
<%= "icp_access deny all" if node['squid']['icp_access_deny_all'] %>
<% if node['squid']['port'].kind_of?(Array) %>
  <% node['squid']['port'].each do |port| %>
http_port <%= port %>
  <% end %>
<% else %>
http_port <%= node['squid']['port'] %>
<% end %>

<%= "hierarchy_stoplist cgi-bin ?" if @version.to_f < 3.5 %>

<% node['squid']['logformats'].each do |name, format| %>
logformat <%= name %> <%= format %>
<% end -%>

access_log <%= !@log_module.nil? ? @log_module + ':' : '' %><%= node['squid']['log_dir'] %>/access.log <%= node['squid']['access_log_option'] %>
refresh_pattern	    ^ftp:			1440	20%	10080
refresh_pattern     ^gopher:			1440	0%	1440
refresh_pattern	    -i (/cgi-bin/|\?)		0	0%	0
refresh_pattern     (Release|Package(.gz)*)$	0	20%	2880
# refresh_pattern	    \.deb$			1440    20%	10080
# refresh_pattern	    \.rpm$			1440    20%	10080
# refresh_pattern	    \.iso$			1440    20%	10080
# refresh_pattern	    \.$			1440    20%	10080
# refresh_pattern	    .				0	20%	4320
hosts_file /etc/hosts
maximum_object_size <%= node['squid']['max_obj_size'] %> <%= node['squid']['max_obj_size_unit'] %>
<%- if node['squid']['enable_cache_dir'] %>
cache_dir ufs <%= node['squid']['cache_dir'] %> <%= node['squid']['cache_size'] %> 16 256
<%- end %>
coredump_dir <%= node['squid']['coredump_dir'] %>
cache_mem <%= node['squid']['cache_mem'] %> MB
<% @directives.each do |directive| %>
<%= directive %>
<% end %>

<% if node['squid']['config_include_dir'] %>
# Include additional configuration files
include <%= node['squid']['config_include_dir'] %>/*.conf
<% end %>

{'fraction_non_alphanumeric': 0.21965544244322632, 'fraction_numerical': 0.039415296267293135, 'mean_word_length': 4.876533742331288, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 9, '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': '4532415', 'n_tokens_mistral': 3404, 'n_tokens_neox': 2746, 'n_words': 620}