Skip to content
Snippets Groups Projects
Commit ecdd22b1 authored by Klas Arvidsson's avatar Klas Arvidsson
Browse files

added access to empt and error page when BLOCK_ALL enabled, and bugfix

parent 27dc0227
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,10 @@ import urllib.parse
emptypage = "https://www.ida.liu.se/edu/ugrad/datortenta/empty"
errorpage = "https://www.ida.liu.se/edu/ugrad/datortenta/blocked.php"
emptyrex = "^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/empty"
errorrex = "^https?://www\.ida\.liu\.se/edu/ugrad/datortenta/blocked\.php\?.*"
filterlog = "/var/log/squid/filter.log"
basedir = "/usr/libexec/squid/helpers"
hostname = socket.gethostname()
......@@ -76,7 +80,9 @@ def main():
block_all = basedir + "/../BLOCK_ALL"
if os.path.isfile(block_all):
ruleset.append( ["^.*", False] )
ruleset.append( [re.compile(emptyrex), True] )
ruleset.append( [re.compile(errorrex), True] )
ruleset.append( [re.compile("^.*"), False] )
devel_rules = basedir + "/../devel.rules"
if 'devel' in hostname and os.path.isfile(devel_rules):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment