summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dansguardian-advanced-html.lsp22
-rw-r--r--dansguardian-controller.lua7
-rw-r--r--dansguardian-model.lua3
-rw-r--r--squid-model.lua11
-rw-r--r--squid-ntlm-html.lsp11
-rw-r--r--squid-saccess-html.lsp18
6 files changed, 49 insertions, 23 deletions
diff --git a/dansguardian-advanced-html.lsp b/dansguardian-advanced-html.lsp
index 9929700..3c0fc2b 100644
--- a/dansguardian-advanced-html.lsp
+++ b/dansguardian-advanced-html.lsp
@@ -19,31 +19,35 @@
?>
<h1>Content Filter</h1>
+<h2>General Information</h2>
+<p>
DansGuardian is web content filtering software. It works as a web proxy,
making web requests in behalf of the client, and inspecting the returned
content before passing on to the client. DansGuardian uses phraselists to
identify harmful content. This means that updated "blacklists" are
generally not necessary. DansGuardian must be used in combination with a
"smart proxy", such as squid.
-<b>This page lets you manually configure the filter rule files for DansGuardian.</b><br><br>
+</p>
+<p>
+This page lets you manually configure the filter rule files for DansGuardian.
+</p>
<h2>Status</h2>
+<dt>Program version</dt><dd><? io.write( form.info.version.value ) ?></dd>
+<dt>Process status</dt><dd><? io.write( form.info.status.value ) ?></dd>
+<dt>Process information</dt><dd>This process runs as a service. When you make and save changes, the configuration
+files for the service are changed. However, the changes will not be <i>applied</i>
+until you restart the service.</dd>
<form action="" method="POST">
-<dt>dansguardian is: <? io.write( service.status ) ?></dt>
+<dt>Daemon control</dt>
<dd><input class="submit" type="submit" name="srvcmd" value="start" <? io.write( srv1fill ) ?> style="width:100px">
<input class="submit" type="submit" name="srvcmd" value="stop" <? io.write( srv2fill ) ?> style="width:100px">
<input class="submit" type="submit" name="srvcmd" value="restart" <? io.write( srv2fill ) ?> style="width:100px"></dd>
<p class="error"><? io.write( service.message ) ?></p>
</form>
-<p>
-This process runs as a service. When you make and save changes, the configuration
-files for the service are changed. However, the changes will not be <i>applied</i>
-until you restart the service.
-</p>
-
<h2>Configuration</h2>
-<pre style="color: #ff2020;"><? io.write( service.cfgerr ) ?></pre><br>
+<pre style="color: #ff2020;"><? io.write( service.cfgerr ) ?></pre>
<h3>Files</h3>
<p>
Click on one of the files to edit it.
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua
index d907f00..0d6c7e8 100644
--- a/dansguardian-controller.lua
+++ b/dansguardian-controller.lua
@@ -70,7 +70,9 @@ general = function( self )
end
advanced = function( self )
-
+
+ local info = { status = { value = "stopped" }, version = { value = self.model.get_dansguardian_version() }, srvctrl = { value = srvctrl} };
+
local option = { script = ENV["SCRIPT_NAME"],
prefix = self.conf.prefix,
controller = self.conf.controller,
@@ -88,9 +90,10 @@ advanced = function( self )
end
service.status = self.model.get_status()
+ info.status.value = service.status
service.config, service.cfgerr = self.model.get_advanced_config()
- return ( cfe ({ option = option, service = service }) )
+ return ( cfe ({ option = option, service = service, info = info }) )
end
plain = function( self )
diff --git a/dansguardian-model.lua b/dansguardian-model.lua
index b9ade6b..1abec68 100644
--- a/dansguardian-model.lua
+++ b/dansguardian-model.lua
@@ -3,6 +3,7 @@
module (..., package.seeall)
require "posix"
+require "format"
dansguardiancfg = "/etc/dansguardian/dansguardian.conf"
dansguardiancfg2 = "/etc/dansguardian/dansguardianf1.conf"
@@ -168,7 +169,7 @@ update_edit_config = function( name, config )
local fptr = io.open( "/etc/dansguardian/" .. name, "wb+" )
if fptr ~= nil then
- fptr:write( config )
+ fptr:write( format.dostounix( config ) )
fptr:close()
retval = ""
else
diff --git a/squid-model.lua b/squid-model.lua
index 5806a0a..eedd178 100644
--- a/squid-model.lua
+++ b/squid-model.lua
@@ -155,9 +155,9 @@ get_winbindd_config = function()
local error = ""
local config = { domain = { value="", type="text", label="domain" },
- dcname = { value="", type="text", label="DC NetBIOS name" },
- dcipaddr = { value="", type="text", label="DC IP Address" },
- interfaces = { value="", type="text", label="interfaces" },
+ dcnetbiosname = { value="", type="text", label="DC NetBIOS name" },
+ dcipaddress = { value="", type="text", label="DC IP Address" },
+ interface = { value="", type="text", label="interfaces" },
loglevel = { value="", type="text", label="0" },
account = { value="", type="text", label="account" },
password = { value="", type="text", label="password" }
@@ -165,11 +165,12 @@ get_winbindd_config = function()
local ptr = io.open( "/etc/samba/smb.conf" )
if ptr ~= nil then
-
+ ptr:close()
else
end
-
+
+ return config
end
get_adv_config = function()
diff --git a/squid-ntlm-html.lsp b/squid-ntlm-html.lsp
index c5ce880..8fe0c4b 100644
--- a/squid-ntlm-html.lsp
+++ b/squid-ntlm-html.lsp
@@ -45,10 +45,13 @@ the changes will not be <i>applied</i> until you restart the service.</dd>
<form action="" method="POST">
<h2>Configuration</h2>
-
-<table>
- <dt>Name</dt><dd>Value</dd>
-</table>
+<dt>Domain</dt><dd><input class="input" type="text" name="domain" value="<? io.write ( config.domain.value ) ?>"></dd>
+<dt>DC NetBIOS Name</dt><dd><input class="input" type="text" name="domain" value="<? io.write ( config.dcnetbiosname.value ) ?>"></dd>
+<dt>DC IP Address</dt><dd><input class="input" type="text" name="domain" value="<? io.write ( config.dcipaddress.value ) ?>"></dd>
+<dt>Interface</dt><dd><input class="input" type="text" name="domain" value="<? io.write ( config.interface.value ) ?>"></dd>
+<dt>Loglevel</dt><dd><input class="input" type="text" name="domain" value="<? io.write ( config.loglevel.value ) ?>"></dd>
+<dt>Account</dt><dd><input class="input" type="text" name="domain" value=""></dd>
+<dt>Password</dt><dd><input class="input" type="text" name="domain" value=""></dd>
<h3>Action</h3>
<dt>What to do?</dt>
diff --git a/squid-saccess-html.lsp b/squid-saccess-html.lsp
index 322be02..eb14ff5 100644
--- a/squid-saccess-html.lsp
+++ b/squid-saccess-html.lsp
@@ -12,29 +12,43 @@
?>
<h1>Web Proxy - Special Access</h1>
+<h2>General Information</h2>
<p>
-<dt>
The squid web proxy server is normally configured to require authenticated access. In some cases, such
as anti-virus update programs, the process cannot authenticate itself to the proxy server. For these
<i>special</i> cases, it is possible to have squid allow anonymous access to the Internet.<br><br>
You may choose to specify the special cases by specific ip address, browser identification or destination
domain.
-</dt>
</p>
<form action="" method="POST">
<h2>Special IP Addresses</h2>
<p>
+If you wish to specify hosts that may access the Internet by IP address,
+enter the address(es) in the box below, one per line.
+</p>
+<p>
<textarea name="s_ip" style="width:100%;"><? io.write( service.config.s_ip ) ?></textarea>
</p>
<h2>Browser Identification</h2>
<p>
+If you have a browser that identifies itself in a special way, you may
+specify it here. Note that any client identifying itself as this type
+of browser will be allowed anonymous access. Enter the browser identification(s)
+in the box below, one per line. Regular expressions are allowed.
+</p>
+<p>
<textarea name="s_browser" style="width:100%;"><? io.write( service.config.s_browser ) ?></textarea>
</p>
<h2>Special Domains</h2>
<p>
+If you have a specail domain that needs to be accessed in a special way, you
+may specify if here. This will allow anonymous access to the domains listed.
+Enter the domain url below. Regular expressions are allowed.
+</p>
+<p>
<textarea name="s_domain" style="width:100%;"><? io.write( service.config.s_domain ) ?></textarea>
</p>