From 6080784f5eb8bcae13436b3651726e91110d482e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 20 May 2006 21:16:26 +0000 Subject: Adding clamav and havp packages. Submitted-by: Rajkumar S --- packages/clamav.inc | 41 +++++++++++++++++ packages/clamav.xml | 24 ++++++++++ packages/havp.inc | 107 +++++++++++++++++++++++++++++++++++++++++++ packages/havp.xml | 109 ++++++++++++++++++++++++++++++++++++++++++++ packages/havp_blacklist.xml | 67 +++++++++++++++++++++++++++ packages/havp_whitelist.xml | 67 +++++++++++++++++++++++++++ 6 files changed, 415 insertions(+) create mode 100644 packages/clamav.inc create mode 100644 packages/clamav.xml create mode 100644 packages/havp.inc create mode 100644 packages/havp.xml create mode 100644 packages/havp_blacklist.xml create mode 100644 packages/havp_whitelist.xml (limited to 'packages') diff --git a/packages/clamav.inc b/packages/clamav.inc new file mode 100644 index 00000000..b63eb984 --- /dev/null +++ b/packages/clamav.inc @@ -0,0 +1,41 @@ + diff --git a/packages/clamav.xml b/packages/clamav.xml new file mode 100644 index 00000000..ee390a50 --- /dev/null +++ b/packages/clamav.xml @@ -0,0 +1,24 @@ + + clamav + 0.1 + ClamAV: Settings + /usr/local/pkg/clamav.inc + + + clamav + /usr/local/etc/rc.d/clamav.sh + + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/clamav.inc + + + clamav_install_command(); + clamav_deinstall_command(); + sync_package_clamav(); + sync_package_clamav(); + sync_package_clamav(); + + diff --git a/packages/havp.inc b/packages/havp.inc new file mode 100644 index 00000000..631db0e3 --- /dev/null +++ b/packages/havp.inc @@ -0,0 +1,107 @@ + "") + fwrite($fd,"BIND_ADDRESS " . $tmp['bind_address'] . " \n"); + if ($tmp['source_address'] <> "") + fwrite($fd,"SOURCE_ADDRESS " . $tmp['source_address'] . " \n"); + if ($tmp['transparent'] == "on"){ + fwrite($fd,"TRANSPARENT true\n"); + } + else { + fwrite($fd,"TRANSPARENT false\n"); + } + if ($tmp['range'] == "on"){ + fwrite($fd,"RANGE true\n"); + } + else { + fwrite($fd,"RANGE false\n"); + } + } + fclose($fd); + $start = "/usr/local/sbin/havp &\n"; + $stop = "/usr/bin/killall havp\n" . "sleep 2"; + write_rcfile(array( + "file" => "havp.sh", + "start" => $start, + "stop" => $stop + ) + ); + conf_mount_ro(); + config_unlock(); + unlink_if_exists("/usr/local/etc/havp/havp.config"); + mwexec("ln -sf /etc/havp.config /usr/local/etc/havp/havp.config"); + mwexec("/usr/local/etc/rc.d/havp.sh stop"); + mwexec("/usr/local/etc/rc.d/havp.sh start"); +} + +function havp_install_command() { + global $config, $g; + mwexec ("mkdir -p /var/log/havp/"); + mwexec ("mkdir -p /var/tmp/havp/"); + mwexec ("mkdir -p /var/run/havp/"); + mwexec ("chown havp:havp /var/log/havp"); + mwexec ("chown havp:havp /var/tmp/havp"); + mwexec ("chown havp:havp /var/run/havp"); + sync_package_havp(); +} + +function havp_deinstall_command() { + global $config, $g; + conf_mount_rw(); + unlink_if_exists("/usr/local/etc/rc.d/havp.sh"); + unlink_if_exists("/usr/local/etc/havp/havp.config"); + conf_mount_ro(); +} +function sync_package_havp_whitelist() { + global $config; + conf_mount_rw(); + config_lock(); + $fd = fopen("/usr/local/etc/havp/whitelist","w"); + if($config['installedpackages']['havpwhitelist']['config'] != "") + foreach($config['installedpackages']['havpwhitelist']['config'] as $tmp) { + fwrite($fd, $tmp['url'] . "\n"); + } + fclose($fd); + /* signal a reload of all files */ + conf_mount_ro(); + config_unlock(); +} + +function sync_package_havp_blacklist() { + global $config; + conf_mount_rw(); + config_lock(); + $fd = fopen("/usr/local/etc/havp/blacklist","w"); + if($config['installedpackages']['havpblacklist']['config'] != "") + foreach($config['installedpackages']['havpblacklist']['config'] as $tmp) { + fwrite($fd, $tmp['url'] . "\n"); + } + fclose($fd); + /* signal a reload of all files */ + conf_mount_ro(); + config_unlock(); +} +?> \ No newline at end of file diff --git a/packages/havp.xml b/packages/havp.xml new file mode 100644 index 00000000..8f278a4a --- /dev/null +++ b/packages/havp.xml @@ -0,0 +1,109 @@ + + havp + 0.1 + Havp: Settings + /usr/local/pkg/havp.inc + + + HAVP +
Services
+ Modify HAVP settings. + /pkg_edit.php?xml=havp.xml&act=edit&id=0 + havp.xml +
+ + + havp + /usr/local/etc/rc.d/havp.sh + + + + + Settings + /pkg_edit.php?xml=havp.xml&act=edit&id=0 + + + + Whitelist + /pkg.php?xml=havp_whitelist.xml + + + Blacklist + /pkg.php?xml=havp_blacklist.xml + + + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/havp.inc + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/havp_whitelist.xml + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/havp_blacklist.xml + + + ['installedpackages']['havp]['config'] + + + + Server Number + servernumber + Specify how many servers (child processes) are simultaneously listening on port PORT for a connection. Minimum value should be the peak requests-per-second expected + 5 for headroom. + input + + + Max Server Number + maxservers + This is the hard limit for concurrent requests processed. + input + + + Transparent? + transparent + Run HAVP as transparent Proxy? + checkbox + yes + + + Port + port + Port HAVP is listening on. + input + 8080 + + + Bind Address + bind_address + IP address that HAVP listens on. Leave it empty to bind all addresses. + input + + + Source Address + source_address + IP address used for sending outbound packets. Let it be undefined if you want OS to handle right address. + input + + + Range Requests + range + Allow HTTP Range Requests? + checkbox + yes + + + + havp_install_command(); + havp_deinstall_command(); + sync_package_havp(); + sync_package_havp(); + sync_package_havp(); + +
+ diff --git a/packages/havp_blacklist.xml b/packages/havp_blacklist.xml new file mode 100644 index 00000000..38388628 --- /dev/null +++ b/packages/havp_blacklist.xml @@ -0,0 +1,67 @@ + + + havp-blacklist + 0.1.0 + Havp: Blacklist + /usr/local/pkg/havp.inc + + + HAVP Blacklist + +
Services
+ havp.xml +
+ + + Settings + /pkg_edit.php?xml=havp.xml&act=edit&id=0 + + + Whitelist + /pkg.php?xml=havp_whitelist.xml + + + Blacklist + /pkg.php?xml=havp_blacklist.xml + + + + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/havp.inc + + + ['installedpackages']['havpblacklist']['config'] + + + + Blocked URL + url + + + Description + description + + + + + + Blocked URL + url + Enter the URL to blacklist + input + + + Description + description + Enter the description for this url + input + + + + sync_package_havp_blacklist(); + sync_package_havp_blacklist(); + sync_package_havp_blacklist(); +
diff --git a/packages/havp_whitelist.xml b/packages/havp_whitelist.xml new file mode 100644 index 00000000..429d957e --- /dev/null +++ b/packages/havp_whitelist.xml @@ -0,0 +1,67 @@ + + + havp-whitelist + 0.1.0 + HAVP: Whitelist + /usr/local/pkg/havp.inc + + + HAVP Whitelist + +
Services
+ havp.xml +
+ + + Settings + /pkg_edit.php?xml=havp.xml&act=edit&id=0 + + + Whitelist + /pkg.php?xml=havp_whitelist.xml + + + + Blacklist + /pkg.php?xml=havp_blacklist.xml + + + + + /usr/local/pkg/ + 0755 + http://agni.linuxense.com/packages/config/havp.inc + + + ['installedpackages']['havpwhitelist']['config'] + + + + Exempted URL + url + + + Description + description + + + + + + Exempted URL + url + Enter the URL to exempt from blacklisting + input + + + Description + description + Enter the description for this item + input + + + + sync_package_havp_whitelist(); + sync_package_havp_whitelist(); + sync_package_havp_whitelist(); +
-- cgit v1.2.3