diff --git a/files/squid/helpers/squid-url-rewrite.py b/files/squid/helpers/squid-url-rewrite.py index e6ac941a960998137b401ab7b03d47e512b4545b..88f9788a907e73a0b89817b7ed0450c86ccf1d47 100755 --- a/files/squid/helpers/squid-url-rewrite.py +++ b/files/squid/helpers/squid-url-rewrite.py @@ -3,9 +3,11 @@ import sys import re import datetime +import socket errorpage = "http://www.ida.liu.se/~examadm/empty" basedir = "/usr/libexec/squid/helpers" +hostname = socket.gethostname() def modify_url(line, ruleset): ### [channel-ID <SP>] URL <SP> client_ip "/" fqdn <SP> user <SP> method [<SP> kv-pairs]<NL> @@ -25,7 +27,7 @@ def modify_url(line, ruleset): r = re.match('https://www\.ida\.liu\.se/~opendsa/(.*)', url) if r != None: - return "OK rewrite-url=\"http://exam.ida.liu.se:12000/" + r.group(1) + "\"" + return 'OK rewrite-url="http://{}:12000/{}"'.format(hostname, r.group(1)) for i in ruleset: diff --git a/files/squid/squid.conf b/files/squid/squid.conf index f5098c7017cfe555facb9642d12bf5d398a18647..23e1064db77cd3d9fc919672742996e633f5bead 100644 --- a/files/squid/squid.conf +++ b/files/squid/squid.conf @@ -121,7 +121,7 @@ ssl_bump server-first all # Inititate with: # /usr/lib64/squid/ssl_crtd -c -s /var/lib/ssl_db -sslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB +sslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/lib/squid/ssl_db -M 4MB sslcrtd_children 32 startup=5 idle=1 # the following two options are unsafe and not always necessary: diff --git a/manifests/squid_filter.pp b/manifests/squid_filter.pp index 6c8355996914cc7c156aefa20e1d51748ef3a20d..fe52da2bf18986950f86760737c3cf371cc9cd43 100644 --- a/manifests/squid_filter.pp +++ b/manifests/squid_filter.pp @@ -45,17 +45,17 @@ class aes::squid_filter { group => squid, } - file { '/var/lib/ssl_db' : + file { '/var/lib/squid' : ensure => directory, mode => '0750', owner => squid, group => squid, } - exec { '/usr/lib64/squid/ssl_crtd -c -s /var/lib/ssl_db' : + exec { '/usr/lib64/squid/ssl_crtd -c -s /var/lib/squid/ssl_db' : user => "squid", group => "squid", - creates => '/var/lib/ssl_db/certs', + creates => '/var/lib/squid/ssl_db', } service { "squid" :