aboutsummaryrefslogtreecommitdiffstats
path: root/config/squidGuard
diff options
context:
space:
mode:
Diffstat (limited to 'config/squidGuard')
-rw-r--r--config/squidGuard/squidguard.inc161
-rw-r--r--config/squidGuard/squidguard.xml89
-rw-r--r--config/squidGuard/squidguard_acl.xml353
-rw-r--r--config/squidGuard/squidguard_blacklist.php1
-rw-r--r--config/squidGuard/squidguard_configurator.inc97
-rw-r--r--config/squidGuard/squidguard_default.xml189
-rw-r--r--config/squidGuard/squidguard_dest.xml237
-rw-r--r--config/squidGuard/squidguard_log.php3
-rw-r--r--config/squidGuard/squidguard_rewr.xml45
-rw-r--r--config/squidGuard/squidguard_sync.xml163
-rw-r--r--config/squidGuard/squidguard_time.xml34
11 files changed, 870 insertions, 502 deletions
diff --git a/config/squidGuard/squidguard.inc b/config/squidGuard/squidguard.inc
index 856e15b6..fb7fad28 100644
--- a/config/squidGuard/squidguard.inc
+++ b/config/squidGuard/squidguard.inc
@@ -332,6 +332,7 @@ function squidguard_resync() {
//}
squidguard_cron_install();
+ squidguard_sync_on_changes();
}
# -----------------------------------------------------------------------------
@@ -1264,7 +1265,7 @@ function squidguard_adt_safesrch_add($rewrite_item)
# log dump
function squidguard_logdump($filename, $lnoffset, $lncount, $reverse)
{
- define('LOGSHOW_BUFSIZE', '65536');
+ define('LOGSHOW_BUFSIZE', '262144');
$cnt = '';
if (file_exists($filename)) {
@@ -1399,4 +1400,160 @@ function squidguard_blacklist_list()
return $res;
}
-?> \ No newline at end of file
+
+// ##### The following part is based on the code of pfblocker #####
+
+/* Uses XMLRPC to synchronize the changes to a remote node */
+function squidguard_sync_on_changes() {
+ global $config, $g;
+ $varsyncenablexmlrpc = $config['installedpackages']['squidguardsync']['config'][0]['varsyncenablexmlrpc'];
+ $varsynctimeout = $config['installedpackages']['squidguardsync']['config'][0]['varsynctimeout'];
+
+ // if checkbox is NOT checked do nothing
+ if(!$varsyncenablexmlrpc) {
+ return;
+ }
+
+ log_error("SquidGuard: Starting XMLRPC process (squidguard_do_xmlrpc_sync) with timeout {$varsynctimeout} seconds.");
+
+ // if checkbox is checked get IP and password of the destination hosts
+ foreach ($config['installedpackages']['squidguardsync']['config'] as $rs ){
+ foreach($rs['row'] as $sh){
+ // if checkbox is NOT checked do nothing
+ if($sh['varsyncdestinenable']) {
+ $varsyncprotocol = $sh['varsyncprotocol'];
+ $sync_to_ip = $sh['varsyncipaddress'];
+ $password = $sh['varsyncpassword'];
+ $varsyncport = $sh['varsyncport'];
+ // check if all credentials are complete for this host
+ if($password && $sync_to_ip && $varsyncport && $varsyncprotocol) {
+ squidguard_do_xmlrpc_sync($sync_to_ip, $password, $varsyncport, $varsyncprotocol);
+ }
+ else {
+ log_error("SquidGuard: XMLRPC Sync with {$sh['varsyncipaddress']} has incomplete credentials. No XMLRPC Sync done!");
+ }
+ }
+ else {
+ log_error("SquidGuard: XMLRPC Sync with {$sh['varsyncipaddress']} is disabled");
+ }
+ }
+ }
+ log_error("SquidGuard: Finished XMLRPC process (squidguard_do_xmlrpc_sync).");
+}
+
+/* Do the actual XMLRPC sync */
+function squidguard_do_xmlrpc_sync($sync_to_ip, $password, $varsyncport, $varsyncprotocol) {
+ global $config, $g;
+
+ $varsynctimeout = $config['installedpackages']['squidguardsync']['config'][0]['varsynctimeout'];
+
+ if($varsynctimeout == '' || $varsynctimeout == 0) {
+ $varsynctimeout = 150;
+ }
+
+ // log_error("SquidGuard: Starting XMLRPC process (squidguard_do_xmlrpc_sync) with timeout {$varsynctimeout} seconds.");
+
+ if(!$password)
+ return;
+
+ if(!$sync_to_ip)
+ return;
+
+ if(!$varsyncport)
+ return;
+
+ if(!$varsyncprotocol)
+ return;
+
+ // Check and choose correct protocol type, port number and IP address
+ $synchronizetoip .= "$varsyncprotocol" . '://';
+ $port = "$varsyncport";
+
+ $synchronizetoip .= $sync_to_ip;
+
+ /* xml will hold the sections to sync */
+ $xml = array();
+ $xml['squidguardgeneral'] = $config['installedpackages']['squidguardgeneral'];
+ $xml['squidguardacl'] = $config['installedpackages']['squidguardacl'];
+ $xml['squidguarddefault'] = $config['installedpackages']['squidguarddefault'];
+ $xml['squidguarddest'] = $config['installedpackages']['squidguarddest'];
+ $xml['squidguardrewrite'] = $config['installedpackages']['squidguardrewrite'];
+ $xml['squidguardtime'] = $config['installedpackages']['squidguardtime'];
+
+ /* assemble xmlrpc payload */
+ $params = array(
+ XML_RPC_encode($password),
+ XML_RPC_encode($xml)
+ );
+
+ /* set a few variables needed for sync code borrowed from filter.inc */
+ $url = $synchronizetoip;
+ log_error("SquidGuard: Beginning squidguard XMLRPC sync with {$url}:{$port}.");
+ $method = 'pfsense.merge_installedpackages_section_xmlrpc';
+ $msg = new XML_RPC_Message($method, $params);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
+ $cli->setCredentials('admin', $password);
+ if($g['debug'])
+ $cli->setDebug(1);
+ /* send our XMLRPC message and timeout after $varsynctimeout seconds */
+ $resp = $cli->send($msg, $varsynctimeout);
+ if(!$resp) {
+ $error = "A communications error occurred while squidguard was attempting XMLRPC sync with {$url}:{$port}.";
+ log_error("SquidGuard: $error");
+ file_notice("sync_settings", $error, "squidguard Settings Sync", "");
+ } elseif($resp->faultCode()) {
+ $cli->setDebug(1);
+ $resp = $cli->send($msg, $varsynctimeout);
+ $error = "An error code was received while squidguard XMLRPC was attempting to sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ log_error("SquidGuard: $error");
+ file_notice("sync_settings", $error, "squidguard Settings Sync", "");
+ } else {
+ log_error("SquidGuard: XMLRPC has synced data successfully with {$url}:{$port}.");
+ }
+
+ /* tell squidguard to reload our settings on the destionation sync host. */
+ $method = 'pfsense.exec_php';
+ $execcmd = "require_once('/usr/local/pkg/squidguard.inc');\n";
+ // pfblocker just needed one fuction to reload after XMLRPC. squidguard needs more so we point to a fuction below which contains all fuctions
+ $execcmd .= "squidguard_all_after_XMLRPC_resync();";
+
+ /* assemble xmlrpc payload */
+ $params = array(
+ XML_RPC_encode($password),
+ XML_RPC_encode($execcmd)
+ );
+
+ log_error("SquidGuard XMLRPC is reloading data on {$url}:{$port}.");
+ $msg = new XML_RPC_Message($method, $params);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
+ $cli->setCredentials('admin', $password);
+ $resp = $cli->send($msg, $varsynctimeout);
+ if(!$resp) {
+ $error = "A communications error occurred while squidguard was attempting XMLRPC sync with {$url}:{$port} (exec_php).";
+ log_error($error);
+ file_notice("sync_settings", $error, "squidguard Settings Sync", "");
+ } elseif($resp->faultCode()) {
+ $cli->setDebug(1);
+ $resp = $cli->send($msg, $varsynctimeout);
+ $error = "An error code was received while squidguard XMLRPC was attempting to sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ log_error($error);
+ file_notice("sync_settings", $error, "squidguard Settings Sync", "");
+ } else {
+ log_error("SquidGuard: XMLRPC has reloaded data successfully on {$url}:{$port} (exec_php).");
+ }
+
+}
+
+// ##### The part above is based on the code of pfblocker #####
+
+// This function restarts all other needed functions after XMLRPC so that the content of .XML + .INC will be written in the files
+// Adding more functions will increase the time to sync
+function squidguard_all_after_XMLRPC_resync() {
+
+ squidguard_resync_acl();
+ squidguard_resync();
+
+ log_error("SquidGuard: Finished XMLRPC process. It should be OK. For more information look at the host which started sync.");
+}
+
+?>
diff --git a/config/squidGuard/squidguard.xml b/config/squidGuard/squidguard.xml
index d84d53ab..c9df88ca 100644
--- a/config/squidGuard/squidguard.xml
+++ b/config/squidGuard/squidguard.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description>[<![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguardgeneral</name>
@@ -50,16 +50,20 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<service>
- <name>squidGuard</name>
- <description>Proxy server filter Service</description>
- <executable>squidGuard</executable>
+ <name>squidGuard</name>
+ <description><![CDATA[Proxy server filter Service]]></description>
+ <executable>squidGuard</executable>
</service>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard.inc</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
@@ -67,74 +71,87 @@
<item>http://www.pfsense.org/packages/config/squidGuard/squidguard_configurator.inc</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_acl.xml</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_acl.xml</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_default.xml</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_default.xml</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_dest.xml</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_dest.xml</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_rewr.xml</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_rewr.xml</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_time.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_time.xml</item>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_sync.xml</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/www/squidGuard/</prefix>
- <chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_log.php</item>
+ <prefix>/usr/local/www/squidGuard/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_log.php</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/www/squidGuard/</prefix>
- <chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_blacklist.php</item>
+ <prefix>/usr/local/www/squidGuard/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/squidGuard/squidguard_blacklist.php</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.pfsense.org/packages/config/squidGuard/sgerror.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/squidGuard/sgerror.php</item>
</additional_files_needed>
<fields>
<field>
<fielddescr>Enable</fielddescr>
<fieldname>squidguard_enable</fieldname>
- <description>Check this for enable squidGuard</description>
+ <description><![CDATA[Check this option to enable squidGuard]]></description>
<type>checkbox</type>
</field>
+ <field>
+ <name>Logging options</name>
+ <type>listtopic</type>
+ </field>
<field>
<fielddescr>Enable GUI log</fielddescr>
<fieldname>enable_guilog</fieldname>
- <description>Check this for enable GUI log.</description>
+ <description><![CDATA[Check this option to log the access to the Proxy Filter GUI.]]></description>
<type>checkbox</type>
</field>
<field>
<fielddescr>Enable log</fielddescr>
<fieldname>enable_log</fieldname>
- <description>Check this for enable log of the proxy filter. Usually log used for testing filter settings.</description>
+ <description><![CDATA[Check this option to log the proxy filter settings like blocked websites in Common ACL, Group ACL and Target Categories. This option is usually used to check the filter settings.]]></description>
<type>checkbox</type>
</field>
<field>
<fielddescr>Enable log rotation</fielddescr>
<fieldname>log_rotation</fieldname>
- <description>Check this for enable daily rotate a log of the proxy filter. Use this option for limit log file size.</description>
+ <description><![CDATA[Check this option to rotate the logs every day. This is recommended if you enable any kind of logging to limit file size and do not run out of disk space.]]></description>
<type>checkbox</type>
</field>
+ <field>
+ <name>Miscellaneous</name>
+ <type>listtopic</type>
+ </field>
<field>
<fielddescr>Clean Advertising</fielddescr>
<fieldname>adv_blankimg</fieldname>
- <description>Check this to display a blank gif image instead the default block page. With this option you get a cleaner page.</description>
+ <description><![CDATA[Check this option to display a blank gif image instead of the default block page. With this option the user gets a cleaner webpage.]]></description>
<type>checkbox</type>
</field>
<field>
@@ -144,24 +161,24 @@
<field>
<fielddescr>Blacklist</fielddescr>
<fieldname>blacklist</fieldname>
- <description>Check this for enable blacklist</description>
+ <description><![CDATA[Check this option to enable blacklist]]></description>
<type>checkbox</type>
</field>
<field>
<fielddescr>Blacklist proxy</fielddescr>
<fieldname>blacklist_proxy</fieldname>
- <description>
- Blacklist upload proxy - enter here, or leave blank.
- Format: host:[port login:pass] . Default proxy port 1080.
+ <description><![CDATA[<br>
+ Blacklist upload proxy - enter here, or leave blank.<br>
+ Format: host:[port login:pass] . Default proxy port 1080.<br>
Example: '192.168.0.1:8080 user:pass'
- </description>
+ ]]></description>
<type>input</type>
<size>100</size>
</field>
<field>
<fielddescr>Blacklist URL</fielddescr>
<fieldname>blacklist_url</fieldname>
- <description>Enter FTP, HTTP or LOCAL (firewall) URL blacklist archive, or leave blank.</description>
+ <description><![CDATA[Enter the path to the blacklist (blacklist.tar.gz) here. You can use FTP, HTTP or LOCAL URL blacklist archive or leave blank. The LOCAL path could be your pfsense (/tmp/blacklist.tar.gz).]]></description>
<type>input</type>
<size>100</size>
</field>
diff --git a/config/squidGuard/squidguard_acl.xml b/config/squidGuard/squidguard_acl.xml
index 1b631ca3..07ecd71b 100644
--- a/config/squidGuard/squidguard_acl.xml
+++ b/config/squidGuard/squidguard_acl.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description><![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguardacl</name>
@@ -45,201 +45,198 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Disabled</fielddescr>
- <fieldname>disabled</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Name</fielddescr>
- <fieldname>name</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Time</fielddescr>
- <fieldname>time</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
+ <columnitem>
+ <fielddescr>Disabled</fielddescr>
+ <fieldname>disabled</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Name</fielddescr>
+ <fieldname>name</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Time</fielddescr>
+ <fieldname>time</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ </columnitem>
</adddeleteeditpagefields>
<fields>
- <field>
- <fielddescr>Disabled</fielddescr>
- <fieldname>disabled</fieldname>
- <description>Check this for disable this ACL rule.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Name</fielddescr>
- <fieldname>name</fieldname>
- <description>
- Enter the unique name here.
- Name must consist of minimum 2 symbols, first from which letter. &lt;br&gt;
- All other symbols must be [a-Z_0-9].
- </description>
- <type>input</type>
- <required/>
- <size>100</size>
- </field>
- <field>
- <fielddescr>Order</fielddescr>
- <fieldname>order</fieldname>
- <description>
- Select the new position for ACL item. ACL are evaluated on a first-match source basis.&lt;br&gt;
- &lt;b&gt;Note:&lt;/b&gt; &lt;br&gt;
- Search for a suitable ACL by field 'source' will occur before the first match. If you want to define an exception for some sources (IP) from the IP range, put them on first of the list. &lt;br&gt;
- &lt;b&gt;For example:&lt;/b&gt; &lt;br&gt;
- ACL with single (or short range) source ip 10.0.0.15, must be placed before ACL with more large ip range 10.0.0.0/24 &lt;br&gt;
- </description>
- <type>select</type>
- </field>
- <field>
- <fielddescr>Client (source)</fielddescr>
- <fieldname>source</fieldname>
- <description>
- Enter client's IP address or domain or "username" here. For separate use space.
- &lt;br&gt;&lt;b&gt;Example:&lt;/b&gt;
- &lt;br&gt;ip: 192.168.0.1 or subnet 192.168.0.0/24 or subnet 192.168.1.0/255.255.255.0 or range 192.168.1.1-192.168.1.10
- &lt;br&gt;domain: foo.bar match foo.bar or *.foo.bar
- &lt;br&gt;username: 'user1'
- </description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>3</rows>
- <required/>
- </field>
- <field>
- <fielddescr>Time</fielddescr>
- <fieldname>time</fieldname>
- <description>Select time in which 'Target Rules' will operate, or leave 'none' for action of rules without time restriction. If this option is set, then in off-time will operate the second rule set.</description>
- <type>select</type>
- </field>
- <field>
- <fielddescr>Target Rules</fielddescr>
- <fieldname>dest</fieldname>
- <description></description>
- <type>input</type>
- <size>100</size>
- </field>
- <field>
- <fielddescr>Not to allow IP addresses in URL</fielddescr>
- <fieldname>notallowingip</fieldname>
- <description>
- To make sure that people don't bypass the URL filter.
- by simply using the IP addresses instead of the fully qualified domain names, you can check this option.
- This option has no effect on the WhiteList.
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Redirect mode</fielddescr>
- <fieldname>redirect_mode</fieldname>
- <description>
- Select redirect mode here.
- &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
-<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
- &lt;br&gt; Options:
- &lt;A title="To 'url' will added special client information;" &gt;
- &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client view 'url' content without any notification about;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
- &lt;/u&gt;
- </description>
- <type>select</type>
- <value>rmod_none</value>
- <options>
- <option><name>none</name> <value>rmod_none</value></option>
- <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
- <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
-<!-- <option><name>int blank image</name> <value>rmod_int_bim</value></option> -->
-<!-- <option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option> -->
- <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
- <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
- <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
- <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Redirect</fielddescr>
- <fieldname>redirect</fieldname>
- <description>
- Enter external redirection URL, error message or size (bytes) here.
- </description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>2</rows>
- </field>
+ <field>
+ <fielddescr>Disabled</fielddescr>
+ <fieldname>disabled</fieldname>
+ <description><![CDATA[Check this to disable this ACL rule.]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Name</fielddescr>
+ <fieldname>name</fieldname>
+ <description><![CDATA[
+ Enter a unique name of this rule here.<br>
+ The name must consist between 2 and 15 symbols [a-Z_0-9]. The first one must be a letter.<br>
+ ]]></description>
+ <type>input</type>
+ <required/>
+ <size>100</size>
+ </field>
+ <field>
+ <fielddescr>Order</fielddescr>
+ <fieldname>order</fieldname>
+ <description><![CDATA[
+ Select the new position for this ACL item. ACLs are evaluated on a first-match source basis.<br>
+ <b>Note:</b><br>
+ Search for a suitable ACL by field 'source' will occur before the first match. If you want to define an exception for some sources (IP) from the IP range, put them on first of the list.<br>
+ <b>Example:</b><br>
+ ACL with single (or short range) source ip 10.0.0.15 must be placed before ACL with more large ip range 10.0.0.0/24.<br>
+ ]]></description>
+ <type>select</type>
+ </field>
+ <field>
+ <fielddescr>Client (source)</fielddescr>
+ <fieldname>source</fieldname>
+ <description><![CDATA[
+ Enter client's IP address or domain or "username" here. To separate them use space.<br>
+ <b>Example:</b><br>
+ <b>IP:</b> 192.168.0.1 - <b>Subnet:</b> 192.168.0.0/24 or 192.168.1.0/255.255.255.0 - <b>IP-Range:</b> 192.168.1.1-192.168.1.10<br>
+ <b>Domain:</b> foo.bar matches foo.bar or *.foo.bar<br>
+ <b>Username:</b> 'user1'
+ ]]></description>
+ <type>textarea</type>
+ <cols>65</cols>
+ <rows>3</rows>
+ <required/>
+ </field>
+ <field>
+ <fielddescr>Time</fielddescr>
+ <fieldname>time</fieldname>
+ <description><![CDATA[Select the time in which 'Target Rules' will operate or leave 'none' for rules without time restriction. If this option is set then in off-time the second ruleset will operate.]]></description>
+ <type>select</type>
+ </field>
+ <field>
+ <fielddescr>Target Rules</fielddescr>
+ <fieldname>dest</fieldname>
+ <description><![CDATA[]]></description>
+ <type>input</type>
+ <size>100</size>
+ </field>
+ <field>
+ <fielddescr>Do not allow IP-Addresses in URL</fielddescr>
+ <fieldname>notallowingip</fieldname>
+ <description><![CDATA[To make sure that people do not bypass the URL filter by simply using the IP-Addresses instead of the FQDN you can check this option. This option has no effect on the whitelist.]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Redirect mode</fielddescr>
+ <fieldname>redirect_mode</fieldname>
+ <description>
+ Select redirect mode here.
+ &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
+<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
+ &lt;br&gt; Options:
+ &lt;A title="To 'url' will added special client information;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client view 'url' content without any notification about;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
+ &lt;/u&gt;
+ </description>
+ <type>select</type>
+ <value>rmod_none</value>
+ <options>
+ <option><name>none</name> <value>rmod_none</value></option>
+ <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
+ <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
+<!-- <option><name>int blank image</name> <value>rmod_int_bim</value></option> -->
+<!-- <option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option> -->
+ <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
+ <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
+ <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
+ <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Redirect</fielddescr>
+ <fieldname>redirect</fieldname>
+ <description><![CDATA[Enter the external redirection URL, error message or size (bytes) here.]]></description>
+ <type>textarea</type>
+ <cols>65</cols>
+ <rows>2</rows>
+ </field>
<!-- not need now
- <field>
- <fielddescr>Redirect for off-time</fielddescr>
- <fieldname>overredirect</fieldname>
- <description>
- Enter external redirection URL, error message or size (bytes) here.
- </description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>2</rows>
- </field>
+ <field>
+ <fielddescr>Redirect for off-time</fielddescr>
+ <fieldname>overredirect</fieldname>
+ <description><![CDATA[
+ Enter external redirection URL, error message or size (bytes) here.
+ ]]></description>
+ <type>textarea</type>
+ <cols>65</cols>
+ <rows>2</rows>
+ </field>
-->
- <field>
- <fielddescr>Use SafeSearch engine</fielddescr>
- <fieldname>safesearch</fieldname>
- <description>
- To protect your children from adult content, you can use the protected mode of search engines.
- Now it is supported by Google, Yandex, Yahoo, MSN, Live Search, Bing. Make sure that the search engines can, and others, it is recommended to prohibit.
- &lt;br&gt;Note: ! This option overrides 'Rewrite' setting. !
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Rewrite</fielddescr>
- <fieldname>rewrite</fieldname>
- <description>Enter rewrite condition name for this rule, or leave blank.</description>
- <type>select</type>
- </field>
- <field>
- <fielddescr>Rewrite for off-time</fielddescr>
- <fieldname>overrewrite</fieldname>
- <description>Enter rewrite condition name for this rule, or leave blank.</description>
- <type>select</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- <size>100</size>
- </field>
- <field>
- <fielddescr>Log</fielddescr>
- <fieldname>enablelog</fieldname>
- <description>Check this for log this item.</description>
- <type>checkbox</type>
- </field>
+ <field>
+ <fielddescr>Use SafeSearch engine</fielddescr>
+ <fieldname>safesearch</fieldname>
+ <description><![CDATA[
+ To protect your children from adult content you can use the protected mode of search engines.<br>
+ At the moment it is supported by Google, Yandex, Yahoo, MSN, Live Search and Bing. Make sure that the search engines can be accessed. It is recommended to prohibit access to others.<br>
+ <b>Note:</b> This option overrides 'Rewrite' setting.
+ ]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Rewrite</fielddescr>
+ <fieldname>rewrite</fieldname>
+ <description><![CDATA[Enter the rewrite condition name for this rule or leave it blank.]]></description>
+ <type>select</type>
+ </field>
+ <field>
+ <fielddescr>Rewrite for off-time</fielddescr>
+ <fieldname>overrewrite</fieldname>
+ <description><![CDATA[Enter the rewrite condition name for this rule or leave it blank.]]></description>
+ <type>select</type>
+ </field>
+ <field>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ <description><![CDATA[You may enter any description here for your reference.]]></description>
+ <type>input</type>
+ <size>100</size>
+ </field>
+ <field>
+ <fielddescr>Log</fielddescr>
+ <fieldname>enablelog</fieldname>
+ <description><![CDATA[Check this option to enable logging for this ACL.]]></description>
+ <type>checkbox</type>
+ </field>
</fields>
<custom_php_validation_command>
- squidguard_validate_acl(&amp;$_POST, &amp;$input_errors);
+ squidguard_validate_acl(&amp;$_POST, &amp;$input_errors);
</custom_php_validation_command>
<custom_php_command_before_form>
- squidguard_before_form_acl(&amp;$pkg);
+ squidguard_before_form_acl(&amp;$pkg);
</custom_php_command_before_form>
<custom_php_after_form_command>
- squidGuard_print_javascript();
+ squidGuard_print_javascript();
</custom_php_after_form_command>
<custom_php_resync_config_command>
- squidguard_resync_acl();
+ squidguard_resync_acl();
</custom_php_resync_config_command>
<custom_delete_php_command>
- squidguard_resync_acl();
+ squidguard_resync_acl();
</custom_delete_php_command>
<custom_add_php_command>
</custom_add_php_command>
<custom_add_php_command_late>
</custom_add_php_command_late>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/squidGuard/squidguard_blacklist.php b/config/squidGuard/squidguard_blacklist.php
index 5e8382ae..98e0aecd 100644
--- a/config/squidGuard/squidguard_blacklist.php
+++ b/config/squidGuard/squidguard_blacklist.php
@@ -236,6 +236,7 @@ window.setTimeout('getactivity()', 150);
$tab_array[] = array(gettext("Rewrites"), false, "/pkg.php?xml=squidguard_rewr.xml");
$tab_array[] = array(gettext("Blacklist"), true, "/squidGuard/squidguard_blacklist.php");
$tab_array[] = array(gettext("Log"), false, "/squidGuard/squidguard_log.php");
+ $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=squidguard_sync.xml&amp;id=0");
display_top_tabs($tab_array);
?>
</td>
diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc
index c69ef0ee..0100fba4 100644
--- a/config/squidGuard/squidguard_configurator.inc
+++ b/config/squidGuard/squidguard_configurator.inc
@@ -51,7 +51,12 @@ require_once('pfsense-utils.inc');
require_once('pkg-utils.inc');
require_once('filter.inc');
require_once('service-utils.inc');
-require_once('squid.inc');
+
+# squid package must exists by default system path (for v.2.0/2.1)
+# todo: move include string to the squid-function call string position
+if (file_exists('/usr/local/pkg/squid.inc')) {
+ require_once('/usr/local/pkg/squid.inc');
+}
# ------------------------------------------------------------------------------
# Allow additional execution time 0 = no limit
@@ -89,8 +94,8 @@ define('CONFIG_SG_HEADER', "
define('REDIRECTOR_OPTIONS_REM', '# squidGuard options');
define('REDIRECTOR_PROGRAM_OPT', 'redirect_program');
define('REDIRECT_BYPASS_OPT', 'redirector_bypass');
-define('REDIRECT_CHILDREN_OPT', 'redirect_children');
-define('REDIRECTOR_PROCESS_COUNT', '3'); # redirector processes count will started
+define('REDIRECT_CHILDREN_OPT', 'url_rewrite_children');
+define('REDIRECTOR_PROCESS_COUNT', '5'); # redirector processes count will started
# ------------------------------------------------------------------------------
# squidguard config options
@@ -105,15 +110,28 @@ define('REDIRECT_URL_ARGS', '&a=%a&n=%n&i=%i&s=%s&t=%t&u=%u');
# ------------------------------------------------------------------------------
# squidguard system constants
# ------------------------------------------------------------------------------
-define('SQUID_CONFIGFILE', '/usr/local/etc/squid/squid.conf');
+
+$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+if ($pf_version > 2.0)
+ define('SQUIDGUARD_LOCALBASE', '/usr/pbi/squidguard-' . php_uname("m"));
+else
+ define('SQUIDGUARD_LOCALBASE','/usr/local');
+
+if (!defined('SQUID_LOCALBASE') && ($pf_version > 2.0))
+ define('SQUID_LOCALBASE', '/usr/pbi/squid-' . php_uname("m"));
+elseif (!defined('SQUID_LOCALBASE'))
+ define('SQUID_LOCALBASE','/usr/local');
+
+define('SQUID_CONFIGFILE', SQUID_LOCALBASE . '/etc/squid/squid.conf');
define('TMP_DIR', '/var/tmp');
#
define('SQUIDGUARD_CONFIGFILE', '/squidGuard.conf');
define('SQUIDGUARD_CONFLOGFILE', '/sg_configurator.log');
define('SQUIDGUARD_LOGFILE', 'block.log');
-define('SQUIDGUARD_CONFBASE', '/usr/local/etc/squid');
-define('SQUIDGUARD_WORKDIR', '/usr/local/etc/squidGuard');
-define('SQUIDGUARD_BINPATH', '/usr/local/bin');
+define('SQUIDGUARD_GUILOGFILE', 'squidGuard.log');
+define('SQUIDGUARD_CONFBASE', SQUID_LOCALBASE . '/etc/squid');
+define('SQUIDGUARD_WORKDIR', SQUIDGUARD_LOCALBASE . '/etc/squidGuard');
+define('SQUIDGUARD_BINPATH', SQUIDGUARD_LOCALBASE . '/bin');
define('SQUIDGUARD_TMP', '/tmp/squidGuard'); # SG temp
define('SQUIDGUARD_VAR', '/var/squidGuard'); # SG variables
define('SQUIDGUARD_STATE', '/squidGuard.state');
@@ -126,7 +144,7 @@ define('SQUIDGUARD_LOGDIR', '/var/squidGuard/log');
define('SQUIDGUARD_WEBGUI_LOG', '/squidguard_gui.log');
define('SQUIDGUARD_WEBGUI_HISTORY_LOG', '/squidguard_gui_history.log');
#
-define('SQUIDGUARD_SCR_LOGROTATE', '/usr/local/etc/rc.d/squidGuard_logrotate'); # Logrotate script
+define('SQUIDGUARD_SCR_LOGROTATE', SQUIDGUARD_LOCALBASE . '/etc/rc.d/squidGuard_logrotate'); # Logrotate script
#
# DB home catalog contains 'Blacklist' and 'User' sub-catalogs
define('SQUIDGUARD_DB_BLACKLIST', '/bl');
@@ -371,7 +389,7 @@ function sg_reconfigure()
if ($squidguard_config[F_WORKDIR])
$conf_file = $squidguard_config[F_WORKDIR] . SQUIDGUARD_CONFIGFILE;
file_put_contents($conf_file, $conf);
- file_put_contents('/usr/local/etc/squid' . SQUIDGUARD_CONFIGFILE, $conf); # << squidGuard want config '/usr/local/etc/squid' by default
+ file_put_contents(SQUID_LOCALBASE . '/etc/squid' . SQUIDGUARD_CONFIGFILE, $conf); # << squidGuard want config '/usr/local/etc/squid' by default
set_file_access($squidguard_config[F_WORKDIR], OWNER_NAME, 0755);
conf_mount_ro();
sg_addlog("sg_reconfigure", "Save squidGuard config to '$conf_file'.", SQUIDGUARD_INFO);
@@ -385,9 +403,9 @@ function sg_reconfigure()
# ------------------------------------------------------------------------------
# squid_reconfigure
# Insert in '/usr/local/squid/etc/squid.conf' options:
-# redirector_bypass on
+# redirector_bypass off
# redirect_program /usr/local/squidGuard/bin/squidGuard -c /path_to_config_file
-# redirect_children 1
+# url_rewrite_children 5
# ------------------------------------------------------------------------------
function squid_reconfigure($remove_only = '')
@@ -416,7 +434,7 @@ function squid_reconfigure($remove_only = '')
$redirector_conf = $squidguard_config[F_WORKDIR] . SQUIDGUARD_CONFIGFILE;
$conf[] = REDIRECTOR_PROGRAM_OPT . " $redirector_path -c $redirector_conf";
- $conf[] = REDIRECT_BYPASS_OPT . " on";
+ $conf[] = REDIRECT_BYPASS_OPT . " off";
$conf[] = REDIRECT_CHILDREN_OPT . " " . REDIRECTOR_PROCESS_COUNT;
sg_addlog("squid_reconfigure", "Add new redirector options to Squid config.", SQUIDGUARD_INFO);
@@ -428,7 +446,10 @@ function squid_reconfigure($remove_only = '')
$config['installedpackages']['squid']['config'][0]['custom_options'] = $conf;
write_config('Update redirector options to squid config.');
- squid_resync();
+ # resync squid package, if installed
+ if (function_exists('squid_resync')) {
+ squid_resync();
+ }
}
# ------------------------------------------------------------------------------
@@ -659,7 +680,7 @@ function sg_rebuild_db($shtag, $rdb_dbhome, $rdb_itemslist)
$sh_scr[] = "chown -R -v " . OWNER_NAME . " $dbhome";
# restart squid for changes to take effects
- $sh_scr[] = "/usr/local/sbin/squid -k reconfigure";
+ $sh_scr[] = SQUID_LOCALBASE . "/sbin/squid -k reconfigure";
# store & exec sh
$sh_scr = implode("\n", $sh_scr);
@@ -1543,11 +1564,10 @@ if(!function_exists("is_url")) {
function is_url($url)
{
if (empty($url)) return false;
- if (eregi("^http://", $url)) return true;
- if (eregi("^https://", $url)) return true;
+ if (preg_match("/^(http|https):\/\//i", $url)) return true;
if (strstr("blank", $url)) return true;
if (strstr("blank_img", $url)) return true;
- if (eregi("^((30[1235]{1})|(40[0-9]{1})|(41[0-7]{1})|(50[0-5]{1}))", $url)) return true; # http error code 30x, 4xx, 50x.
+ if (preg_match("/^((30[1235]{1})|(40[0-9]{1})|(41[0-7]{1})|(50[0-5]{1}))/i", $url)) return true; # http error code 30x, 4xx, 50x.
return false;
}
}
@@ -1558,7 +1578,7 @@ function is_dest_url($url)
$fmt = "[a-zA-Z0-9_-]";
if (empty($url)) return false;
- if (eregi("^(($fmt){1,}\.){1,}($fmt){2,}(/(.[^\*][^ ])*)", $url)) return true;
+ if (preg_match("/^(($fmt){1,}\.){1,}($fmt){2,}(\/(.[^\*][^ ])*)/i", $url)) return true;
return false;
}
# ------------------------------------------------------------------------------
@@ -1603,8 +1623,8 @@ function is_ipaddr_valid($val)
function is_domain_valid($domain)
{
$dm_fmt = "([a-z0-9\-]{1,})";
- $dm_fmt = "^(($dm_fmt{1,}\.){1,}$dm_fmt{2,})+$"; # example: (my.)(super.)(domain.)com
- return is_string($domain) && eregi($dm_fmt, trim($domain));
+ $dm_fmt = "/^(($dm_fmt{1,}\.){1,}$dm_fmt{2,})+$/i"; # example: (my.)(super.)(domain.)com
+ return is_string($domain) && preg_match($dm_fmt, trim($domain));
}
# ------------------------------------------------------------------------------
@@ -1612,8 +1632,8 @@ function is_domain_valid($domain)
# ------------------------------------------------------------------------------
function is_username($username)
{
- $unm_fmt = "^\'[a-zA-Z_0-9\.\-]{1,}\'$";
- return is_string($username) && eregi($unm_fmt, trim($username));
+ $unm_fmt = "/^\'[a-zA-Z_0-9\.\-]{1,}\'$/i";
+ return is_string($username) && preg_match($unm_fmt, trim($username));
}
# ------------------------------------------------------------------------------
# check name
@@ -1627,7 +1647,7 @@ function check_name_format ($name, $input_errors)
$elog[] = " Size of name '$val' must be between [2..16].";
# All symbols must be [a-zA-Z_0-9\-] First symbol = letter.
- if (!eregi("^([a-zA-Z]{1})([a-zA-Z_0-9\-]+)$", $val))
+ if (!preg_match("/^([a-zA-Z]{1})([a-zA-Z_0-9\-]+)$/i", $val))
$elog[] = " Invalid name $name. Valid name symbols: ['a-Z', '_', '0-9', '-']. First symbol must be a letter.";
# update log
@@ -1784,15 +1804,15 @@ function check_date($date)
{
$err = '';
$val = trim($date);
- $dtfmt = "([0-9]{4})\.([0-9]{2})\.([0-9]{2})";
+ $dtfmt = "/^([0-9]{4})\.([0-9]{2})\.([0-9]{2})/i";
# check date range
- if (eregi("^{$dtfmt}-{$dtfmt}$", $val)) {
+ if (preg_match("{$dtfmt}-{$dtfmt}$", $val)) {
$val = explode("-", str_replace(".", '', $val));
if (intval($val[0]) >= intval($val[1]))
$err .= "Invalid date range, begin range must be less than the end. {$val[0]} - {$val[1]}";
}
- elseif (!eregi("^(([0-9]{4})|[*])\.(([0-9]{2})|[*])\.(([0-9]{2})|[*])$", $val)) {
+ elseif (!preg_match("/^(([0-9]{4})|[*])\.(([0-9]{2})|[*])\.(([0-9]{2})|[*])$/i", $val)) {
$err .= "Bad date format.";
}
@@ -1815,7 +1835,7 @@ function check_time($time)
if (empty($time)) return '';
# time range format: 'HH:MM-HH:MM'
- if (!eregi("^([0-2][0-9])\:([0-5][0-9])-([0-2][0-9])\:([0-5][0-9])$", $time))
+ if (!preg_match("/^([0-2][0-9])\:([0-5][0-9])-([0-2][0-9])\:([0-5][0-9])$/i", $time))
$err = "Invalid time range '$time'. You must use 'HH:MM-HH:MM' time range format. ";
else {
$tms = str_replace("-", "\n", $time);
@@ -1863,18 +1883,29 @@ function acl_remove_blacklist_items($items)
# -----------------------------------------------------------------------------
function sg_script_logrotate()
{
- $lines = 1000; # SG logfile truncate lines count
- global $squidguard_config;
- $sglogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_LOGFILE;
+ global $squidguard_config;
+
+ $sglogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_LOGFILE;
+ $sgguilogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_GUILOGFILE;
+ $sgconflogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_CONFLOGFILE;
$res =
<<<EOD
#!/bin/sh
#
# This file generated automaticly with SquidGuard configurator
+# Rotates the block logfile
tail -{$lines} {$sglogname} > {$sglogname}.0
tail -{$lines} {$sglogname}.0 > {$sglogname}
rm -f {$sglogname}.0
+# Rotates the squidguard GUI logile
+tail -{$lines} {$sgguilogname} > {$sgguilogname}.0
+tail -{$lines} {$sgguilogname}.0 > {$sgguilogname}
+rm -f {$sgguilogname}.0
+# Rotates the squidguard conf logile
+tail -{$lines} {$sgconflogname} > {$sgconflogname}.0
+tail -{$lines} {$sgconflogname}.0 > {$sgconflogname}
+rm -f {$sgconflogname}.0
EOD;
return $res;
}
@@ -2187,7 +2218,7 @@ function sg_update_blacklist($from_file)
set_file_access($dbhome, OWNER_NAME, 0755);
squidguard_update_log("Reconfigure Squid proxy.");
- mwexec("/usr/local/sbin/squid -k reconfigure");
+ mwexec(SQUID_LOCALBASE . "/sbin/squid -k reconfigure");
squidguard_update_log("Blacklist update complete.");
@@ -2326,7 +2357,7 @@ function squidguard_blacklist_restore_arcdb()
squidguard_rebuild_db("arc_", $dbhome, $files);
squidguard_update_log("Reconfigure Squid proxy.");
- mwexec("/usr/local/sbin/squid -k reconfigure");
+ mwexec(SQUID_LOCALBASE . "/sbin/squid -k reconfigure");
conf_mount_ro();
squidguard_update_log("Restore success.");
@@ -2460,4 +2491,4 @@ class TSgTag
}
}
-?> \ No newline at end of file
+?>
diff --git a/config/squidGuard/squidguard_default.xml b/config/squidGuard/squidguard_default.xml
index ff05085a..01380ea5 100644
--- a/config/squidGuard/squidguard_default.xml
+++ b/config/squidGuard/squidguard_default.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description><![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguarddefault</name>
@@ -43,110 +43,107 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<fields>
- <field>
- <fielddescr>Target Rules</fielddescr>
- <fieldname>dest</fieldname>
- <description></description>
- <type>input</type>
- <size>100</size>
- </field>
- <field>
- <fielddescr>Not to allow IP addresses in URL</fielddescr>
- <fieldname>notallowingip</fieldname>
- <description>
- To make sure that people don't bypass the URL filter
- by simply using the IP addresses instead of the fully qualified domain names, you can check this option.
- This option has no effect on the WhiteList.
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Proxy Denied Error</fielddescr>
- <fieldname>deniedmessage</fieldname>
- <description>The first part of the error message displayed to clients when denied. Defaults to "Request denied by $g['product_name'] proxy"</description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>2</rows>
- </field>
-
- <field>
- <fielddescr>Redirect mode</fielddescr>
- <fieldname>redirect_mode</fieldname>
- <description>
- Select redirect mode here.
- &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
-<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
- &lt;br&gt; Options:
- &lt;A title="To 'url' will added special client information;" &gt;
- &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client view 'url' content without any notification about;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
- &lt;/u&gt;
- </description>
- <type>select</type>
- <value>rmod_none</value>
- <options>
- <!--option><name>none</name> <value>rmod_none</value></option-->
- <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
- <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
- <!--option><name>int blank image</name> <value>rmod_int_bim</value></option-->
- <!--option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option-->
- <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
- <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
- <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
- <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Redirect info</fielddescr>
- <fieldname>redirect</fieldname>
- <description>
- Enter external redirection URL, error message or size (bytes) here.
- </description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>2</rows>
- </field>
- <field>
- <fielddescr>Use SafeSearch engine</fielddescr>
- <fieldname>safesearch</fieldname>
- <description>
- To protect your children from adult content, you can use the protected mode of search engines.
- Now it is supported by Google, Yandex, Yahoo, MSN, Live Search, Bing. Make sure that the search engines can, and others, it is recommended to prohibit.
- &lt;br&gt;Note: ! This option overrides 'Rewrite' setting. !
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Rewrite</fielddescr>
- <fieldname>rewrite</fieldname>
- <description>Enter rewrite condition name for this rule, or leave blank.</description>
- <type>select</type>
- </field>
- <field>
- <fielddescr>Log</fielddescr>
- <fieldname>enablelog</fieldname>
- <description>Check this for log this item.</description>
- <type>checkbox</type>
- </field>
+ <field>
+ <fielddescr>Target Rules</fielddescr>
+ <fieldname>dest</fieldname>
+ <description><![CDATA[]]></description>
+ <type>input</type>
+ <size>100</size>
+ </field>
+ <field>
+ <fielddescr>Do not allow IP-Addresses in URL</fielddescr>
+ <fieldname>notallowingip</fieldname>
+ <description><![CDATA[To make sure that people do not bypass the URL filter by simply using the IP-Addresses instead of the FQDN you can check this option. This option has no effect on the whitelist.]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Proxy Denied Error</fielddescr>
+ <fieldname>deniedmessage</fieldname>
+ <description><![CDATA[The first part of the error message displayed to clients when access was denied. Defaults to <b>"Request denied by $g['product_name'] proxy"</b>]]></description>
+ <type>textarea</type>
+ <cols>65</cols>
+ <rows>2</rows>
+ </field>
+ <field>
+ <fielddescr>Redirect mode</fielddescr>
+ <fieldname>redirect_mode</fieldname>
+ <description>
+ Select redirect mode here.
+ &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
+<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
+ &lt;br&gt; Options:
+ &lt;A title="To 'url' will added special client information;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client view 'url' content without any notification about;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
+ &lt;/u&gt;
+ </description>
+ <type>select</type>
+ <value>rmod_none</value>
+ <options>
+ <!--option><name>none</name> <value>rmod_none</value></option-->
+ <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
+ <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
+ <!--option><name>int blank image</name> <value>rmod_int_bim</value></option-->
+ <!--option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option-->
+ <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
+ <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
+ <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
+ <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Redirect info</fielddescr>
+ <fieldname>redirect</fieldname>
+ <description><![CDATA[Enter external redirection URL, error message or size (bytes) here.]]></description>
+ <type>textarea</type>
+ <cols>65</cols>
+ <rows>2</rows>
+ </field>
+ <field>
+ <fielddescr>Use SafeSearch engine</fielddescr>
+ <fieldname>safesearch</fieldname>
+ <description><![CDATA[
+ To protect your children from adult content you can use the protected mode of search engines.<br>
+ At the moment it is supported by Google, Yandex, Yahoo, MSN, Live Search and Bing. Make sure that the search engines can be accessed. It is recommended to prohibit access to others.<br>
+ <b>Note:</b> This option overrides 'Rewrite' setting.
+ ]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Rewrite</fielddescr>
+ <fieldname>rewrite</fieldname>
+ <description><![CDATA[Enter the rewrite condition name for this rule or leave it blank.]]></description>
+ <type>select</type>
+ </field>
+ <field>
+ <fielddescr>Log</fielddescr>
+ <fieldname>enablelog</fieldname>
+ <description><![CDATA[Check this option to enable logging for this ACL.]]></description>
+ <type>checkbox</type>
+ </field>
</fields>
<custom_php_validation_command>
- squidguard_validate_acl(&amp;$_POST, &amp;$input_errors);
+ squidguard_validate_acl(&amp;$_POST, &amp;$input_errors);
</custom_php_validation_command>
<custom_php_command_before_form>
- squidguard_before_form_acl(&amp;$pkg, false);
+ squidguard_before_form_acl(&amp;$pkg, false);
</custom_php_command_before_form>
<custom_php_after_form_command>
- squidGuard_print_javascript();
+ squidGuard_print_javascript();
</custom_php_after_form_command>
<custom_add_php_command/>
<custom_php_resync_config_command>
-// squidguard_resync();
+// squidguard_resync();
</custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/squidGuard/squidguard_dest.xml b/config/squidGuard/squidguard_dest.xml
index 9c425816..5ffc0aa6 100644
--- a/config/squidGuard/squidguard_dest.xml
+++ b/config/squidGuard/squidguard_dest.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description><![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguarddest</name>
@@ -45,132 +45,131 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Name</fielddescr>
- <fieldname>name</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Redirect</fielddescr>
- <fieldname>redirect</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
+ <columnitem>
+ <fielddescr>Name</fielddescr>
+ <fieldname>name</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Redirect</fielddescr>
+ <fieldname>redirect</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ </columnitem>
</adddeleteeditpagefields>
<fields>
- <field>
- <fielddescr>Name</fielddescr>
- <fieldname>name</fieldname>
- <description>
- Enter the unique name here.
- Name must consist of minimum 2 symbols, first from which letter. &lt;br&gt;
- All other symbols must be [a-Z_0-9].
- </description>
- <type>input</type>
- <size>100</size>
- <required/>
- </field>
- <field>
- <fielddescr>Domains list</fielddescr>
- <fieldname>domains</fieldname>
- <description>
- Enter destination domains or IP-address here. For separate use ' '(space).
- &lt;p&gt; &lt;b&gt;Example:&lt;/b&gt; 'mail.ru e-mail.ru yahoo.com 192.168.1.1' .
- </description>
- <type>textarea</type>
- <cols>60</cols>
- <rows>10</rows>
- </field>
- <field>
- <fielddescr>URLs list</fielddescr>
- <fieldname>urls</fieldname>
- <description>
- Enter url's here.
- For separate urls's use ' '(space).
- &lt;p&gt; &lt;b&gt;Example:&lt;/b&gt; 'host.com/xxx 12.10.220.125/alisa' .
- </description>
- <type>textarea</type>
- <cols>60</cols>
- <rows>10</rows>
- </field>
- <field>
- <fielddescr>Expressions</fielddescr>
- <fieldname>expressions</fieldname>
- <description>
- Enter word fragments, what may be contains in destinations URL path.
- For separate expression words use '|'.
- &lt;p&gt; &lt;b&gt;Example:&lt;/b&gt; 'mail|casino|game' .
- </description>
- <type>textarea</type>
- <cols>60</cols>
- <rows>10</rows>
- </field>
- <field>
- <fielddescr>Redirect mode</fielddescr>
- <fieldname>redirect_mode</fieldname>
- <description>
- Select redirect mode here.
- &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
-<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
- &lt;br&gt; Options:
- &lt;A title="To 'url' will added special client information;" &gt;
- &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client view 'url' content without any notification about;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
- &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
- &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
- &lt;/u&gt;
- </description>
- <type>select</type>
- <value>rmod_none</value>
- <options>
- <option><name>none</name> <value>rmod_none</value></option>
- <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
- <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
- <option><name>int blank image</name> <value>rmod_int_bim</value></option>
-<!-- <option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option> -->
- <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
- <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
- <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
- <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Redirect</fielddescr>
- <fieldname>redirect</fieldname>
- <description>
- Enter external redirection URL, error message or size (bytes) here.
- </description>
- <type>textarea</type>
- <cols>60</cols>
- <rows>2</rows>
- </field>
- <field>
- <fielddescr>Log</fielddescr>
- <fieldname>enablelog</fieldname>
- <type>checkbox</type>
- <description>Check this for log this item.</description>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- <size>90</size>
- </field>
- </fields>
+ <field>
+ <fielddescr>Name</fielddescr>
+ <fieldname>name</fieldname>
+ <description><![CDATA[
+ Enter a unique name of this rule here.<br>
+ The name must consist between 2 and 15 symbols [a-Z_0-9]. The first one must be a letter.<br>
+ ]]></description>
+ <type>input</type>
+ <size>100</size>
+ <required/>
+ </field>
+ <field>
+ <fielddescr>Domain List</fielddescr>
+ <fieldname>domains</fieldname>
+ <description><![CDATA[
+ Enter destination domains or IP-addresses here. To separate them use space.<br>
+ <b>Example:</b> mail.ru e-mail.ru yahoo.com 192.168.1.1
+ ]]></description>
+ <type>textarea</type>
+ <cols>60</cols>
+ <rows>10</rows>
+ </field>
+ <field>
+ <fielddescr>URL List</fielddescr>
+ <fieldname>urls</fieldname>
+ <description><![CDATA[
+ Enter destination URLs here. To separate them use space.<br>
+ <b>Example:</b> host.com/xxx 12.10.220.125/alisa
+ ]]></description>
+ <type>textarea</type>
+ <cols>60</cols>
+ <rows>10</rows>
+ </field>
+ <field>
+ <fielddescr>Regular Expression</fielddescr>
+ <fieldname>expressions</fieldname>
+ <description><![CDATA[
+ Enter word fragments of the destination URL. To separate them use <b>|</b> .
+ <b>Example:</b> mail|casino|game|\.rsdf$
+ ]]></description>
+ <type>textarea</type>
+ <cols>60</cols>
+ <rows>10</rows>
+ </field>
+ <field>
+ <fielddescr>Redirect mode</fielddescr>
+ <fieldname>redirect_mode</fieldname>
+ <description>
+ Select redirect mode here.
+ &lt;br&gt; Note: if you use 'transparent proxy', then 'int' redirect mode will not accessible.
+<!-- &lt;br&gt;&lt;b&gt; int size limit :&lt;/b&gt; if content size 0 or > 'size limit', then client moved to 'blank image' page; -->
+ &lt;br&gt; Options:
+ &lt;A title="To 'url' will added special client information;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt;ext url err page&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client view 'url' content without any notification about;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url redirect&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with displaying url in addres bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'move'&lt;/span&gt;&lt;/A&gt; ,
+ &lt;A title="Client will moved to specified url with showing progress(only!) in status bar;" &gt;
+ &lt;span style="background-color: #dddddd;" &gt; ext url as 'found'.&lt;/span&gt;&lt;/A&gt;
+ &lt;/u&gt;
+ </description>
+ <type>select</type>
+ <value>rmod_none</value>
+ <options>
+ <option><name>none</name> <value>rmod_none</value></option>
+ <option><name>int error page (enter error message)</name> <value>rmod_int</value></option>
+ <option><name>int blank page </name> <value>rmod_int_bpg</value></option>
+ <option><name>int blank image</name> <value>rmod_int_bim</value></option>
+<!-- <option><name>int size limit (enter size in bytes)</name> <value>rmod_int_szl</value></option> -->
+ <option><name>ext url err page (enter URL)</name> <value>rmod_ext_err</value></option>
+ <option><name>ext url redirect (enter URL)</name> <value>rmod_ext_rdr</value></option>
+ <option><name>ext url move (enter URL)</name> <value>rmod_ext_mov</value></option>
+ <option><name>ext url found (enter URL)</name> <value>rmod_ext_fnd</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Redirect</fielddescr>
+ <fieldname>redirect</fieldname>
+ <description><![CDATA[Enter the external redirection URL, error message or size (bytes) here.]]></description>
+ <type>textarea</type>
+ <cols>60</cols>
+ <rows>2</rows>
+ </field>
+ <field>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ <description><![CDATA[You may enter any description here for your reference.]]></description>
+ <type>input</type>
+ <size>90</size>
+ </field>
+ <field>
+ <fielddescr>Log</fielddescr>
+ <fieldname>enablelog</fieldname>
+ <type>checkbox</type>
+ <description><![CDATA[Check this option to enable logging for this ACL.]]></description>
+ </field>
+ </fields>
<custom_delete_php_command/>
<custom_php_validation_command>
- squidguard_validate_destination($_POST, &amp;$input_errors);
+ squidguard_validate_destination($_POST, &amp;$input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
</custom_php_resync_config_command>
<custom_php_after_form_command>
- squidGuard_print_javascript();
+ squidGuard_print_javascript();
</custom_php_after_form_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/squidGuard/squidguard_log.php b/config/squidGuard/squidguard_log.php
index e5f19407..8eba2311 100644
--- a/config/squidGuard/squidguard_log.php
+++ b/config/squidGuard/squidguard_log.php
@@ -275,6 +275,7 @@ window.setTimeout('getactivity()', 150);
$tab_array[] = array(gettext("Rewrites"), false, "/pkg.php?xml=squidguard_rewr.xml");
$tab_array[] = array(gettext("Blacklist"), false, "/squidGuard/squidguard_blacklist.php");
$tab_array[] = array(gettext("Log"), true, "$selfpath");
+ $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=squidguard_sync.xml&amp;id=0");
display_top_tabs($tab_array);
?>
</td>
@@ -323,4 +324,4 @@ window.setTimeout('getactivity()', 150);
Rounded("div#mainarea","bl br","#FFF","#eeeeee","smooth");
</script-->
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/config/squidGuard/squidguard_rewr.xml b/config/squidGuard/squidguard_rewr.xml
index 8a3f801f..c21cb1c0 100644
--- a/config/squidGuard/squidguard_rewr.xml
+++ b/config/squidGuard/squidguard_rewr.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description><![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguardrewrite</name>
@@ -43,6 +43,10 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
<columnitem>
@@ -58,11 +62,10 @@
<field>
<fielddescr>Name</fielddescr>
<fieldname>name</fieldname>
- <description>
- Enter the unique name here.
- Name must consist of minimum 2 symbols, first from which letter. &lt;br&gt;
- All other symbols must be [a-Z_0-9].
- </description>
+ <description><![CDATA[
+ Enter a unique name of this rule here.<br>
+ The name must consist between 2 and 15 symbols [a-Z_0-9]. The first one must be a letter.<br>
+ ]]></description>
<type>input</type>
<required/>
<size>100</size>
@@ -89,13 +92,13 @@
<fielddescr>Opt.</fielddescr>
<fieldname>mode</fieldname>
<type>select</type>
- <value>no</value>
- <options>
- <option> <name>---------</name> <value>no</value> </option>
- <option> <name>no case </name> <value>nocase</value> </option>
- <option> <name>redirect </name> <value>redirect</value> </option>
- <option> <name>no case + redirect</name> <value>nocase_redirect</value> </option>
- </options>
+ <value>no</value>
+ <options>
+ <option> <name>---------</name> <value>no</value> </option>
+ <option> <name>no case </name> <value>nocase</value> </option>
+ <option> <name>redirect </name> <value>redirect</value> </option>
+ <option> <name>no case + redirect</name> <value>nocase_redirect</value> </option>
+ </options>
</rowhelperfield>
<!-- <rowhelperfield>
<fielddescr>Http 301</fielddescr>
@@ -113,18 +116,18 @@
<field>
<fielddescr>Log</fielddescr>
<fieldname>enablelog</fieldname>
- <description>Check this for log this item.</description>
+ <description><![CDATA[Check this option to enable logging for this ACL.]]></description>
<type>checkbox</type>
</field>
<field>
<fielddescr>Description</fielddescr>
<fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).&lt;br&gt;
- &lt;b&gt; Note: &lt;/b&gt; &lt;br&gt;
- &lt;b&gt;Rewrite rule&lt;/b&gt; - define how url will are replaced.&lt;br&gt;
- &lt;b&gt;Target URL or regular expression&lt;/b&gt; - contains destination url or regular expression. Regular expression example: */cc32e46.exe &lt;br&gt;
- &lt;b&gt;Replace to&lt;/b&gt; - contains replacing url.
- </description>
+ <description><![CDATA[You may enter any description here for your reference.<br>
+ <b>Note:</b><br>
+ <b>Rewrite rule:</b> Define how the URL will be replaced.<br>
+ <b>Target URL or Regular Expression:</b> Contains destination URL or regular expression. This is the URL or RegEx the user wants to visit.<br>
+ <b>Replace to URL:</b> Contains the replacing URL. This is the URL the user will see instead the original one.
+ ]]></description>
<type>input</type>
<size>100</size>
</field>
@@ -138,4 +141,4 @@
<custom_php_resync_config_command>
// squidguard_resync_rewrite();
</custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/squidGuard/squidguard_sync.xml b/config/squidGuard/squidguard_sync.xml
new file mode 100644
index 00000000..cf21c1bf
--- /dev/null
+++ b/config/squidGuard/squidguard_sync.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+<![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+squidguardsync.xml
+part of pfSense (http://www.pfSense.com)
+Copyright (C) 2013 Alexander Wilke <nachtfalkeaw@web.de>
+based on pfblocker_sync.xml
+All rights reserved.
+
+Based on m0n0wall (http://m0n0.ch/wall)
+Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
+All rights reserved.
+*/
+/* ========================================================================== */
+/*
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ========================================================================== */
+]]></copyright>
+ <description><![CDATA[Describe your package here]]></description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>squidguardsync</name>
+ <version>1.3_1 pkg v.1.9</version>
+ <title>Proxy filter SquidGuard: XMLRPC Sync</title>
+ <include_file>/usr/local/pkg/squidguard.inc</include_file>
+ <tabs>
+ <tab>
+ <text>General settings</text>
+ <url>/pkg_edit.php?xml=squidguard.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Common ACL</text>
+ <url>/pkg_edit.php?xml=squidguard_default.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Groups ACL</text>
+ <url>/pkg.php?xml=squidguard_acl.xml</url>
+ </tab>
+ <tab>
+ <text>Target categories</text>
+ <url>/pkg.php?xml=squidguard_dest.xml</url>
+ </tab>
+ <tab>
+ <text>Times</text>
+ <url>/pkg.php?xml=squidguard_time.xml</url>
+ </tab>
+ <tab>
+ <text>Rewrites</text>
+ <url>/pkg.php?xml=squidguard_rewr.xml</url>
+ </tab>
+ <tab>
+ <text>Blacklist</text>
+ <url>/squidGuard/squidguard_blacklist.php</url>
+ </tab>
+ <tab>
+ <text>Log</text>
+ <url>/squidGuard/squidguard_log.php</url>
+ </tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ </tabs>
+ <fields>
+ <field>
+ <name>SquidGuard XMLRPC Sync</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Automatically sync SquidGuard configuration changes?</fielddescr>
+ <fieldname>varsyncenablexmlrpc</fieldname>
+ <description><![CDATA[All changes will be synced immediately to the IPs listed below if this option is checked.<br>
+ <b>Important:</b> Only sync from host A to B, A to C but <b>do not</B> enable XMLRPC sync <b>to</b> A. This will result in a loop!]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>XMLRPC timeout</fielddescr>
+ <fieldname>varsynctimeout</fieldname>
+ <description><![CDATA[Timeout in seconds for the XMLRPC timeout. Default: 150]]></description>
+ <type>input</type>
+ <default_value>150</default_value>
+ <size>5</size>
+ </field>
+
+ <field>
+ <fielddescr>Destination Server</fielddescr>
+ <fieldname>none</fieldname>
+ <type>rowhelper</type>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>Enable</fielddescr>
+ <fieldname>varsyncdestinenable</fieldname>
+ <type>checkbox</type>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>GUI Protocol</fielddescr>
+ <fieldname>varsyncprotocol</fieldname>
+ <description><![CDATA[Choose the protocol of the destination host. Probably <b>http</b> or <b>https</b>]]></description>
+ <type>select</type>
+ <default_value>HTTP</default_value>
+ <options>
+ <option><name>HTTP</name><value>http</value></option>
+ <option><name>HTTPS</name><value>https</value></option>
+ </options>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>GUI IP-Address</fielddescr>
+ <fieldname>varsyncipaddress</fieldname>
+ <description><![CDATA[IP Address of the destination host.]]></description>
+ <type>input</type>
+ <size>15</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>GUI Port</fielddescr>
+ <fieldname>varsyncport</fieldname>
+ <description><![CDATA[Choose the port of the destination host.]]></description>
+ <type>input</type>
+ <size>3</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>GUI Admin Password</fielddescr>
+ <fieldname>varsyncpassword</fieldname>
+ <description><![CDATA[Password of the user "admin" on the destination host.]]></description>
+ <type>password</type>
+ <size>20</size>
+ </rowhelperfield>
+ </rowhelper>
+ </field>
+ </fields>
+ <custom_delete_php_command>
+ squidguard_sync_on_changes();
+ </custom_delete_php_command>
+ <custom_php_resync_config_command>
+ squidguard_sync_on_changes();
+ </custom_php_resync_config_command>
+</packagegui>
diff --git a/config/squidGuard/squidguard_time.xml b/config/squidGuard/squidguard_time.xml
index c27de273..dfd589aa 100644
--- a/config/squidGuard/squidguard_time.xml
+++ b/config/squidGuard/squidguard_time.xml
@@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <description>Describe your package here</description>
+ <description><![CDATA[Describe your package here]]></description>
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>squidguardtime</name>
@@ -45,6 +45,10 @@
<text>Log</text>
<url>/squidGuard/squidguard_log.php</url>
</tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=squidguard_sync.xml</url>
+ </tab>
</tabs>
<adddeleteeditpagefields>
<columnitem>
@@ -60,11 +64,10 @@
<field>
<fielddescr>Name</fielddescr>
<fieldname>name</fieldname>
- <description>
- Enter the unique name here.
- Name must consist of minimum 2 symbols, first from which letter. &lt;br&gt;
- All other symbols must be [a-Z_0-9].
- </description>
+ <description><![CDATA[
+ Enter a unique name of this rule here.<br>
+ The name must consist between 2 and 15 symbols [a-Z_0-9]. The first one must be a letter.<br>
+ ]]></description>
<type>input</type>
<required/>
<size>100</size>
@@ -76,7 +79,7 @@
<rowhelperfield>
<fielddescr>Time type</fielddescr>
<fieldname>timetype</fieldname>
- <description></description>
+ <description><![CDATA[]]></description>
<type>select</type>
<value>weekly</value>
<options>
@@ -87,7 +90,7 @@
<rowhelperfield>
<fielddescr>Days</fielddescr>
<fieldname>timedays</fieldname>
- <description></description>
+ <description><![CDATA[]]></description>
<type>select</type>
<value>*</value>
<options>
@@ -110,7 +113,7 @@
<rowhelperfield>
<fielddescr>Time range</fielddescr>
<fieldname>sg_timerange</fieldname>
- <description>00:00-08:00</description>
+ <description><![CDATA[00:00-08:00]]></description>
<type>input</type>
<size>20</size>
<value>00:00-23:59</value>
@@ -120,12 +123,11 @@
<field>
<fielddescr>Description</fielddescr>
<fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed). &lt;br&gt;
- &lt;b&gt; Note: &lt;/b&gt; &lt;br&gt;
- Field &lt;b&gt;'Date or date range'&lt;/b&gt; have format 'yyyy.mm.dd'; 'yyyy.mm.dd-yyyy.mm.dd'; or use '*' in format. &lt;br&gt;
- Example: '2007.05.01'; '2007.04.14-2007.04.17'; '*.12.24'; '2007.*.01'; &lt;br&gt;
- Field &lt;b&gt;'Time range'&lt;/b&gt; have format 'hh:mm-hh:mm'. Example: '08:00-18:00';
- </description>
+ <description><![CDATA[You may enter any description here for your reference.<br>
+ <b>Note:</b><br>
+ <b>Example for Date or Date Range:</b> 2007.12.31 <b>or</b> 2007.11.31-2007.12.31 <b>or</b> *.12.31 <b>or</b> 2007.*.31<br>
+ <b>Example for Time Range:</b> 08:00-18:00
+ ]]></description>
<type>input</type>
<size>80</size>
</field>
@@ -139,4 +141,4 @@
<custom_php_resync_config_command>
// squidguard_resync_time();
</custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
+</packagegui>