mirror of
https://github.com/serverok/squid-proxy-installer.git
synced 2026-04-02 18:49:50 +00:00
added support for Ubuntu 22.04
This commit is contained in:
67
conf/ubuntu-2204.conf
Normal file
67
conf/ubuntu-2204.conf
Normal file
@@ -0,0 +1,67 @@
|
||||
http_port 3128
|
||||
cache deny all
|
||||
hierarchy_stoplist cgi-bin ?
|
||||
|
||||
access_log none
|
||||
cache_store_log none
|
||||
cache_log /dev/null
|
||||
|
||||
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
|
||||
|
||||
acl localhost src 127.0.0.1/32 ::1
|
||||
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
|
||||
|
||||
acl SSL_ports port 1-65535
|
||||
acl Safe_ports port 1-65535
|
||||
acl CONNECT method CONNECT
|
||||
acl siteblacklist dstdomain "/etc/squid/blacklist.acl"
|
||||
http_access allow manager localhost
|
||||
http_access deny manager
|
||||
|
||||
http_access deny !Safe_ports
|
||||
|
||||
http_access deny CONNECT !SSL_ports
|
||||
http_access deny siteblacklist
|
||||
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/passwd
|
||||
|
||||
auth_param basic children 5
|
||||
auth_param basic realm Squid proxy-caching web server
|
||||
auth_param basic credentialsttl 2 hours
|
||||
acl password proxy_auth REQUIRED
|
||||
http_access allow localhost
|
||||
http_access allow password
|
||||
http_access deny all
|
||||
|
||||
forwarded_for off
|
||||
request_header_access Allow allow all
|
||||
request_header_access Authorization allow all
|
||||
request_header_access WWW-Authenticate allow all
|
||||
request_header_access Proxy-Authorization allow all
|
||||
request_header_access Proxy-Authenticate allow all
|
||||
request_header_access Cache-Control allow all
|
||||
request_header_access Content-Encoding allow all
|
||||
request_header_access Content-Length allow all
|
||||
request_header_access Content-Type allow all
|
||||
request_header_access Date allow all
|
||||
request_header_access Expires allow all
|
||||
request_header_access Host allow all
|
||||
request_header_access If-Modified-Since allow all
|
||||
request_header_access Last-Modified allow all
|
||||
request_header_access Location allow all
|
||||
request_header_access Pragma allow all
|
||||
request_header_access Accept allow all
|
||||
request_header_access Accept-Charset allow all
|
||||
request_header_access Accept-Encoding allow all
|
||||
request_header_access Accept-Language allow all
|
||||
request_header_access Content-Language allow all
|
||||
request_header_access Mime-Version allow all
|
||||
request_header_access Retry-After allow all
|
||||
request_header_access Title allow all
|
||||
request_header_access Connection allow all
|
||||
request_header_access Proxy-Connection allow all
|
||||
request_header_access User-Agent allow all
|
||||
request_header_access Cookie allow all
|
||||
request_header_access All deny all
|
||||
@@ -10,7 +10,9 @@
|
||||
# https://serverok.in/contact
|
||||
############################################################
|
||||
|
||||
if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 20.04" > /dev/null; then
|
||||
if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 22.04" > /dev/null; then
|
||||
echo "ubuntu2204"
|
||||
elif cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 20.04" > /dev/null; then
|
||||
echo "ubuntu2004"
|
||||
elif cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 18.04" > /dev/null; then
|
||||
echo "ubuntu1804"
|
||||
|
||||
@@ -35,7 +35,9 @@ fi
|
||||
|
||||
SOK_OS=$(/usr/local/bin/sok-find-os)
|
||||
|
||||
if [ $SOK_OS == "ubuntu2004" ]; then
|
||||
if [ $SOK_OS == "ubuntu2204" ]; then
|
||||
systemctl reload squid
|
||||
elif [ $SOK_OS == "ubuntu2004" ]; then
|
||||
systemctl reload squid
|
||||
elif [ $SOK_OS == "ubuntu1804" ]; then
|
||||
systemctl reload squid
|
||||
@@ -55,6 +57,6 @@ elif [ $SOK_OS == "centos8" ]; then
|
||||
systemctl reload squid
|
||||
else
|
||||
echo "OS NOT SUPPORTED.\n"
|
||||
echo "Contact admin@serverok.in to add support for your os."
|
||||
echo "Contact https://serverok.in/contact to add support for your OS."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
@@ -33,9 +33,9 @@ if cat /etc/os-release | grep PRETTY_NAME | grep "Ubuntu 22.04"; then
|
||||
/usr/bin/apt update
|
||||
/usr/bin/apt -y install apache2-utils squid
|
||||
touch /etc/squid/passwd
|
||||
/bin/rm -f /etc/squid/squid.conf
|
||||
mv /etc/squid/squid.conf /etc/squid/squid.conf.bak
|
||||
/usr/bin/touch /etc/squid/blacklist.acl
|
||||
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid.conf
|
||||
/usr/bin/wget --no-check-certificate -O /etc/squid/squid.conf https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/ubuntu-2204.conf
|
||||
if [ -f /sbin/iptables ]; then
|
||||
/sbin/iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
|
||||
/sbin/iptables-save
|
||||
|
||||
Reference in New Issue
Block a user