aboutsummaryrefslogtreecommitdiffstats
path: root/config/dansguardian
diff options
context:
space:
mode:
Diffstat (limited to 'config/dansguardian')
-rwxr-xr-xconfig/dansguardian/dansguardian.conf.template8
-rwxr-xr-xconfig/dansguardian/dansguardian.inc40
-rw-r--r--config/dansguardian/dansguardian.xml21
-rw-r--r--config/dansguardian/dansguardian_log.xml2
4 files changed, 56 insertions, 15 deletions
diff --git a/config/dansguardian/dansguardian.conf.template b/config/dansguardian/dansguardian.conf.template
index 7b3fcc4c..993ea72e 100755
--- a/config/dansguardian/dansguardian.conf.template
+++ b/config/dansguardian/dansguardian.conf.template
@@ -126,10 +126,10 @@ statlocation = '/var/log/dansguardian/stats'
{$filterports}
# the ip of the proxy (default is the loopback - i.e. this server)
-proxyip = 127.0.0.1
+proxyip = {$proxyip}
# the port DansGuardian connects to proxy on
-proxyport = 3128
+proxyport = {$proxyport}
# Whether to retrieve the original destination IP in transparent proxy
# setups and check it against the domain pulled from the HTTP headers.
@@ -182,9 +182,7 @@ custombannedimagefile = '/usr/local/share/dansguardian/transparent1x1.gif'
#Banned flash replacement
usecustombannedflash = {$usecustombannedflash}
-custombannedflashfile = '/usr/local/share/dansguardian/blockedflash.swf'
-
-
+{$custombannedflashfile}
# Filter groups options
# filtergroups sets the number of filter groups. A filter group is a set of content
diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc
index 343c38b9..ab25c7ae 100755
--- a/config/dansguardian/dansguardian.inc
+++ b/config/dansguardian/dansguardian.inc
@@ -79,6 +79,8 @@ function sync_package_dansguardian() {
$maxagechildren=($dansguardian['maxagechildren']?$dansguardian['maxagechildren']:"500");
$maxips=($dansguardian['maxips']?$dansguardian['maxips']:"0");
$preforkchildren=($dansguardian['preforkchildren']?$dansguardian['preforkchildren']:"10");
+ $proxyip=($dansguardian['proxyip']?$dansguardian['proxyip']:"127.0.0.1");
+ $proxyport=($dansguardian['proxyport']?$dansguardian['proxyport']:"127.0.0.1");
#general options
$urlcachenumber=($dansguardian_config['urlcachenumber']?$dansguardian_config['urlcachenumber']:"1000");
@@ -118,6 +120,8 @@ function sync_package_dansguardian() {
$reportlanguage=($dansguardian_log['report_language']?$dansguardian_log['report_language']:"ukenglish");
$showweightedfound=(preg_match('/showweightedfound/',$dansguardian_log['report_options'])?"on":"off");
$usecustombannedflash=(preg_match('/usecustombannedflash/',$dansguardian_log['report_options'])?"on":"off");
+ if (file_exists('/usr/local/share/dansguardian/blockedflash.swf'))
+ $custombannedflashfile="custombannedflashfile = '/usr/local/share/dansguardian/blockedflash.swf'";
$usecustombannedimage=(preg_match('/usecustombannedimage/',$dansguardian_log['report_options'])?"on":"off");
$nonstandarddelimiter=(preg_match('/nonstandarddelimiter/',$dansguardian_log['report_options'])?"on":"off");
@@ -621,6 +625,20 @@ EOF;
$count++;
}
+ if ($user_xml==""){
+ $user_xml .=<<<EOF
+ <field>
+ <name>Users</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Users</fielddescr>
+ <fieldname>info_checkbox</fieldname>
+ <type>checkbox</type>
+ <description><![CDATA[Dansguardian users are required only when you have more then one group.<br>All unauthenticated users or unlisted uses will match first filter group.]]></description>
+ </field>
+EOF;
+ }
#Create/update filtergroupslist
file_put_contents($dansguardian_dir."/lists/filtergroupslist",$filtergroupslist,LOCK_EX);
#Create/update userlist xml file
@@ -671,8 +689,16 @@ EOF;
conf_mount_rw();
write_config();
+
+ $dirs=array('/usr/local/etc/dansguardian/lists/bannedrooms/',
+ '/var/log/dansguardian');
+
+ foreach ($dirs as $dir)
+ if (!is_dir($dir))
+ mkdir ($dir,0755,true);
+
#update file owner
- mwexec("chown -R $daemonuser:$daemongroup /usr/loca/etc/dansguardian");
+ mwexec("chown -R $daemonuser:$daemongroup /usr/local/etc/dansguardian");
mwexec("chown -R $daemonuser:$daemongroup /var/log/dansguardian");
#create config files
@@ -695,8 +721,9 @@ EOF;
#clamdscan.conf dansguardian file
$cconf="/usr/local/etc/dansguardian/contentscanners/clamdscan.conf";
$cconf_file=file_get_contents($cconf);
- if (!preg_match('/clamav/',$cconf_file)){
- file_put_contents($cconf, $cconf_file."\nclamdudsfile = '/var/run/clamav/clamd.sock'", LOCK_EX);
+ if (preg_match('/#clamdudsfile/',$cconf_file)){
+ $cconf_file=preg_replace('/#clamdudsfile/','clamdudsfile',$cconf_file);
+ file_put_contents($cconf, $cconf_file, LOCK_EX);
}
#clamd conf file
@@ -725,12 +752,7 @@ EOF;
}
}
- $dirs=array('/usr/local/etc/dansguardian/lists/bannedrooms/',
- '/var/log/dansguardian');
- foreach ($dirs as $dir)
- if (!is_dir($dir))
- mkdir ($dir,0755,true);
-
+
$script='/usr/local/etc/rc.d/dansguardian';
if($config['installedpackages']['dansguardian']['config'][0]['enable']){
$script_file=file_get_contents($script);
diff --git a/config/dansguardian/dansguardian.xml b/config/dansguardian/dansguardian.xml
index 42e2b37e..0870c91b 100644
--- a/config/dansguardian/dansguardian.xml
+++ b/config/dansguardian/dansguardian.xml
@@ -290,6 +290,27 @@
Use this to set a hard limit on the number of users allowed to concurrently<br>
browse the web. Set to 0 for no limit, and to disable the IP cache process.]]></description>
</field>
+ <field>
+ <name>Listening Settings</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Proxy IP</fielddescr>
+ <fieldname>proxyip</fieldname>
+ <type>input</type>
+ <size>20</size>
+ <description><![CDATA[Default: <strong>127.0.0.1</strong><br>
+ Sets ip address for proxy server(usually squid).]]></description>
+ </field>
+ <field>
+ <fielddescr>Proxy Port</fielddescr>
+ <fieldname>proxyport</fieldname>
+ <type>input</type>
+ <size>10</size>
+ <description><![CDATA[Default: <strong>3128</strong><br>
+ Sets port number fro proxy server.]]></description>
+ </field>
+
</fields>
<custom_php_install_command>
dansguardian_php_install_command();
diff --git a/config/dansguardian/dansguardian_log.xml b/config/dansguardian/dansguardian_log.xml
index ceb7ccb0..18e3db55 100644
--- a/config/dansguardian/dansguardian_log.xml
+++ b/config/dansguardian/dansguardian_log.xml
@@ -149,7 +149,7 @@
<type>select</type>
<options>
<option><name>Show weighted found (on)</name><value>showweightedfound</value></option>
- <option><name>Use custom banned flash (on)</name><value>usecustombannedflash</value></option>
+ <option><name>Use custom banned flash (off)</name><value>usecustombannedflash</value></option>
<option><name>Use custom banned image (on)</name><value>usecustombannedimage</value></option>
<option><name>Non standard delimiter (on)</name><value>nonstandarddelimiter</value></option>
</options>