From 7da7cf4e7e7a162c9ac44d4ffa7f986c022a75be Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Sat, 28 Feb 2009 21:48:39 -0500 Subject: Add a package for 1.2.x that will give protocol options for Manual Outbound NAT, since the change was too dramatic to merge into the feature-complete RELENG_1_2. --- config/onatproto/onatproto.inc | 18 +++ config/onatproto/onatproto.patch | 267 +++++++++++++++++++++++++++++++++++++++ config/onatproto/onatproto.xml | 65 ++++++++++ 3 files changed, 350 insertions(+) create mode 100644 config/onatproto/onatproto.inc create mode 100644 config/onatproto/onatproto.patch create mode 100644 config/onatproto/onatproto.xml (limited to 'config') diff --git a/config/onatproto/onatproto.inc b/config/onatproto/onatproto.inc new file mode 100644 index 00000000..93454107 --- /dev/null +++ b/config/onatproto/onatproto.inc @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/config/onatproto/onatproto.patch b/config/onatproto/onatproto.patch new file mode 100644 index 00000000..c8d802f3 --- /dev/null +++ b/config/onatproto/onatproto.patch @@ -0,0 +1,267 @@ +--- /etc/inc/filter.inc.orig 2009-02-24 15:11:55.000000000 -0500 ++++ /etc/inc/filter.inc 2009-02-24 19:38:51.000000000 -0500 +@@ -494,7 +494,7 @@ + } + + /* Generate a 'nat on' or 'no nat on' rule for given interface */ +-function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) { ++function filter_nat_rules_generate_if($if, $src = "any", $proto = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) { + global $config; + + /* XXX: billm - any idea if this code is needed? */ +@@ -507,6 +507,12 @@ + else + $tgt = "($if)"; + ++ /* Add the protocol, if defined */ ++ if (($proto != "") && ($proto != "any")) ++ $protocol = " proto {$proto}"; ++ else ++ $protocol = ""; ++ + /* Add the hard set source port (useful for ISAKMP) */ + if ($natport != "") + $tgt .= " port {$natport}"; +@@ -546,7 +552,7 @@ + + /* Put all the pieces together */ + if($if_friendly) +- $natrule = "{$nat} on \${$if_friendly} from {$src} to {$dst} {$target}{$staticnatport_txt}\n"; ++ $natrule = "{$nat} on \${$if_friendly} {$protocol} from {$src} to {$dst} {$target}{$staticnatport_txt}\n"; + + return $natrule; + } +@@ -654,6 +660,7 @@ + + $natrules .= filter_nat_rules_generate_if($natif, + $src, ++ $obent['protocol'], + $obent['sourceport'], + $dst, + $obent['dstport'], +@@ -669,9 +676,9 @@ + update_filter_reload_status("Creating outbound NAT rules"); + + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false); ++ "{$lansa}/{$lancfg['subnet']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false); ++ "{$lansa}/{$lancfg['subnet']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($wanif, + "{$lansa}/{$lancfg['subnet']}"); + +@@ -683,9 +690,9 @@ + $opt_interface = $oc['if']; + if (interface_has_gateway("$opt_interface")) { + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false); ++ "{$lansa}/{$lancfg['subnet']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false); ++ "{$lansa}/{$lancfg['subnet']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, + "{$lansa}/{$lancfg['subnet']}"); + } +@@ -701,22 +708,22 @@ + + /* create outbound nat entries for primary wan */ + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false); ++ "{$optsa}/{$optcfg['subnet']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false); ++ "{$optsa}/{$optcfg['subnet']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat'])); ++ "{$optsa}/{$optcfg['subnet']}", "any", null, "", null, null, null, isset($optcfg['nonat'])); + + /* create outbound nat entries for all opt wans */ + foreach($optints as $oc) { + $opt_interface = $oc['if']; + if (interface_has_gateway("$opt_interface")) { + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false); ++ "{$optsa}/{$optcfg['subnet']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false); ++ "{$optsa}/{$optcfg['subnet']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat'])); ++ "{$optsa}/{$optcfg['subnet']}", "any", null, "", null, null, null, isset($optcfg['nonat'])); + } + } + } +@@ -728,9 +735,9 @@ + if($config['pptp']['pptp_subnet'] <> "") + $pptp_subnet = $config['pptp']['pptp_subnet']; + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false); ++ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false); ++ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($wanif, + "{$pptpdcfg['remoteip']}/{$pptp_subnet}"); + +@@ -739,9 +746,9 @@ + $opt_interface = $oc['if']; + if ((is_private_ip($pptpdcfg['remoteip'])) && (interface_has_gateway($opt_interface))) { + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false); ++ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false); ++ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, + "{$pptpdcfg['remoteip']}/{$pptp_subnet}"); + } +@@ -754,20 +761,20 @@ + if($config['pppoe']['pppoe_subnet'] <> "") + $pppoe_subnet = $config['pppoe']['pppoe_subnet']; + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false); ++ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false); ++ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$pppoecfg['remoteip']}/{$pppoe_subnet}"); ++ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any"); + + /* generate nat mappings for opts with a gateway opts */ + foreach($optints as $oc) { + $opt_interface = $oc['if']; + if ((is_private_ip($pppoecfg['remoteip'])) && (interface_has_gateway($opt_interface))) { + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false); ++ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false); ++ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, + "{$pppoecfg['remoteip']}/{$pppoe_subnet}"); + } +@@ -780,22 +787,22 @@ + $netip = explode("/", $route['network']); + if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0]))) { + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$route['network']}", 500, "", 500, null, 500, false); ++ "{$route['network']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$route['network']}", 5060, "", 5060, null, 5060, false); ++ "{$route['network']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($wanif, +- "{$route['network']}", "", null); ++ "{$route['network']}", "any", "", null); + } + /* generate nat mapping for static routes on opts */ + foreach($optints as $oc) { + $opt_interface = $oc['if']; + if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0])) && (interface_has_gateway($opt_interface))) { + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$route['network']}", 500, "", 500, null, 500, false); ++ "{$route['network']}", "any", 500, "", 500, null, 500, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$route['network']}", 5060, "", 5060, null, 5060, false); ++ "{$route['network']}", "any", 5060, "", 5060, null, 5060, false); + $natrules .= filter_nat_rules_generate_if($opt_interface, +- "{$route['network']}", "", null); ++ "{$route['network']}", "any", "", null); + } + } + +--- /usr/local/www-orig/firewall_nat_out.php 2008-01-07 21:14:44.000000000 -0500 ++++ /usr/local/www/firewall_nat_out.php 2009-02-24 18:21:20.000000000 -0500 +@@ -102,6 +102,7 @@ + $natent['interface'] = "wan"; + $natent['destination']['any'] = true; + $natent['natport'] = ""; ++ $natent['protocol'] = "any"; + $a_out[] = $natent; + } + $savemsg = "Default rules for each interface have been created."; +@@ -265,6 +266,11 @@ + echo "LAN"; + else + echo htmlspecialchars($config['interfaces'][$natent['interface']]['descr']); ++ ++ if (($natent['protocol'] != "any") && ($natent['protocol'] != "")) ++ $proto = $natent['protocol'] . "/"; ++ else ++ $proto = ""; + ?> +   + +@@ -273,10 +279,11 @@ + + + + + +@@ -293,9 +300,9 @@ + + + + +--- /usr/local/www-orig/firewall_nat_out_edit.php 2008-11-08 17:53:23.000000000 -0500 ++++ /usr/local/www/firewall_nat_out_edit.php 2009-02-25 12:07:33.000000000 -0500 +@@ -49,6 +49,7 @@ + } + + if (isset($id) && $a_out[$id]) { ++ $pconfig['proto'] = $a_out[$id]['protocol']; + list($pconfig['source'],$pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']); + $pconfig['sourceport'] = $a_out[$id]['sourceport']; + address_to_pconfig($a_out[$id]['destination'], $pconfig['destination'], +@@ -170,6 +171,9 @@ + if (!$natent['interface']) + $natent['interface'] == "wan"; + ++ if ($natent['proto'] != $_POST['proto']) ++ continue; ++ + if (($natent['interface'] == $_POST['interface']) && ($natent['source']['network'] == $osn)) { + if (isset($natent['destination']['not']) == isset($_POST['destination_not'])) { + if ((isset($natent['destination']['any']) && ($ext == "any")) || +@@ -188,6 +192,7 @@ + $natent['descr'] = $_POST['descr']; + $natent['target'] = $_POST['target']; + $natent['interface'] = $_POST['interface']; ++ $natent['protocol'] = $_POST['proto']; + + /* static-port */ + if(isset($_POST['staticnatport'])) +@@ -316,6 +321,17 @@ + Hint: in most cases, you'll want to use WAN here. + + ++ Protocol ++ ++
Choose which IP protocol ++ this rule should match.
++ Hint: in most cases, you should specify any  here.
++ ++ + Source + + diff --git a/config/onatproto/onatproto.xml b/config/onatproto/onatproto.xml new file mode 100644 index 00000000..e4e4e8b9 --- /dev/null +++ b/config/onatproto/onatproto.xml @@ -0,0 +1,65 @@ + + + + + + . + 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. + */ +/* ========================================================================== */ + ]]> + + Patch to add Protocol options to Manual Outbound NAT + pfSense 1.2.x + Only needed if you want to NAT outbound based on protocol as well as port. + onatproto + 0.1 + onatproto + /usr/local/pkg/onatproto.inc + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/onatproto/onatproto.inc + + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/onatproto/onatproto.patch + + + onatproto_install(); + + -- cgit v1.2.3 From 40d9915647000e7337539fccaf455d17064adbfb Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Mar 2009 15:48:29 -0500 Subject: Do not file notice when package is not configured --- config/autoconfigbackup/autoconfigbackup.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/autoconfigbackup/autoconfigbackup.inc b/config/autoconfigbackup/autoconfigbackup.inc index fd0d3169..c95bbbb3 100644 --- a/config/autoconfigbackup/autoconfigbackup.inc +++ b/config/autoconfigbackup/autoconfigbackup.inc @@ -134,7 +134,7 @@ function upload_config($reasonm = "") { $notice_text = "Either the username, password or encryption password is not set for Automatic Configuration Backup. "; $notice_text .= "Please correct this in Diagnostics -> AutoConfigBackup -> Settings."; log_error($notice_text); - file_notice("AutoConfigBackup", $notice_text, $notice_text, ""); + //file_notice("AutoConfigBackup", $notice_text, $notice_text, ""); conf_mount_rw(); touch("/cf/conf/autoconfigback.notice"); conf_mount_ro(); -- cgit v1.2.3 From 8f8121f28405be1acbc5aafa907dcdaf8c3d4e18 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Mar 2009 15:49:58 -0500 Subject: * Axe upload routine during filter run (we use parse config hook now) * Do not file error either --- config/autoconfigbackup/autoconfigbackup.inc | 2 +- config/autoconfigbackup/autoconfigbackup.xml | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'config') diff --git a/config/autoconfigbackup/autoconfigbackup.inc b/config/autoconfigbackup/autoconfigbackup.inc index c95bbbb3..ac8038d2 100644 --- a/config/autoconfigbackup/autoconfigbackup.inc +++ b/config/autoconfigbackup/autoconfigbackup.inc @@ -133,7 +133,7 @@ function upload_config($reasonm = "") { if(!file_exists("/cf/conf/autoconfigback.notice")) { $notice_text = "Either the username, password or encryption password is not set for Automatic Configuration Backup. "; $notice_text .= "Please correct this in Diagnostics -> AutoConfigBackup -> Settings."; - log_error($notice_text); + //log_error($notice_text); //file_notice("AutoConfigBackup", $notice_text, $notice_text, ""); conf_mount_rw(); touch("/cf/conf/autoconfigback.notice"); diff --git a/config/autoconfigbackup/autoconfigbackup.xml b/config/autoconfigbackup/autoconfigbackup.xml index 5e5eaf73..869cd747 100644 --- a/config/autoconfigbackup/autoconfigbackup.xml +++ b/config/autoconfigbackup/autoconfigbackup.xml @@ -48,11 +48,6 @@
Diagnostics
/autoconfigbackup.php - - /usr/local/pkg/pf/ - 0755 - http://www.pfsense.com/packages/config/autoconfigbackup/upload_config_filter.php - /usr/local/pkg/parse_config/ 0755 -- cgit v1.2.3 From 379c1d569555e803913556dafbdd710e2e01c444 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Mar 2009 21:52:27 +0100 Subject: change fields descriptions for squid bypass-functions regarding to the forums discussion: http://forum.pfsense.org/index.php/topic,14607.0.html --- config/squid/squid.xml | 8 ++++---- config/squid3/squid.xml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/squid/squid.xml b/config/squid/squid.xml index 4c8bc4ab..a119e647 100644 --- a/config/squid/squid.xml +++ b/config/squid/squid.xml @@ -169,15 +169,15 @@ - Do NOT proxy Private Address Space (RFC 1918) + Bypass proxy for Private Address Space (RFC 1918) destination private_subnet_proxy_off - Do not forward traffic to Private Address Space (RFC 1918) <b>destination</b> through the proxy server. + Do not forward traffic to Private Address Space (RFC 1918) <b>destination</b> through the proxy server but directly through the firewall. checkbox - Do NOT proxy these IPs + Bypass proxy for these source IPs defined_ip_proxy_off - Do not forward traffic from these <b>source</b> IPs through the proxy server. Separate by semi-colons (;). + Do not forward traffic from these <b>source</b> IPs through the proxy server but directly through the firewall. Separate by semi-colons (;). input 80 diff --git a/config/squid3/squid.xml b/config/squid3/squid.xml index 8529526e..662805da 100644 --- a/config/squid3/squid.xml +++ b/config/squid3/squid.xml @@ -169,15 +169,15 @@ - Do NOT proxy Private Address Space (RFC 1918) + Bypass proxy for Private Address Space (RFC 1918) destination private_subnet_proxy_off - Do not forward traffic to Private Address Space (RFC 1918) <b>destination</b> through the proxy server. + Do not forward traffic to Private Address Space (RFC 1918) <b>destination</b> through the proxy server but directly through the firewall. checkbox - Do NOT proxy these IPs + Bypass proxy for these source IPs defined_ip_proxy_off - Do not forward traffic from these <b>source</b> IPs through the proxy server. Separate by semi-colons (;). + Do not forward traffic from these <b>source</b> IPs through the proxy server but directly through the firewall. Separate by semi-colons (;). input 80 -- cgit v1.2.3 From bc586f76d5aeeccdb1e5e0864675818eda6f89e2 Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Sun, 1 Mar 2009 15:59:39 -0500 Subject: Update Dashboard package. Fixes broken log viewing on 1.2.1+, and fixes broken IPSec status. Adds a couple features to logging. --- config/dashboard/dashboard.inc | 11 +++++++++-- config/dashboard/dashboard.xml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc index b147632e..a97954ae 100644 --- a/config/dashboard/dashboard.inc +++ b/config/dashboard/dashboard.inc @@ -4,10 +4,11 @@ function dashboard_install() { global $g, $config; assign_privs(); if(!file_exists("/usr/local/www/index.php.before_dashboard")) { - /* backup the pre-dashboard index.php file */ + /* backup the pre-dashboard files */ mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); - /* backup the pre-dashboard fbegin.inc file */ mwexec("cp /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard"); + mwexec("cp /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard"); + mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard"); } mwexec("tar xzvpf /usr/local/pkg/widgets.tgz -C /"); assign_privs(); @@ -20,6 +21,8 @@ function dashboard_deinstall() { /* restore the files prior to the dashboard package installation */ mwexec("cp /usr/local/www/index.php.before_dashboard /usr/local/www/index.php"); mwexec("cp /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc"); + mwexec("cp /usr/local/www/diag_logs_filter.php.before_dashboard /usr/local/www/diag_logs_filter.php"); + mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard /usr/local/www/diag_logs_filter_dynamic.php"); } assign_privs(); } @@ -29,10 +32,14 @@ function assign_privs() { mwexec("chown root:wheel /usr/local/www/fbegin.php"); mwexec("chown root:wheel /usr/local/www/graph_cpu.php"); mwexec("chown root:wheel /usr/local/www/stats.php"); + mwexec("chown root:wheel /usr/local/www/diag_logs_filter.php"); + mwexec("chown root:wheel /usr/local/www/diag_logs_filter_dynamic.php"); mwexec("chmod a+rw /usr/local/www/index.php"); mwexec("chmod a+rw /usr/local/www/fbegin.php"); mwexec("chmod a+rw /usr/local/www/graph_cpu.php"); mwexec("chmod a+rw /usr/local/www/stats.php"); + mwexec("chmod a+rw /usr/local/www/diag_logs_filter.php"); + mwexec("chmod a+rw /usr/local/www/diag_logs_filter_dynamic.php"); } ?> \ No newline at end of file diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index a0e1b35a..ab96e727 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.2 + 0.7.0 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 3b34b3d8e6df4affb65dd3b1cf18b3667b268788 Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Sun, 1 Mar 2009 20:03:32 -0500 Subject: Fix a small formatting bug in log output. --- config/dashboard/dashboard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index ab96e727..26e41cef 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.0 + 0.7.1 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 66cc19a6f46187978bb960d8eff3a7c12ac2ae9b Mon Sep 17 00:00:00 2001 From: dvserg Date: Mon, 2 Mar 2009 12:02:38 +0300 Subject: havp package added --- config/havp/havp.inc | 656 +++++++++++++++++++++++++++++++++++++++++++++++++++ config/havp/havp.xml | 250 ++++++++++++++++++++ 2 files changed, 906 insertions(+) create mode 100644 config/havp/havp.inc create mode 100644 config/havp/havp.xml (limited to 'config') diff --git a/config/havp/havp.inc b/config/havp/havp.inc new file mode 100644 index 00000000..85427eb2 --- /dev/null +++ b/config/havp/havp.inc @@ -0,0 +1,656 @@ + $val) { + if ($config['cron']['item'][$key]['task_name'] === $task_name) { + unset($config['cron']['item'][$key]); + $flag_cron_upd = true; + + # log ! cron task deleted ! + break; + } + } + + # set new cron task + if (($on_off === true) and !empty($cron_item)) { + $config['cron']['item'][] = $cron_item; + $flag_cron_upd = true; + + # log ! cron task installed ! + } + + # write config and configure cron only if cron task modified + if ($flag_cron_upd === true) { + write_config("Installed cron task '$task_name' for 'havp' package"); + configure_cron(); + # log ! cron stored ! + } + } + else { + # ! error $name ! + + # if error - break function + return; + } +} +?> diff --git a/config/havp/havp.xml b/config/havp/havp.xml new file mode 100644 index 00000000..a70b09bc --- /dev/null +++ b/config/havp/havp.xml @@ -0,0 +1,250 @@ + + + havp + Services: Antivirus proxy server (havp + clamav) -> Settings + Status + 1.7.1 + havp.inc + + + + HTTP Antivirus + Proxy server antivirus +
Services
+ /pkg_edit.php?xml=havp.xml&id=0 +
+ + + http://www.pfsense.com/packages/config/havp/havp.inc + + + + + Settings + /pkg_edit.php?xml=havp.xml&id=0 + + + + + + Enable + enable + Check this for enable proxy. + checkbox + + + Use external interface + listenextinterface + Select this for use external interface, otherwise the proxy will use the internal interface '127.0.0.1'. Cascade you other proxy to the HAVP as 'parent proxy' via '127.0.0.1' ip. + checkbox + proxyiface + + + Proxy interface + proxyiface + The interface(s) the proxy server will bind to. + interfaces_selection + + lan + + + Proxy port + proxyport + This is the port the proxy server will listen on. + input + 10 + + 3128 + + + Parent proxy + parentproxy + + Enter the parent proxy as PROXY:PORT format or leave empty. + + input + 90 + + + Language + lang + Select the language in which the proxy server will display error messages to users. + select + en + + + + + + + + + + + + + + Max download size + maxdownloadsize + Enter value or leave empty. Value in bytes. Downloads larger than 'Max download size' will be blocked. Only if not Whitelisted! + input + 10 + + + + Disable X-Forward + xforwardedfor + If not set, proxy will include your system's IP address or name in the HTTP requests it forwards. + checkbox + + + + Whitelist + whitelist + + Enter each destination url on a new line that will be accessable to the users without scanning. + Use '*' symbol for mask. Example: *.pfsense.com/*, *sourceforge.net/*clamav-*, */*.xml, */*.inc + + textarea + 60 + 5 + base64 + + + + Blacklist + blacklist + Enter each destination domain on a new line that will be accessable to the users that are allowed to use the proxy. + textarea + 60 + 5 + base64 + + + + Block file if error scanning + failscanerror + If set, the proxy will block the files on which an error scanning. + checkbox + + + + Scan max file size + scanmaxsize + + Enter here value in bytes (5, 10, 15, 20) or leave empty. + Files larger than this limit won't be scanned. + Empty or 0 also disables the limit. + NOTE: Setting limit is a security risk, because some archives like + ZIP need all the data to be scanned properly! Use this only if you + can't afford temporary space for big files. Also scanner settings + will affect how many files will be scanned inside an archive etc. + + input + 10 + + + + Scan images + scanimg + Check this for scan image files. + checkbox + + + + Scan archives + scanarc + Check this for scan within archives and compressed files. + checkbox + + + + Scan archive max file size + scanarcmaxsize + 10M + + Enter here value in megabytes (15M) or leave empty. + Files in archives larger than this limit won't be scanned. + Value of 0 also disables the limit. + + input + 10 + + + + AV bases update + havpavupdate + + <input name='submit' type='submit' value='Update_AV'> + Press button for update AV database now. + + select + hv_none + + + + + + + + + + + + + + Regional AV database update mirror + dbregion + Select regional database mirror. + select + + + + + + + + + + + + + + + + + + + + Optional AV database update servers + avupdateserver + Enter here space separated AV update servers, or leave empty. + textarea + 60 + 5 + + + + Syslog + syslog + Check this for enable Syslog. + checkbox + + + Log + log + Check this for enable log. + checkbox + + + + havp_validate_settings($_POST, &$input_errors); + + + havp_resync(); + + + + + +
\ No newline at end of file -- cgit v1.2.3 From 46633e4793ad7b74ac3686749a89cf600d86f196 Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Mon, 2 Mar 2009 09:52:16 -0500 Subject: Redo previous commit to fix the package. --- config/dashboard/dashboard.inc | 1 + config/dashboard/dashboard.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc index a97954ae..0eab0a3a 100644 --- a/config/dashboard/dashboard.inc +++ b/config/dashboard/dashboard.inc @@ -28,6 +28,7 @@ function dashboard_deinstall() { } function assign_privs() { + /* Fix permissions on replaced files */ mwexec("chown root:wheel /usr/local/www/index.php"); mwexec("chown root:wheel /usr/local/www/fbegin.php"); mwexec("chown root:wheel /usr/local/www/graph_cpu.php"); diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index 26e41cef..ba8bb575 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -42,7 +42,7 @@ /* ========================================================================== */ ]]> - Describe your package here + Dashboard package Describe your package requirements here Currently there are no FAQ items provided. dashboard -- cgit v1.2.3 From 3754d566646a6c286a60c0d98e3be47a37a4b0ba Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Mon, 2 Mar 2009 20:28:15 -0500 Subject: More formatting fixes. Notably: ipv6, igmp, and tcp flags) --- config/dashboard/dashboard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index ba8bb575..16940e35 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.1 + 0.7.2 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 4eeace55ac3757e3bb904a759d855c683d0062ab Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Tue, 3 Mar 2009 17:57:21 -0500 Subject: Really unbreak the AJAX viewer this time. Forward and Reverse work. Fix a couple more minor formatting bugs. --- config/dashboard/dashboard.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index 16940e35..492aef40 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.2 + 0.7.3 Dashboard /usr/local/pkg/dashboard.inc @@ -59,13 +59,10 @@ 077 http://www.pfsense.com/packages/config/dashboard/binaries/widgets.tgz - + dashboard_install(); - + dashboard_deinstall(); - - - -- cgit v1.2.3 From 71b72f493b125aa424113eb0c145f52bc7628b8a Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 5 Mar 2009 12:19:45 -0700 Subject: FreeSWITCH adjust tabbing in freeswitch.xml --- config/freeswitch/begin_recording.wav | Bin config/freeswitch/class.phpmailer.tmp | 0 config/freeswitch/class.smtp.tmp | 0 config/freeswitch/freeswitch.inc | 0 config/freeswitch/freeswitch.xml | 26 ++++++++++----------- config/freeswitch/freeswitch_cmd.tmp | 0 config/freeswitch/freeswitch_dialplan.xml | 0 config/freeswitch/freeswitch_dialplan_includes.tmp | 0 .../freeswitch_dialplan_includes_details.tmp | 0 .../freeswitch_dialplan_includes_details_edit.tmp | 0 .../freeswitch_dialplan_includes_edit.tmp | 0 config/freeswitch/freeswitch_extensions.tmp | 0 config/freeswitch/freeswitch_extensions.xml | 0 config/freeswitch/freeswitch_extensions_edit.tmp | 0 config/freeswitch/freeswitch_external.xml | 0 config/freeswitch/freeswitch_gateways.tmp | 0 config/freeswitch/freeswitch_gateways_edit.tmp | 0 config/freeswitch/freeswitch_internal.xml | 0 config/freeswitch/freeswitch_ivr.tmp | 0 config/freeswitch/freeswitch_ivr_edit.tmp | 0 config/freeswitch/freeswitch_ivr_options.tmp | 0 config/freeswitch/freeswitch_ivr_options_edit.tmp | 0 config/freeswitch/freeswitch_mailto.tmp | 0 config/freeswitch/freeswitch_modules.xml | 0 config/freeswitch/freeswitch_public.xml | 0 config/freeswitch/freeswitch_public_includes.tmp | 0 .../freeswitch_public_includes_details.tmp | 0 .../freeswitch_public_includes_details_edit.tmp | 0 .../freeswitch/freeswitch_public_includes_edit.tmp | 0 config/freeswitch/freeswitch_recordings.tmp | 0 config/freeswitch/freeswitch_recordings_edit.tmp | 0 config/freeswitch/freeswitch_recordings_play.tmp | 0 config/freeswitch/freeswitch_status.tmp | 0 config/freeswitch/freeswitch_time_conditions.tmp | 0 .../freeswitch/freeswitch_time_conditions_edit.tmp | 0 config/freeswitch/freeswitch_vars.xml | 0 config/freeswitch/libcurl.so.5 | Bin config/freeswitch/libiconv.so.3 | Bin config/freeswitch/libncurses.so.5.6 | Bin config/freeswitch/libodbc.so.1 | Bin config/freeswitch/libogg.so.5.3 | Bin config/freeswitch/libspandsp.so.1 | Bin config/freeswitch/libtinfo.so.5.6 | Bin config/freeswitch/libvorbis.so.4 | Bin config/freeswitch/mod_fax.so.1 | Bin config/freeswitch/mod_shout.so.1 | Bin config/freeswitch/please_enter_your_pin_number.wav | Bin .../your_pin_number_is_incorect_goodbye.wav | Bin 48 files changed, 13 insertions(+), 13 deletions(-) mode change 100644 => 100755 config/freeswitch/begin_recording.wav mode change 100644 => 100755 config/freeswitch/class.phpmailer.tmp mode change 100644 => 100755 config/freeswitch/class.smtp.tmp mode change 100644 => 100755 config/freeswitch/freeswitch.inc mode change 100644 => 100755 config/freeswitch/freeswitch.xml mode change 100644 => 100755 config/freeswitch/freeswitch_cmd.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_dialplan.xml mode change 100644 => 100755 config/freeswitch/freeswitch_dialplan_includes.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_dialplan_includes_details.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_dialplan_includes_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_extensions.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_extensions.xml mode change 100644 => 100755 config/freeswitch/freeswitch_extensions_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_external.xml mode change 100644 => 100755 config/freeswitch/freeswitch_gateways.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_gateways_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_internal.xml mode change 100644 => 100755 config/freeswitch/freeswitch_ivr.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_ivr_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_ivr_options.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_ivr_options_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_mailto.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_modules.xml mode change 100644 => 100755 config/freeswitch/freeswitch_public.xml mode change 100644 => 100755 config/freeswitch/freeswitch_public_includes.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_public_includes_details.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_public_includes_details_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_public_includes_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_recordings.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_recordings_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_recordings_play.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_status.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_time_conditions.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_time_conditions_edit.tmp mode change 100644 => 100755 config/freeswitch/freeswitch_vars.xml mode change 100644 => 100755 config/freeswitch/libcurl.so.5 mode change 100644 => 100755 config/freeswitch/libiconv.so.3 mode change 100644 => 100755 config/freeswitch/libncurses.so.5.6 mode change 100644 => 100755 config/freeswitch/libodbc.so.1 mode change 100644 => 100755 config/freeswitch/libogg.so.5.3 mode change 100644 => 100755 config/freeswitch/libspandsp.so.1 mode change 100644 => 100755 config/freeswitch/libtinfo.so.5.6 mode change 100644 => 100755 config/freeswitch/libvorbis.so.4 mode change 100644 => 100755 config/freeswitch/mod_fax.so.1 mode change 100644 => 100755 config/freeswitch/mod_shout.so.1 mode change 100644 => 100755 config/freeswitch/please_enter_your_pin_number.wav mode change 100644 => 100755 config/freeswitch/your_pin_number_is_incorect_goodbye.wav (limited to 'config') diff --git a/config/freeswitch/begin_recording.wav b/config/freeswitch/begin_recording.wav old mode 100644 new mode 100755 diff --git a/config/freeswitch/class.phpmailer.tmp b/config/freeswitch/class.phpmailer.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/class.smtp.tmp b/config/freeswitch/class.smtp.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml old mode 100644 new mode 100755 index 665dabb9..4f1c6af0 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.3.1 + 0.8.3.2 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc @@ -112,11 +112,11 @@ installedpackages->package->$packagename->configuration->freeswitchsettings - - /tmp/ - 0755 - http://portableusbapps.com/packages/config/freeswitch/freeswitch.tgz - + + /tmp/ + 0755 + http://portableusbapps.com/packages/config/freeswitch/freeswitch.tgz + /usr/local/pkg/ 0755 @@ -167,11 +167,11 @@ 0755 http://www.pfsense.com/packages/config/freeswitch/libodbc.so.1 - - /usr/local/lib/ - 0755 - http://www.pfsense.com/packages/config/freeswitch/libiconv.so.3 - + + /usr/local/lib/ + 0755 + http://www.pfsense.com/packages/config/freeswitch/libiconv.so.3 + /tmp/ 0755 @@ -478,10 +478,10 @@ - sync_package_freeswitch_settings(); + sync_package_freeswitch_settings(); - sync_package_freeswitch_settings(); + sync_package_freeswitch_settings(); freeswitch_php_install_command(); diff --git a/config/freeswitch/freeswitch_cmd.tmp b/config/freeswitch/freeswitch_cmd.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_dialplan.xml b/config/freeswitch/freeswitch_dialplan.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_dialplan_includes.tmp b/config/freeswitch/freeswitch_dialplan_includes.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_dialplan_includes_details.tmp b/config/freeswitch/freeswitch_dialplan_includes_details.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_extensions.tmp b/config/freeswitch/freeswitch_extensions.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_extensions.xml b/config/freeswitch/freeswitch_extensions.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_extensions_edit.tmp b/config/freeswitch/freeswitch_extensions_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_external.xml b/config/freeswitch/freeswitch_external.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_internal.xml b/config/freeswitch/freeswitch_internal.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_ivr.tmp b/config/freeswitch/freeswitch_ivr.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_ivr_options.tmp b/config/freeswitch/freeswitch_ivr_options.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_ivr_options_edit.tmp b/config/freeswitch/freeswitch_ivr_options_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_mailto.tmp b/config/freeswitch/freeswitch_mailto.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_modules.xml b/config/freeswitch/freeswitch_modules.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_public.xml b/config/freeswitch/freeswitch_public.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_public_includes.tmp b/config/freeswitch/freeswitch_public_includes.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_public_includes_details.tmp b/config/freeswitch/freeswitch_public_includes_details.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_public_includes_details_edit.tmp b/config/freeswitch/freeswitch_public_includes_details_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_public_includes_edit.tmp b/config/freeswitch/freeswitch_public_includes_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_recordings.tmp b/config/freeswitch/freeswitch_recordings.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_recordings_edit.tmp b/config/freeswitch/freeswitch_recordings_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_recordings_play.tmp b/config/freeswitch/freeswitch_recordings_play.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_time_conditions.tmp b/config/freeswitch/freeswitch_time_conditions.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_time_conditions_edit.tmp b/config/freeswitch/freeswitch_time_conditions_edit.tmp old mode 100644 new mode 100755 diff --git a/config/freeswitch/freeswitch_vars.xml b/config/freeswitch/freeswitch_vars.xml old mode 100644 new mode 100755 diff --git a/config/freeswitch/libcurl.so.5 b/config/freeswitch/libcurl.so.5 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libiconv.so.3 b/config/freeswitch/libiconv.so.3 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libncurses.so.5.6 b/config/freeswitch/libncurses.so.5.6 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libodbc.so.1 b/config/freeswitch/libodbc.so.1 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libogg.so.5.3 b/config/freeswitch/libogg.so.5.3 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libspandsp.so.1 b/config/freeswitch/libspandsp.so.1 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libtinfo.so.5.6 b/config/freeswitch/libtinfo.so.5.6 old mode 100644 new mode 100755 diff --git a/config/freeswitch/libvorbis.so.4 b/config/freeswitch/libvorbis.so.4 old mode 100644 new mode 100755 diff --git a/config/freeswitch/mod_fax.so.1 b/config/freeswitch/mod_fax.so.1 old mode 100644 new mode 100755 diff --git a/config/freeswitch/mod_shout.so.1 b/config/freeswitch/mod_shout.so.1 old mode 100644 new mode 100755 diff --git a/config/freeswitch/please_enter_your_pin_number.wav b/config/freeswitch/please_enter_your_pin_number.wav old mode 100644 new mode 100755 diff --git a/config/freeswitch/your_pin_number_is_incorect_goodbye.wav b/config/freeswitch/your_pin_number_is_incorect_goodbye.wav old mode 100644 new mode 100755 -- cgit v1.2.3 From c89cd325f9f3addb796214da2210a131cf8918f3 Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 5 Mar 2009 12:26:01 -0700 Subject: FreeSWITCH version update in freeswitch.inc --- config/freeswitch/freeswitch.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index d5f31330..cf34f8e6 100755 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1672,7 +1672,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.3.1"; + $freeswitch_package_version = "0.8.3.2"; $freeswitch_build_version = "1.0.3"; $freeswitch_build_revision = "12228"; -- cgit v1.2.3 From 2de9d6be33f02bd1628199588ad8c3eb3c607874 Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 5 Mar 2009 16:06:55 -0700 Subject: FreeSWITCH remove whitespaces around all xml tags --- config/freeswitch/freeswitch.inc | 2 +- config/freeswitch/freeswitch.xml | 184 ++++++++++---------- config/freeswitch/freeswitch_dialplan.xml | 66 ++++---- config/freeswitch/freeswitch_extensions.xml | 76 ++++----- config/freeswitch/freeswitch_external.xml | 62 +++---- config/freeswitch/freeswitch_internal.xml | 60 +++---- config/freeswitch/freeswitch_modules.xml | 252 ++++++++++++++-------------- config/freeswitch/freeswitch_public.xml | 60 +++---- config/freeswitch/freeswitch_vars.xml | 60 +++---- 9 files changed, 411 insertions(+), 411 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index cf34f8e6..75c7bd84 100755 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1672,7 +1672,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.3.2"; + $freeswitch_package_version = "0.8.3.3"; $freeswitch_build_version = "1.0.3"; $freeswitch_build_revision = "12228"; diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index 4f1c6af0..8703af24 100755 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -2,18 +2,18 @@ - - + - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.3.2 + 0.8.3.3 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc @@ -56,8 +56,8 @@ freeswitch - freeswitch.sh - freeswitch + freeswitch.sh + freeswitch FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. @@ -77,7 +77,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -89,11 +89,11 @@ IVR /freeswitch/freeswitch_ivr.php - + Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -105,28 +105,28 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 installedpackages->package->$packagename->configuration->freeswitchsettings - - /tmp/ - 0755 - http://portableusbapps.com/packages/config/freeswitch/freeswitch.tgz - + + /tmp/ + 0755 + http://portableusbapps.com/packages/config/freeswitch/freeswitch.tgz + /usr/local/pkg/ 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch.inc - + /usr/local/lib/ 0755 http://www.pfsense.com/packages/config/freeswitch/libtinfo.so.5.6 - + /usr/local/lib/ 0755 @@ -146,12 +146,12 @@ /usr/local/lib/ 0755 http://www.pfsense.com/packages/config/freeswitch/libcurl.so.5 - + /tmp/ 0755 http://www.pfsense.com/packages/config/freeswitch/mod_shout.so.1 - + /tmp/ 0755 @@ -166,185 +166,185 @@ /usr/local/lib/ 0755 http://www.pfsense.com/packages/config/freeswitch/libodbc.so.1 - - - /usr/local/lib/ - 0755 - http://www.pfsense.com/packages/config/freeswitch/libiconv.so.3 - + + + /usr/local/lib/ + 0755 + http://www.pfsense.com/packages/config/freeswitch/libiconv.so.3 + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/please_enter_your_pin_number.wav - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/begin_recording.wav /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/your_pin_number_is_incorect_goodbye.wav /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/class.smtp.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/class.phpmailer.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_cmd.tmp - + /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan.xml /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes_edit.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes_details.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions_edit.tmp - + /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_external.xml - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_gateways.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_gateways_edit.tmp - + /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_internal.xml /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr.tmp - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr_edit.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr_options_edit.tmp - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr_options.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_mailto.tmp - + /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_modules.xml /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_public.xml /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes.tmp - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes_edit.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes_details.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes_details_edit.tmp - + /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings_edit.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings_play.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_status.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_time_conditions.tmp /tmp/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_time_conditions_edit.tmp - + /usr/local/pkg/ - 0755 + 0755 http://www.pfsense.com/packages/config/freeswitch/freeswitch_vars.xml @@ -371,31 +371,31 @@ event_socket_port Enter the event socket port here. default: 8021 input - + Event Socket Password event_socket_password Enter the event socket password here. default: ClueCon password - + XML RPC HTTP Port xml_rpc_http_port Enter the XML RPC HTTP Port here. default: 8787 input - + XML RPC Auth Realm xml_rpc_auth_realm Enter the XML RPC Auth Realm here. default: freeswitch input - + XML RPC Auth User xml_rpc_auth_user Enter the XML RPC Auth User here. default: freeswitch input - + XML RPC Auth Password xml_rpc_auth_pass @@ -413,7 +413,7 @@ smtphost Enter the SMTP host address. If you using a different port append it on the end with a semi-colon. e.g. smtp.gmail.com:465 input - + SMTP Secure smtpsecure @@ -449,7 +449,7 @@ false - + SMTP Username smtpusername @@ -474,13 +474,13 @@ Enter the SMTP From Name. input - + sync_package_freeswitch_settings(); - + sync_package_freeswitch_settings(); @@ -489,4 +489,4 @@ freeswitch_deinstall_command(); - + \ No newline at end of file diff --git a/config/freeswitch/freeswitch_dialplan.xml b/config/freeswitch/freeswitch_dialplan.xml index 3ce35570..41ca32d4 100755 --- a/config/freeswitch/freeswitch_dialplan.xml +++ b/config/freeswitch/freeswitch_dialplan.xml @@ -1,27 +1,27 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -44,18 +44,18 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchdialplan 0.1 FreeSWITCH: Dialplan pkg_edit.php?xml=freeswitch_dialplan.xml&id=0 - /usr/local/pkg/freeswitch.inc + /usr/local/pkg/freeswitch.inc Settings @@ -73,7 +73,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -85,11 +85,11 @@ IVR /freeswitch/freeswitch_ivr.php - + Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -97,11 +97,11 @@ Rec /freeswitch/freeswitch_recordings.php - + Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -117,20 +117,20 @@ base64 off 30 - 70 + 70 33 - sync_package_freeswitch_dialplan(); + sync_package_freeswitch_dialplan(); - + - sync_package_freeswitch_dialplan(); + sync_package_freeswitch_dialplan(); \ No newline at end of file diff --git a/config/freeswitch/freeswitch_extensions.xml b/config/freeswitch/freeswitch_extensions.xml index 61277e97..1e3c13a4 100755 --- a/config/freeswitch/freeswitch_extensions.xml +++ b/config/freeswitch/freeswitch_extensions.xml @@ -1,27 +1,27 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -44,13 +44,13 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchextensions 0.1 FreeSWITCH: Extensions @@ -72,7 +72,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -80,7 +80,7 @@ Internal /pkg_edit.php?xml=freeswitch_internal.xml&id=0 - + IVR /freeswitch/freeswitch_ivr.php @@ -88,7 +88,7 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -100,7 +100,7 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -111,7 +111,7 @@ Extension extension - + Mailbox mailbox @@ -120,7 +120,7 @@ Description description - + Extension @@ -176,14 +176,14 @@ Enter the outbound caller id number here. input - - Voicemail Mail To + + Voicemail Mail To vm-mailto Optional: Enter the email address to send voicemail to. input - - - Voicemail Attach File + + + Voicemail Attach File vm-attach-file Choose whether to attach the file to the email. select @@ -197,8 +197,8 @@ false - - + + User Context user_context @@ -215,10 +215,10 @@ - sync_package_freeswitch_extensions(); + sync_package_freeswitch_extensions(); - - sync_package_freeswitch_extensions(); + + sync_package_freeswitch_extensions(); diff --git a/config/freeswitch/freeswitch_external.xml b/config/freeswitch/freeswitch_external.xml index 62fa9dd3..7dd2d65b 100755 --- a/config/freeswitch/freeswitch_external.xml +++ b/config/freeswitch/freeswitch_external.xml @@ -1,27 +1,27 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -44,18 +44,18 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchexternal 0.1 FreeSWITCH: External pkg_edit.php?xml=freeswitch_external.xml&id=0 - /usr/local/pkg/freeswitch.inc + /usr/local/pkg/freeswitch.inc Settings @@ -73,7 +73,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -81,7 +81,7 @@ Internal /pkg_edit.php?xml=freeswitch_internal.xml&id=0 - + IVR /freeswitch/freeswitch_ivr.php @@ -89,7 +89,7 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -101,7 +101,7 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -117,20 +117,20 @@ base64 off 30 - 70 + 70 33 - sync_package_freeswitch_external(); + sync_package_freeswitch_external(); - + - sync_package_freeswitch_external(); + sync_package_freeswitch_external(); \ No newline at end of file diff --git a/config/freeswitch/freeswitch_internal.xml b/config/freeswitch/freeswitch_internal.xml index 4ae5848f..db43b707 100755 --- a/config/freeswitch/freeswitch_internal.xml +++ b/config/freeswitch/freeswitch_internal.xml @@ -1,27 +1,27 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -44,18 +44,18 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchinternal 0.1 FreeSWITCH: Internal pkg_edit.php?xml=freeswitch_internal.xml&id=0 - /usr/local/pkg/freeswitch.inc + /usr/local/pkg/freeswitch.inc Settings @@ -72,7 +72,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -89,7 +89,7 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -101,7 +101,7 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -117,20 +117,20 @@ base64 off 30 - 70 + 70 33 - sync_package_freeswitch_internal(); + sync_package_freeswitch_internal(); - + - sync_package_freeswitch_internal(); + sync_package_freeswitch_internal(); \ No newline at end of file diff --git a/config/freeswitch/freeswitch_modules.xml b/config/freeswitch/freeswitch_modules.xml index 91620ac9..fd962aa3 100755 --- a/config/freeswitch/freeswitch_modules.xml +++ b/config/freeswitch/freeswitch_modules.xml @@ -1,26 +1,26 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -43,13 +43,13 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. FreeSWITCH Modules 0.2 FreeSWITCH: Modules @@ -63,8 +63,8 @@ freeswitch - freeswitch.sh - freeswitch + freeswitch.sh + freeswitch FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. @@ -83,7 +83,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -99,8 +99,8 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - - + + Public /freeswitch/freeswitch_public_includes.php @@ -112,21 +112,21 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 - installedpackages->package->$packagename->configuration->freeswitchmodules + installedpackages->package->$packagename->configuration->freeswitchmodules - + <b>Loggers</b> loggers listtopic - + mod_console mod_console Send logs to the console. @@ -141,8 +141,8 @@ disable - - + + mod_logfile mod_logfile Send logs to the local file system. @@ -158,7 +158,7 @@ - + mod_syslog mod_syslog Send logs to a remote syslog server. @@ -174,13 +174,13 @@ - + <b>Multi-Faceted</b> multi-faceted listtopic - + mod_enum mod_enum Route PSTN numbers over internet according to ENUM servers, such as e164.org. @@ -196,13 +196,13 @@ - + <b>XML Interfaces</b> xml_interfaces - listtopic + listtopic - + mod_xml_rpc mod_xml_rpc XML Remote Procedure Calls. Issue commands from your web application. @@ -218,7 +218,7 @@ - + mod_xml_curl mod_xml_curl XML Gateway Code. Configure FreeSWITCH from a web server on boot and on the fly. @@ -233,8 +233,8 @@ disable - - + + mod_xml_cdr mod_xml_cdr XML based call detail record handler. @@ -250,13 +250,13 @@ - + <b>Event Handlers</b> event_handlers listtopic - - + + mod_cdr_csv mod_cdr_csv CSV call detail record handler. @@ -272,7 +272,7 @@ - + mod_event_multicast mod_event_multicast Broadcasts events to netmask. @@ -288,7 +288,7 @@ - + mod_event_socket mod_event_socket Sends events via a single socket. @@ -303,8 +303,8 @@ disable - - + + mod_zeroconf mod_zeroconf Support for zeroconf. @@ -320,13 +320,13 @@ - + <b>Directory Interfaces</b> directory_interfaces listtopic - + mod_ldap mod_ldap LDAP module made to obtain dialplans, user accounts, etc. @@ -342,13 +342,13 @@ - + <b>Endpoints</b> endpoints listtopic - - + + mod_dingaling mod_dingaling Jabber/GoogleTalk Talk integration module. @@ -364,7 +364,7 @@ - + mod_iax mod_iax IAX2. @@ -379,8 +379,8 @@ disable - - + + mod_portaudio mod_portaudio Voice through a local soundcard. @@ -396,7 +396,7 @@ - + mod_alsa mod_alsa @@ -411,8 +411,8 @@ disable - - + + mod_sofia mod_sofia SIP module. @@ -428,7 +428,7 @@ - + mod_loopback mod_loopback A loopback channel driver to make an outbound call as an inbound call. @@ -444,7 +444,7 @@ - + mod_wanpipe mod_wanpipe T1/E1 Sangoma Card module. @@ -460,7 +460,7 @@ - + mod_woomera mod_woomera H.323/Woomera module. @@ -476,7 +476,7 @@ - + mod_openzap mod_openzap Interface to Zaptel hardware. @@ -492,13 +492,13 @@ - + <b>Applications</b> applications listtopic - - + + mod_commands mod_commands A mass plethora of API interface commands. @@ -514,7 +514,7 @@ - + mod_conference mod_conference Conference room module. @@ -530,7 +530,7 @@ - + mod_dptools mod_dptools Dialplan Tools: provides a number of apps and utilities for the dialplan. @@ -546,7 +546,7 @@ - + mod_expr mod_expr Brian Allen Vanderburgs expression evaluation library. @@ -562,7 +562,7 @@ - + mod_fax mod_fax FAX provides fax send and receive. @@ -578,7 +578,7 @@ - + mod_fifo mod_fifo FIFO provides custom call queues including call park. @@ -594,7 +594,7 @@ - + mod_voicemail mod_voicemail Full featured voicemail module. @@ -610,7 +610,7 @@ - + mod_limit mod_limit Resource limitation module. @@ -626,7 +626,7 @@ - + mod_esf mod_esf Holds the multi cast paging application for SIP. @@ -642,7 +642,7 @@ - + mod_fsv mod_fsv FreeSWITCH Video application (Recording and playback). @@ -658,13 +658,13 @@ - + <b>SNOM Module</b> snom_module listtopic - - + + mod_snom mod_snom @@ -680,13 +680,13 @@ - + <b>Dialplan Interfaces</b> dialplan_interfaces listtopic - - + + mod_dialplan_directory mod_dialplan_directory Allows you to obtain a dialplan from a directory resource. @@ -702,7 +702,7 @@ - + mod_dialplan_xml mod_dialplan_xml Allows you to program dialplans in XML format. @@ -718,7 +718,7 @@ - + mod_dialplan_asterisk mod_dialplan_asterisk Allows you to create dialplans the old-fashioned way. @@ -734,7 +734,7 @@ - + mod_yaml mod_yaml Allows you to program dialplans in YAML format. @@ -750,13 +750,13 @@ - + <b>Codec Interfaces</b> codec_interfaces listtopic - - + + mod_voipcodecs mod_voipcodecs @@ -772,7 +772,7 @@ - + mod_g723_1 mod_g723_1 G.723.1 codec. @@ -788,7 +788,7 @@ - + mod_g729 mod_g729 G729 codec is only supported in passthrough mode. @@ -804,7 +804,7 @@ - + mod_amr mod_amr amr codec. @@ -820,7 +820,7 @@ - + mod_ilbc mod_ilbc ILBC codec. @@ -836,7 +836,7 @@ - + mod_speex mod_speex Speex codec. @@ -852,7 +852,7 @@ - + mod_siren mod_siren Siren codec. @@ -867,8 +867,8 @@ disable - - + + mod_celt mod_celt Celt codec. @@ -884,7 +884,7 @@ - + mod_h26x mod_h26x H26X signed linear codec. Video Pass-thru. @@ -900,13 +900,13 @@ - + <b>File Format Interfaces</b> file_format_interfaces listtopic - - + + mod_sndfile mod_sndfile Multi-format file format transcoder (WAV, etc). @@ -922,7 +922,7 @@ - + mod_native_file mod_native_file File interface for codec specific file formats. @@ -938,13 +938,13 @@ - + <b>Streams/Files</b> streams_files listtopic - + mod_shout mod_shout mp3 files and shoutcast streams. @@ -960,7 +960,7 @@ - + mod_local_stream mod_local_stream For local streams (play all the files in a directory). @@ -976,7 +976,7 @@ - + mod_tone_stream mod_tone_stream Generate tone streams. @@ -992,13 +992,13 @@ - + <b>Languages</b> languages listtopic - + mod_spidermonkey mod_spidermonkey JavaScript support. @@ -1014,7 +1014,7 @@ - + mod_perl mod_perl Perl support. @@ -1030,7 +1030,7 @@ - + mod_python mod_python Python support. @@ -1046,7 +1046,7 @@ - + mod_java mod_java Java support. @@ -1062,7 +1062,7 @@ - + mod_lua mod_lua Lua support. @@ -1078,13 +1078,13 @@ - + <b>ASR /TTS</b> asr_tts listtopic - + mod_flite mod_flite Free open source Text to Speech. @@ -1100,7 +1100,7 @@ - + mod_pocketsphinx mod_pocketsphinx Free open source Speech Recognition. @@ -1116,7 +1116,7 @@ - + mod_cepstral mod_cepstral Links into Cepstral for dynamic sound output. Not available on this build. @@ -1132,7 +1132,7 @@ - + mod_openmrcp mod_openmrcp Module for an open MRCP implementation. @@ -1148,7 +1148,7 @@ - + mod_rss mod_rss Reads RSS feeds via a TTS engine. @@ -1164,13 +1164,13 @@ - + <b>Say</b> say listtopic - - + + mod_say_en mod_say_en @@ -1186,7 +1186,7 @@ - + mod_say_zh mod_say_zh @@ -1201,15 +1201,15 @@ disable - - + + - sync_package_freeswitch_modules(); + sync_package_freeswitch_modules(); - - sync_package_freeswitch_modules(); + + sync_package_freeswitch_modules(); diff --git a/config/freeswitch/freeswitch_public.xml b/config/freeswitch/freeswitch_public.xml index fab77635..ed633a4e 100755 --- a/config/freeswitch/freeswitch_public.xml +++ b/config/freeswitch/freeswitch_public.xml @@ -1,26 +1,26 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -43,18 +43,18 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchpublic 0.1 FreeSWITCH: Public pkg_edit.php?xml=freeswitch_public.xml&id=0 - /usr/local/pkg/freeswitch.inc + /usr/local/pkg/freeswitch.inc Settings @@ -71,7 +71,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -87,7 +87,7 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -100,7 +100,7 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -116,20 +116,20 @@ base64 off 30 - 70 + 70 33 - sync_package_freeswitch_public(); + sync_package_freeswitch_public(); - + - sync_package_freeswitch_public(); + sync_package_freeswitch_public(); \ No newline at end of file diff --git a/config/freeswitch/freeswitch_vars.xml b/config/freeswitch/freeswitch_vars.xml index ac4246b9..9a4e172c 100755 --- a/config/freeswitch/freeswitch_vars.xml +++ b/config/freeswitch/freeswitch_vars.xml @@ -1,27 +1,27 @@ - - + . - All rights reserved. - */ + FreeSWITCH (TM) + http://www.freeswitch.org/ + + part of pfSense (http://www.pfSense.com) + Copyright (C) 2007 to whom it may belong + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -44,18 +44,18 @@ 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. - */ + */ /* ========================================================================== */ - ]]> - - FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. + Describe your package requirements here + Currently there are no FAQ items provided. freeswitchvars 0.1 FreeSWITCH: Vars pkg_edit.php?xml=freeswitch_vars.xml&id=0 - /usr/local/pkg/freeswitch.inc + /usr/local/pkg/freeswitch.inc Settings @@ -72,7 +72,7 @@ External /pkg_edit.php?xml=freeswitch_external.xml&id=0 - + Gateways /freeswitch/freeswitch_gateways.php @@ -88,7 +88,7 @@ Modules /pkg_edit.php?xml=freeswitch_modules.xml&id=0 - + Public /freeswitch/freeswitch_public_includes.php @@ -100,7 +100,7 @@ Status /freeswitch/freeswitch_status.php - + Vars /pkg_edit.php?xml=freeswitch_vars.xml&id=0 @@ -117,20 +117,20 @@ base64 off 30 - 70 + 70 33 - sync_package_freeswitch_vars(); + sync_package_freeswitch_vars(); - + - sync_package_freeswitch_vars(); + sync_package_freeswitch_vars(); \ No newline at end of file -- cgit v1.2.3 From 9154cf219365944fe9b1423ac1622f2df4390849 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Fri, 6 Mar 2009 16:46:18 +0100 Subject: lo to Fit123 --- config/Fit123/bin/afc/reset_states.sh | 5 + config/Fit123/bin/code-red/all.css | 1178 +++++++++++++++++++++++++++++ config/Fit123/bin/date/index.abc | 275 +++++++ config/Fit123/bin/ltsp/services.inc | 1316 +++++++++++++++++++++++++++++++++ 4 files changed, 2774 insertions(+) create mode 100644 config/Fit123/bin/afc/reset_states.sh create mode 100644 config/Fit123/bin/code-red/all.css create mode 100644 config/Fit123/bin/date/index.abc create mode 100644 config/Fit123/bin/ltsp/services.inc (limited to 'config') diff --git a/config/Fit123/bin/afc/reset_states.sh b/config/Fit123/bin/afc/reset_states.sh new file mode 100644 index 00000000..e0d0d48b --- /dev/null +++ b/config/Fit123/bin/afc/reset_states.sh @@ -0,0 +1,5 @@ +#!/bin/sh +sleep 60 +/sbin/pfctl -F state +sleep 40 +/sbin/pfctl -F state diff --git a/config/Fit123/bin/code-red/all.css b/config/Fit123/bin/code-red/all.css new file mode 100644 index 00000000..e813ff4d --- /dev/null +++ b/config/Fit123/bin/code-red/all.css @@ -0,0 +1,1178 @@ +/* Element CSS Definitions */ +html, body, td, th, input, select { + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 0.9em; + +} + +div.GraphLink { + position: relative; +} + +span.GraphLinkLine { + position: absolute; + background-color: #990000; + width: 100%; +} + +/* DOM Tooltip CSS definitions */ +div.niceTitle +{ + background-color: #333333; + color: #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + width: 220px; + left: 0; + top: 0; + padding: 4px; + position: absolute; + text-align: left; + z-index: 20; + -moz-border-radius: 0 10px 10px 10px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); + -moz-opacity: .87; + -khtml-opacity: .87; + opacity: .87; +} +div.niceTitle h1 +{ + background: #990000; + border-bottom: 1px dotted #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + margin: 3px; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 3px; + text-align: left; + left: 0; + top: 0; + -moz-border-radius: 0 8px 0 0; + -moz-opacity: 1; +} +div.niceTitle .contents +{ + margin: 0; + padding: 0 3px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); + -moz-opacity: 1; + -khtml-opacity: 1; + opacity: 1; +} +div.niceTitle p +{ + background: #FFFFFF; + border: 1px solid #990000; + color: #000000; + font-size: 11px; + font-family: "Trebuchet MS", sans-serif; + padding: 5px; + margin: 3px; + text-align: left; + -moz-opacity: 1; + -moz-border-radius: 0 0 8px 8px; +} + +body { + margin: 0px auto; + background: url('images/background.gif') no-repeat; + background-position : center 0px; + background-color: #4a0203; +} + +form { + margin: 0px; +} +a { + text-decoration: none; +} +form input { + font-size: 1.1em; +} + +iframe { + z-index: 1; + border: 1px dashed #990000; +} +.iframe { + background-color: #FFFFFF; +} + +/* ID Based CSS Definitions */ +#wrapper { + width: 810px; + margin: 0px auto; +} + +#header { + background: url('images/header.png') no-repeat; + background-position: 0px; + height: 102px; + width: 810px; + margin-bottom: 5px; + z-index: 2; +} +#header-left { + position: relative; + /* background: url('images/logo.gif') no-repeat; */ + background-position: center; + height: 65px; + width: 145px; + left: 10px; + float: left; +} +#header-left #status-link { + position: relative; + top: 10px; + left: 6px; +} +#header-right { + position: relative; + /* background: url('images/header.gif') no-repeat; */ + height: 70px; + color: #fff; + left: 0px; + margin-left: 165px; +} +#header-right .alert { + position: relative; + /* background: url('images/alert.gif') no-repeat; */ + background-position: 4px 2px; + color: #fff; + height: 17px; + width: 500px; + padding: 4px; + padding-left: 27px; + float: left; +} +#header-right .container { + position: relative; +} +#header-right .container .left { + position: relative; + float: left; + font-size: 1.3em; + font-weight: bold; + top: 15px; + left: 4px; + display: none; +} +#header-right .container .right { + position: relative; + float: right; + top: 22px; + padding-right: 4px; + z-index: 1; +} + +#header-right .container .right #alerts { + position: relative; + background: url('images/alert_bgr.png') no-repeat; + height: 39px; + width: 431px; + z-index: 1; + padding-top: 20px; + padding-left: 5px; + margin: 0px; +} +#header-right .container .right #hostname { + position: relative; + height: 39px; + width: 431px; + z-index: 1; + padding-left: 5px; + margin: 0px; + top: 25px; + left: 230px; + font-size: 14px; + color: #990000; + font-weight: bold; +} + + + +table#marquee { + position: relative; + top: -6px; + left: -5px; + border: 0; + padding: 0; + margin: 0; + width: 424px; + background-color: transparent; + padding: 2px; + border: 0px; +} +span#marquee-container { + position: absolute; + visibility: hidden; + top: -100px; + left: -10000px; +} +div#marquee-text { + font-size: 1.18em; + font-weight: normal; + font-family: Verdana; + color: #ffffff; +} +table#marquee div#container { + position: relative; + overflow: hidden; + width: 418px; + height: 20px; +} +table#marquee div#container div#scroller { + position: absolute; + left: 0px; + top: 0px; +} + + + + + +#content { + position: relative; + top: -5px; + left: 0px; + margin-top: 0px; + margin-left: 0px; + padding-top: 0px; + width: 810px; + background-color: #ffffff; +} + +#left { + width: 810px; + height: 1px; +} +#right { + position: relative; + top: -10px; + width: 770px; + margin-top: 0px; + margin-left: 5px; + margin-right: 5px; + padding-top: 5px; + padding-left: 10px; + padding-right: 10px; + padding-bottom: 20px; + min-height: 400px; +} + +#footer { + position: relative; + background: url('images/footer.png') no-repeat; + top: -18px; + left: 0px; + width: 810px; + height: 75px; + color: #999999; + text-align: center;; + font-size: 0.9em; + padding-top: 17px; + margin-bottom: 20px; + clear: both; +} +#footer p { + padding: 0px; + margin: 0px; +} + +/* Style the List */ +#navigation { + /* background: url('images/menu.gif') no-repeat; */ + /* width: 693px; */ + position: relative; + top: -35px; + left: 3px; + width: 810px; + padding: 0px; + height: 28px; + z-index: 3; +} +#navigation ul { + padding: 0; + margin: 0; + list-style: none; + text-align: center; +} +#navigation ul#menu { + padding-top: 3px; + padding-left: 5px; +} + +/* Style the List Elements */ +#navigation ul li { + float: left; + position: relative; + /* width: 7.5em; */ + width: 8.77em; +} +#navigation ul li div { + font-size: 1em; + font-weight: bold; +} +/* Make the List inside the List Elements */ +/* initially hidden with absolute position */ +#navigation ul li ul { + display: none; + position: absolute; + top: 2em; + left: -2px; + width: 9em; + font-weight: normal; + background: transparent bottom left no-repeat; /* This is key to making the menu maintain visibility when not on a link */ + /* background-color: #202020; + background: url("images/menu_footer.gif") no-repeat; + background-position: bottom; + */ + padding: 0em 0 0.4em 0; + padding-top: 0.3em; +} +/* to override top and left in browsers other than IE */ +/* which will position to the top right of the containing */ +/* li, rather than bottom left */ +#navigation ul li > ul { + top: auto; + left: auto; + left: -1px !important; +} +/* Show initial drop down upon mouse over, but do not show */ +/* nested side drop menus within listed elements */ +#navigation ul li:hover ul { + display: block; + cursor: pointer; +} +#navigation ul li:hover { + cursor: pointer; + cursor: pointer; +} +#navigation ul li:hover div { + text-decoration: none; +} + +#navigation ul li { + background-color: transparent; + color: #FFF; +} +#navigation ul li ul li { + border: 1px solid #990000; + width: 8.8em; + height: 1.6em; + line-height: 1.6em; + background-color: #990000; + color: #FFF; +} +#navigation ul li ul li:hover { + background-color: #666666; +} + +#navigation li li a { + display: block; + padding-left: 10px; + padding-right: 10px; +} + +#navigation ul li ul li a.navlnk:hover { + text-decoration: none; +} +#navigation ul li.first { + border-right: 0px; +} +#navigation ul li.middle { + border-right: 0px; +} +#navigation ul li.last { + +} + +#navigation ul li.dropfirst { + border-bottom: 0px; +} +#navigation ul li.dropmiddle { + border-bottom: 0px; +} +#navigation ul li.droplast { +} + +#wzdtabcont { + float: left; + background-color: #FFFFFF; + color: #000000; + padding: 0; +} + +ul#wzdnav { + font-size: 0.96em; + float: left; + width: 14.5em; + margin: 0; + padding-left: 18px; +} + +ul#wzdnav li { + list-style: none; + margin: 0; + padding-bottom: 0.2em; + padding-left: 0; +} + +ul#wzdnav a { + display: block; + padding: 0.3em; + font-weight: normal; +} + +#wzdnavbold a { + display: block; + padding: 0.3em; + font-weight: bold ! important; +} + +ul#wzdnav a:link { + color: black; + background-color: #eee; +} + +ul#wzdnav a:visited { + color: #666; + background-color: #eee; +} + +ul#wzdnav a:hover { + color: black; + background-color: white; +} + +ul#wzdnav a:active { + color: white; + background-color: gray; +} + +#graph { + position: relative; + z-index: 10; +} + +#logoutbtn { + position: absolute; + left: 95%; + vertical-align: middle; +} + + +#graph { + position: relative; + z-index: 10; +} + + + +/* Class Based CSS Definitions */ +.pgtitle { + font-size: 18px; + color: #777777; + font-weight: bold; +} +.tfrtitle { + font-size: 18px; + color: #ffffff; + font-weight: bold; +} +.vncell { + background-color: #DDDDDD; + padding-right: 20px; + padding-left: 8px; + border-bottom: 1px solid #999999; +} +.formfld { + font-size: small; +} +.formselect { + font-size: 1.0em; +} +.langopt { + padding-left: 34px; + padding-top: 2px; + padding-bottom: 2px; +} +.saved { + /* background: url('/themes/nione/images/icons/icon_wzd_saved.png') no-repeat 0 1px #FFFFFF; */ + list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_saved.png') ! important; +} +.notsaved { + /* background: url('/themes/nione/images/icons/icon_wzd_nsaved.png') no-repeat 0 1px #FFFFFF; */ + list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_nsaved.png') ! important; +} +.en { + background: url('/themes/nervecenter/images/icons/icon_flag_en.png') no-repeat 0 1px #FFFFFF; +} +.de { + background: url('/themes/nervecenter/images/icons/icon_flag_de.png') no-repeat 0 1px #FFFFFF; +} +.es { + background: url('/themes/nervecenter/images/icons/icon_flag_es.png') no-repeat 0 1px #FFFFFF; +} +.pt_BR { + background: url('/themes/nervecenter/images/icons/icon_flag_pt_BR.png') no-repeat 0 1px #FFFFFF; +} +.host { + background: url('/themes/nervecenter/images/icons/icon_frmfld_host.png') no-repeat 0 1px #FFFFFF; +} +.search { + background: url('/themes/nervecenter/images/icons/icon_frmfld_search.png') no-repeat 0 1px #FFFFFF; +} +.file { + background: url('/themes/nervecenter/images/icons/icon_frmfld_file.png') no-repeat 0 1px #FFFFFF; +} +.mail { + background: url('/themes/nervecenter/images/icons/icon_frmfld_mail.png') no-repeat 0 1px #FFFFFF; +} +.imp { + background: url('/themes/nervecenter/images/icons/icon_frmfld_imp.png') no-repeat 0 1px #FFFFFF; +} +.pwd { + background: url('/themes/nervecenter/images/icons/icon_frmfld_pwd.png') no-repeat 0 1px #FFFFFF; +} +.user { + background: url('/themes/nervecenter/images/icons/icon_frmfld_user.png') no-repeat 0 1px #FFFFFF ; +} +.group { + background: url('/themes/nervecenter/images/icons/icon_frmfld_group.png') no-repeat 0 1px #FFFFFF; +} +.url { + background: url('/themes/nervecenter/images/icons/icon_frmfld_url.png') no-repeat 0 1px #FFFFFF; +} +.time { + background: url('/themes/nervecenter/images/icons/icon_frmfld_time.png') no-repeat 0 1px #FFFFFF; +} +.unknown { + background: url('/themes/nervecenter/images/icons/icon_frmfld_unknown.png') no-repeat 0 1px #FFFFFF; +} +.formfld_cert { + background: url('/themes/nervecenter/images/icons/icon_frmfld_cert.png') no-repeat 0 1px #FFFFFF; + padding-left: 28px; + font-family: Courier New, Courier, monospaced; + font-size: 11px; +} +.formfldalias { + background-color: #990000; + color: #FFFFFF; +} +.formpre { + font-family: Courier New, Courier, monospaced; + font-size: 10px; +} +.formbtn { + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: bold; +} +.formbtns { + font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; +} +.vvcell { + background-color: #FFFFC6; +} +.errmsg { + font-weight: bold; + color: #CC0000; +} +.red { + color: #CC0000; +} +.gray { + color: #A0A0A0; +} +.vexpl { + font-size: 11px; +} +.navlnk { + color: #FFFFFF; + text-decoration: none; + font-size: 13px; +} +.navlnks { + color: #FFFFFF; + text-decoration: none; + font-size: 11px; +} +.redlnk { + color: #990000; + text-decoration: none; +} +.tblnk { + color: #999999; + text-decoration: none; +} +.vncellreq { + background-color: #DDDDDD; + padding-right: 20px; + padding-left: 8px; + font-weight: bold; + border-bottom: 1px solid #999999; +} +.vncellt { + background-color: #DDDDDD; + padding-right: 20px; + padding-left: 8px; + padding-top: 4px; + padding-bottom: 4px; + font-weight: bold; + border-bottom: 1px solid #999999; +} +.vtable { + border-bottom: 1px solid #999999; +} +.vnsepcell { + background-color: #BBBBBB; + padding-right: 20px; + padding-left: 8px; + font-weight: bold; + border-bottom: 1px solid #999999; + font-size: 11px; +} +.cpline { + font-size: 11px; + color: #FFFFFF; +} +.hostname { + font-size: 11px; + color: #990000; + font-weight: bold; +} +.vnsepcellr { + background-color: #BBBBBB; + padding-right: 20px; + padding-left: 8px; + font-weight: bold; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; +} +.listr { + background-color: #FFFFFF; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + padding-right: 6px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +.listrpad { + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + padding-right: 16px; + padding-left: 10px; + padding-top: 8px; + padding-bottom: 8px; +} +.listn { + font-size: 11px; + padding-right: 16px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +.listbg { + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + background-color: #990000; + color: #FFFFFF; + padding-right: 16px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +.listbggrey { + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + background-color: #999999; + padding-right: 16px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +.listhdr { + background-color: #BBBBBB; + padding-right: 16px; + padding-left: 6px; + font-weight: bold; + border-bottom: 1px solid #999999; + font-size: 11px; + padding-top: 5px; + padding-bottom: 5px; +} +.listhdr a { + color: #000000; +} +.listhdrr { + background-color: #BBBBBB; + padding-right: 16px; + padding-left: 6px; + font-weight: bold; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + padding-top: 5px; + padding-bottom: 5px; +} +.listhdrr a { + color: #000000; +} +.listlr { + background-color: #FFFFFF; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + border-left: 1px solid #999999; + font-size: 11px; + padding-right: 6px; + padding-left: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +.listlrns { + background-color: #FFFFFF; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + border-left: 1px solid #999999; + font-size: 11px; + padding-top: 4px; + padding-bottom: 4px; +} +.list { + font-size: 11px; + padding-left: 6px; + padding-top: 2px; + padding-bottom: 2px; +} +.listt { + font-size: 11px; + padding-top: 5px; +} +.listhdrrns { + background-color: #BBBBBB; + padding-left: 6px; + padding-top: 5px; + padding-bottom: 5px; + padding-right: 6px; + font-weight: bold; + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; +} +.listbgns { + border-right: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 11px; + background-color: #D9DEE8; + padding-left: 6px; + padding-right: 4px; + padding-top: 4px; + padding-bottom: 4px; +} +.listtopic { + border-right: 1px solid #999999; + font-size: 11px; + background-color: #990000; + padding-right: 16px; + padding-left: 6px; + color: #FFFFFF; + font-weight: bold; + padding-top: 5px; + padding-bottom: 5px; +} +.optsect_t { + border-right: 1px solid #999999; + background-color: #990000; + padding-right: 6px; + padding-left: 6px; + padding-top: 2px; + padding-bottom: 2px; +} +.optsect_s { + font-size: 11px; + color: #FFFFFF; + font-weight: bold; +} +.tabnavtbl { +} + + +/* MISC CSS Definitions */ +ul#tabnav { + font-size: 11px; + font-weight: bold; + list-style-type: none; + margin: 0; + padding: 0; +} +ul#tabnav li.tabinact1 { + float: left; + background-color: #777777; + color: #FFFFFF; + padding: 0; + white-space: nowrap; +} +ul#tabnav li.tabinact { + float: left; + border-left: 1px solid #999999; + background-color: #777777; + color: #FFFFFF; + padding: 0; + white-space: nowrap; +} +ul#tabnav li.tabinact a { + float: left; + display: block; + text-decoration: none; + padding: 5px 8px 5px 8px; + color: #FFFFFF; +} +ul#tabnav li.tabinact1 a { + float: left; + display: block; + text-decoration: none; + padding: 5px 8px 5px 8px; + color: #FFFFFF; +} +ul#tabnav li.tabact { + float: left; + background-color: #EEEEEE; + color: #000000; + padding: 5px 8px 5px 8px; + white-space: nowrap; +} +.tabcont { + background-color: #EEEEEE; + padding-right: 12px; + padding-left: 12px; + padding-top: 12px; + padding-bottom: 12px; +} +.tabact { + float: left; + background-color: #EEEEEE; + color: #000000; + padding: 5px 8px 5px 8px; + white-space: nowrap; +} +.tabinact { + font-weight: bold; + float: left; + border-left: 1px solid #999999; + background-color: #777777; + color: #FFFFFF; + padding: 0; + white-space: nowrap; +} +.menu { + background-color: #000000; + white-space: nowrap; + padding: 0px 5px 0px 5px; + width: 100%; + vertical-align: top; +} + + +/* Auto Complete Suggestions */ +div.suggestions { + -moz-box-sizing: border-box; + /* box-sizing: border-box; */ + border: 1px solid black; + position: absolute; + background-color: #990000; + color: #FFF; +} + +div.suggestions div { + cursor: default; + padding: 0px 3px; + background-color: #990000; + color: #FFF; +} + +div.suggestions div.current { + background-color: #3366cc; + color: #FFF; +} +/* End Auto Complete Suggestions */ + + +/* Nifty Corners Crap */ +.rtop,.artop{display:block} +.rtop *,.artop *{display:block;height:1px;overflow:hidden;font-size:1px} +.artop *{border-style: solid;border-width:0 1px} +.r1,.rl1,.re1,.rel1{margin-left:5px} +.r1,.rr1,.re1,.rer1{margin-right:5px} +.r2,.rl2,.re2,.rel2,.ra1,.ral1{margin-left:3px} +.r2,.rr2,.re2,.rer2,.ra1,.rar1{margin-right:3px} +.r3,.rl3,.re3,.rel3,.ra2,.ral2,.rs1,.rsl1,.res1,.resl1{margin-left:2px} +.r3,.rr3,.re3,.rer3,.ra2,.rar2,.rs1,.rsr1,.res1,.resr1{margin-right:2px} +.r4,.rl4,.rs2,.rsl2,.re4,.rel4,.ra3,.ral3,.ras1,.rasl1,.res2,.resl2{margin-left:1px} +.r4,.rr4,.rs2,.rsr2,.re4,.rer4,.ra3,.rar3,.ras1,.rasr1,.res2,.resr2{margin-right:1px} +.rx1,.rxl1{border-left-width:5px} +.rx1,.rxr1{border-right-width:5px} +.rx2,.rxl2{border-left-width:3px} +.rx2,.rxr2{border-right-width:3px} +.re2,.rel2,.ra1,.ral1,.rx3,.rxl3,.rxs1,.rxsl1{border-left-width:2px} +.re2,.rer2,.ra1,.rar1,.rx3,.rxr3,.rxs1,.rxsr1{border-right-width:2px} +.rxl1,.rxl2,.rxl3,.rxl4,.rxsl1,.rxsl2,.ral1,.ral2,.ral3,.ral4,.rasl1,.rasl2{border-right-width:0} +.rxr1,.rxr2,.rxr3,.rxr4,.rxsr1,.rxsr2,.rar1,.rar2,.rar3,.rar4,.rasr1,.rasr2{border-left-width:0} +.r4,.rl4,.rr4,.re4,.rel4,.rer4,.ra4,.rar4,.ral4,.rx4,.rxl4,.rxr4{height:2px} +.rer1,.rel1,.re1,.res1,.resl1,.resr1{border-width:1px 0 0;height:0px !important;height /**/:1px} +/* End Nifty Corners Crap */ + +/* Widget CSS */ +.widgetsubheader { + border-right: 1px solid #999999; + font-size: 11px; + background-color: #999999; + padding-right: 6px; + padding-left: 6px; + color: #FFFFFF; + font-weight: bold; + padding-top: 5px; + padding-bottom: 5px; +} +.widgetheader { + border-right: 1px solid #999999; + font-size: 11px; + background-color: #990000; + padding-right: 6px; + padding-left: 6px; + color: #FFFFFF; + font-weight: bold; + padding-top: 5px; + padding-bottom: 5px; +} +.widgetdiv{ + margin:5px; + padding: 5px; + background:#CCCCCC; +} + +/* CSS for Dynamic Log Viewer */ +/* Author: Erik Kristensen */ +div#log div.log-entry { + clear: both; +} + +div#log div.log-entry span, +div#log div.log-header span { + padding: 3px 2px 3px 2px; + padding-left: 8px; +} + +div#log div.log-entry span.log-action { + padding-bottom: 6px; + padding-left: 5px; + padding-right: 5px; +} + +div#log div.log-header span { + border-top: 1px solid #999; + background-color: #bbb; + font-weight: bold; + text-align: left; +} + +div#log span.log-action, +div#log span.log-time, +div#log span.log-interface, +div#log span.log-source, +div#log span.log-destination, +div#log span.log-protocol { + float: left; + text-align: left; + border-left: 1px solid #999; + border-bottom: 1px solid #999; +} + +div#log span.log-general { + +} + +div#log span.log-protocol { + border-right: 1px solid #999; +} + +div#log span.log-action { + width: 2em; + text-align: center; +} + +div#log span.log-time { + width: 12.5em; +} + +div#log span.log-interface { + width: 5em; +} + +div#log span.log-source, +div#log span.log-destination { + width: 17.6em; +} + +div#log span.log-protocol { + width: 5.5em; +} +/* END CSS FOR DYNAMIC LOG VIEWER */ + +#login { + background: #cccccc; + border: 0px solid #666666; + margin: 5em auto; + padding: 0em; + width: 340px; +} + +#login h1 { + background: url(images/misc/logon.png) no-repeat top left; + margin-top: 0; + display: block; + text-indent: -1000px; + height: 50px; + border-bottom: none; +} + +#login p { + font-size: 1em; + font-weight: bold; + padding: 3px; + margin: 0em; + text-indent: 10px; +} + +#login span { + font-size: 1em; + font-weight: bold; + width: 20%; + padding: 3px; + margin: 0em; + text-indent: 10px; +} + +#login p#text { + font-size: 1em; + font-weight: normal; + padding: 3px; + margin: 0em; + text-indent: 10px; +} + +#login #submit { + font-size: 1em; + font-weight: bold; + padding: 3px; + margin: 0em; + text-indent: 10px; +} + +/* Widget CSS */ +.widgetsubheader { + border-right: 1px solid #999999; + font-size: 11px; + background-color: #B1B1B1; + padding-right: 6px; + padding-left: 6px; + color: #000000; + font-weight: bold; + padding-top: 5px; + padding-bottom: 5px; +} +.widgetheader { + border-right: 1px solid #999999; + font-size: 11px; + background-color: #990000; + padding-right: 6px; + padding-left: 6px; + color: #FFFFFF; + font-weight: bold; + padding-top: 5px; + padding-bottom: 5px; +} +.widgetdiv{ + margin:5px; + padding: 5px; + background:#CCCCCC; +} +.widgetconfigdiv{ + background:#BBBBBB; + font-size: 11px; + color: #000000; + padding-right: 5px; + padding-left: 5px; + padding-top: 5px; + padding-bottom: 5px; +} + +div#log div.log-entry-mini { + clear: both; +} + +div#log div.log-entry-mini span { + padding: 2px 2px 2px 2px; + padding-left: 8px; +} + +div#log span.log-action-mini-header, +div#log span.log-interface-mini-header, +div#log span.log-source-mini-header, +div#log span.log-destination-mini-header, +div#log span.log-protocol-mini-header { + float: left; + text-align: left; + background-color: #FFFFFF; + font-size: 12px; + border-left: 1px solid #999; + border-bottom: 1px solid #999; +} + +div#log span.log-action-mini, +div#log span.log-time-mini, +div#log span.log-interface-mini, +div#log span.log-source-mini, +div#log span.log-destination-mini, +div#log span.log-protocol-mini { + float: left; + text-align: left; + background-color: #FFFFFF; + font-size: 11px; + border-left: 1px solid #999; + border-bottom: 1px solid #999; +} + +div#log span.log-action-mini, +div#log span.log-action-mini-header { + width: 6%; +} + +div#log span.log-interface-mini, +div#log span.log-interface-mini-header { + width: 8%; +} + +div#log span.log-source-mini, +div#log span.log-destination-mini, +div#log span.log-source-mini-header, +div#log span.log-destination-mini-header { + width: 31%; +} + +div#log span.log-protocol-mini, +div#log span.log-protocol-mini-header { + width: 8%; + border-right: 1px solid #999; +} diff --git a/config/Fit123/bin/date/index.abc b/config/Fit123/bin/date/index.abc new file mode 100644 index 00000000..73a81fa1 --- /dev/null +++ b/config/Fit123/bin/date/index.abc @@ -0,0 +1,275 @@ +. + 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. +*/ + + ## Load Essential Includes + require_once('guiconfig.inc'); + require_once('notices.inc'); + + + ## Load Functions Files + require_once('includes/functions.inc.php'); + + + ## Load AJAX, Initiate Class ############################################### + require_once('includes/sajax.class.php'); + + ## Initiate Class and Set location of ajax file containing + ## the information that we need for this page. Also set functions + ## that SAJAX will be using. + $oSajax = new sajax(); + $oSajax->sajax_remote_uri = 'sajax/index.sajax.php'; + $oSajax->sajax_request_type = 'POST'; + $oSajax->sajax_export("get_stats"); + $oSajax->sajax_handle_client_request(); + ############################################################################ + + + ## Check to see if we have a swap space, + ## if true, display, if false, hide it ... + if(file_exists("/usr/sbin/swapinfo")) { + $swapinfo = `/usr/sbin/swapinfo`; + if(stristr($swapinfo,'%') == true) $showswap=true; + } + + + ## User recently restored his config. + ## If packages are installed lets resync + if(file_exists('/conf/needs_package_sync')) { + if($config['installedpackages'] <> '') { + conf_mount_rw(); + unlink('/conf/needs_package_sync'); + header('Location: pkg_mgr_install.php?mode=reinstallall'); + exit; + } + } + + + ## If it is the first time webGUI has been + ## accessed since initial install show this stuff. + if(file_exists('/conf/trigger_initial_wizard')) { + + echo << + + + {$g['product_name']}.local - {$g['product_name']} first time setup + + + + + +EOF; + echo "\n"; + + if(file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css")) + echo "\n"; + else + echo ""; + + echo "
\n"; + echo "
\n"; + echo "

\n"; + echo "

\n"; + echo "Welcome to {$g['product_name']}!

\n"; + echo "One moment while we start the initial setup wizard.

\n"; + echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.

\n"; + echo "To bypass the wizard, click on the {$g['product_name']} logo on the initial page.\n"; + echo "

\n"; + echo "\n"; + echo "\n"; + exit; + } + + + ## Find out whether there's hardware encryption or not + unset($hwcrypto); + $fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r"); + if ($fd) { + while (!feof($fd)) { + $dmesgl = fgets($fd); + if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) { + $hwcrypto = $matches[1]; + break; + } + } + fclose($fd); + } + + + ## Set Page Title and Include Header + $pgtitle = "{$g['product_name']} webGUI"; + include("head.inc"); + +?> + + + +

"; +?> + +

System Overview

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
System information
Name
Version + +
+ built on +
Platform / Current Date /
Hardware crypto
Uptime
Last config change
State table size + +
+ Show states +
MBUF Usage + + / +
CPU usage + + left barred bargray barright bar +   + +
Memory usage + + left barred bargray barright bar +   + +
SWAP usage + + left barred bargray barright bar +   + +
Temperature + + /images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" />/images/misc/bar_blue.gif" height="15" name="tempwidtha" id="tempwidtha" width="" border="0" align="middle" alt="red bar" />/images/misc/bar_gray.gif" height="15" name="tempwidthb" id="tempwidthb" width="" border="0" align="middle" alt="gray bar" />/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /> +   + " /> +
Disk usage + + /images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" />/images/misc/bar_blue.gif" height="15" width="" border="0" align="middle" alt="red bar" />/images/misc/bar_gray.gif" height="15" width="" border="0" align="middle" alt="gray bar" />/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /> +   + +
+ + + + + + + + + diff --git a/config/Fit123/bin/ltsp/services.inc b/config/Fit123/bin/ltsp/services.inc new file mode 100644 index 00000000..a788a2b3 --- /dev/null +++ b/config/Fit123/bin/ltsp/services.inc @@ -0,0 +1,1316 @@ +. + 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. +*/ + +/* include all configuration functions */ +require_once("functions.inc"); + +function load_balancer_use_sticky() { + global $config, $g; + if (isset ($config['system']['lb_use_sticky'])) + touch("/var/etc/use_pf_pool__stickyaddr"); + else + unlink_if_exists("/var/etc/use_pf_pool__stickyaddr"); +} + +function services_dhcpd_configure() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dhcpd_configure($if) being called $mt\n"; + } + + /* if OLSRD is enabled, allow WAN to house DHCP. */ + if($config['installedpackages']['olsrd']) + foreach($config['installedpackages']['olsrd']['config'] as $olsrd) + if($olsrd['enable']) + $is_olsr_enabled = true; + + /* configure DHCPD chroot */ + $fd = fopen("/tmp/dhcpd.sh","w"); + $status = `mount | grep "{$g['dhcpd_chroot_path']}/dev"`; + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/dev\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/etc\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n"); + fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n"); + fwrite($fd, "chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n"); + fwrite($fd, "cp /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n"); + fwrite($fd, "cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n"); + fwrite($fd, "chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n"); + if(!trim($status)) + fwrite($fd, "mount -t devfs devfs {$g['dhcpd_chroot_path']}/dev\n"); + fclose($fd); + mwexec("/bin/sh /tmp/dhcpd.sh"); + + /* kill any running dhcpd */ + if(is_process_running("dhcpd")) + mwexec("killall dhcpd", true); + + $syscfg = $config['system']; + $dhcpdcfg = $config['dhcpd']; + + /* DHCP enabled on any interfaces? */ + $dhcpdenable = false; + if(is_array($dhcpdcfg)) + foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) { + if (isset($dhcpifconf['enable']) && + (($dhcpif == "lan") || + (isset($config['interfaces'][$dhcpif]['enable']) && + $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge'])))) + $dhcpdenable = true; + if (isset($dhcpifconf['enable']) && + (($dhcpif == "wan") || (isset($config['interfaces'][$dhcpif]['enable']) && + $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge'])))) + $dhcpdenable = true; + } + + if (!$dhcpdenable) + return 0; + + if ($g['booting']) + echo "Starting DHCP service..."; + else + sleep(1); + + /* write dhcpd.conf */ + $fd = fopen("{$g['dhcpd_chroot_path']}/etc/dhcpd.conf", "w"); + if (!$fd) { + printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n"); + return 1; + } + + + + $dhcpdconf = << $dhcpifconf) { + if($dhcpifconf['failover_peerip'] <> "") { + /* + * yep, failover peer is defined. + * does it match up to a defined vip? + */ + $skew = 110; + $a_vip = &$config['virtualip']['vip']; + if(is_array($a_vip)) { + foreach ($a_vip as $vipent) { + $int = guess_interface_from_ip($dhcpifconf['failover_peerip']); + $intip = find_interface_ip($int); + $real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif); + if($int == $real_dhcpif) { + /* this is the interface! */ + if($vipent['advskew'] < "20") + $skew = 0; + } + } + } else { + log_error("Warning! DHCP Failover setup and no CARP virtual IP's defined!"); + } + if($skew > 10) { + $type = "secondary"; + $dhcpdconf_pri = "mclt 600;\n"; + $my_port = "520"; + $peer_port = "519"; + } else { + $my_port = "519"; + $peer_port = "520"; + $type = "primary"; + $dhcpdconf_pri = "split 128;\n"; + $dhcpdconf_pri .= " mclt 600;\n"; + } + $dhcpdconf .= << $dhcpifconf) { + + $ifcfg = $config['interfaces'][$dhcpif]; + + if (!isset($dhcpifconf['enable']) || + ($ifcfg['ipaddr'] == "dhcp") || + (($dhcpif != "lan") && + (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge']))) + continue; + + if($dhcpif == "lan" && $ifcfg['bridge']) + log_error("NOTE: DHCP Server on LAN is enabled."); + + $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']); + $subnetmask = gen_subnet_mask($ifcfg['subnet']); + + if($is_olsr_enabled == true) + if($dhcpifconf['netmask']) + $subnetmask = gen_subnet_mask($dhcpifconf['netmask']); + + $dnscfg = ""; + + if ($dhcpifconf['domain']) { + $dnscfg .= " option domain-name \"{$dhcpifconf['domain']}\";\n"; + } + if (isset($dhcpifconf['ddnsupdate'])) { + if($dhcpifconf['ddnsdomain'] <> "") { + $dnscfg .= " ddns-domainname \"{$dhcpifconf['ddnsdomain']}\";\n"; + } + $dnscfg .= " ddns-update-style interim;\n"; + } + + + if (is_array($dhcpifconf['dnsserver']) && ($dhcpifconf['dnsserver'][0])) { + $dnscfg .= " option domain-name-servers " . join(",", $dhcpifconf['dnsserver']) . ";"; + } else if (isset($config['dnsmasq']['enable'])) { + $dnscfg .= " option domain-name-servers " . $ifcfg['ipaddr'] . ";"; + } else if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) { + $dnscfg .= " option domain-name-servers " . join(",", $syscfg['dnsserver']) . ";"; + } + + $dhcpdconf .= "subnet $subnet netmask $subnetmask {\n"; + $dhcpdconf .= " pool {\n"; + + /* is failover dns setup? */ + if (is_array($dhcpifconf['dnsserver']) && $dhcpifconf['dnsserver'][0] <> "") { + $dhcpdconf .= " option domain-name-servers {$dhcpifconf['dnsserver'][0]}"; + if($dhcpifconf['dnsserver'][1] <> "") + $dhcpdconf .= ",{$dhcpifconf['dnsserver'][1]}"; + $dhcpdconf .= ";\n"; + } + + if($dhcpifconf['failover_peerip'] <> "") + $dhcpdconf .= " deny dynamic bootp clients;\n"; + + if (isset($dhcpifconf['denyunknown'])) + $dhcpdconf .= " deny unknown clients;\n"; + + if ($dhcpifconf['gateway']) + $routers = $dhcpifconf['gateway']; + else + $routers = $ifcfg['ipaddr']; + + if($dhcpifconf['failover_peerip'] <> "") { + $dhcpdconf .= " failover peer \"dhcp{$dhcpnum}\";\n"; + $dhcpnum++; + } + + $dhcpdconf .= << "") && ($dhcpifconf['filename'] <> "")) { + $dhcpdconf .= " next-server {$dhcpifconf['next-server']};\n"; + $dhcpdconf .= " filename \"{$dhcpifconf['filename']}\";\n"; + } + if ($dhcpifconf['rootpath'] <> "") { + $dhcpdconf .= " option root-path \"{$dhcpifconf['rootpath']}\";\n"; + } + } + $dhcpdconf .= << /dev/null 2>&1 "); + if (is_array($config['dhcpd'][$if]['staticmap'])) { + + foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) { + mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac'])); + log_error("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac'])); + } + + } + } else { + mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " ); + mwexec("/usr/sbin/arp -da > /dev/null 2>&1 "); + } + + return 0; +} + +function services_dhcrelay_configure() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dhcrelay_configure() being called $mt\n"; + } + + /* kill any running dhcrelay */ + killbypid("{$g['varrun_path']}/dhcrelay.pid"); + + $dhcrelaycfg = $config['dhcrelay']; + + /* DHCPRelay enabled on any interfaces? */ + $dhcrelayenable = false; + if(is_array($dhcrelaycfg)) { + foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) { + if (isset($dhcrelayifconf['enable']) && + (($dhcrelayif == "lan") || + (isset($config['interfaces'][$dhcrelayif]['enable']) && + $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge'])))) + $dhcrelayenable = true; + } + } + + if (!$dhcrelayenable) + return 0; + + if ($g['booting']) + echo "Starting DHCP relay service..."; + else + sleep(1); + + $dhcrelayifs = array(); + foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) { + + $ifcfg = $config['interfaces'][$dhcrelayif]; + + if (!isset($dhcrelayifconf['enable']) || + (($dhcrelayif != "lan") && + (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge']))) + continue; + + $dhcrelayifs[] = $ifcfg['if']; + } + + /* In order for the relay to work, it needs to be active on the + interface in which the destination server sits */ + foreach ($config['interfaces'] as $ifname) { + $subnet = $ifname['ipaddr'] . "/" . $ifname['subnet']; + if (ip_in_subnet($dhcrelaycfg['server'],$subnet)) + $destif = $ifname['if']; + } + + if (!isset($destif)) + $destif = $config['interfaces']['wan']['if']; + + $dhcrelayifs[] = $destif; + $dhcrelayifs = array_unique($dhcrelayifs); + + /* fire up dhcrelay */ + $cmd = "/usr/local/sbin/dhcrelay -i " . join(" -i ", $dhcrelayifs); + + if (isset($dhcrelaycfg['agentoption'])) + $cmd .= " -a -m replace"; + + $cmd .= " {$dhcrelaycfg['server']}"; + mwexec($cmd); + + if (!$g['booting']) { + /* set the reload filter dity flag */ + touch("{$g['tmp_path']}/filter_dirty"); + } + + return 0; +} + +function services_dyndns_reset() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dyndns_reset() being called $mt\n"; + } + + if (file_exists("{$g['vardb_path']}/ez-ipupdate.cache")) { + conf_mount_rw(); + unlink("{$g['vardb_path']}/ez-ipupdate.cache"); + conf_mount_ro(); + } + + if (file_exists("{$g['conf_path']}/ez-ipupdate.cache")) { + conf_mount_rw(); + unlink("{$g['conf_path']}/ez-ipupdate.cache"); + conf_mount_ro(); + } + + if (file_exists("{$g['conf_path']}/dyndns.cache")) { + conf_mount_rw(); + unlink("{$g['conf_path']}/dyndns.cache"); + conf_mount_ro(); + } + + return 0; +} + +function services_dyndns_configure() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dyndns_configure() being called $mt\n"; + } + + $dyndnscfg = $config['dyndns']; + $wancfg = $config['interfaces']['wan']; + + if (isset($dyndnscfg['enable'])) { + + if ($g['booting']) { + echo "Starting DynDNS client..."; + if(isset($config['system']['use_old_dyndns'])) { + echo " [Using ez-ipupdate] "; + services_dyndns_configure_old(); + return; + } + } else { + sleep(1); + if(isset($config['system']['use_old_dyndns'])) { + services_dyndns_configure_old(); + return; + } + } + + /* load up the dyndns.class */ + require_once("dyndns.class"); + + log_error("DynDns: Running updatedns()"); + + /* determine WAN interface name */ + $wanif = get_real_wan_interface(); + /* get ip */ + $ip = find_interface_ip($wanif); + + $dns = new updatedns($dnsService = $config['dyndns']['type'], + $dnsHost = $config['dyndns']['host'], + $dnsUser = $config['dyndns']['username'], + $dnsPass = $config['dyndns']['password'], + $dnsWilcard = $config['dyndns']['wildcard'], + $dnsMX = $config['dyndns']['mx']); + + if ($g['booting']) + echo "done.\n"; + } + + return 0; +} + +function services_dyndns_configure_old() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dyndns_configure_old() being called $mt\n"; + } + + /* kill any running ez-ipupdate */ + /* ez-ipupdate needs SIGQUIT instead of SIGTERM */ + sigkillbypid("{$g['varrun_path']}/ez-ipupdate.pid", "QUIT"); + + $dyndnscfg = $config['dyndns']; + $wancfg = $config['interfaces']['wan']; + + if (isset($dyndnscfg['enable'])) { + + if ($g['booting']) + echo "Starting DynDNS client..."; + else + sleep(1); + + /* determine WAN interface name */ + $wanif = get_real_wan_interface(); + + /* write ez-ipupdate.conf */ + $fd = fopen("{$g['varetc_path']}/ez-ipupdate.conf", "w"); + if (!$fd) { + printf("Error: cannot open ez-ipupdate.conf in services_dyndns_configure().\n"); + return 1; + } + + $ezipupdateconf = << $paents) { + if ($paif == "wan" && !(is_ipaddr($config['interfaces']['wan']['ipaddr']) || + ($config['interfaces']['wan']['ipaddr'] == "dhcp") || + ($config['interfaces']['wan']['ipaddr'] == "bigpond"))) + continue; + + $args = $config['interfaces'][$paif]['if'] . " auto"; + + foreach ($paents as $paent) { + + if (isset($paent['subnet'])) + $args .= " " . escapeshellarg("{$paent['subnet']}/{$paent['subnet_bits']}"); + else if (isset($paent['range'])) + $args .= " " . escapeshellarg($paent['range']['from'] . "-" . + $paent['range']['to']); + } + + mwexec_bg("/usr/local/sbin/choparp " . $args); + } + } +} + +function services_dnsupdate_process() { + global $config, $g; + if(isset($config['system']['developerspew'])) { + $mt = microtime(); + echo "services_dnsupdate_process() being called $mt\n"; + } + + /* Dynamic DNS updating active? */ + if (isset($config['dnsupdate']['enable'])) { + + $wanip = get_current_wan_address(); + if ($wanip) { + + $keyname = $config['dnsupdate']['keyname']; + /* trailing dot */ + if (substr($keyname, -1) != ".") + $keyname .= "."; + + $hostname = $config['dnsupdate']['host']; + /* trailing dot */ + if (substr($hostname, -1) != ".") + $hostname .= "."; + + /* write private key file + this is dumb - public and private keys are the same for HMAC-MD5, + but nsupdate insists on having both */ + $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.private", "w"); + $privkey .= << "on") + return; + $fd = fopen("{$g['varetc_path']}/olsr.conf", "w"); + + if($olsrd['announcedynamicroute'] or $olsrd['enableannounce'] == "on") { + $enableannounce .= "\nHna4\n"; + $enableannounce .= "{\n"; + if($olsrd['announcedynamicroute']) + $enableannounce .= "\t{$olsrd['announcedynamicroute']}\n"; + if($olsrd['enableannounce'] == "on") + $enableannounce .= "0.0.0.0 0.0.0.0"; + $enableannounce .= "\n}\n"; + } else { + $enableannounce = ""; + } + + $olsr .= <<0 +# +# defaults to 1 + +MprCoverage 3 + +# Example plugin entry with parameters: + +EODA; + +if($olsrd['enablehttpinfo'] == "on") { + $olsr .= << 0) + mwexec('killall miniupnpd 2>/dev/null', true); + mwexec('/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null'); + mwexec('/sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null'); + break; + case "restart": + upnp_action('stop'); + upnp_action('start'); + break; + } +} + +function upnp_start() { + global $config, $g; + if($config['installedpackages']['miniupnpd']['config'][0]['enable']) { + if($g['booting']) { + echo "Starting UPnP service..."; + include('/usr/local/pkg/miniupnpd.inc'); + sync_package_miniupnpd(); + echo "done.\n"; + } + else { + upnp_action('start'); + } + } +} + +?> -- cgit v1.2.3 From 0054eca5a325e34b4f9f463d982685b6b92deff2 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Fri, 6 Mar 2009 16:51:05 +0100 Subject: Fit123 says to git track them all --- config/Fit123/bin/code-red/background.gif | Bin 0 -> 112090 bytes config/Fit123/bin/code-red/footer.png | Bin 0 -> 23360 bytes config/Fit123/bin/code-red/header.png | Bin 0 -> 31124 bytes config/Fit123/bin/ltsp/services_dhcp.abc | 642 ++++++++++++++++++++++++++++++ config/Fit123/ddns.xml | 69 ++++ config/Fit123/fit123.inc | 281 +++++++++++++ config/Fit123/fit123.xml | 75 ++++ 7 files changed, 1067 insertions(+) create mode 100644 config/Fit123/bin/code-red/background.gif create mode 100644 config/Fit123/bin/code-red/footer.png create mode 100644 config/Fit123/bin/code-red/header.png create mode 100644 config/Fit123/bin/ltsp/services_dhcp.abc create mode 100644 config/Fit123/ddns.xml create mode 100644 config/Fit123/fit123.inc create mode 100644 config/Fit123/fit123.xml (limited to 'config') diff --git a/config/Fit123/bin/code-red/background.gif b/config/Fit123/bin/code-red/background.gif new file mode 100644 index 00000000..3f0dc770 Binary files /dev/null and b/config/Fit123/bin/code-red/background.gif differ diff --git a/config/Fit123/bin/code-red/footer.png b/config/Fit123/bin/code-red/footer.png new file mode 100644 index 00000000..b668a615 Binary files /dev/null and b/config/Fit123/bin/code-red/footer.png differ diff --git a/config/Fit123/bin/code-red/header.png b/config/Fit123/bin/code-red/header.png new file mode 100644 index 00000000..06921877 Binary files /dev/null and b/config/Fit123/bin/code-red/header.png differ diff --git a/config/Fit123/bin/ltsp/services_dhcp.abc b/config/Fit123/bin/ltsp/services_dhcp.abc new file mode 100644 index 00000000..89548502 --- /dev/null +++ b/config/Fit123/bin/ltsp/services_dhcp.abc @@ -0,0 +1,642 @@ +. + 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. +*/ + +require("guiconfig.inc"); + +$if = $_GET['if']; +if ($_POST['if']) + $if = $_POST['if']; + +/* if OLSRD is enabled, allow WAN to house DHCP. */ +if($config['installedpackages']['olsrd']) { + foreach($config['installedpackages']['olsrd']['config'] as $olsrd) { + if($olsrd['enable']) { + $iflist = array("lan" => "LAN", "wan" => "WAN"); + $is_olsr_enabled = true; + break; + } + } +} + +if(!$iflist) + $iflist = array("lan" => "LAN"); + +for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { + $oc = $config['interfaces']['opt' . $i]; + + if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) { + $iflist['opt' . $i] = $oc['descr']; + } +} + +if (!$if || !isset($iflist[$if])) + $if = "lan"; + +$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from']; +$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to']; +$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime']; +$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime']; +$pconfig['gateway'] = $config['dhcpd'][$if]['gateway']; +list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver']; +list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpd'][$if]['dnsserver']; +$pconfig['enable'] = isset($config['dhcpd'][$if]['enable']); +$pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']); +$pconfig['staticarp'] = isset($config['dhcpd'][$if]['staticarp']); +$pconfig['ddnsdomain'] = $config['dhcpd'][$if]['ddnsdomain']; +$pconfig['ddnsupdate'] = isset($config['dhcpd'][$if]['ddnsupdate']); +list($pconfig['ntp1'],$pconfig['ntp2']) = $config['dhcpd'][$if]['ntpserver']; +$pconfig['netboot'] = isset($config['dhcpd'][$if]['netboot']); +$pconfig['nextserver'] = $config['dhcpd'][$if]['next-server']; +$pconfig['filename'] = $config['dhcpd'][$if]['filename']; +$pconfig['rootpath'] = $config['dhcpd'][$if]['rootpath']; +$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip']; +$pconfig['netmask'] = $config['dhcpd'][$if]['netmask']; + +$ifcfg = $config['interfaces'][$if]; + +/* set the enabled flag which will tell us if DHCP relay is enabled + * on any interface. We will use this to disable DHCP server since + * the two are not compatible with each other. + */ + +$dhcrelay_enabled = false; +$dhcrelaycfg = $config['dhcrelay']; + +if(is_array($dhcrelaycfg)) { + foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) { + if (isset($dhcrelayifconf['enable']) && + (($dhcrelayif == "lan") || + (isset($config['interfaces'][$dhcrelayif]['enable']) && + $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge'])))) + $dhcrelay_enabled = true; + } +} + + +if (!is_array($config['dhcpd'][$if]['staticmap'])) { + $config['dhcpd'][$if]['staticmap'] = array(); +} +staticmaps_sort($if); +$a_maps = &$config['dhcpd'][$if]['staticmap']; + +function is_inrange($test, $start, $end) { + if ( (ip2long($test) < ip2long($end)) && (ip2long($test) > ip2long($start)) ) + return true; + else + return false; +} + +if ($_POST) { + + unset($input_errors); + + $pconfig = $_POST; + + /* input validation */ + if ($_POST['enable']) { + $reqdfields = explode(" ", "range_from range_to"); + $reqdfieldsn = explode(",", "Range begin,Range end"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + foreach($a_maps as $mapent) { + if(is_inrange($mapent['ipaddr'], $_POST['range_from'], $_POST['range_to'])) { + $input_errors[] = "{$mapent['ipaddr']} is inside the range you specified."; + } + + } + + if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) { + $input_errors[] = "A valid range must be specified."; + } + if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) { + $input_errors[] = "A valid range must be specified."; + } + if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) { + $input_errors[] = "A valid IP address must be specified for the gateway."; + } + if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) { + $input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers."; + } + if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) { + $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers."; + } + if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) { + $input_errors[] = "The default lease time must be at least 60 seconds."; + } + if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) { + $input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time."; + } + if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) { + $input_errors[] = "A valid domain name must be specified for the dynamic DNS registration."; + } + if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2']))) { + $input_errors[] = "A valid IP address must be specified for the primary/secondary NTP servers."; + } + if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) { + $input_errors[] = "A valid IP address must be specified for the network boot server."; + } + + + if (!$input_errors) { + /* make sure the range lies within the current subnet */ + $subnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet'])); + $subnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); + + if ((ip2long($_POST['range_from']) < $subnet_start) || (ip2long($_POST['range_from']) > $subnet_end) || + (ip2long($_POST['range_to']) < $subnet_start) || (ip2long($_POST['range_to']) > $subnet_end)) { + $input_errors[] = "The specified range lies outside of the current subnet."; + } + + if (ip2long($_POST['range_from']) > ip2long($_POST['range_to'])) + $input_errors[] = "The range is invalid (first element higher than second element)."; + + /* make sure that the DHCP Relay isn't enabled on this interface */ + if (isset($config['dhcrelay'][$if]['enable'])) + $input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server."; + } + } + + if (!$input_errors) { + $config['dhcpd'][$if]['range']['from'] = $_POST['range_from']; + $config['dhcpd'][$if]['range']['to'] = $_POST['range_to']; + $config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime']; + $config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime']; + $config['dhcpd'][$if]['netmask'] = $_POST['netmask']; + $previous = $config['dhcpd'][$if]['failover_peerip']; + if($previous <> $_POST['failover_peerip']) { + mwexec("rm -rf /var/dhcpd/var/db/*"); + } + $config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip']; + + unset($config['dhcpd'][$if]['winsserver']); + if ($_POST['wins1']) + $config['dhcpd'][$if]['winsserver'][] = $_POST['wins1']; + if ($_POST['wins2']) + $config['dhcpd'][$if]['winsserver'][] = $_POST['wins2']; + + unset($config['dhcpd'][$if]['dnsserver']); + if ($_POST['dns1']) + $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns1']; + if ($_POST['dns2']) + $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns2']; + + $config['dhcpd'][$if]['gateway'] = $_POST['gateway']; + $config['dhcpd'][$if]['denyunknown'] = ($_POST['denyunknown']) ? true : false; + $config['dhcpd'][$if]['enable'] = ($_POST['enable']) ? true : false; + $config['dhcpd'][$if]['staticarp'] = ($_POST['staticarp']) ? true : false; + $config['dhcpd'][$if]['ddnsdomain'] = $_POST['ddnsdomain']; + $config['dhcpd'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false; + + unset($config['dhcpd'][$if]['ntpserver']); + if ($_POST['ntp1']) + $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp1']; + if ($_POST['ntp2']) + $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp2']; + + $config['dhcpd'][$if]['netboot'] = ($_POST['netboot']) ? true : false; + $config['dhcpd'][$if]['next-server'] = $_POST['nextserver']; + $config['dhcpd'][$if]['filename'] = $_POST['filename']; + $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath']; + + write_config(); + + /* static arp configuration */ + interfaces_staticarp_configure($if); + + $retval = 0; + $retvaldhcp = 0; + $retvaldns = 0; + config_lock(); + /* dnsmasq_configure calls dhcpd_configure */ + /* no need to restart dhcpd twice */ + if (isset($config['dnsmasq']['regdhcpstatic'])) { + $retvaldns = services_dnsmasq_configure(); + if ($retvaldns == 0) { + if (file_exists($d_hostsdirty_path)) + unlink($d_hostsdirty_path); + if (file_exists($d_staticmapsdirty_path)) + unlink($d_staticmapsdirty_path); + } + } else { + $retvaldhcp = services_dhcpd_configure(); + if ($retvaldhcp == 0) { + if (file_exists($d_staticmapsdirty_path)) + unlink($d_staticmapsdirty_path); + } + } + config_unlock(); + if($retvaldhcp == 1 || $retvaldns == 1) + $retval = 1; + $savemsg = get_std_save_message($retval); + } +} + +if ($_GET['act'] == "del") { + if ($a_maps[$_GET['id']]) { + unset($a_maps[$_GET['id']]); + write_config(); + if(isset($config['dhcpd'][$if]['enable'])) { + touch($d_staticmapsdirty_path); + if (isset($config['dnsmasq']['regdhcpstatic'])) + touch($d_hostsdirty_path); + } + header("Location: services_dhcp.php?if={$if}"); + exit; + } +} + +$pgtitle = "Services: DHCP server"; +include("head.inc"); + +?> + + + + + +

+
+ + +"; + echo ""; + exit; + } +?> +

+You must apply the changes in order for them to take effect.");?>
+ + + + + + +
+ $ifname) { + if ($ifent == $if) + $active = true; + else + $active = false; + $tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}"); + } + display_top_tabs($tab_array); + ?> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + onClick="enable_change(false)"> + Enable DHCP server on + + interface
  + > + Deny unknown clients
+ If this is checked, only the clients defined below will get DHCP leases from this server.
Subnet + +
Subnet + mask + +
Available + range + + - + +
Subnet Mask + +
Range + +  to  +
WINS servers +
+ +
DNS servers +
+
+ NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page. +
Gateway +
+ The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network. +
Default lease + time + + seconds
+ This is used for clients that do not ask for a specific + expiration time.
+ The default is 7200 seconds. +
Maximum lease + time + + seconds
+ This is the maximum lease time for clients that ask + for a specific expiration time.
+ The default is 86400 seconds. +
Failover peer IP: +
+ Leave blank to disable. Enter the REAL address of the other machine. Machines must be using CARP. +
Static ARP + + + + + + + + + +
+ >  + + Enable Static ARP entries +
+   + + Note: Only the machines listed below will be able to communicate with the firewall on this NIC. +
+
Dynamic DNS +
+ - Show Dynamic DNS +
+ +
NTP servers +
+ - Show NTP configuration +
+ +
Enable Network booting +
+ - Show Network booting +
+ +
  + + +
 

Note:
+
The DNS servers entered in System: + General setup (or the DNS + forwarder, if enabled)
will + be assigned to clients by the DHCP server.
+
+ The DHCP lease table can be viewed on the Status: + DHCP leases page.
+

+
+ + + + + + + + + + + "" or $mapent['ipaddr'] <> ""): ?> + + + + + + + + + + + + + + +
MAC addressIP addressHostnameDescription + + + + + +
+
+ + +   + +   + +   + + + + + + +
+
+ + + + + +
+
+
+
+

+ + + + diff --git a/config/Fit123/ddns.xml b/config/Fit123/ddns.xml new file mode 100644 index 00000000..95c74f88 --- /dev/null +++ b/config/Fit123/ddns.xml @@ -0,0 +1,69 @@ + + + + + + Describe your package here + Describe your package requirements here + Currently there are no FAQ items provided. + ddns + DDNS + /usr/local/pkg/fit123.inc + + + Fit123 + /pkg_edit.php?xml=fit123.xml&id=0 + + + + DDNS + /pkg_edit.php?xml=ddns.xml&id=0 + + + + + Dynamic DNS + enable + + A more customize way to update dynamic dns and mainly for IP's that doesn't change very often.<br> + Will check for ip change every 5 min via local shell script and will only contact provider on change.<br> + (needs a reboot, hopefully it can be changed ) + + checkbox + + + Enter string that should be phrased + line1 + + String for OpenDNS should look like:<br> + https://username:password@updates.opendns.com/nic/update?hostname= + + textarea + 80 + 1 + + + Enter 2th string that should be phrased + line2 + Leave empty if not used + textarea + 80 + 1 + + + Enter 3th string that should be phrased + line3 + Leave empty if not used + textarea + 80 + 1 + + + + ddns_config(); + + + + Fit123_install_config(); + Fit123_install_deinstall(); + diff --git a/config/Fit123/fit123.inc b/config/Fit123/fit123.inc new file mode 100644 index 00000000..d5856f01 --- /dev/null +++ b/config/Fit123/fit123.inc @@ -0,0 +1,281 @@ + 0) + { + // Add cron job DDNS.sh to config.xml + $cron_item = array(); + $cron_item['minute'] = "*/5"; + $cron_item['hour'] = "*"; + $cron_item['mday'] = "*"; + $cron_item['month'] = "*"; + $cron_item['wday'] = "*"; + $cron_item['who'] = "root"; + $cron_item['command'] = "/usr/local/pkg/Fit123/ddns/DDNS.sh"; + $config['cron']['item'][] = $cron_item; + write_config(); + configure_cron(); + } + } + else + { + // Remove DDNS.sh cron entry from config.xml + $task_key = '/usr/local/pkg/Fit123/ddns/DDNS.sh'; + $x_name=''; + $x=0; + foreach($config['cron']['item'] as $item) { + if($item['command']==$task_key) { + $x_name = $x; + } + $x++; + } + unset($x); + if($x_name > 0) + { + unset($config['cron']['item'][$x_name]); + write_config(); + } + configure_cron(); + } + +// Created DDNS updater file ddns.php + + //Get user entry from config.xml + $line1text = $config['installedpackages']['ddns']['config'][0]['line1']; + $line2text = $config['installedpackages']['ddns']['config'][0]['line2']; + $line3text = $config['installedpackages']['ddns']['config'][0]['line3']; + + // Open ddns.php for writing + $hf = fopen("/usr/local/pkg/Fit123/ddns/ddns.php","w"); + if(!$hf) { + log_error("could not open /usr/local/pkg/Fit123/ddns/ddns.php for writing"); + exit; + } + + // The start of the config file + fwrite($hf, ''); + fwrite($hf, "\n"); + fclose($hf); + +// Create local shell script to watch for wan ip change + + // Get WAN nic name from config.xml + $wannic = $config['interfaces']['wan']['if']; + + //Open DDNS.sh for writing + $hfd = fopen("/usr/local/pkg/Fit123/ddns/DDNS.sh","w"); + if(!$hfd) { + log_error("could not open /usr/local/pkg/Fit123/ddns/DDNS.sh for writing"); + exit; + } + // The start of the config file + fwrite($hfd, '#!/bin/sh'); + fwrite($hfd, "\n"); + fwrite($hfd, 'ext_if="'); + fwrite($hfd, $wannic); + fwrite($hfd, '"'); + fwrite($hfd, "\n"); + fwrite($hfd, 'dns_file="/usr/local/pkg/Fit123/ddns/DDNS.ip"'); + fwrite($hfd, "\n"); + fwrite($hfd, 'update_file="/usr/local/bin/php /usr/local/pkg/Fit123/ddns/ddns.php"'); + fwrite($hfd, "\n"); + fwrite($hfd, 'EXIT_SUCCESS=0'); + fwrite($hfd, "\n"); + fwrite($hfd, 'EXIT_FAILURE=1'); + fwrite($hfd, "\n"); + fwrite($hfd, 'if [ `id -u` -ne 0 ]'); + fwrite($hfd, "\n"); + fwrite($hfd, 'then'); + fwrite($hfd, "\n"); + fwrite($hfd, ' echo "Only root may run this program."'); + fwrite($hfd, "\n"); + fwrite($hfd, ' exit $EXIT_FAILURE'); + fwrite($hfd, "\n"); + fwrite($hfd, 'fi'); + fwrite($hfd, "\n"); + fwrite($hfd, 'get_ip(){'); + fwrite($hfd, "\n"); + fwrite($hfd, ' if [ -f $dns_file ]'); + fwrite($hfd, "\n"); + fwrite($hfd, ' then'); + fwrite($hfd, "\n"); + fwrite($hfd, ' registered_ip=`cat ${dns_file}`'); + fwrite($hfd, "\n"); + fwrite($hfd, ' else'); + fwrite($hfd, "\n"); + fwrite($hfd, ' registered_ip=""'); + fwrite($hfd, "\n"); + fwrite($hfd, ' fi'); + fwrite($hfd, "\n"); + fwrite($hfd, ' current_ip=`ifconfig ${ext_if} | awk '); + fwrite($hfd, "'"); + fwrite($hfd, '/inet / { print $2 }'); + fwrite($hfd, "'"); + fwrite($hfd, '`'); + fwrite($hfd, "\n"); + fwrite($hfd, '}'); + fwrite($hfd, "\n"); + fwrite($hfd, 'update_hosts(){'); + fwrite($hfd, "\n"); + fwrite($hfd, ' if [ "$registered_ip" != "$current_ip" ]'); + fwrite($hfd, "\n"); + fwrite($hfd, ' then'); + fwrite($hfd, "\n"); + fwrite($hfd, ' $update_file'); + fwrite($hfd, "\n"); + fwrite($hfd, ' echo $current_ip > $dns_file'); + fwrite($hfd, "\n"); + fwrite($hfd, ' fi'); + fwrite($hfd, "\n"); + fwrite($hfd, '}'); + fwrite($hfd, "\n"); + fwrite($hfd, 'get_ip'); + fwrite($hfd, "\n"); + fwrite($hfd, 'update_hosts'); + fwrite($hfd, "\n"); + fwrite($hfd, 'exit $EXIT_SUCCESS'); + fwrite($hfd, "\n"); + fclose($hfd); +} +?> diff --git a/config/Fit123/fit123.xml b/config/Fit123/fit123.xml new file mode 100644 index 00000000..3e39eed3 --- /dev/null +++ b/config/Fit123/fit123.xml @@ -0,0 +1,75 @@ + + + + + + Describe your package here + Describe your package requirements here + Currently there are no FAQ items provided. + Fit123 + 0.0.0.1 + Fit123 + /usr/local/pkg/fit123.inc + + Fit123 + +
Status
+ /pkg_edit.php?xml=fit123.xml&id=0 +
+ + + Fit123 + /pkg_edit.php?xml=fit123.xml&id=0 + + + + DDNS + /pkg_edit.php?xml=ddns.xml&id=0 + + + + /usr/local/pkg/ + 0644 + http://pfsense.comuf.com/packages/config/Fit123/fit123.inc + + + /usr/local/pkg/ + 0644 + http://pfsense.comuf.com/packages/config/Fit123/ddns.xml + + + + Date + adddate + Adds current date to front page + checkbox + + + Code-red + codered + Change nervecenter Theme to Code-red + checkbox + + + LTSP + ltsp + Adds 3th network boot option + checkbox + + + After Filter Change + afc + + When using voip behind a multiwan failover setup, states needs to be cleared.<br> + (Press save twice to activate and deactivate) + + checkbox + + + Fit123_config(); + + + + Fit123_install_config(); + Fit123_install_deinstall(); +
-- cgit v1.2.3 From b8aef919ecfd63ac8a75bb9bbb93dc483091e595 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Sun, 8 Mar 2009 19:58:17 +0100 Subject: File permisson and url change --- config/Fit123/fit123.inc | 22 ++++++++++++++-------- config/Fit123/fit123.xml | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'config') diff --git a/config/Fit123/fit123.inc b/config/Fit123/fit123.inc index d5856f01..4dcc2f36 100644 --- a/config/Fit123/fit123.inc +++ b/config/Fit123/fit123.inc @@ -30,19 +30,21 @@ function Fit123_install_config() { //Greate directories and downloading files to them //Date exec("mkdir /usr/local/pkg/Fit123/date"); - exec("fetch -o /usr/local/pkg/Fit123/date/index.php http://pfsense.comuf.com/packages/config/Fit123/bin/date/index.abc"); + exec("fetch -o /usr/local/pkg/Fit123/date/index.php http://www.pfsense.com/packages/config/Fit123/bin/date/index.abc"); //Code-Red Nervecenter Theme exec("mkdir /usr/local/pkg/Fit123/code-red"); - exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://pfsense.comuf.com/packages/config/Fit123/bin/code-red/all.css"); - exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://pfsense.comuf.com/packages/config/Fit123/bin/code-red/background.gif"); - exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://pfsense.comuf.com/packages/config/Fit123/bin/code-red/footer.png"); - exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://pfsense.comuf.com/packages/config/Fit123/bin/code-red/header.png"); + exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/all.css"); + exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/background.gif"); + exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/footer.png"); + exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/header.png"); //LTSP 3th network boot Option exec("mkdir /usr/local/pkg/Fit123/LTSP"); - exec("fetch -o /usr/local/pkg/Fit123/LTSP/ http://pfsense.comuf.com/packages/config/Fit123/bin/ltsp/services.inc"); - exec("fetch -o /usr/local/pkg/Fit123/LTSP/services_dhcp.php http://pfsense.comuf.com/packages/config/Fit123/bin/ltsp/services_dhcp.abc"); + exec("fetch -o /usr/local/pkg/Fit123/LTSP/ http://www.pfsense.com/packages/config/Fit123/bin/ltsp/services.inc"); + exec("fetch -o /usr/local/pkg/Fit123/LTSP/services_dhcp.php http://www.pfsense.com/packages/config/Fit123/bin/ltsp/services_dhcp.abc"); //AFC Reset's states after filter change - exec("fetch -o /usr/local/bin/reset_states.sh http://pfsense.comuf.com/packages/config/Fit123/bin/afc/reset_states.sh"); + exec("mkdir /usr/local/pkg/Fit123/afc"); + exec("fetch -o /usr/local/pkg/Fit123/afc/reset_states.sh http://www.pfsense.com/packages/config/Fit123/bin/afc/reset_states.sh"); + exec("chmod 744 /usr/local/pkg/Fit123/afc/reset_states.sh"); //DDNS exec("mkdir /usr/local/pkg/Fit123/ddns"); conf_mount_ro(); @@ -266,6 +268,8 @@ global $config; fwrite($hfd, "\n"); fwrite($hfd, ' echo $current_ip > $dns_file'); fwrite($hfd, "\n"); + fwrite($hfd, ' echo "Your DDNS records have been updated" | logger'); + fwrite($hfd, "\n"); fwrite($hfd, ' fi'); fwrite($hfd, "\n"); fwrite($hfd, '}'); @@ -277,5 +281,7 @@ global $config; fwrite($hfd, 'exit $EXIT_SUCCESS'); fwrite($hfd, "\n"); fclose($hfd); + + exec("chmod 744 /usr/local/pkg/Fit123/ddns/DDNS.sh"); } ?> diff --git a/config/Fit123/fit123.xml b/config/Fit123/fit123.xml index 3e39eed3..063a0f4b 100644 --- a/config/Fit123/fit123.xml +++ b/config/Fit123/fit123.xml @@ -30,12 +30,12 @@ /usr/local/pkg/ 0644 - http://pfsense.comuf.com/packages/config/Fit123/fit123.inc + http://www.pfsense.com/packages/config/Fit123/fit123.inc /usr/local/pkg/ 0644 - http://pfsense.comuf.com/packages/config/Fit123/ddns.xml + http://www.pfsense.com/packages/config/Fit123/ddns.xml -- cgit v1.2.3 From c11007c6618df6a0dca523c7a4544c0f8c74db9f Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sun, 8 Mar 2009 21:34:50 +0100 Subject: Create necessary directories, add 'local =' parameter Ensures stunnel can actually be used after installation. Add optional 'local =' parameter to a tunnel, to force binding to a particular IP for outgoing connections. Useful for transport mode IPSec, or with VPNs in general. Known issues: After (re)install, list of tunnels must be saved once to produce proper config file. Not sure why this isn't happening automagically. --- config/stunnel.xml | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/stunnel.xml b/config/stunnel.xml index 85e43081..d2f0dd3a 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -111,6 +111,13 @@ Enter the port to redirect to. input + + Outgoing source IP + sourceip + Enter the source IP address for outgoing connections. + input + + stunnel @@ -128,6 +135,7 @@ fwrite($fout, "setgid = stunnel \n"); foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); + if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); fwrite($fout, "TIMEOUTclose = 0\n\n"); @@ -135,7 +143,7 @@ fclose($fout); conf_mount_ro(); config_unlock(); - system("/usr/bin/killall stunnel 2>/dev/null"); + system("/usr/local/etc/rc.d/stunnel.sh stop 2>/dev/null"); system("/usr/local/etc/rc.d/stunnel.sh start 2>/dev/null"); ]]> @@ -144,25 +152,38 @@ safe_mkdir("/usr/local/etc/stunnel"); system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - system("/bin/mkdir /var/tmp/stunnel"); - system("/bin/mkdir /var/tmp/stunnel/var"); - system("/bin/mkdir /var/tmp/stunnel/var/tmp"); + system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel"); system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); - chmod("/var/tmp/stunnel/var/tmp/", 1777); - $fout = fopen("/usr/local/etc/rc.d/stunnel.sh","w"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel/var/stunnel"); - fwrite($fout, "#!/bin/sh\n"); - fwrite($fout, "# PACKAGE: STunnel\n"); - fwrite($fout, "# EXECUTABLE: stunnel\n"); - fwrite($fout, "/usr/local/sbin/stunnel /usr/local/etc/stunnel/stunnel.conf\n\n"); - fclose($fout); - chmod("/usr/local/etc/rc.d/stunnel.sh", 0555); + $_rcfile['file']='stunnel.sh'; + $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; + $_rcfile['stop'].="killall stunnel \n\t"; + write_rcfile($_rcfile); + system("rm /usr/local/etc/rc.d/stunnel"); + + conf_mount_rw(); + config_lock(); + $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); + fwrite($fout, "cert = /usr/local/etc/stunnel/stunnel.pem \n"); + fwrite($fout, "chroot = /var/tmp/stunnel \n"); + fwrite($fout, "setuid = stunnel \n"); + fwrite($fout, "setgid = stunnel \n"); + foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { + fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); + if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); + fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); + fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); + fwrite($fout, "TIMEOUTclose = 0\n\n"); + } + fclose($fout); + conf_mount_ro(); + config_unlock(); ]]> -- cgit v1.2.3 From f7452a391914883dd7412a64ad2b6166f102937d Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Sun, 8 Mar 2009 16:49:04 -0400 Subject: Fix snort package, rc.d script was being written incorrectly when multiple interfaces were selected. --- config/snort/snort.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index c1c1a400..8b9d77f7 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -140,7 +140,7 @@ function sync_package_snort() /* Note the sleep delay. Seems to help getting mult interfaces to start -gtm */ foreach($snortInterfaces as $snortIf) { - $start .= ";sleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast &"; + $start .= "\nsleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast &"; } /* if block offenders is checked, start snort2c */ -- cgit v1.2.3 From 5ee52d94c6ffa509d4cca370a707553434ee4685 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sun, 8 Mar 2009 21:34:50 +0100 Subject: Create necessary directories, add 'local =' parameter Ensures stunnel can actually be used after installation. Add optional 'local =' parameter to a tunnel, to force binding to a particular IP for outgoing connections. Useful for transport mode IPSec, or with VPNs in general. Known issues: After (re)install, list of tunnels must be saved once to produce proper config file. Not sure why this isn't happening automagically. --- config/stunnel.xml | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/stunnel.xml b/config/stunnel.xml index 85e43081..d2f0dd3a 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -111,6 +111,13 @@ Enter the port to redirect to. input + + Outgoing source IP + sourceip + Enter the source IP address for outgoing connections. + input + + stunnel @@ -128,6 +135,7 @@ fwrite($fout, "setgid = stunnel \n"); foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); + if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); fwrite($fout, "TIMEOUTclose = 0\n\n"); @@ -135,7 +143,7 @@ fclose($fout); conf_mount_ro(); config_unlock(); - system("/usr/bin/killall stunnel 2>/dev/null"); + system("/usr/local/etc/rc.d/stunnel.sh stop 2>/dev/null"); system("/usr/local/etc/rc.d/stunnel.sh start 2>/dev/null"); ]]> @@ -144,25 +152,38 @@ safe_mkdir("/usr/local/etc/stunnel"); system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - system("/bin/mkdir /var/tmp/stunnel"); - system("/bin/mkdir /var/tmp/stunnel/var"); - system("/bin/mkdir /var/tmp/stunnel/var/tmp"); + system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel"); system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); - chmod("/var/tmp/stunnel/var/tmp/", 1777); - $fout = fopen("/usr/local/etc/rc.d/stunnel.sh","w"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel/var/stunnel"); - fwrite($fout, "#!/bin/sh\n"); - fwrite($fout, "# PACKAGE: STunnel\n"); - fwrite($fout, "# EXECUTABLE: stunnel\n"); - fwrite($fout, "/usr/local/sbin/stunnel /usr/local/etc/stunnel/stunnel.conf\n\n"); - fclose($fout); - chmod("/usr/local/etc/rc.d/stunnel.sh", 0555); + $_rcfile['file']='stunnel.sh'; + $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; + $_rcfile['stop'].="killall stunnel \n\t"; + write_rcfile($_rcfile); + system("rm /usr/local/etc/rc.d/stunnel"); + + conf_mount_rw(); + config_lock(); + $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); + fwrite($fout, "cert = /usr/local/etc/stunnel/stunnel.pem \n"); + fwrite($fout, "chroot = /var/tmp/stunnel \n"); + fwrite($fout, "setuid = stunnel \n"); + fwrite($fout, "setgid = stunnel \n"); + foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { + fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); + if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); + fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); + fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); + fwrite($fout, "TIMEOUTclose = 0\n\n"); + } + fclose($fout); + conf_mount_ro(); + config_unlock(); ]]> -- cgit v1.2.3 From dff5764a0cfce21dd1e48ed0cdf016efe78aa061 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sun, 8 Mar 2009 21:34:50 +0100 Subject: Create necessary directories, add 'local =' parameter Ensures stunnel can actually be used after installation. Add optional 'local =' parameter to a tunnel, to force binding to a particular IP for outgoing connections. Useful for transport mode IPSec, or with VPNs in general. Known issues: After (re)install, list of tunnels must be saved once to produce proper config file. Not sure why this isn't happening automagically. Signed-off-by: Bill Marquette Minor tweaks to original patch added as part of this commit --- config/stunnel.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/stunnel.xml b/config/stunnel.xml index d2f0dd3a..ef526309 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -149,16 +149,16 @@ /dev/null"); - chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); + safe_mkdir("/usr/local/etc/stunnel"); + system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); + chmod("/usr/local/etc/stunnel/stunnel.pem", 600); + make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel"); + system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); $_rcfile['file']='stunnel.sh'; $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; $_rcfile['stop'].="killall stunnel \n\t"; write_rcfile($_rcfile); - system("rm /usr/local/etc/rc.d/stunnel"); + unlink_if_exists("/usr/local/etc/rc.d/stunnel"); conf_mount_rw(); config_lock(); @@ -183,7 +183,7 @@ -- cgit v1.2.3 From 78512e0364d6e8d2f797ee2dc32c2867b2f427de Mon Sep 17 00:00:00 2001 From: rob iscool Date: Sun, 1 Mar 2009 04:02:38 -0800 Subject: Updates to Snort.inc and Snort.xml 03-01-09 Signed-off-by: Bill Marquette Comments: Removed openvpn-client related changes from merge request --- config/snort/snort.inc | 4 ++-- config/snort/snort.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 8b9d77f7..20a03f93 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -140,12 +140,12 @@ function sync_package_snort() /* Note the sleep delay. Seems to help getting mult interfaces to start -gtm */ foreach($snortInterfaces as $snortIf) { - $start .= "\nsleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast &"; + $start .= ";sleep 8;snort -c /usr/local/etc/snort/snort.conf -l /var/log/snort -D -i {$snortIf} -A fast -q"; } /* if block offenders is checked, start snort2c */ if($_POST['blockoffenders']) - $start .= ";sleep 8;snort2c -w /var/db/whitelist -a /var/log/snort/alert"; + $start .= "\nsleep 8;snort2c -w /var/db/whitelist -a /var/log/snort/alert"; $sample_before = "\nBEFORE_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n"; $sample_after = "\nAFTER_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n"; diff --git a/config/snort/snort.xml b/config/snort/snort.xml index 6ba362c0..22b8e874 100644 --- a/config/snort/snort.xml +++ b/config/snort/snort.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Snort - 2.8.2.2 + 2.8.3.2 Services: Snort /usr/local/pkg/snort.inc -- cgit v1.2.3 From 89c1e0ed2ba945e2aa4ecbe4b8b9e6d36b68bd4b Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Mon, 9 Mar 2009 12:24:02 -0500 Subject: add package delete to deinstall - who knows, maybe it will work --- config/imspector/imspector.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/imspector/imspector.inc b/config/imspector/imspector.inc index 09974363..1316ea5b 100644 --- a/config/imspector/imspector.inc +++ b/config/imspector/imspector.inc @@ -101,7 +101,7 @@ @unlink(IMSPECTOR_ETC . '/acl_blacklist.txt'); @unlink(IMSPECTOR_ETC . '/acl_whitelist.txt'); - //exec('pkg_delete imspector-0.4'); + exec('pkg_delete imspector-0.8'); } function sync_package_imspector() { -- cgit v1.2.3 From 8eff152d4aacf8f89c0388d571b44ca5360657aa Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Mon, 9 Mar 2009 12:27:13 -0500 Subject: Revert "add package delete to deinstall - who knows, maybe it will work" This reverts commit 98c5f0521ca9a9ee723a0863b8e9c97b59d26077. --- config/imspector/imspector.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/imspector/imspector.inc b/config/imspector/imspector.inc index 1316ea5b..09974363 100644 --- a/config/imspector/imspector.inc +++ b/config/imspector/imspector.inc @@ -101,7 +101,7 @@ @unlink(IMSPECTOR_ETC . '/acl_blacklist.txt'); @unlink(IMSPECTOR_ETC . '/acl_whitelist.txt'); - exec('pkg_delete imspector-0.8'); + //exec('pkg_delete imspector-0.4'); } function sync_package_imspector() { -- cgit v1.2.3 From 01c613d4e27d5e8245846ab22ce704422798dd84 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 00:39:15 -0500 Subject: start migrating javascript to prototype --- config/imspector/services_imspector_logs.php | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index fce9b892..14881bc6 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -151,6 +151,8 @@ include("head.inc"); //echo $pfSenseHead->getHTML(); ?> + +
@@ -188,7 +190,7 @@ function xmlhttpPost() updatepage(self.xmlHttpReq.responseText); } - document.getElementById('im_status').style.display = "inline"; + $('im_status').style.display = "inline"; self.xmlHttpReq.send("mode=render§ion=" + section); } @@ -204,25 +206,25 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; /* create titling information if needed */ - if (!document.getElementById(a[1])) { - document.getElementById('im_convos').innerHTML += + if (!$(a[1])) { + $('im_convos').innerHTML += "
" + a[1] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2])) { + if (!$(a[1] + "_" + a[2])) { var imageref = ""; if (a[0]) imageref = "" + a[1] + ""; - document.getElementById(a[1]).innerHTML += + $(a[1]).innerHTML += "
" + imageref + a[2] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3])) { - document.getElementById(a[1] + "_" + a[2]).innerHTML += + if (!$(a[1] + "_" + a[2] + "_" + a[3])) { + $(a[1] + "_" + a[2]).innerHTML += "
" + a[3] + "
" + "
"; } - if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { - document.getElementById(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += + if (!$(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { + $(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += "
»" + a[4] + "
"; @@ -236,21 +238,21 @@ function updatepage(str) if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; - document.getElementById('im_status').style.display = "none"; - var bottom = parseInt(document.getElementById('im_content').scrollTop); - var bottom2 = parseInt(document.getElementById('im_content').style.height); + $('im_status').style.display = "none"; + var bottom = parseInt($('im_content').scrollTop); + var bottom2 = parseInt($('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); - if (absheight == document.getElementById('im_content').scrollHeight) { + if (absheight == $('im_content').scrollHeight) { moveit = 1; } else { moveit = 0; } - document.getElementById('im_content').innerHTML = parts[2]; + $('im_content').innerHTML = parts[2]; if (moveit == 1) { - document.getElementById('im_content').scrollTop = 0; - document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; + $('im_content').scrollTop = 0; + $('im_content').scrollTop = $('im_content').scrollHeight; } - document.getElementById('im_content_title').innerHTML = title; + $('im_content_title').update = title; the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } -- cgit v1.2.3 From 6abb9ffd8bbd42c903c31ab5bf6fe68ef1c6f1a7 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 01:19:23 -0500 Subject: remove home rolled xmlhttpPost crap, use Prototype --- config/imspector/services_imspector_logs.php | 44 +++++++++++++--------------- 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index 14881bc6..ecb8606f 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -172,26 +172,23 @@ var section = 'none'; var moveit = 1; var the_timeout; -function xmlhttpPost() -{ - var xmlHttpReq = false; - var self = this; - - if (window.XMLHttpRequest) - self.xmlHttpReq = new XMLHttpRequest(); - else if (window.ActiveXObject) - self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); - - self.xmlHttpReq.open('POST', 'services_imspector_logs.php', true); - self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - - self.xmlHttpReq.onreadystatechange = function() { - if (self.xmlHttpReq && self.xmlHttpReq.readyState == 4) - updatepage(self.xmlHttpReq.responseText); - } - - $('im_status').style.display = "inline"; - self.xmlHttpReq.send("mode=render§ion=" + section); +function xmlhttpPost(){ + var url = "/services_imspector_logs.php" + new Ajax.Request(url, { + method: 'post', + parameters: { + mode: 'render', + section: section + }, + onSuccess: function(transport){ + var response = transport.responseText || ""; + updatepage(response); + $('im_status').style.display = "none"; + }, + onLoading: function(){ + $('im_status').style.display = "inline"; + } + }); } function updatepage(str) @@ -233,12 +230,11 @@ function updatepage(str) /* determine the title of this conversation */ var details = parts[1].split(","); - var title = details[0] + " conversation between " + details[ 1 ] + + var title = details[0] + " conversation between " + details[1] + " and " + details[2] + ""; if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; - $('im_status').style.display = "none"; var bottom = parseInt($('im_content').scrollTop); var bottom2 = parseInt($('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); @@ -247,12 +243,12 @@ function updatepage(str) } else { moveit = 0; } - $('im_content').innerHTML = parts[2]; + $('im_content').update(parts[2]); if (moveit == 1) { $('im_content').scrollTop = 0; $('im_content').scrollTop = $('im_content').scrollHeight; } - $('im_content_title').update = title; + $('im_content_title').update(title); the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } -- cgit v1.2.3 From 34a0c678b48d0e0f8ebe929551c474e0322a65de Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 01:25:21 -0500 Subject: More Prototype-isms Whitespace cleanup --- config/imspector/services_imspector_logs.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index ecb8606f..f9e6d902 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -257,9 +257,14 @@ function setsection(value) section = value; clearTimeout(the_timeout); xmlhttpPost(); - document.getElementById('im_content').scrollTop = 0; - document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; + $('im_content').scrollTop = 0; + $('im_content').scrollTop = $('im_content').scrollHeight; } + +document.observe('dom:loaded', function() { + xmlhttpPost(); +}); + EOD; print($zz); @@ -271,22 +276,19 @@ print($zz);
 
- +
-
-
+
+
-
+
- - -
-- cgit v1.2.3 From 81d0087fbf73aa9ab05cf8ec1067dbb462fc698c Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 02:04:30 -0500 Subject: put readable variable names in for a[*] array --- config/imspector/services_imspector_logs.php | 40 +++++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index f9e6d902..8f208e5d 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -202,29 +202,37 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; + var image = a[0]; + var protocol = a[1]; + var login = a[2]; + var destination = a[3]; + var date = a[4]; + + /* create titling information if needed */ - if (!$(a[1])) { + if (!$(protocol)) { $('im_convos').innerHTML += - "
" + a[1] + "
" + - "
"; + "
" + protocol + "
" + + "
"; } - if (!$(a[1] + "_" + a[2])) { + if (!$(protocol + "_" + login)) { var imageref = ""; - if (a[0]) imageref = "" + a[1] + ""; - $(a[1]).innerHTML += - "
" + imageref + a[2] + "
" + - "
"; + if (image) imageref = "" + protocol + ""; + $(protocol).innerHTML += + "
" + imageref + login + "
" + + "
"; } - if (!$(a[1] + "_" + a[2] + "_" + a[3])) { - $(a[1] + "_" + a[2]).innerHTML += - "
" + a[3] + "
" + - "
"; + if (!$(protocol + "_" + login + "_" + destination)) { + $(protocol + "_" + login).innerHTML += + "
" + destination + "
" + + "
"; } - if (!$(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { - $(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += - "
»" + a[4] + "
"; + '"' + "setsection('" + protocol + "|" + login + "|" + destination + "|" + date + "');" + '"' + "' + >»" + date + ""; } } -- cgit v1.2.3 From 4ac09def4160c485483bf5f62e8c48c7489fc5eb Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Tue, 10 Mar 2009 20:05:30 +0100 Subject: Added certificate management Major change which allows assigning certificates to tunnels. Certificates are managed on a separate tab, but they must be manually generated on another system and pasted in along with RSA keys. Certificate status display lists status including days until expiry. --- config/stunnel.xml | 107 +++++++++--------- config/stunnel/stunnel.inc | 232 +++++++++++++++++++++++++++++++++++++++ config/stunnel/stunnel_certs.xml | 147 +++++++++++++++++++++++++ 3 files changed, 429 insertions(+), 57 deletions(-) create mode 100644 config/stunnel/stunnel.inc create mode 100644 config/stunnel/stunnel_certs.xml (limited to 'config') diff --git a/config/stunnel.xml b/config/stunnel.xml index 64c9becd..6ea9f99f 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -51,11 +51,35 @@
Services
stunnel.xml
+ + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/stunnel/stunnel.inc + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/stunnel/stunnel_certs.xml + ['installedpackages']['package']['$packagename']['configuration'] + + + + Tunnels + /pkg.php?xml=stunnel.xml + + + + Certificates + /pkg.php?xml=stunnel_certs.xml + + + + items. An example of this would be the nat page where you add new nat redirects --> Description @@ -69,6 +93,10 @@ Listen on Port localport + + Certificate + certificatelink + Redirects to IP redirectip @@ -99,6 +127,16 @@ Enter the local port to bind this redirection to. input + + Certificate + certificate + Select server certificate to use for this tunnel. Certificates are defined on the 'Certificates' page. + select + + + + + Redirects to IP redirectip @@ -117,72 +155,27 @@ Enter the source IP address for outgoing connections. input - + stunnel /usr/local/etc/rc.d/stunnel.sh stunnel + + /usr/local/pkg/stunnel.inc + - /dev/null"); - system("/usr/local/etc/rc.d/stunnel.sh start 2>/dev/null"); - ]]> + stunnel_save($config); - /dev/null"); - chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); - $_rcfile['file']='stunnel.sh'; - $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; - $_rcfile['stop'].="killall stunnel \n\t"; - write_rcfile($_rcfile); - unlink_if_exists("/usr/local/etc/rc.d/stunnel"); - conf_mount_rw(); - config_lock(); - $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); - fwrite($fout, "cert = /usr/local/etc/stunnel/stunnel.pem \n"); - fwrite($fout, "chroot = /var/tmp/stunnel \n"); - fwrite($fout, "setuid = stunnel \n"); - fwrite($fout, "setgid = stunnel \n"); - foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { - fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); - if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); - fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); - fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); - fwrite($fout, "TIMEOUTclose = 0\n\n"); - } - fclose($fout); - conf_mount_ro(); - config_unlock(); - ]]> + stunnel_install(); - + stunnel_deinstall(); + + stunnel_addcerts($config); + + diff --git a/config/stunnel/stunnel.inc b/config/stunnel/stunnel.inc new file mode 100644 index 00000000..62558e34 --- /dev/null +++ b/config/stunnel/stunnel.inc @@ -0,0 +1,232 @@ +Invalid key/cert!'; + } elseif($valid<30) { + $_status='Expires in '.$valid.' days!'; + } else { + $_status='OK ('.$valid.' days)'; + } + $config['installedpackages']['stunnelcerts']['config'][$i]['status']=$_status; + } +} + + +$tunnels=$config['installedpackages']['stunnel']['config']; +is_array($tunnels) ? $num_tunnels=count($tunnels) : $num_tunnels=0; +if(!isset($_GET['id']) and $num_tunnels) { + for ($i=0;$i<$num_tunnels;$i++) { + $tunnel=$tunnels[$i]; + if($tunnel['certificate']) { + $certid=0; + if(is_array($config['installedpackages']['stunnelcerts']['config'])) { + foreach($config['installedpackages']['stunnelcerts']['config'] as $cert) { + if($tunnel['certificate']==$cert['filename']) + $config['installedpackages']['stunnel']['config'][$i]['certificatelink']= + ''.$cert['description'].''; + $certid++; + } + } + } + } +} + +function stunnel_printcsr() { +# $GLOBALS['savemsg']="
" . print_r($GLOBALS['config']['installedpackages']['stunnelcerts']['config'],true) . "
"; +} + +function stunnel_addcerts($config) { + $certs=$config['installedpackages']['stunnelcerts']['config']; + $tunnels=$config['installedpackages']['stunnel']['config']; + ?> + + + + /dev/null"); + system("/usr/local/etc/rc.d/stunnel.sh start 2>/dev/null"); +} +function stunnel_save_cert($config) { + $GLOBALS['config']['installedpackages']['stunnelcerts']['savemsg']=''; + if(isset($_POST['id'])) { +# echo "
";
+#		print_r($_POST);
+#		echo "
"; + + if(!$_POST['cert_chain']) { + $GLOBALS['config']['installedpackages']['stunnelcerts']['savemsg'].="Certificate chain must be specified!
"; + } if(!$_POST['cert_key']) { + $GLOBALS['config']['installedpackages']['stunnelcerts']['savemsg'].="RSA Key must be specified!
"; + } + if($_POST['cert_chain'] and $_POST['cert_key']) { + $_cert=openssl_x509_parse($_POST['cert_chain']); +# echo("
");
+#			print_r($_cert);
+#			echo("
"); + if($_cert['hash']) { + if(openssl_x509_check_private_key($_POST['cert_chain'], $_POST['cert_key'])) { + file_put_contents('/usr/local/etc/stunnel/'.$_cert['hash'].'.key', + $_POST['cert_key']); + file_put_contents('/usr/local/etc/stunnel/'.$_cert['hash'].'.chain', + $_POST['cert_chain']); + file_put_contents('/usr/local/etc/stunnel/'.$_cert['hash'].'.pem', + $_POST['cert_key']."\n".$_POST['cert_chain']); + system('chown stunnel:stunnel /usr/local/etc/stunnel/*'); + chmod('/usr/local/etc/stunnel/'.$_cert['hash'].'.key', 0600); + chmod('/usr/local/etc/stunnel/'.$_cert['hash'].'.pem', 0600); + + $_POST['filename']=$_cert['hash']; + $_POST['expiry_raw']=$_cert['validTo_time_t']; + $_POST['expiry']=date('Y-m-d', $_cert['validTo_time_t']); + $_POST['subject']=$_cert['name']; + } else { + $GLOBALS['config']['installedpackages']['stunnelcerts']['savemsg'].="Certificate and key do not match!
"; + $_POST['filename']=''; + } + } else { + $GLOBALS['config']['installedpackages']['stunnelcerts']['savemsg'].="Couldn't parse certificate!
"; + $_POST['expiry_raw']=''; + $_POST['expiry']=''; + $_POST['subject']=''; + $_POST['filename']=''; + } + } + $_POST['cert_key']=base64_encode($_POST['cert_key']); + $_POST['cert_chain']=base64_encode($_POST['cert_chain']); + $_fname=$GLOBALS['config']['installedpackages']['stunnelcerts']['config'][$_POST['id']]['filename']; + if($_fname and $_fname!=$_POST['filename']) { + unlink_if_exists('/usr/local/etc/stunnel/'.$_fname.'.chain'); + unlink_if_exists('/usr/local/etc/stunnel/'.$_fname.'.key'); + unlink_if_exists('/usr/local/etc/stunnel/'.$_fname.'.pem'); + } + } +} + +function stunnel_install() { + safe_mkdir("/usr/local/etc/stunnel"); + system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); + chmod("/usr/local/etc/stunnel/stunnel.pem", 0600); + make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel"); + system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); + $_rcfile['file']='stunnel.sh'; + $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; + $_rcfile['stop'].="killall stunnel \n\t"; + write_rcfile($_rcfile); + unlink_if_exists("/usr/local/etc/rc.d/stunnel"); + + conf_mount_rw(); + config_lock(); + $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); + fwrite($fout, "cert = /usr/local/etc/stunnel/stunnel.pem \n"); + fwrite($fout, "chroot = /var/tmp/stunnel \n"); + fwrite($fout, "setuid = stunnel \n"); + fwrite($fout, "setgid = stunnel \n"); + foreach($config['installedpackages']['stunnel']['config'] as $pkgconfig) { + fwrite($fout, "\n[" . $pkgconfig['description'] . "]\n"); + if($pkgconfig['sourceip']) fwrite($fout, "local = " . $pkgconfig['sourceip'] . "\n"); + fwrite($fout, "accept = " . $pkgconfig['localip'] . ":" . $pkgconfig['localport'] . "\n"); + fwrite($fout, "connect = " . $pkgconfig['redirectip'] . ":" . $pkgconfig['redirectport'] . "\n"); + fwrite($fout, "TIMEOUTclose = 0\n\n"); + } + fclose($fout); + conf_mount_ro(); + config_unlock(); +} + +function stunnel_deinstall() { + rmdir_recursive("/var/tmp/stunnel"); + rmdir_recursive("/usr/local/etc/stunnel*"); + unlink_if_exists("/usr/local/etc/rc.d/stunnel.sh"); +} + +?> \ No newline at end of file diff --git a/config/stunnel/stunnel_certs.xml b/config/stunnel/stunnel_certs.xml new file mode 100644 index 00000000..3d7cc3fa --- /dev/null +++ b/config/stunnel/stunnel_certs.xml @@ -0,0 +1,147 @@ + + + + + + + + Stunnel certificates + Describe your package requirements here + Currently there are no FAQ items provided. + stunnelcerts + 4.18 + Services: Secure Tunnel - Certificates + + ['installedpackages']['package']['$packagename']['configuration'] + + + + Tunnels + /pkg.php?xml=stunnel.xml + + + Certificates + /pkg.php?xml=stunnel_certs.xml + + + + + + + + Description + description + + + Subject + subject + + + + Status + status + + + + + + + Description + description + Enter a (short) description for this certificate + input + + + Certificate filename + filename + File name of certificate (read-only; updated on save). Extensions (.pem, .chain, .key) are added automatically. + input + + + Certificate subject + subject + Certificate subject (read-only; updated on save) + input + 50 + + + Certificate valid until + expiry + The certificate will expire on this date, and will no longer work. + input + + + RSA private key + cert_key + RSA private key used for certificate. Do not change for existing certificates!<br> + <b>Leave blank to automatically create key and certificate signing request on save.</b> + textarea + 7 + 65 + + + Certificate chain + cert_chain + Full certificate chain; root certificate on top, then any intermediates, server certificate at the end.<br> + <b>Full chain required for private or EV certificates!</b> + textarea + 7 + 65 + + + + /usr/local/pkg/stunnel.inc + + stunnel_save_cert($config); + stunnel_save($config); + + + stunnel_printcsr(); + + + stunnel_disablefields(); + + + stunnel_delete($config); + + + -- cgit v1.2.3 From 9511c2764831e281783a9522a6ced837b548c354 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 22:23:59 -0500 Subject: Revert "put readable variable names in for a[*] array" This reverts commit 689a5cd5fbc4c6ab1093df3c4fa601ae390e6200. --- config/imspector/services_imspector_logs.php | 40 +++++++++++----------------- 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index 8f208e5d..f9e6d902 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -202,37 +202,29 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; - var image = a[0]; - var protocol = a[1]; - var login = a[2]; - var destination = a[3]; - var date = a[4]; - - /* create titling information if needed */ - if (!$(protocol)) { + if (!$(a[1])) { $('im_convos').innerHTML += - "
" + protocol + "
" + - "
"; + "
" + a[1] + "
" + + "
"; } - if (!$(protocol + "_" + login)) { + if (!$(a[1] + "_" + a[2])) { var imageref = ""; - if (image) imageref = "" + protocol + ""; - $(protocol).innerHTML += - "
" + imageref + login + "
" + - "
"; + if (a[0]) imageref = "" + a[1] + ""; + $(a[1]).innerHTML += + "
" + imageref + a[2] + "
" + + "
"; } - if (!$(protocol + "_" + login + "_" + destination)) { - $(protocol + "_" + login).innerHTML += - "
" + destination + "
" + - "
"; + if (!$(a[1] + "_" + a[2] + "_" + a[3])) { + $(a[1] + "_" + a[2]).innerHTML += + "
" + a[3] + "
" + + "
"; } - if (!$(protocol + "_" + login + "_" + destination + "_" + date)) { - /* XXX: use observer instead of onclick */ - $(protocol + "_" + login + "_" + destination).innerHTML += - "
»" + date + "
"; + '"' + "setsection('" + a[1] + "|" + a[2] + "|" + a[3] + "|" + a[4] + "');" + '"' + "' + >»" + a[4] + ""; } } -- cgit v1.2.3 From 5227386a27292542a37025b23752febcd3cce5fb Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 22:25:13 -0500 Subject: Revert "More Prototype-isms" This reverts commit f68491164d4f3a0a22b5b630f8c34b3e950dd8fa. --- config/imspector/services_imspector_logs.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index f9e6d902..ecb8606f 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -257,14 +257,9 @@ function setsection(value) section = value; clearTimeout(the_timeout); xmlhttpPost(); - $('im_content').scrollTop = 0; - $('im_content').scrollTop = $('im_content').scrollHeight; + document.getElementById('im_content').scrollTop = 0; + document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; } - -document.observe('dom:loaded', function() { - xmlhttpPost(); -}); - EOD; print($zz); @@ -276,19 +271,22 @@ print($zz);
 
- +
-
-
+
+
-
+
+ + + -- cgit v1.2.3 From 2e0c1cc991c4cc2e5ea619941cf0eedaf2777423 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 22:25:27 -0500 Subject: Revert "remove home rolled xmlhttpPost crap, use Prototype" This reverts commit ecacddc29028cf9f6e94d326461d7a6087493ba1. --- config/imspector/services_imspector_logs.php | 44 +++++++++++++++------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index ecb8606f..14881bc6 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -172,23 +172,26 @@ var section = 'none'; var moveit = 1; var the_timeout; -function xmlhttpPost(){ - var url = "/services_imspector_logs.php" - new Ajax.Request(url, { - method: 'post', - parameters: { - mode: 'render', - section: section - }, - onSuccess: function(transport){ - var response = transport.responseText || ""; - updatepage(response); - $('im_status').style.display = "none"; - }, - onLoading: function(){ - $('im_status').style.display = "inline"; - } - }); +function xmlhttpPost() +{ + var xmlHttpReq = false; + var self = this; + + if (window.XMLHttpRequest) + self.xmlHttpReq = new XMLHttpRequest(); + else if (window.ActiveXObject) + self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); + + self.xmlHttpReq.open('POST', 'services_imspector_logs.php', true); + self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + + self.xmlHttpReq.onreadystatechange = function() { + if (self.xmlHttpReq && self.xmlHttpReq.readyState == 4) + updatepage(self.xmlHttpReq.responseText); + } + + $('im_status').style.display = "inline"; + self.xmlHttpReq.send("mode=render§ion=" + section); } function updatepage(str) @@ -230,11 +233,12 @@ function updatepage(str) /* determine the title of this conversation */ var details = parts[1].split(","); - var title = details[0] + " conversation between " + details[1] + + var title = details[0] + " conversation between " + details[ 1 ] + " and " + details[2] + ""; if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; + $('im_status').style.display = "none"; var bottom = parseInt($('im_content').scrollTop); var bottom2 = parseInt($('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); @@ -243,12 +247,12 @@ function updatepage(str) } else { moveit = 0; } - $('im_content').update(parts[2]); + $('im_content').innerHTML = parts[2]; if (moveit == 1) { $('im_content').scrollTop = 0; $('im_content').scrollTop = $('im_content').scrollHeight; } - $('im_content_title').update(title); + $('im_content_title').update = title; the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } -- cgit v1.2.3 From 327fa645ee0267873bbca9e9e0c9a545d43ad922 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 10 Mar 2009 22:25:44 -0500 Subject: Revert "start migrating javascript to prototype" This reverts commit e33637e6eded91962267b364ec48a74ee1ff835c. --- config/imspector/services_imspector_logs.php | 36 +++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'config') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index 14881bc6..fce9b892 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -151,8 +151,6 @@ include("head.inc"); //echo $pfSenseHead->getHTML(); ?> - -
@@ -190,7 +188,7 @@ function xmlhttpPost() updatepage(self.xmlHttpReq.responseText); } - $('im_status').style.display = "inline"; + document.getElementById('im_status').style.display = "inline"; self.xmlHttpReq.send("mode=render§ion=" + section); } @@ -206,25 +204,25 @@ function updatepage(str) if (!a[1] || !a[2] || !a[3]) continue; /* create titling information if needed */ - if (!$(a[1])) { - $('im_convos').innerHTML += + if (!document.getElementById(a[1])) { + document.getElementById('im_convos').innerHTML += "
" + a[1] + "
" + "
"; } - if (!$(a[1] + "_" + a[2])) { + if (!document.getElementById(a[1] + "_" + a[2])) { var imageref = ""; if (a[0]) imageref = "" + a[1] + ""; - $(a[1]).innerHTML += + document.getElementById(a[1]).innerHTML += "
" + imageref + a[2] + "
" + "
"; } - if (!$(a[1] + "_" + a[2] + "_" + a[3])) { - $(a[1] + "_" + a[2]).innerHTML += + if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3])) { + document.getElementById(a[1] + "_" + a[2]).innerHTML += "
" + a[3] + "
" + "
"; } - if (!$(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { - $(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += + if (!document.getElementById(a[1] + "_" + a[2] + "_" + a[3] + "_" + a[4])) { + document.getElementById(a[1] + "_" + a[2] + "_" + a[3]).innerHTML += "
»" + a[4] + "
"; @@ -238,21 +236,21 @@ function updatepage(str) if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; - $('im_status').style.display = "none"; - var bottom = parseInt($('im_content').scrollTop); - var bottom2 = parseInt($('im_content').style.height); + document.getElementById('im_status').style.display = "none"; + var bottom = parseInt(document.getElementById('im_content').scrollTop); + var bottom2 = parseInt(document.getElementById('im_content').style.height); var absheight = parseInt( bottom + bottom2 ); - if (absheight == $('im_content').scrollHeight) { + if (absheight == document.getElementById('im_content').scrollHeight) { moveit = 1; } else { moveit = 0; } - $('im_content').innerHTML = parts[2]; + document.getElementById('im_content').innerHTML = parts[2]; if (moveit == 1) { - $('im_content').scrollTop = 0; - $('im_content').scrollTop = $('im_content').scrollHeight; + document.getElementById('im_content').scrollTop = 0; + document.getElementById('im_content').scrollTop = document.getElementById('im_content').scrollHeight; } - $('im_content_title').update = title; + document.getElementById('im_content_title').innerHTML = title; the_timeout = setTimeout( "xmlhttpPost();", 5000 ); } -- cgit v1.2.3 From 493432ce315f85f43c47ea47dc92d052cd1d9483 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 11 Mar 2009 18:47:34 -0400 Subject: Show loading indicator correctly. --- config/autoconfigbackup/autoconfigbackup.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/autoconfigbackup/autoconfigbackup.php b/config/autoconfigbackup/autoconfigbackup.php index 80db5543..9ac35b14 100644 --- a/config/autoconfigbackup/autoconfigbackup.php +++ b/config/autoconfigbackup/autoconfigbackup.php @@ -127,6 +127,10 @@ function get_hostnames() { print_info_box("Warning! You are currently viewing an alternate hosts backup history ($hostname)"); ?> + +
+
+ Loading, please wait... +

  +

-
- Loading, please wait... -
Date: Thu, 12 Mar 2009 01:34:48 -0600 Subject: FreeSWITCH build revision 12545 works on freebsd 7.0 and higher --- config/freeswitch/freeswitch.inc | 4 ++-- config/freeswitch/freeswitch.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index 75c7bd84..2601df01 100755 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1672,9 +1672,9 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.3.3"; + $freeswitch_package_version = "0.8.3.4"; $freeswitch_build_version = "1.0.3"; - $freeswitch_build_revision = "12228"; + $freeswitch_build_revision = "12545"; conf_mount_rw(); config_lock(); diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index 8703af24..e6578f70 100755 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.3.3 + 0.8.3.4 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc @@ -489,4 +489,4 @@ freeswitch_deinstall_command(); - \ No newline at end of file + -- cgit v1.2.3 From d39d2d9d71e982025df36c7ac389911d31d221e5 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Thu, 12 Mar 2009 11:20:11 +0100 Subject: Fixed wrong text in certificate management. --- config/stunnel/stunnel_certs.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/stunnel/stunnel_certs.xml b/config/stunnel/stunnel_certs.xml index 3d7cc3fa..540d556c 100644 --- a/config/stunnel/stunnel_certs.xml +++ b/config/stunnel/stunnel_certs.xml @@ -113,7 +113,6 @@ RSA private key cert_key RSA private key used for certificate. Do not change for existing certificates!<br> - <b>Leave blank to automatically create key and certificate signing request on save.</b> textarea 7 65 -- cgit v1.2.3 From 63083e5c5877147283ea3e22f082425b7013df9a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 13 Mar 2009 00:25:51 -0400 Subject: Show please setup auto config backup as a message after redirecting page --- config/autoconfigbackup/autoconfigbackup.php | 2 +- config/autoconfigbackup/autoconfigbackup_backup.php | 2 +- config/autoconfigbackup/autoconfigbackup_stats.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/autoconfigbackup/autoconfigbackup.php b/config/autoconfigbackup/autoconfigbackup.php index 9ac35b14..4f143adb 100644 --- a/config/autoconfigbackup/autoconfigbackup.php +++ b/config/autoconfigbackup/autoconfigbackup.php @@ -64,7 +64,7 @@ else $myhostname = $config['system']['hostname'] . "." . $config['system']['domain']; if(!$username) { - Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0"); + Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0&savemsg=Please+setup+Auto+Config+Backup"); exit; } diff --git a/config/autoconfigbackup/autoconfigbackup_backup.php b/config/autoconfigbackup/autoconfigbackup_backup.php index cebd7a56..47336c27 100644 --- a/config/autoconfigbackup/autoconfigbackup_backup.php +++ b/config/autoconfigbackup/autoconfigbackup_backup.php @@ -57,7 +57,7 @@ $del_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackup $hostname = $config['system']['hostname'] . "." . $config['system']['domain']; if(!$username) { - Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0"); + Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0&savemsg=Please+setup+Auto+Config+Backup"); exit; } diff --git a/config/autoconfigbackup/autoconfigbackup_stats.php b/config/autoconfigbackup/autoconfigbackup_stats.php index 65f02b2d..c024d689 100644 --- a/config/autoconfigbackup/autoconfigbackup_stats.php +++ b/config/autoconfigbackup/autoconfigbackup_stats.php @@ -60,7 +60,7 @@ $stats_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigback $hostname = $config['system']['hostname'] . "." . $config['system']['domain']; if(!$username) { - Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0"); + Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0&savemsg=Please+setup+Auto+Config+Backup"); exit; } -- cgit v1.2.3 From d881d31378d18bde7929eb7561d326716efcf5c2 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Fri, 13 Mar 2009 10:47:29 +0100 Subject: DDNS doesn't need a reboot and lets go ALPHA --- config/Fit123/ddns.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/Fit123/ddns.xml b/config/Fit123/ddns.xml index 95c74f88..ea461254 100644 --- a/config/Fit123/ddns.xml +++ b/config/Fit123/ddns.xml @@ -27,7 +27,6 @@ A more customize way to update dynamic dns and mainly for IP's that doesn't change very often.<br> Will check for ip change every 5 min via local shell script and will only contact provider on change.<br> - (needs a reboot, hopefully it can be changed ) checkbox -- cgit v1.2.3 From 662b06322bd35b323b9f1fb528abaa4a424515d1 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 13 Mar 2009 15:07:51 -0400 Subject: Fricking.xml is in the frickin/ dir --- config/frickin.xml | 75 ------------------------------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 config/frickin.xml (limited to 'config') diff --git a/config/frickin.xml b/config/frickin.xml deleted file mode 100644 index 8f59bb8c..00000000 --- a/config/frickin.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - . - 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. - */ -/* ========================================================================== */ - ]]> - - Describe your package here - Describe your package requirements here - Currently there are no FAQ items provided. - frickin - 1.2 - none - installedpackages->package->$packagename->configuration->settings - - /usr/local/bin/ - 0755 - http://www.pfsense.com/packages/All/frickin - - - $fout = fopen("/usr/local/etc/rc.d/frickin.sh", "w"); - fwrite($fout, "#!/bin/sh\n# This package was automatically generated\n# by the pfSense package system.\n\n"); - fwrite($fout, "# PACKAGE: Frickin Proxy\n"); - fwrite($fout, "# EXECUTABLE: frickin\n"); - fwrite($fout, "/usr/local/bin/frickin"); - fwrite($fout, " -s 127.0.0.1"); - fwrite($fout, " -c 20"); - fwrite($fout, " &\n"); - fclose($fout); - mwexec("/usr/bin/killall frickin"); - mwexec("chmod a+rx /usr/local/etc/rc.d/frickin.sh"); - mwexec("/usr/local/etc/rc.d/frickin.sh"); - - - unlink_if_exists("/usr/local/etc/rc.d/frickin.sh"); - unlink_if_exists("/usr/local/bin/frickin"); - - -- cgit v1.2.3 From f9a5fbfa1079f9a8dcfdfe4ad1bd50c1317ec8ac Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sat, 14 Mar 2009 00:27:08 +0100 Subject: Added pfJailctl and jail_template packages See http://doc.pfsense.org/index.php/PfJailctl_package for details. --- config/jail_template/jail_template.img.uzip | Bin 0 -> 63200768 bytes config/jail_template/jail_template.inc | 32 + config/jailctl/jailctl | 1053 +++++++++++++++++++++++++++ config/jailctl/jailctl-utils.inc | 272 +++++++ config/jailctl/jailctl.inc | 217 ++++++ config/jailctl/jailctl.xml | 233 ++++++ config/jailctl/jailctl_defaults.xml | 122 ++++ config/jailctl/jailctl_list.inc | 112 +++ config/jailctl/jailctl_settings.xml | 121 +++ config/jailctl/sysinstall | Bin 0 -> 447888 bytes 10 files changed, 2162 insertions(+) create mode 100644 config/jail_template/jail_template.img.uzip create mode 100644 config/jail_template/jail_template.inc create mode 100755 config/jailctl/jailctl create mode 100644 config/jailctl/jailctl-utils.inc create mode 100644 config/jailctl/jailctl.inc create mode 100644 config/jailctl/jailctl.xml create mode 100644 config/jailctl/jailctl_defaults.xml create mode 100644 config/jailctl/jailctl_list.inc create mode 100644 config/jailctl/jailctl_settings.xml create mode 100755 config/jailctl/sysinstall (limited to 'config') diff --git a/config/jail_template/jail_template.img.uzip b/config/jail_template/jail_template.img.uzip new file mode 100644 index 00000000..1c92fb90 Binary files /dev/null and b/config/jail_template/jail_template.img.uzip differ diff --git a/config/jail_template/jail_template.inc b/config/jail_template/jail_template.inc new file mode 100644 index 00000000..f9c00b79 --- /dev/null +++ b/config/jail_template/jail_template.inc @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/config/jailctl/jailctl b/config/jailctl/jailctl new file mode 100755 index 00000000..542c2db6 --- /dev/null +++ b/config/jailctl/jailctl @@ -0,0 +1,1053 @@ +#!/bin/sh + +# ------------------------------------- +# Jail management script +# Copyright (c) 2004-2008 Eirik Oeverby +# All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * 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. +# * The name(s) of the author(s) may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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. +# ------------------------------------- + +############################################################################## +# Configuration section # +# # +# Change the CFGFILE variable to point to your jail configuration file. # +############################################################################## + +# Clear the hook lists (for security reasons) +unset BEFORESTART_HOOKS +unset AFTERSTART_HOOKS +unset BEFORESTOP_HOOKS +unset AFTERSTOP_HOOKS +unset BEFORESTATUS_HOOKS +unset AFTERSTATUS_HOOKS +unset BEFOREBACKUP_HOOKS +unset AFTERBACKUP_HOOKS +unset BEFORERESTORE_HOOKS +unset AFTERRESTORE_HOOKS +unset BEFORECREATE_HOOKS +unset AFTERCREATE_HOOKS +unset BEFOREUPGRADE_HOOKS +unset AFTERUPGRADE_HOOKS +unset BEFOREDELETE_HOOKS +unset AFTERDELETE_HOOKS + +CFGFILE="/usr/local/etc/jails.conf" +. ${CFGFILE} + +PROCFS=`expr "$PROCFS" : "[tT][rR][uU][eE]"` +LINPROCFS=`expr "$LINPROCFS" : "[tT][rR][uU][eE]"` + +############################################################################## +# Main function section # +# # +# These functions are wrappers for the action functions below. They do # +# various sanity checking of input parameters, and verify the existence and # +# required states of the affected jail(s). # +############################################################################## + +usage() { + ## Output usage information + echo "Usage:" >&2 + echo "jailctl []" >&2 + echo " = start|stop|status|create|delete|upgrade|backup|restore" >&2 + echo " = hostname|all" >&2 + echo " = Backup destination / restore source" >&2 + echo >&2 +} + +jail_status() { + ## Output the status of one or several jails + if [ ! $JAIL ] || [ $JAIL = "all" ] || jail_exists ; then + # Jail exists (or "all" was specified), we can query its status + if [ ! $JAIL ] || [ $JAIL = "all" ] ; then + # Output a brief list for all jails + echo "Jail status (*=running, !=not configured):" + for JAIL in $JAILS ; do + # Loop through jails + JAIL=`expr "$JAIL" : "\(.*\):.*"` + # Run hooks + jail_run_hooks before-status + if jail_exists && jail_running ; then + # Jail is running + echo "*$JAIL ($(jail_ip))" + elif jail_exists ; then + # Jail not running + echo " $JAIL ($(jail_ip))" + else + # Jail nonexistant or not configured + echo "!$JAIL ($(jail_ip))" + fi + # Run hooks + jail_run_hooks after-status + done + else + # Output information for a specific jail + # Run hooks + jail_run_hooks before-status + if jail_running ; then + # Jail is running, be verbose + echo "$JAIL ($(jail_ip)) is up." + echo "Path: $(jail_path)" + echo "Interface: $(jail_if)" + echo "Process list:" + # Output process list for jail + jps + elif jail_exists; then + # Jail not running + echo "$JAIL ($(jail_ip)) is down." + echo "Path: $(jail_path)" + echo "Interface: $(jail_if)" + else + # Jail nonexistant or not configured + echo "Unable to query jail $JAIL!" + echo "Incomplete configuration?" + fi + # Run hooks + jail_run_hooks after-status + fi + else + echo "Path: $(jail_path)" + echo "Interface: $(jail_if)" + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + +jail_start() { + ## Start one or several jails + if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then + # Jail exists (or "all" was specified), we can attempt to start it + if [ $JAIL = "all" ] ; then + # Attempting to start all jails + for JAIL in $JAILS ; do + # Loop through jails + JAIL=`expr "$JAIL" : "\(.*\):.*"` + if jail_running ; then + # Jail is running, cannot start + echo "Jail already running!" + elif jail_exists ; then + # Jail not running, starting + echo "Starting jail $JAIL..." + jstart + else + # Jail nonexistant or not configured + echo "Unable to start jail $JAIL!" + echo "Incomplete configuration?" + fi + done + else + # Start a specific jail + if jail_running && [ ! $FORCE ] ; then + # Jail is running, cannot start + echo "Jail already running!" + elif jail_exists ; then + # Jail not running, starting + echo "Starting jail $JAIL..." + jstart + else + # Jail nonexistant or not configured + echo "Unable to start jail $JAIL!" + echo "Incomplete configuration?" + fi + fi + else + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + +jail_stop() { + ## Stop one or several jails + if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then + # Jail exists (or "all" was specified), we can attempt to stop it + if [ $JAIL = "all" ] ; then + # Attempting to stop all jails + if [ $VERSION -eq 4 ] && [ `ls /proc | wc -l` -eq 0 ] ; then + # We are on FreeBSD 4.x, and we have no /proc to rely on + jstop + else + for JAIL in $JAILS ; do + # Loop through jails + JAIL=`expr "$JAIL" : "\(.*\):.*"` + if jail_exists && jail_running ; then + # Jail is running, stopping + echo "Stopping jail $JAIL..." + jstop + elif jail_exists && ! jail_running ; then + # Jail not running, cannot stop + echo "Jail not running ($JAIL)!" + else + # Jail nonexistant or not configured + echo "Unable to stop jail $JAIL!" + echo "Incomplete configuration?" + fi + done + fi + else + if jail_exists && jail_running ; then + if [ $VERSION -eq 4 ] && [ `ls /proc | wc -l` -eq 0 ] ; then + # We are on FreeBSD 4.x, and we have no /proc to rely on + echo 'Without a proc filesystem, you must use "jailctl stop all"!' + else + # Jail running, stopping + echo "Stopping jail $JAIL..." + jstop + fi + elif jail_exists && ! jail_running ; then + # Jail not running, cannot stop + echo "Jail not running!" + else + # Jail nonexistant or not configured + echo "Unable to start jail $JAIL!" + echo "Incomplete configuration?" + fi + fi + else + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + +jail_create() { + ## Create a jail + # Be more specific in distinguishing return codes from jail_exists + jail_exists ; RC=$? + if [ $JAIL ] && [ $RC -eq 1 ] ; then + # If the jail is configured but does not exist on disk, create the jail + echo "Creating jail $JAIL..." + jcreate + else + # Jail not configured or already exists + echo "Jail $JAIL cannot be created!" + fi + return 0 +} + +jail_upgrade() { + ## Upgrade one or several jails + if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then + # Jail exists (or "all" was specified), we can attempt to upgrade it + if [ $JAIL = "all" ] ; then + # Attempting to upgrade all jails + for JAIL in $JAILS ; do + # Loop through jails + JAIL=`expr "$JAIL" : "\(.*\):.*"` + if jail_exists ; then + # Jail exists and is not running, upgrading + echo "Upgrading jail $JAIL..." + jupgrade + else + # Jail nonexistant or not configured + echo "Jail does not exist, or not configured!" + fi + done + else + if jail_exists ; then + # Jail exists and is not running, upgrading + echo "Upgrading jail $JAIL..." + jupgrade + else + # Jail nonexistant or not configured + echo "Jail does not exist, or not configured!" + fi + fi + else + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + +jail_delete() { + ## Delete a specific jail + if [ $JAIL ] && ((jail_exists && ! jail_running) || [ $FORCE ]) ; then + # Jail exists and is not running, deleting + echo "Deleting jail $JAIL..." + jdelete + else + # Jail nonexistant, running or not configured, cannot delete + echo "Jail $JAIL cannot be deleted!" + fi + return 0 +} + +jail_backup() { + ## Back up one or several jails + if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then + # Jail exists (or "all" was specified), we can attempt to back it up + if [ $JAIL = "all" ] ; then + # Attempting to back up all jails + for JAIL in $JAILS ; do + # Loop through jails + JAIL=`expr "$JAIL" : "\(.*\):.*"` + if jail_exists && ! jail_running ; then + # Jail exists and is not running, doing cold backup + echo "Doing cold backup of jail $JAIL..." + jbackup cold + elif jail_exists && jail_running ; then + # Jail is running, doing warm backup + echo "Doing warm backup of jail $JAIL..." + jbackup + else + # Jail nonexistant or not configured + echo "Jail does not exist, or not configured!" + fi + done + else + if jail_exists && ! jail_running ; then + # Jail exists and is not running, doing cold backup + echo "Doing cold backup of jail $JAIL..." + jbackup cold + elif jail_exists && jail_running ; then + # Jail is running, doing warm backup + echo "Doing warm backup of jail $JAIL..." + jbackup + else + # Jail nonexistant or not configured + echo "Jail does not exist, or not configured!" + fi + fi + else + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + +jail_restore() { + ## Restore a jail + # Be more specific in distinguishing return codes from jail_exists + jail_exists ; RC=$? + if [ $JAIL ] && [ $RC -eq 1 ] ; then + echo "Restoring jail $JAIL from backup" + local JP=$(jail_path) + # Restore the jail + jrestore + else + # No jail was specified, or the specified jail doesn't exist (on disk + # or in jails.conf. Show usage information) + echo "No valid jail specified!" + echo + usage + fi +} + + +# +### Helper function section +# + +jail_exists() { + ## Query a jails existence + local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"` +# for J in $JAILS ; do + # Loop through configured jails + local J_NAME=`expr "$J" : "\(.*\):.*"` + if [ $J_NAME = $JAIL ] && [ -d "$(jail_path)" ] && \ + [ `expr $(ls -a $(jail_path) | grep -v "^.snap$" | wc -l)` -gt 2 ]; then + # Jail is configured, its directory exists, and the + # directory contains more than . and .. + return 0 + elif [ $J_NAME = $JAIL ] && [ ! -d "$(jail_path)" ] || \ + ( [ -d "$(jail_path)" ] && \ + [ `expr $(ls -a $(jail_path) | grep -v "^.snap$" | wc -l)` -le 2 ]); then + # Jail is defined, but not yet created (directory missing or empty) + return 1 + fi +# done + # Jail doesn't exist + return 2 +} + +jail_name() { + ## Query the name of a jail + ## Must be updated to be able to search per IP. Searching per name makes + ## no sense + local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"` +# for J in $JAILS ; do + # Loop through configured jails + local J_NAME=`expr "$J" : "\(.*\):.*"` + if [ $J_NAME = $JAIL ] ; then + # Name part of jail definition matches + echo $J_NAME + return 0 + fi +# done + # Jail not found or error + return 1 +} + +jail_ip() { + ## Query the IP of a jail + local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"` +# for J in $JAILS ; do + # Loop through configured jails + local J_NAME=`expr "$J" : "\([^;].*\):.*"` + if [ $J_NAME = $JAIL ] ; then + # Name part of jail definition matches, output IP +echo $J > debug.file + local J_IP=`expr "$J" : ".*:\([^;]*\)"` + echo $J_IP + return 0 + fi +# done + # Jail not found or error + return 1 +} + +jail_path() { + ## Query the path to a jail + local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"` +# for J in $JAILS ; do + # Loop through configured jails + local J_NAME=`expr "$J" : "\(.*\):.*"` + if [ $J_NAME = $JAIL ] ; then + # Name part of jail definition matches, output path + local J_HOME=`expr "$J" : "[^;]*;\([^;]*\).*$"` + if [ -n "$J_HOME" ] ; then + if [ `expr "$J_HOME" : ".*\/$"` -gt 0 ] ; then + local J_PATH=`expr "$J_HOME" : "\(.*\)/$"` + else + local J_PATH="${J_HOME}/${J_NAME}" + fi + else + local J_PATH="${JAIL_HOME}$J_NAME" + fi + echo $J_PATH + return 0 + fi +# done + # Jail not found or error + return 1 +} + +jail_if() { + ## Query the path to a jail + local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"` +# for J in $JAILS ; do + # Loop through configured jails + local J_NAME=`expr "$J" : "\(.*\):.*"` + if [ $J_NAME = $JAIL ] ; then + # Name part of jail definition matches, output path + local J_HOME=`expr "$J" : "[^;]*;\([^;]*\).*$"` + local J_IF=`expr "$J" : ".*;[^;]*;\([^;]*\).*$"` + if [ -z "$J_IF" ] ; then + local J_IF=$IF + fi + echo $J_IF + return 0 + fi +# done + # Jail not found or error + return 1 +} + +jail_running() { + ## Query the running state of a jail + if [ $VERSION -ge 5 ] ; then + # We are on FreeBSD 5.x, using jls(1) tool + local JLS="`/usr/sbin/jls | grep \"\/${JAIL}$\"`" + if [ ! "$JLS" ] ; then + # Jail is not running + return 1 + fi + for i in "$JLS" ; do + # Fetching output string, concatenating + local J_LIST="$J_LIST $i" + done + # Setting JAIL_ID variable; this is the system jail ID + JAIL_ID=`echo $J_LIST | cut -d \ -f 1` + local JPS=`expr "\`/usr/sbin/jexec $JAIL_ID /bin/ps ax | grep -v \"ps\ ax\" | wc -l | cut -f 2\`" : "[[:space:]]*\([0-9]*\).*"` + if [ "$JPS" -lt 2 ] ; then + # Jail is not running (no processes, anyway) + return 1 + fi + else + # We are on FreeBSD 4.x, use old dirty trick + if [ ! -f "/var/run/jails/${JAIL}.running" ] ; then + # Jail is not running + return 1 + fi + fi + # Jail is running + return 0 +} + +# +### Activity function section +# + +jail_run_hooks() { + ## Select a hook list to run + case $1 in + before-start) + jrunhooks "$1" "$BEFORESTART_HOOKS" + ;; + after-start) + jrunhooks "$1" "$AFTERSTART_HOOKS" + ;; + before-stop) + jrunhooks "$1" "$BEFORESTOP_HOOKS" + ;; + after-stop) + jrunhooks "$1" "$AFTERSTOP_HOOKS" + ;; + before-status) + jrunhooks "$1" "$BEFORESTATUS_HOOKS" + ;; + after-status) + jrunhooks "$1" "$AFTERSTATUS_HOOKS" + ;; + before-backup) + jrunhooks "$1" "$BEFOREBACKUP_HOOKS" + ;; + after-backup) + jrunhooks "$1" "$AFTERBACKUP_HOOKS" + ;; + before-restore) + jrunhooks "$1" "$BEFORERESTORE_HOOKS" + ;; + after-restore) + jrunhooks "$1" "$AFTERRESTORE_HOOKS" + ;; + before-create) + jrunhooks "$1" "$BEFORECREATE_HOOKS" + ;; + after-create) + jrunhooks "$1" "$AFTERCREATE_HOOKS" + ;; + before-upgrade) + jrunhooks "$1" "$BEFOREUPGRADE_HOOKS" + ;; + after-upgrade) + jrunhooks "$1" "$AFTERUPGRADE_HOOKS" + ;; + before-delete) + jrunhooks "$1" "$BEFOREDELETE_HOOKS" + ;; + after-delete) + jrunhooks "$1" "$AFTERDELETE_HOOKS" + ;; + esac +} + +jps() { + ## List running processes in a jail + if [ $VERSION -ge 5 ] ; then + # We are on FreeBSD 5.x, use jexec(1) tool + /usr/sbin/jexec $JAIL_ID ps auxwww + else + # We are on FreeBSD 4.x, use old dirty trick (requires /proc on host!) + echo "CMD PID TIME UTIME STIME" + cat /proc/*/status | grep "${JAIL}" | cut -d \ -f 1 -f 2 -f 8 -f 9 -f 10 + fi + return 0 +} + +jstart() { + ## Start a jail + local JP=$(jail_path) + local IP=$(jail_ip) + local JIF=$(jail_if) + if [ $PROCFS -gt 0 ] ; then + # Mount proc filesystem into jail + /sbin/mount_procfs procfs ${JP}/proc + fi + if [ $LINPROCFS -gt 0 ] ; then + # Mount Linux proc filesystem into jail + /sbin/mount_linprocfs linprocfs ${JP}/compat/linux/proc + fi + + if [ $VERSION -ge 5 ] ; then + # Run hooks + jail_run_hooks before-start + # We are on FreeBSD 5.x, use devfs + /sbin/mount -t devfs devfs ${JP}/dev + devfs -m ${JP}/dev ruleset 4 + devfs -m ${JP}/dev rule applyset + fi + + # Bring up network interface alias and start jail + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff alias + echo >> ${JP}/var/log/jailstart.log + echo $(date) >> ${JP}/var/log/jailstart.log + jail $JP $JAIL $IP /bin/sh /etc/rc 2>&1 >${JP}/var/log/jailstart.log & + + if [ $VERSION -eq 4 ] ; then + # We're on FreeBSD 4.x, Create run file + touch /var/run/jails/${JAIL}.running + fi + + if [ $VERSION -ge 5 ] ; then + # Run hooks + jail_run_hooks after-start + fi + + return 0 +} + +jstop() { + ## Stop a jail + local JP=$(jail_path) + local IP=$(jail_ip) + local JIF=$(jail_if) + + if [ $VERSION -ge 5 ] ; then + # Run hooks + jail_run_hooks before-stop + fi + + echo "Sending TERM signal to jail processes..." + if [ $VERSION -ge 5 ] ; then + # We are on FreeBSD 5.x, use jexec(1) tool + /usr/sbin/jexec $JAIL_ID /bin/sh /etc/rc.shutdown + sleep 2 + /usr/sbin/jexec $JAIL_ID kill -15 -1 + # Waiting for processes to die + sleep 4 + while jail_running ; do + # Some processes are still running, do a kill -9 -1 + echo "Some processes would not terminate; sending KILL signal..." + /usr/sbin/jexec $JAIL_ID kill -9 -1 + # Give processes some time to die + sleep 2 + done + umount -f ${JP}/dev + else + # We are on FreeBSD 4.x + if [ "$JAIL" = "all" ] ; then + # /proc is unavailable, so we can only stop ALL jails at once + local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`" + for PID in "$PS" ; do + kill -15 $PID 2>/dev/null 1>/dev/null + done + # Waiting for processes to die + sleep 4 + local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`" + while [ "$PS" ] ; do + # Some processes are still running, do a kill -9 on each + echo "Some processes would not terminate; sending KILL signal..." + for PID in "$PS" ; do + # Sending KILL signal to all processes in the jail + kill -9 $PID 2>/dev/null 1>/dev/null + done + # Give processes some time to die + sleep 2 + local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`" + done + else + # Use /proc filesystem (REQUIRED for single-jail operation!) + local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`" + for PID in "$PS" ; do + # Sending TERM signal to all processes in the jail + kill -15 $PID 2>/dev/null 1>/dev/null + done + # Waiting for processes to die + sleep 4 + local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`" + while [ "$PS" ] ; do + # Some processes are still running, do a kill -9 on each + echo "Some processes would not terminate; sending KILL signal..." + for PID in "$PS" ; do + # Sending KILL signal to all processes in the jail + kill -9 $PID 2>/dev/null 1>/dev/null + done + # Give processes some time to die + sleep 2 + local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`" + done + fi + fi + + if [ $PROCFS -gt 0 ] ; then + # Unmount the jail proc filesystem + umount -f ${JP}/proc + fi + if [ $LINPROCFS -gt 0 ] ; then + # Unmount the jail Linux proc filesystem + umount -f ${JP}/compat/linux/proc + fi + + if [ $VERSION -eq 4 ] ; then + # We are on FreeBSD 4.x, remove runfile + rm /var/run/jails/${JAIL}.running + fi + + # Bring down network interface alias + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff -alias + + if [ $VERSION -ge 5 ] ; then + # Run hooks + jail_run_hooks after-stop + fi + + return 0 +} + +jcreate() { + jail_run_hooks before-create + ## Create a jail + local JP=$(jail_path) + local IP=$(jail_ip) + local JIF=$(jail_if) + + # Create jail directory + mkdir -p $JP + # Populate jail directory + jpopulate + # Initialize jail directory contents + jinit + # Remove unneeded files and clean up + jcleanup + jail_run_hooks after-create + return 0 +} + +jupgrade() { + jail_run_hooks before-upgrade + ## Upgrade a jail + local JP=$(jail_path) + # Run mergemaster to prepare the jail for upgrade + mergemaster -Upi -D $JP + # Populate jail directory + jpopulate + # Run mergemaster to update default configuration files + mergemaster -Ui -D $JP + # Remove unneeded files and clean up + jcleanup + if jail_running ; then + echo "Jail running, please restart!" + fi + jail_run_hooks after-upgrade + +} + +jdelete() { + jail_run_hooks before-delete + ## Delete a jail + local JP=$(jail_path) + local m_search="" + if [ $PROCFS -gt 0 ] ; then m_search="${JP}/proc" ; fi + if [ $LINPROCFS -gt 0 ] ; then + if [ -n "${m_search}" ] ; then m_search="${m_search}\|" ; fi + m_search="${m_search}${JP}/compat/linux/proc" + fi + if [ $VERSION -ge 5 ] ; then + if [ -n "${m_search}" ] ; then m_search="${m_search}\|" ; fi + m_search="${m_search}${JP}/dev" + fi + MOUNTS=`mount | grep "$JP" | grep -v "${m_search} | cut -d \ -f 3"` + MOUNTS_NO=`echo -n $MOUNTS | wc -l` + if [ $MOUNTS_NO -gt 0 ]; then + echo "WARNING: Mounted directories found in ${JP}:" + echo $MOUNTS + echo -n "Unmount ('n' will cancel delete)? [y/n] " + read ANS + if [ x$ANS = xy ]; then + for m in $MOUNTS ; do + echo -n "Unmounting $m ..." + umount_msg=`umount -f $m 2>&1` + umount_res=$? + sleep 1 + if [ $umount_res -ne 0 ] ; then + echo "FAILED!" + echo "$umount_msg" + else + echo "ok." + fi + done + MOUNTS=`mount | grep "$JP" | grep -v "${m_search}"` + MOUNTS_NO=`echo -n $MOUNTS | wc -l` + echo $MOUNTS_NO + if [ $MOUNTS_NO -gt 0 ] ; then + echo "Unmounting failed. Jail not deleted." + else + echo "All filesystems unmounted successfully. Deleting jail." + # Pass one: removing unprotected files + rm -Rf $JP 2>&1 > /dev/null + # Pass two: removing SCHG flag from jail tree + chflags -R noschg $JP + # Pass three: Removing jail directory + rm -Rf $JP + fi + fi + else + # Pass one: removing unprotected files + rm -Rf $JP 2>&1 > /dev/null + # Pass two: removing SCHG flag from jail tree + chflags -R noschg $JP + # Pass three: Removing jail directory + rm -Rf $JP + fi + jail_run_hooks after-delete + +} + +jbackup() { + ## Back up a jail + local JP=$(jail_path) + + # Determine target file for backup + if [ -n "$CMD" ] ; then + TARGET=$CMD + else + TARGET="${BACKUPDIR}/${JAIL}.tar" + fi + + # Run backup + jail_run_hooks before-backup + if [ ! "$1" = "cold" -a $VERSION -ge 5 ] ; then + # Run warm backup - FreeBSD >=5 only + if [ -z "$GPG" ] ; then + /usr/sbin/jexec $JAIL_ID /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast > ${TARGET}.gz + else + /usr/sbin/jexec $JAIL_ID /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast | $GPG -o ${TARGET}.gz.gpg + fi + else + # Run cold backup + if [ -z "$GPG" ] ; then + chroot $JP /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast > ${TARGET}.gz + else + chroot $JP /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast | $GPG -o ${TARGET}.gz.gpg + fi + fi + jail_run_hooks after-backup +} + +jrestore() { + ## Restore a jail from backup + # Create jail home + mkdir -p $JP && cd $JP + + # Determine source file for backup + if [ -n "$CMD" ] ; then + SOURCE=$CMD + else + SOURCE="${BACKUPDIR}/${JAIL}.tar.gz" + fi + + [ -f $SOURCE ] && jail_run_hooks before-restore + # Restore + tar -zpxf $SOURCE + [ $? -eq 0 ] && jail_run_hooks after-restore +} + + +# +### Activity helper function section +# + +jpopulate() { + ## Populate a jail directory + cd /usr/src + # Running installworld into jail directory + make installworld ${INSTALLWORLD_FLAGS} DESTDIR=${JP} 2>&1 | grep '>>>' +} + +jcleanup() { + ## Remove unneeded files and clean up a jail + # Copying the most recent list of files to delete + if [ $VERSION -ge 5 ] ; then + cp ${JAIL_HOME}addons/dellist5.txt $JP/dellist.txt + else + cp ${JAIL_HOME}addons/dellist4.txt $JP/dellist.txt + fi + # Removing protection from files to be deleted + chroot $JP chflags -R noschg $(cat ${JP}/dellist.txt) 2>/dev/null 1>/dev/null + # Deleting files + chroot $JP rm -Rf $(cat ${JP}/dellist.txt) 2>/dev/null 1>/dev/null + + # Changing binaries to be jail compatible + chroot ${JP} ln -f /usr/bin/true /sbin/mount + chroot ${JP} ln -f /usr/bin/true /sbin/umount + chroot ${JP} ln -f /usr/bin/true /sbin/swapon + chroot ${JP} ln -f /usr/bin/true /sbin/swapoff + chroot ${JP} chflags noschg /sbin/init + chroot ${JP} rm /sbin/init + chroot ${JP} ln -f /usr/bin/true /sbin/init + chroot ${JP} ln -f /usr/bin/true /sbin/adjkerntz + chroot ${JP} ln -f /usr/bin/true /sbin/ifconfig + + # Copy timezone information from host + cp /etc/localtime ${JP}/etc/localtime +} + +jinit() { + ## Install default set of configuration files + cd /usr/src/etc + # Installing distribution files to jail directory + make distribution DESTDIR=${JP} -DNO_MAKEDEV_RUN 2>/dev/null 1>/dev/null + + # Create directories in jail + mkdir -p ${JP}/proc + mkdir -p ${JP}/usr/home + mkdir -p ${JP}/root/.ssh + mkdir -p ${JP}/compat/linux/proc + mkdir -p ${JP}/usr/local/bin + chroot ${JP} ln -sf /usr/home /home + + # Update passwd database with default root user/pw + IFS2=$IFS + IFS=$(echo -e '\n\t') + if [ -z "$BATCH" ] ; then + echo "Setting root password in jail" + chroot ${JP} /usr/bin/passwd root + else + for L in $(cat ${JP}/etc/master.passwd) ; do + if [ "$L" = 'root::0:0::0:0:Charlie &:/root:/bin/csh' ] ; then + echo "root:${ROOT_PW}:0:0::0:0:Charlie &:/root:/bin/csh" >> ${JP}/tmp/jailctl.001 + else + echo $L >> ${JP}/tmp/jailctl.001 + fi + done + pwd_mkdb -p -d ${JP}/etc ${JP}/tmp/jailctl.001 + IFS=$IFS2 + fi + + # Install jail hostname and IP into hosts file + JAIL_HOST=$(expr $JAIL : "\([a-zA-Z0-9\-]*\)\..*") + JAIL_DOMAIN=$(expr $JAIL : "${JAIL_HOST}\.\(.*\)") + echo "$IP $JAIL $JAIL_HOST" >> ${JP}/etc/hosts + + # Create new rc.conf + echo '# Default jail rc.conf' > ${JP}/etc/rc.conf + for L in $RC_CONF ; do + echo $L >> ${JP}/etc/rc.conf + done + echo "hostname=\"$JAIL\"" >> ${JP}/etc/rc.conf + + # Update SSH configuration + sed -i .jailctl -Ee "s/#?PermitRootLogin no/PermitRootLogin yes/" ${JP}/etc/ssh/sshd_config + + # Update resolv.conf + echo "domain $JAIL_DOMAIN" > ${JP}/etc/resolv.conf + # Update resolv.conf + for L in $NAMESERVERS ; do + echo "nameserver $L" >> ${JP}/etc/resolv.conf + done + + # Creating symlinks + chroot ${JP} ln -sf /dev/null /kernel + if [ $VERSION -ge 5 ] ; then + # We are on FreeBSD 5.x, work around distribution bug + chroot ${JP} ln -sf /lib/libm.so.3 /lib/libm.so.2 + fi + + if [ $VERSION -eq 4 ] ; then + # We are on FreeBSD 4.x, initializing device tree + cd ${JP}/dev + sh MAKEDEV jail + fi + + # Installing addons + cp -R ${JAIL_HOME}addons/* ${JP}/ + + # Starting jail for the first time, calling runme.sh to install software + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff alias + JSTART=$(jail $JP $JAIL $IP /bin/sh /runme.sh) + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff -alias + + # Output commmands used to run installation script for easy re-run + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && echo "ifconfig $JIF inet $IP netmask 0xffffffff alias" + echo "jail $JP $JAIL $IP /bin/sh /runme.sh" + [ $(echo $JIF | cut -c 1-4) != 'carp' ] && echo "ifconfig $JIF inet $IP netmask 0xffffffff -alias" +} + +jrunhooks() { + ## Run a hook list + # Find jail ID on FreeBSD >5 + local JAIL_ID=0 + if [ $VERSION -ge 5 ] && jail_running ; then + local JLS="`/usr/sbin/jls | grep \"\/${JAIL}$\"`" + for i in "$JLS" ; do + # Fetching output string, concatenating + local J_LIST="$J_LIST $i" + done + # Setting JAIL_ID variable; this is the system jail ID + local JAIL_ID=`echo $J_LIST | cut -d \ -f 1` + fi + + for HOOK in $@; do + # Skip first parameter + [ ! "$HOOK" = "$1" ] && $HOOK $1 $JAIL $(jail_path) $JAIL_ID + done +} + +# +### Main block +# + +## Get current working directory +CWD=$(pwd) + +## Get command line parameters +ACTION=$1 +JAIL=$2 +CMD=$3 + +if [ "$CMD" = "force" ] ; then + FORCE=1 +fi + +## Checking current FreeBSD version +VERSION="`uname -r | cut -c 1`" + +if [ $VERSION -eq 4 ] ; then + # We are on FreeBSD 4.x, creating statefile directory + if [ ! -d "/var/run/jails" ] ; then + mkdir -p /var/run/jails + fi +fi + +case "$ACTION" in +status) jail_status ;; +start) jail_start ;; +stop) jail_stop ;; +create) jail_create ;; +upgrade) jail_upgrade ;; +delete) jail_delete ;; +backup) jail_backup ;; +restore) jail_restore ;; +*) usage ;; + +esac + +cd $CWD + +exit 0 + diff --git a/config/jailctl/jailctl-utils.inc b/config/jailctl/jailctl-utils.inc new file mode 100644 index 00000000..df16750c --- /dev/null +++ b/config/jailctl/jailctl-utils.inc @@ -0,0 +1,272 @@ +> ".$jstatus['jpath']."/etc/hosts \n"; + $cmd.="echo 'hostname=\"".$jail['jname']."\"' > ".$jstatus['jpath']."/etc/rc.conf \n"; + + if(is_array($jconfig['row']) { + foreach($jconfig['row'] as $_row) { + $cmd.="echo '".$_row['rcconfline']."' >> ".$jstatus['jpath']."/etc/rc.conf \n"; + #$cmd.="echo '".str_replace(' ', "\n", $jconfig['jrcconf'])."' >> ".$jstatus['jpath']."/etc/rc.conf \n"; + } + } + $cmd.="echo 'domain ".$jstatus['jhostname'][1]."' > ".$jstatus['jpath']."/etc/resolv.conf \n"; + foreach(explode(' ', trim($jconfig['jdnsservers'])) as $_ns) { + $cmd.="echo 'nameserver ".str_replace(' ', "\nnameserver ", $_ns)."' >> ".$jstatus['jpath']."/etc/resolv.conf \n"; + } + return $cmd; +} + +function jailctl_create_template($jail, $jstatus, $jconfig) { + $mounts=$GLOBALS['jailctl_tmp']['mounts']; + $unionmounts=$GLOBALS['jailctl_tmp']['unionmounts']; + $mount_unionfs=$GLOBALS['jailctl_tmp']['mount_unionfs']; + $mount_nullfs=$GLOBALS['jailctl_tmp']['mount_nullfs']; + + $_path=$jstatus['jpath']; + $_name=$jail['name']; + $_ip=$jail['jip']; + $_hostname=$jstatus['jhostname']; + $_dnsservers=$jconfig['jdnsservers']; + $_passwd=$jconfig['jpasswd']; + $_template=$jail['jtemplates']; + + exec('mkdir -p '.$_path.'/dev'); + exec('mkdir -p '.$_path.'/root'); + exec('ln -s /usr/home '.$_path.'/home'); + + $jail['juse_unionfs']=='on' ? $mount=$mount_unionfs : $mount=$mount_nullfs ; + + foreach($mounts as $mp) { + $cmd[]='mkdir -p '.$_path.'/'.$mp; + $cmd[]=$mount.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp; + } + + foreach($unionmounts as $mp) { + $cmd[]='mkdir -p '.$_path.'/'.$mp; + $cmd[]=$mount_unionfs.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp; + } + + foreach($cmd as $_t) { +# exec($_t.' 2>&1 ', $_mount); + exec($_t.' 2>&1 '); + } +# foreach($_mount as $_out) { +# echo $_out."
"; +# } + + $cmd=jailctl_initialize_jail($jail, $jstatus, $jconfig); + $fd=fopen('/tmp/jcreate_'.$jail['jname'], 'w+'); + fwrite($fd, $cmd); + fclose($fd); + exec("sh /tmp/jcreate_".$jail['jname']." 2>&1 >/var/log/jcreate_exec &"); + + foreach(array_reverse($mounts, true) as $mp) { + exec('umount -f '.$_path.'/'.$mp); + } + + foreach(array_reverse($unionmounts, true) as $mp) { + exec('umount -f '.$_path.'/'.$mp); + } +} + +function jailctl_create_sysinstall($jail, $jstatus, $jconfig) { + exec('mkdir -p '.$jstatus['jpath']); + $cmd="sysinstall "; + $cmd.="_ftpPath=".$jconfig['jftpmirror']." "; + $cmd.="nonInteractive=yes "; + $cmd.="mediaSetFTP "; + $cmd.="releaseName=7.1-RELEASE "; + if($jail['jdists']) { + $cmd.="dists=\"base ".str_replace(',', ' ', $jail['jdists'])."\" "; + $cmd.="distSetCustom "; + } else { + $cmd.=$jail['jdistset']." "; + } + $cmd.="installRoot=".$jstatus['jpath']." "; + $cmd.="installCommit "; + $cmd.="> /var/log/jcreate.log 2>/var/log/jcreate.err \n"; + $cmd.="\n"; + + $cmd.=jailctl_initialize_jail($jail, $jstatus, $jconfig); + + $fd=fopen('/tmp/jcreate_'.$jail['jname'], 'w+'); + fwrite($fd, $cmd); + fclose($fd); + + exec("sh /tmp/jcreate_".$jail['jname']." 2>&1 >/var/log/jcreate_exec &"); +} + +function jailctl_find_if($ip) { + exec("ifconfig | grep -C 1 '".addcslashes($ip, ".")."'", $_ifconfig); + $if=explode(':', $_ifconfig[0]); + + return $if[0]; +} + +function jailctl_addinterfaces($config) { + $vips=$config['virtualip']['vip']; + ?> + + + + "); print_r($jail); echo(""); + + + $jname=$jail['jname']; + $jhostname=explode('.', $jname, 2); + $jpath=$jconfig['jstorage']."/".$jname; + $jip=$jail['jip']; + $jif=$jail['jif']; + + if(is_ipaddr($jif)) { + $jrealif=jailctl_find_if($jif); + #$jrealif=guess_interface_from_ip($jif); + #$jrealif=link_carp_interface_to_parent($jif); + } else { + $jrealif=$config['interfaces'][$jif]['if']; + } + + if($config['interfaces'][$jif]['descr']) { + $jifdesc=$config['interfaces'][$jif]['descr']; + } elseif(is_ipaddr($jif)) { + $vips=$config['virtualip']['vip']; + foreach($vips as $vip) { + if($vip['mode']=='carp' and $vip['subnet']==$jif) { + $jifdesc='CARP on '.strtoupper($vip['interface']); + } + } + } else { + $jifdesc=strtoupper($jail['jif']); + } + + $_out=Array(); + exec('ps axwww | grep "sysinstall.*'.$jname.'" | grep -v grep', $_out); + if(count($_out)) { + $jstate='Building'; + } else { + $_out=Array(); + exec('/usr/local/sbin/jailctl status '.$jname, $_out); + #echo("
"); print_r($_out); echo("
"); + if (substr($_out[0], 0, strlen($jname))==$jname) { + $_tmp=Array(); + ereg("is (.*)\.", array_shift($_out), $_tmp); + switch ($_tmp[1]) { + case 'down': + $jstate='Stopped'; + break; + case 'up': + $jstate='Running'; + break; + default: + $jstate='Undefined'; + break; + } + } else { + $jstate='New'; + } + } + + $jstatus['jstate']=$jstate; + $jstatus['jpath']=$jpath; + $jstatus['jrealif']=$jrealif; + $jstatus['jifdesc']=$jifdesc; + $jstatus['jhostname']=$jhostname; + + return $jstatus; +} + + +?> \ No newline at end of file diff --git a/config/jailctl/jailctl.inc b/config/jailctl/jailctl.inc new file mode 100644 index 00000000..d6b7344c --- /dev/null +++ b/config/jailctl/jailctl.inc @@ -0,0 +1,217 @@ +/dev/null 2>/dev/null &"); +# sync_package_jailctl(); +} + +function jailctl_deinstall() { +# unset($GLOBALS['config']['installedpackages']['pfjailctlsettings']); +# unset($GLOBALS['config']['installedpackages']['pfjailctl']); +} + +function jailctl_install() { + $jails=$GLOBALS['config']['installedpackages']['pfjailctl']['config']; + for($i=0;$i<=count($jails);$i++) { + if(is_array($jails[$i]) and ! $jails[$i]['jname']) + unset($GLOBALS['config']['installedpackages']['pfjailctl']['config'][$i]); + } + + if(!$GLOBALS['config']['installedpackages']['pfjailctlsettings']['config'][0]['jif']) { + $settings['jif']='lan'; + $settings['jdnsservers']=$GLOBALS['config']['interfaces']['lan']['ipaddr']; + $settings['jstorage']='/usr/local/jails'; + $settings['jbackup']=$settings['jstorage']; + $settings['jbackupexcludes']='--exclude ./usr/ports/* --exclude ./tmp/* --exclude ./var/tmp/* --exclude ./usr/src/*'; + $settings['jrcconf']='sshd_enable="YES"'; + $settings['jpasswd']='$1$e4.8A4lV$oU.OQciTOnonltQkK12ff0'; + + $GLOBALS['config']['installedpackages']['pfjailctlsettings']['config'][0]=$settings; + } +} + +function jailctl_servicestatus() { + global $config; + $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0]; + $jails=$config['installedpackages']['pfjailctl']['config']; + is_array($jails) ? $num_jails=count($jails) : $num_jails=0; + + if($num_jails) { + for ($i=0;$i<$num_jails;$i++) { + $jname=$jails[$i]['jname']; + $jstatus=Array(); + $_jcreate=Array(); + exec('/usr/local/sbin/jailctl status '.$jname, $jstatus); + + if (substr($jstatus[0], 0, strlen($jname))==$jname) { + $_tmp=Array(); + ereg("is (.*)\.", array_shift($jstatus), $_tmp); + switch ($_tmp[1]) { + case 'up': + break; + default: + return false; + } + } else { + return false; + } + } + } else { + return false; + } + return true; +} + +function jailctl_do_xmlrpc_sync($config) { + $jails=$config['installedpackages']['pfjailctl']['config'][0]; + $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0]; + $sync=$config['installedpackages']['carpsettings']['config'][0]; + + if(!$sync['synchronizetoip'] or !$sync['password']) + return; + + if($config['system']['webgui']['protocol'] != "") { + $synchronizetoip = $config['system']['webgui']['protocol']; + $synchronizetoip .= "://"; + } + $port = $config['system']['webgui']['port']; + /* if port is empty lets rely on the protocol selection */ + if($port == "") { + if($config['system']['webgui']['protocol'] == "http") + $port = "80"; + else + $port = "443"; + } + $synchronizetoip .= $sync['synchronizetoip']; + + /* xml will hold the sections to sync */ + $xml = array(); + $xml['pfjailctl'] = $config['installedpackages']['pfjailctl']; + $xml['pfjailctlsettings'] = $config['installedpackages']['pfjailctlsettings']; + + /* assemble xmlrpc payload */ + $params = array( + XML_RPC_encode($sync['password']), + XML_RPC_encode($xml) + ); + + /* set a few variables needed for sync code borrowed from filter.inc */ + $url = $synchronizetoip; + log_error("Beginning pfJailctl XMLRPC sync to {$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', $sync['password']); + /* send our XMLRPC message and timeout after 25 seconds */ + $resp = $cli->send($msg, "25"); + if(!$resp) { + $error = "A communications error occured while attempting pfJailctl XMLRPC sync with {$url}:{$port}."; + log_error($error); + file_notice("sync_settings", $error, "pfJailctl Settings Sync", ""); + } elseif($resp->faultCode()) { + $cli->setDebug(1); + $resp = $cli->send($msg, "250"); + $error = "An error code was received while attempting pfJailctl XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString(); + log_error($error); + file_notice("sync_settings", $error, "pfJailctl Settings Sync", ""); + } else { + log_error("pfJailctl XMLRPC sync successfully completed with {$url}:{$port}."); + } + #echo "done.
"; +} + +function sync_package_jailctl() { + global $config, $g; + $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0]; + $jails=$config['installedpackages']['pfjailctl']['config']; + is_array($jails) ? $num_jails=count($jails) : $num_jails=0; + + $jdefaultif=$config['interfaces']['lan']['if']; + + conf_mount_rw(); + config_lock(); + $fd = fopen("/usr/local/etc/jails.conf","w"); + + fwrite($fd, 'IF="'.$jdefaultif.'"'."\n"); + fwrite($fd, 'JAIL_HOME="'.$jconfig['jstorage'].'/"'."\n"); + fwrite($fd, 'BACKUPDIR="'.$jconfig['jbackup'].'"'."\n"); + fwrite($fd, 'BACKUP_EXCLUDE="'.$jconfig['jbackupexcludes'].'"'."\n"); + fwrite($fd, 'INSTALLWORLD_FLAGS="'.$jconfig['jinstallflags'].'"'."\n"); + fwrite($fd, 'BATCH="'.$jconfig['jbatchcreate'].'"'."\n"); + fwrite($fd, 'ROOT_PW="'.$jconfig['jpasswd'].'"'."\n"); + fwrite($fd, 'NAMESERVERS="'.$jconfig['jdnsservers'].'"'."\n"); + fwrite($fd, 'RC_CONF=\''.$jconfig['jrcconf'].'\''."\n"); + + fwrite($fd, "\nJAILS=''\n"); + + $_rcfile['file']='jails.sh'; + $_rcfile['start']=''; + $_rcfile['stop']=''; + if($num_jails) { + for ($i=0;$i<$num_jails;$i++) { + $jname=$jails[$i]['jname']; + $jpath=$jconfig['jstorage']."/".$jname."/"; + $jif=$jails[$i]['jif']; + if(is_ipaddr($jif)) { + $jip=$jif; + #$jif=guess_interface_from_ip($jif); + $jif=jailctl_find_if($jif); + } else { + $jif=$config['interfaces'][$jails[$i]['jif']]['if']; + $jip=$jails[$i]['jip']; + } + + $_cfg="JAILS=\"\$JAILS $jname:$jip;$jpath;$jif\"\n"; + fwrite($fd, $_cfg); + + if($jails[$i]['jautostart']=='on') { + $_rcfile['start'].="/usr/local/sbin/jailctl start $jname \n\t"; + $_rcfile['stop'].="/usr/local/sbin/jailctl stop $jname \n\t"; + } + } + } + + write_rcfile($_rcfile); + fclose($fd); + jailctl_do_xmlrpc_sync($config); +} + +?> diff --git a/config/jailctl/jailctl.xml b/config/jailctl/jailctl.xml new file mode 100644 index 00000000..079ddb6b --- /dev/null +++ b/config/jailctl/jailctl.xml @@ -0,0 +1,233 @@ + + + + + Jail management + Disk space... + Currently there are no FAQ items provided. + pfJailctl + 0.1 + Jails + + + Jails + Jail management +
Services
+ jailctl.xml +
+ + Jails + jails.sh + All jails with autostart enabled. + + include("/usr/local/pkg/jailctl.inc"); + jailctl_servicestatus(); + + + + ['installedpackages']['$packagename']['config'] + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_defaults.xml + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_settings.xml + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl.inc + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl-utils.inc + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_list.inc + + + /usr/local/sbin/ + 0755 + http://www.pfsense.com/packages/config/jailctl/jailctl + + + /usr/sbin/ + 0755 + http://www.pfsense.com/packages/config/jailctl/sysinstall + + + + + Jails + /pkg.php?xml=jailctl.xml + + + + Global settings + /pkg_edit.php?xml=jailctl_settings.xml&id=0 + + + + + + + + State + jstate + + + Jail name + jname + + + Jail IF + jifdesc + + + Jail IP + jip + + + Jail path + jpath + + + Actions + jactions + + + + + + + Jail hostname + jname + FQDN of the jail + input + + + Network interface + jif + Jail will be bound to this interface + interfaces_selection + + + IP address + jip + Must be in the same subnet as the parent interface + input + + + Autostart jail on boot? + jautostart + Start this jail automatically when the system boots? + checkbox + + + + + Jail templates + jselect_templates + listtopic + Select a predefined template for your jail: + + + Templates + jtemplates + Files from the templates will be read-only inside the jail. + select + + + + jtemplate_default + + + Use unionfs + juse_unionfs + Use unionfs instead of nullfs to mount the template contents into the jail + checkbox + + + + Package sets + jselect_sets + listtopic + OR select a distribution set to install: + + + Distribution sets + jdistset + Select a standard set of distributions to install + select + + + + + + + + + + + + Individual packages + jselect_individual + listtopic + OR select individual distributions in addition to 'base': + + + + Individual distributions + jdists + Select individual distributions (multiple selection) + select + + + + + + + + + + + + + + + + + + + /usr/local/pkg/jailctl_list.inc + + sync_package_jailctl(); + + + jailctl_delete(); + + + sync_package_jailctl(); + + + jailctl_install(); + + + jailctl_deinstall(); + + + jailctl_addinterfaces($config); + jailctl_addtemplates($config); + +
+ diff --git a/config/jailctl/jailctl_defaults.xml b/config/jailctl/jailctl_defaults.xml new file mode 100644 index 00000000..c499abcb --- /dev/null +++ b/config/jailctl/jailctl_defaults.xml @@ -0,0 +1,122 @@ + + + + + Jail management + Built world in /usr/obj + Currently there are no FAQ items provided. + pfJailctl_Defaults + 0.1 + Jails: Jail building defaults + + ['installedpackages']['package']['$packagename']['config'] + + + + Jails + /pkg.php?xml=jailctl.xml + + + Global settings + /pkg_edit.php?xml=jailctl_settings.xml&id=0 + + + Jail defaults + /pkg_edit.php?xml=jailctl_defaults.xml&id=0 + + + + + + + Package sets + jdist_select_sets + listtopic + Select a distribution set: + + + Distribution set + jdist_set + Select a standard set of distributions to install + select + eng + + + + + + + distSetUser + + + Individual packages + jdist_select_individual + listtopic + OR select individual distributions in addition to base: + + + Manual pages + jdist_manpages + checkbox + + + Games + jdist_games + checkbox + + + The Ports collection + jdist_ports + checkbox + + + Miscellaneous documentation + jdist_doc + checkbox + + + X.Org client binaries + jdist_xbin + checkbox + + + X.Org libraries + jdist_xlib + checkbox + + + X.Org manual pages + jdist_xman + checkbox + + + X.Org imake distribution + jdist_xprog + checkbox + + + Local additions collection + jdist_local + checkbox + + + + + + /usr/local/pkg/jailctl.inc + + sync_package_jailctl(); + + + sync_package_jailctl(); + + + sync_package_jailctl(); + + + + + + + diff --git a/config/jailctl/jailctl_list.inc b/config/jailctl/jailctl_list.inc new file mode 100644 index 00000000..d1869bd6 --- /dev/null +++ b/config/jailctl/jailctl_list.inc @@ -0,0 +1,112 @@ +
");
+						echo(file_get_contents("/tmp/jcreate_".$_name));
+						echo("
"); + } else { + header('Location: /pkg.php?xml=jailctl.xml'); + } + flush(); + exit; + + case 'start': +# if($jstate!='Stopped') break; + exec('umount -f '.$_path.'/dev'); + if($_template) { + $jail['juse_unionfs']=='on' ? $mount=$mount_unionfs : $mount=$mount_nullfs ; + foreach($mounts as $mp) { + exec($mount.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd); + } + foreach($unionmounts as $mp) { + exec($mount_unionfs.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd); + } + } + + $cmd='jailctl start '.$_name; + exec($cmd, $_cmd); + if($jconfig['debug']) { + echo(""); + } else { + header('Location: /pkg.php?xml=jailctl.xml'); + } + flush(); + exit; + + case 'stop': +# if($jstate!='Running') break; + $cmd='jailctl stop '.$_name; + exec($cmd, $_cmd); + if($_template) { + foreach($mounts as $mp) { + exec('umount -f '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd); + } + foreach($unionmounts as $mp) { + exec('umount -f '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd); + } + } + exec('umount -f '.$_path.'/dev'); + if($jconfig['debug']) { + echo(""); + } else { + header('Location: /pkg.php?xml=jailctl.xml'); + } + flush(); + exit; + } + } + + $config['installedpackages']['pfjailctl']['config'][$i]['jstate']=$jstatus['jstate']; + $config['installedpackages']['pfjailctl']['config'][$i]['jpath']=$jstatus['jpath']; + $config['installedpackages']['pfjailctl']['config'][$i]['jifdesc']= + $jstatus['jifdesc']." (".$jstatus['jrealif'].")"; + + $jactions=Array(); + switch ($jstatus['jstate']) { + case 'Building': + $jactions[]=""; + break; + case 'New': + $jactions[]="Create"; + break; + case 'Stopped': + $jactions[]="Start"; + #$jactions[]="Upgrade"; + break; + case 'Running': + $jactions[]="Stop"; + break; + } + $config['installedpackages']['pfjailctl']['config'][$i]['jactions']=implode(' | ', $jactions); + } +} + + +?> \ No newline at end of file diff --git a/config/jailctl/jailctl_settings.xml b/config/jailctl/jailctl_settings.xml new file mode 100644 index 00000000..e82eea6c --- /dev/null +++ b/config/jailctl/jailctl_settings.xml @@ -0,0 +1,121 @@ + + + + + Jail management + Built world in /usr/obj + Currently there are no FAQ items provided. + pfJailctl_Settings + 0.1 + Jails: Settings + + ['installedpackages']['$packagename']['config'] + + + + Jails + /pkg.php?xml=jailctl.xml + + + Global settings + /pkg_edit.php?xml=jailctl_settings.xml&id=0 + + + + + + + + FTP mirror + jftpmirror + Select a FTP server (mirror) to use for sysinstall + select + + + + + + + ftp://ftp.FreeBSD.org/pub/FreeBSD/ + + + DNS servers + DNS servers to be added to /etc/resolv.conf of jails, space separated IP addresses + jdnsservers + textarea + + + Location for jails + jstorage + Jails will be stored here + input + /usr/local/jails + /usr/local/jails + + + Location for jail backups + jbackup + Backups are .tgz files of the jail directory + input + /usr/local/jails + + + Files to exclude from backup + jbackupexcludes + Files to exclude from backup + input + --exclude ./usr/ports/* --exclude ./tmp/* --exclude ./var/tmp/* --exclude ./usr/src/* + + + System configuration + jrcconf + rowhelper + + + Lines to add to /etc/rc.conf + input + 25 + rcconfline + + + + + Default password for jails + jpasswd + Set to "system" by default.<br> + <b>NOTE: Only type here if you want to change the current default password!</b><br> + This field will show as empty even if a password has been set. Changing this will not affect existing jails. + password + system + + + Debug mode + debug + checkbox + Enable debug information do be shown by the GUI + + + + + + + /usr/local/pkg/jailctl.inc + + sync_package_jailctl(); + + + sync_package_jailctl(); + + + sync_package_jailctl(); + + + + + + + diff --git a/config/jailctl/sysinstall b/config/jailctl/sysinstall new file mode 100755 index 00000000..d4a05fb1 Binary files /dev/null and b/config/jailctl/sysinstall differ -- cgit v1.2.3 From db4523f55ad16382edc05fbf21809108809726f1 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sat, 14 Mar 2009 11:53:13 +0100 Subject: Include all files for jail packages... --- config/jail_template.xml | 36 ++++++++ config/jailctl.xml | 233 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 config/jail_template.xml create mode 100644 config/jailctl.xml (limited to 'config') diff --git a/config/jail_template.xml b/config/jail_template.xml new file mode 100644 index 00000000..d183200b --- /dev/null +++ b/config/jail_template.xml @@ -0,0 +1,36 @@ + + + + + Basic jail template + Disk space... + Currently there are no FAQ items provided. + jail_template + 0.1 + Jail template + + ['installedpackages']['$packagename']['config'] + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/jail_template/jail_template.inc + + + /usr/ + 0755 + http://www.pfsense.com/packages/config/jail_template/jail_template.img.uzip + + + /usr/local/pkg/jail_template.inc + + jail_template_install(); + + + jail_template_deinstall(); + + + jail_template_resync(); + + + diff --git a/config/jailctl.xml b/config/jailctl.xml new file mode 100644 index 00000000..079ddb6b --- /dev/null +++ b/config/jailctl.xml @@ -0,0 +1,233 @@ + + + + + Jail management + Disk space... + Currently there are no FAQ items provided. + pfJailctl + 0.1 + Jails + + + Jails + Jail management +
Services
+ jailctl.xml +
+ + Jails + jails.sh + All jails with autostart enabled. + + include("/usr/local/pkg/jailctl.inc"); + jailctl_servicestatus(); + + + + ['installedpackages']['$packagename']['config'] + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_defaults.xml + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_settings.xml + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl.inc + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl-utils.inc + + + /usr/local/pkg/ + 0644 + http://www.pfsense.com/packages/config/jailctl/jailctl_list.inc + + + /usr/local/sbin/ + 0755 + http://www.pfsense.com/packages/config/jailctl/jailctl + + + /usr/sbin/ + 0755 + http://www.pfsense.com/packages/config/jailctl/sysinstall + + + + + Jails + /pkg.php?xml=jailctl.xml + + + + Global settings + /pkg_edit.php?xml=jailctl_settings.xml&id=0 + + + + + + + + State + jstate + + + Jail name + jname + + + Jail IF + jifdesc + + + Jail IP + jip + + + Jail path + jpath + + + Actions + jactions + + + + + + + Jail hostname + jname + FQDN of the jail + input + + + Network interface + jif + Jail will be bound to this interface + interfaces_selection + + + IP address + jip + Must be in the same subnet as the parent interface + input + + + Autostart jail on boot? + jautostart + Start this jail automatically when the system boots? + checkbox + + + + + Jail templates + jselect_templates + listtopic + Select a predefined template for your jail: + + + Templates + jtemplates + Files from the templates will be read-only inside the jail. + select + + + + jtemplate_default + + + Use unionfs + juse_unionfs + Use unionfs instead of nullfs to mount the template contents into the jail + checkbox + + + + Package sets + jselect_sets + listtopic + OR select a distribution set to install: + + + Distribution sets + jdistset + Select a standard set of distributions to install + select + + + + + + + + + + + + Individual packages + jselect_individual + listtopic + OR select individual distributions in addition to 'base': + + + + Individual distributions + jdists + Select individual distributions (multiple selection) + select + + + + + + + + + + + + + + + + + + + /usr/local/pkg/jailctl_list.inc + + sync_package_jailctl(); + + + jailctl_delete(); + + + sync_package_jailctl(); + + + jailctl_install(); + + + jailctl_deinstall(); + + + jailctl_addinterfaces($config); + jailctl_addtemplates($config); + +
+ -- cgit v1.2.3 From 712a3cf204e2d7f8769db873a913ccf9d4ed6adc Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sat, 14 Mar 2009 12:08:32 +0100 Subject: Bugfix in pfJailctl --- config/jailctl/jailctl-utils.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/jailctl/jailctl-utils.inc b/config/jailctl/jailctl-utils.inc index df16750c..36c50d23 100644 --- a/config/jailctl/jailctl-utils.inc +++ b/config/jailctl/jailctl-utils.inc @@ -25,7 +25,7 @@ function jailctl_initialize_jail($jail, $jstatus, $jconfig) { $cmd.="echo '".$jail['jip']." ".$jail['jname']." ".$jstatus['jhostname'][0]."' >> ".$jstatus['jpath']."/etc/hosts \n"; $cmd.="echo 'hostname=\"".$jail['jname']."\"' > ".$jstatus['jpath']."/etc/rc.conf \n"; - if(is_array($jconfig['row']) { + if(is_array($jconfig['row'])) { foreach($jconfig['row'] as $_row) { $cmd.="echo '".$_row['rcconfline']."' >> ".$jstatus['jpath']."/etc/rc.conf \n"; #$cmd.="echo '".str_replace(' ', "\n", $jconfig['jrcconf'])."' >> ".$jstatus['jpath']."/etc/rc.conf \n"; @@ -269,4 +269,4 @@ function jailctl_jailstatus($config, $jail) { } -?> \ No newline at end of file +?> -- cgit v1.2.3 From b753fe0f921c682542fb3aafd388e67a5cc32727 Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 14 Mar 2009 22:52:14 -0600 Subject: Add new package to backup and restore files and directories --- config/backup/backup.inc | 132 ++++++++++++++++++ config/backup/backup.tmp | 309 ++++++++++++++++++++++++++++++++++++++++++ config/backup/backup.xml | 115 ++++++++++++++++ config/backup/backup_edit.tmp | 213 +++++++++++++++++++++++++++++ 4 files changed, 769 insertions(+) create mode 100644 config/backup/backup.inc create mode 100644 config/backup/backup.tmp create mode 100644 config/backup/backup.xml create mode 100755 config/backup/backup_edit.tmp (limited to 'config') diff --git a/config/backup/backup.inc b/config/backup/backup.inc new file mode 100644 index 00000000..34fb31e3 --- /dev/null +++ b/config/backup/backup.inc @@ -0,0 +1,132 @@ +10^x|1024->2^x] + $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'); + $e=floor(log($bytes,$convention)); + return round($bytes/pow($convention,$e),2).' '.$s[$e]; +} + + +function backup_sync_package_php() +{ + + global $config; + if($config['installedpackages']['backup']['config'] != "") { + + conf_mount_rw(); + config_unlock(); + + foreach($config['installedpackages']['backup']['config'] as $rowhelper) { + if ($rowhelper['enabled'] != "false") { + //$tmp_php = base64_decode($rowhelper['php']); + if (strlen($tmp_php) > 0) { + $tmp .= "// name: ".$rowhelper['name']." \n"; + $tmp .= "// description: ".$rowhelper['description']." \n\n"; + $tmp .= base64_decode($rowhelper['php']); + $tmp .= "\n"; + } + } + + } + + conf_mount_ro(); + + } +} + + +function php_sync_package() +{ + + global $config; + backup_sync_package_php(); + +} + + +function php_install_command() +{ + + global $config; + conf_mount_rw(); + config_lock(); + + if (!is_dir('/usr/local/www/packages/')) { + exec("mkdir /usr/local/www/packages/"); + } + + if (!is_dir('/usr/local/www/packages/backup/')) { + exec("mkdir /usr/local/www/packages/backup/"); + } + + + //rename PHP files from .tmp to .php + exec("cp /tmp/backup.tmp /usr/local/www/packages/backup/backup.php"); + unlink_if_exists("/tmp/backup.tmp"); + + exec("cp /tmp/backup_edit.tmp /usr/local/www/packages/backup/backup_edit.php"); + unlink_if_exists("/tmp/backup_edit.tmp"); + + //write_config(); + + + + php_sync_package(); + + conf_mount_ro(); + config_unlock(); + +} + + +function deinstall_command() +{ + + conf_mount_rw(); + config_lock(); + unlink_if_exists("/usr/local/pkg/backup.xml"); + unlink_if_exists("/usr/local/pkg/backup.inc"); + exec("rm /usr/local/www/packages/backup/"); + conf_mount_ro(); + config_unlock(); + +} + +?> \ No newline at end of file diff --git a/config/backup/backup.tmp b/config/backup/backup.tmp new file mode 100644 index 00000000..6ce7a3ae --- /dev/null +++ b/config/backup/backup.tmp @@ -0,0 +1,309 @@ + 0) { + $backup_cmd = 'tar --create --verbose --gzip --file '.$tmp.$filename.' --directory / '; + foreach ($a_backup as $ent) { + if ($ent['enabled'] =="true"){ + //htmlspecialchars($ent['name']); + //htmlspecialchars($ent['path']); + //htmlspecialchars($ent['description']); + $backup_cmd .= htmlspecialchars($ent['path']).' '; + + } + $i++; + } + //echo $backup_cmd; //exit; + system($backup_cmd); + } + + session_cache_limiter('public'); + $fd = fopen($tmp.$filename, "rb"); + header("Content-Type: binary/octet-stream"); + header("Content-Length: " . filesize($tmp.$filename)); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + fpassthru($fd); + exit; + } +} + +if ($_GET['a'] == "other") { + if ($_GET['t'] == "restore") { + $tmp = '/tmp/'; + $filename = 'pfsense.bak.tgz'; + + //extract the tgz file + if (file_exists('/tmp/'.$filename)) { + //echo "The file $filename exists"; + system('cd /; tar xvpfz /tmp/'.$filename.' '); + header( 'Location: backup.php?savemsg=Backup+has+been+restored.' ) ; + } + else { + header( 'Location: backup.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ; + } + + exit; + } +} + +if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { + $filename = 'pfsense.bak.tgz'; + move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tmp/" . $filename); + $savemsg = "Uploaded file to /tmp/" . htmlentities($_FILES['ulfile']['name']); + system('cd /; tar xvpfz /tmp/'.$filename.' '); +} + + +include("head.inc"); + +?> + + + + +

Backup: Files & Directories

+ + + +
+ + +
+ +
+ + + + \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
+ + + + + +
+

+ Use this to tool to backup files and directories. The following directories + are recommended for backup. + + + + +
pfSense Config/conf
RRD Graph Data Files/var/db/rrd
+

+
+ +
+
+ +
+ +
+ + + + + + + + + +
Upload and Restore
Use this to upload and restore your backup file.File to upload: + + + +
+
+
+
+ + + +\n"; + echo "
\n"; + echo "Backup / Restore
\n"; + echo "The 'backup' button will tar gzip the directories that are listed below to /tmp/pfsense.bak.tgz it then presents a file to download. \n"; + echo "If the backup file does not exist in /tmp/pfsense.bak.tgz then the 'restore' button will be hidden. \n"; + echo "

\n"; + echo "
\n"; + echo " \n"; + if (file_exists('/tmp/pfsense.bak.tgz')) { + echo " \n"; + } + echo "
\n"; + echo "

\n\n"; + + +echo "
\n"; + + +if ($config_change == 1) { + write_config(); + $config_change = 0; +} + +//if ($savemsg) print_info_box($savemsg); +//if (file_exists($d_hostsdirty_path)): echo"

"; +//print_info_box_np("This is an info box."); +//echo"
"; +//endif; + +?> + + + + + + + + + + + 0) { + + foreach ($a_backup as $ent) { + + ?> + + + + + + + + + + + + + + + + + + +
NameEnabledDescription + + + + + + +
+ +
+   + +   + +   + + + + + + +
+
+ + + + + +
+
+ +

+ + +
+
+
+
+
+
+
+
+ +
+ +
+ + + + + diff --git a/config/backup/backup.xml b/config/backup/backup.xml new file mode 100644 index 00000000..44b3809d --- /dev/null +++ b/config/backup/backup.xml @@ -0,0 +1,115 @@ + + + + + + + + Backup + Describe your package requirements here + Currently there are no FAQ items provided. + Backup Settings + 0.1.2 + Settings + /usr/local/pkg/backup.inc + + Backup Files/Dir + Backup settings. +
Diagnostics
+ backup.xml + /packages/backup/backup.php +
+ + + Settings + /pkg_edit.php?xml=backup.xml&id=0 + + + + Settings + /packages/backup.php + + + + installedpackages->package->$packagename->configuration->backup + + /usr/local/pkg/ + 0755 + http://portableusbapps.com/packages/config/backup/backup.xml + + + /usr/local/pkg/ + 0755 + http://portableusbapps.com/packages/config/backup/backup.inc + + + /tmp/ + 0755 + http://portableusbapps.com/packages/config/backup/backup.tmp + + + /tmp/ + 0755 + http://portableusbapps.com/packages/config/backup/backup_edit.tmp + + + + Example Variable One + var1 + Enter the variable one here. + input + + + Example Variable Two + var1 + Enter the variable one here. + input + + + + + + php_sync_package(); + + + php_sync_package(); + + + php_install_command(); + + + deinstall_command(); + +
\ No newline at end of file diff --git a/config/backup/backup_edit.tmp b/config/backup/backup_edit.tmp new file mode 100755 index 00000000..69d63866 --- /dev/null +++ b/config/backup/backup_edit.tmp @@ -0,0 +1,213 @@ + + + + + + +

Backup: Edit

+ + + +
+ + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Name + +
Path + +
Enabled + \n"; + echo " \n"; + switch (htmlspecialchars($pconfig['enabled'])) { + case "true": + echo " \n"; + echo " \n"; + break; + case "false": + echo " \n"; + echo " \n"; + + break; + default: + echo " \n"; + echo " \n"; + } + echo " \n"; + ?> +
Description + +
Enter the description here.
+
  + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+ + + + -- cgit v1.2.3 From 8786348e8a19e788cbca12b88b60191fa6f6b6d6 Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 14 Mar 2009 22:59:15 -0600 Subject: Move the tftp package to the /usr/local/www/packages/tftp directory --- config/tftp/tftp.inc | 8 ++++---- config/tftp/tftp.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/tftp/tftp.inc b/config/tftp/tftp.inc index a7053df9..ee65f52d 100644 --- a/config/tftp/tftp.inc +++ b/config/tftp/tftp.inc @@ -109,14 +109,14 @@ function php_install_command() } - if (!is_dir('/usr/local/www/tftp')) { + if (!is_dir('/usr/local/www/packages/tftp')) { // Create the directory - exec("mkdir /usr/local/www/tftp"); + exec("mkdir /usr/local/www/packages/tftp"); } //rename PHP files from .tmp to .php - exec("cp /tmp/tftp_files.tmp /usr/local/www/tftp/tftp_files.php"); + exec("cp /tmp/tftp_files.tmp /usr/local/www/packages/tftp/tftp_files.php"); unlink_if_exists("/tmp/tftp_files.tmp"); //prepare inetd.conf for tftp @@ -268,7 +268,7 @@ function php_deinstall_command() unlink_if_exists("/usr/local/pkg/tftp.xml"); unlink_if_exists("/usr/local/pkg/tftp.inc"); - unlink_if_exists("/usr/local/www/tftp/tftp_files.php"); + unlink_if_exists("/usr/local/www/packages/tftp/tftp_files.php"); exec("rm -R /tftpboot"); unlink_if_exists("/usr/local/etc/rc.d/tftp.sh"); diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml index e7b69d6b..cf7a2a98 100644 --- a/config/tftp/tftp.xml +++ b/config/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 1.0.2 + 1.0.3 TFTP: Settings /usr/local/pkg/tftp.inc @@ -49,7 +49,7 @@ Add or Remove files for TFTP.
Services
tftp.xml - /tftp/tftp_files.php + /packages/tftp/tftp_files.php
tftp -- cgit v1.2.3 From fd3478aa7dae751a293a68c48987233be253e184 Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 14 Mar 2009 23:10:26 -0600 Subject: FreeSWITCH minor wording change, and css class improvements for pfSense 2.0 --- config/freeswitch/freeswitch.inc | 2 +- config/freeswitch/freeswitch.xml | 4 +-- config/freeswitch/freeswitch_extensions_edit.tmp | 34 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index 2601df01..4222d27a 100755 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1672,7 +1672,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.3.4"; + $freeswitch_package_version = "0.8.3.5"; $freeswitch_build_version = "1.0.3"; $freeswitch_build_revision = "12545"; diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index e6578f70..65acc4d8 100755 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.3.4 + 0.8.3.5 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc @@ -411,7 +411,7 @@ SMTP Host smtphost - Enter the SMTP host address. If you using a different port append it on the end with a semi-colon. e.g. smtp.gmail.com:465 + Enter the SMTP host address. If you using a different port append it on the end with a colon. e.g. smtp.gmail.com:465 input diff --git a/config/freeswitch/freeswitch_extensions_edit.tmp b/config/freeswitch/freeswitch_extensions_edit.tmp index 9b1639f5..aeaaf4bc 100755 --- a/config/freeswitch/freeswitch_extensions_edit.tmp +++ b/config/freeswitch/freeswitch_extensions_edit.tmp @@ -172,49 +172,49 @@ function show_advanced_config() { Extension - +
Enter the extension here. The default configuration expects extension numbers between 1000 -1019. To use 3 digit extensions adjust the dialplan 'default.xml' under name="Local_Extension" change the regular expression="^(10[01][0-9])$" to expression="^(\d{3})$".
Password - +
Enter the password here.
Mailbox - +
Enter the mailbox here. Example: extension 1001 then mailbox 1001
Voicemail Password - +
Enter the voicemail password here.
Account Code - +
Enter the account code here. Example: extension 1001 then accountcode 1001
Effective Caller ID Name - +
Enter the effective caller id name here.
Effective Caller ID Number - +
Enter the effective caller id number here.
@@ -222,14 +222,14 @@ function show_advanced_config() { Outbound Caller ID Name - +
Enter the outbound caller id name here.
Outbound Caller ID Number - +
Enter the outbound caller id number here.
@@ -237,7 +237,7 @@ function show_advanced_config() { Voicemail Mail To - +
Optional: Enter the email address to send voicemail to.
@@ -245,7 +245,7 @@ function show_advanced_config() { Voicemail Attach File \n"; + echo " +
Enter the user context here. Example: default
Call Group - +
Enter the user call group here. Example: sales, support
@@ -297,14 +297,14 @@ function show_advanced_config() { Auth-ACL - +
Enter the auth acl here.
CIDR - +
Enter the cidr here.
@@ -315,7 +315,7 @@ function show_advanced_config() { Extension Description - +
Enter the description of the extension here.
@@ -323,7 +323,7 @@ function show_advanced_config() {   - + -- cgit v1.2.3 From 28b734d6d460c7a7dfcff61b06193088889fc36b Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Tue, 17 Mar 2009 12:33:45 -0400 Subject: Dashboard 0.7.5.1 - Small bugfix for interface name formatting --- config/dashboard/dashboard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index 492aef40..bcb3a8ed 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.3 + 0.7.5.1 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 58851f1c7f48cbe513e9bd0579f741431c687627 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Tue, 17 Mar 2009 19:47:20 +0100 Subject: dns server 3th and 4th option added --- config/Fit123/bin/dnssrv/system.abc | 347 ++++++++++++++++++++++++++++++++++++ config/Fit123/fit123.inc | 11 ++ config/Fit123/fit123.xml | 6 + 3 files changed, 364 insertions(+) create mode 100755 config/Fit123/bin/dnssrv/system.abc (limited to 'config') diff --git a/config/Fit123/bin/dnssrv/system.abc b/config/Fit123/bin/dnssrv/system.abc new file mode 100755 index 00000000..24021aab --- /dev/null +++ b/config/Fit123/bin/dnssrv/system.abc @@ -0,0 +1,347 @@ +. + 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. +*/ + +require("guiconfig.inc"); + +$pconfig['hostname'] = $config['system']['hostname']; +$pconfig['domain'] = $config['system']['domain']; +list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver']; + +$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']); +$pconfig['username'] = $config['system']['username']; +if (!$pconfig['username']) + $pconfig['username'] = "admin"; +$pconfig['webguiproto'] = $config['system']['webgui']['protocol']; +if (!$pconfig['webguiproto']) + $pconfig['webguiproto'] = "http"; +$pconfig['webguiport'] = $config['system']['webgui']['port']; +$pconfig['timezone'] = $config['system']['timezone']; +$pconfig['timeupdateinterval'] = $config['system']['time-update-interval']; +$pconfig['timeservers'] = $config['system']['timeservers']; +$pconfig['theme'] = $config['system']['theme']; + +if (!isset($pconfig['timeupdateinterval'])) + $pconfig['timeupdateinterval'] = 300; +if (!$pconfig['timezone']) + $pconfig['timezone'] = "Etc/UTC"; +if (!$pconfig['timeservers']) + $pconfig['timeservers'] = "pool.ntp.org"; + +$changedesc = "System: "; +$changecount = 0; + +function is_timezone($elt) { + return !preg_match("/\/$/", $elt); +} + +if($pconfig['timezone'] <> $_POST['timezone']) { + /* restart firewall log dumper helper */ + require_once("functions.inc"); + $pid = `ps awwwux | grep -v "grep" | grep "tcpdump -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`; + if($pid) { + mwexec("kill $pid"); + usleep(1000); + } + filter_pflog_start(); +} + +exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist); +$timezonelist = array_filter($timezonelist, 'is_timezone'); +sort($timezonelist); + +if ($_POST) { + + $changecount++; + + unset($input_errors); + $pconfig = $_POST; + + /* input validation */ + $reqdfields = split(" ", "hostname domain username"); + $reqdfieldsn = split(",", "Hostname,Domain,Username"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) { + $input_errors[] = "The hostname may only contain the characters a-z, 0-9 and '-'."; + } + if ($_POST['domain'] && !is_domain($_POST['domain'])) { + $input_errors[] = "The domain may only contain the characters a-z, 0-9, '-' and '.'."; + } + if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddr($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddr($_POST['dns4']))) { + $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server."; + } + if ($_POST['username'] && !preg_match("/^[a-zA-Z0-9]*$/", $_POST['username'])) { + $input_errors[] = "The username may only contain the characters a-z, A-Z and 0-9."; + } + if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) || + ($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) { + $input_errors[] = "A valid TCP/IP port must be specified for the webGUI port."; + } + if (($_POST['password']) && ($_POST['password'] != $_POST['password2'])) { + $input_errors[] = "The passwords do not match."; + } + + $t = (int)$_POST['timeupdateinterval']; + if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) { + $input_errors[] = "The time update interval must be either 0 (disabled) or between 6 and 1440."; + } + foreach (explode(' ', $_POST['timeservers']) as $ts) { + if (!is_domain($ts)) { + $input_errors[] = "A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'."; + } + } + + if (!$input_errors) { + update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname'])); + update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain'])); + update_if_changed("username", $config['system']['username'], $_POST['username']); + + if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto'])) + $restart_webgui = true; + if (update_if_changed("webgui port", $config['system']['webgui']['port'], $_POST['webguiport'])) + $restart_webgui = true; + + update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']); + update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers'])); + update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']); + + /* pfSense themes */ + update_if_changed("System Theme", $config['theme'], $_POST['theme']); + + /* XXX - billm: these still need updating after figuring out how to check if they actually changed */ + unset($config['system']['dnsserver']); + if ($_POST['dns1']) + $config['system']['dnsserver'][] = $_POST['dns1']; + if ($_POST['dns2']) + $config['system']['dnsserver'][] = $_POST['dns2']; + if ($_POST['dns3']) + $config['system']['dnsserver'][] = $_POST['dns3']; + if ($_POST['dns4']) + $config['system']['dnsserver'][] = $_POST['dns4']; + + $olddnsallowoverride = $config['system']['dnsallowoverride']; + + unset($config['system']['dnsallowoverride']); + $config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false; + if ($_POST['password']) { + $config['system']['password'] = crypt($_POST['password']); + update_changedesc("password changed via webConfigurator"); + sync_webgui_passwords(); + } + + if ($changecount > 0) + write_config($changedesc); + + if ($restart_webgui) { + global $_SERVER; + list($host) = explode(":", $_SERVER['HTTP_HOST']); + if ($config['system']['webgui']['port']) { + $url="{$config['system']['webgui']['protocol']}://{$host}:{$config['system']['webgui']['port']}/system.php"; + } else { + $url = "{$config['system']['webgui']['protocol']}://{$host}/system.php"; + } + } + + $retval = 0; + config_lock(); + $retval = system_hostname_configure(); + $retval |= system_hosts_generate(); + $retval |= system_resolvconf_generate(); + $retval |= system_password_configure(); + $retval |= services_dnsmasq_configure(); + $retval |= system_timezone_configure(); + $retval |= system_ntp_configure(); + + if ($olddnsallowoverride != $config['system']['dnsallowoverride']) + $retval |= interfaces_wan_configure(); + + config_unlock(); + + // Reload filter -- plugins might need to run + filter_configure(); + + $savemsg = get_std_save_message($retval); + if ($restart_webgui) + $savemsg .= "
One moment...redirecting to {$url} in 10 seconds."; + } +} + +$pgtitle = "System: General Setup"; +include("head.inc"); + +?> + + + +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hostname +
name of the firewall host, without + domain part
+ e.g. firewall
Domain +
e.g. mycorp.com
DNS servers

+ +
+ +
+ +
+ +
+ IP addresses; these are also used for + the DHCP service, DNS forwarder and for PPTP VPN clients
+
+ > + Allow DNS server list to be overridden by DHCP/PPP + on WAN
+ If this option is set, will use DNS servers assigned + by a DHCP/PPP server on WAN for its own purposes (including + the DNS forwarder). They will not be assigned to DHCP and + PPTP VPN clients, though.

Username +
+ If you want + to change the username for accessing the webGUI, enter it + here.
Password +
+  (confirmation)
If you want + to change the password for accessing the webGUI, enter it + here twice.
webGUI protocol > + HTTP     > + HTTPS
webGUI port +
+ Enter a custom port number for the webGUI + above if you want to override the default (80 for HTTP, 443 + for HTTPS). Changes will take effect immediately after save.
Time zone
Select the location closest + to you
NTP time server +
Use a space to separate multiple + hosts (only one required). Remember to set up at least one + DNS server if you enter a host name here!
 
Theme
  + + This will change the look and feel of +
  +
+
+ +"; + } +?> + + + diff --git a/config/Fit123/fit123.inc b/config/Fit123/fit123.inc index 4dcc2f36..646ab65f 100644 --- a/config/Fit123/fit123.inc +++ b/config/Fit123/fit123.inc @@ -27,6 +27,8 @@ function Fit123_install_config() { //LTSP network boot Option exec("cp /etc/inc/services.inc /usr/local/pkg/Fit123/backup/"); exec("cp /usr/local/www/services_dhcp.php /usr/local/pkg/Fit123/backup/"); + //DNS Server adds option for a 3th and 4th DNS Server + exec("cp /usr/local/www/system.php /usr/local/pkg/Fit123/backup/"); //Greate directories and downloading files to them //Date exec("mkdir /usr/local/pkg/Fit123/date"); @@ -47,6 +49,9 @@ function Fit123_install_config() { exec("chmod 744 /usr/local/pkg/Fit123/afc/reset_states.sh"); //DDNS exec("mkdir /usr/local/pkg/Fit123/ddns"); + //DNS Server adds option for a 3th and 4th DNS Server + exec("mkdir /usr/local/pkg/Fit123/dnssrv"); + exec("fetch -o /usr/local/pkg/Fit123/dnssrv/system.php http://www.pfsense.com/packages/config/Fit123/bin/dnssrv/system.abc"); conf_mount_ro(); config_unlock(); } @@ -91,6 +96,12 @@ global $config; $config['system']['afterfilterchangeshellcmd'] = "/usr/local/bin/reset_states.sh"; else $config['system']['afterfilterchangeshellcmd'] = ""; + + $dnssrv = $config['installedpackages']['fit123']['config'][0]['dnssrv']; + if($dnssrv) + exec("cp /usr/local/pkg/Fit123/dnssrv/system.php /usr/local/www/system.php"); + else + exec("cp /usr/local/pkg/Fit123/backup/system.php /usr/local/www/system.php"); } function ddns_config(){ diff --git a/config/Fit123/fit123.xml b/config/Fit123/fit123.xml index 063a0f4b..04274234 100644 --- a/config/Fit123/fit123.xml +++ b/config/Fit123/fit123.xml @@ -65,6 +65,12 @@ checkbox
+ + DNS Servers + dnssrv + Adds option for a 3th and 4th DNS Server + checkbox + Fit123_config(); -- cgit v1.2.3 From 22ed812a199a8b5d779a97389cd26c42731aacad Mon Sep 17 00:00:00 2001 From: mcrane Date: Tue, 17 Mar 2009 12:48:06 -0600 Subject: Change version of Backup package --- config/backup/backup.inc | 7 +------ config/backup/backup.xml | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/backup/backup.inc b/config/backup/backup.inc index 34fb31e3..fa2783d6 100644 --- a/config/backup/backup.inc +++ b/config/backup/backup.inc @@ -79,7 +79,7 @@ function php_sync_package() backup_sync_package_php(); } - + function php_install_command() { @@ -96,7 +96,6 @@ function php_install_command() exec("mkdir /usr/local/www/packages/backup/"); } - //rename PHP files from .tmp to .php exec("cp /tmp/backup.tmp /usr/local/www/packages/backup/backup.php"); unlink_if_exists("/tmp/backup.tmp"); @@ -104,10 +103,6 @@ function php_install_command() exec("cp /tmp/backup_edit.tmp /usr/local/www/packages/backup/backup_edit.php"); unlink_if_exists("/tmp/backup_edit.tmp"); - //write_config(); - - - php_sync_package(); conf_mount_ro(); diff --git a/config/backup/backup.xml b/config/backup/backup.xml index 44b3809d..6bd813ac 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Backup Settings - 0.1.2 + 0.1.3 Settings /usr/local/pkg/backup.inc -- cgit v1.2.3 From 9efd4729b34a8e3dcb01f7a370f9ceb5d9b96ce8 Mon Sep 17 00:00:00 2001 From: mcrane Date: Tue, 17 Mar 2009 12:50:17 -0600 Subject: Backup package change path to package files and adjust version --- config/backup/backup.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/backup/backup.xml b/config/backup/backup.xml index 6bd813ac..7f6c7b8a 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -61,29 +61,29 @@ Settings /packages/backup.php - + - installedpackages->package->$packagename->configuration->backup + installedpackages->package->$packagename->configuration->backup /usr/local/pkg/ - 0755 - http://portableusbapps.com/packages/config/backup/backup.xml + 0755 + http://www.pfsense.com/packages/config/backup/backup.xml /usr/local/pkg/ - 0755 - http://portableusbapps.com/packages/config/backup/backup.inc + 0755 + http://www.pfsense.com/packages/config/backup/backup.inc /tmp/ - 0755 - http://portableusbapps.com/packages/config/backup/backup.tmp + 0755 + http://www.pfsense.com/packages/config/backup/backup.tmp /tmp/ - 0755 - http://portableusbapps.com/packages/config/backup/backup_edit.tmp - + 0755 + http://www.pfsense.com/packages/config/backup/backup_edit.tmp + Example Variable One @@ -97,13 +97,13 @@ Enter the variable one here. input - + php_sync_package(); - + php_sync_package(); -- cgit v1.2.3 From d3b717133d2b78a0fab78dd1169d70273a5d146d Mon Sep 17 00:00:00 2001 From: mcrane Date: Tue, 17 Mar 2009 13:13:05 -0600 Subject: Change repair path to backup.xml --- config/backup/backup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/backup/backup.xml b/config/backup/backup.xml index 7f6c7b8a..594ef398 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -7,7 +7,7 @@ /* $Id$ */ /* ========================================================================== */ /* - phpservice.xml + backup.xml Copyright (C) 2008 Mark J Crane All rights reserved. */ -- cgit v1.2.3 From 4d775b55e8f015b21f4aef49cb629c9ddba6b173 Mon Sep 17 00:00:00 2001 From: mcrane Date: Tue, 17 Mar 2009 13:15:06 -0600 Subject: Backup package increment build version --- config/backup/backup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/backup/backup.xml b/config/backup/backup.xml index 594ef398..d3e504e3 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Backup Settings - 0.1.3 + 0.1.4 Settings /usr/local/pkg/backup.inc -- cgit v1.2.3 From e71f29843a079db4b5ca9f6636342c69ab1a22c8 Mon Sep 17 00:00:00 2001 From: mcrane Date: Tue, 17 Mar 2009 13:42:09 -0600 Subject: Backup package example pfsense conf path changed to /cf/conf --- config/backup/backup.tmp | 2 +- config/backup/backup.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/backup/backup.tmp b/config/backup/backup.tmp index 6ce7a3ae..86d645d0 100644 --- a/config/backup/backup.tmp +++ b/config/backup/backup.tmp @@ -144,7 +144,7 @@ if ($_GET["savemsg"]) { are recommended for backup. - +
pfSense Config/conf
pfSense Config/cf/conf
RRD Graph Data Files/var/db/rrd

diff --git a/config/backup/backup.xml b/config/backup/backup.xml index d3e504e3..a0f72ba2 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Backup Settings - 0.1.4 + 0.1.5 Settings /usr/local/pkg/backup.inc -- cgit v1.2.3 From d24ce8924908cbaa8b2484848d340f8f3b5250e5 Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 27 Mar 2009 18:36:25 -0600 Subject: TFTP fix file paths --- config/tftp/tftp.inc | 7 ++++++- config/tftp/tftp.xml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/tftp/tftp.inc b/config/tftp/tftp.inc index ee65f52d..8649bc22 100644 --- a/config/tftp/tftp.inc +++ b/config/tftp/tftp.inc @@ -109,8 +109,13 @@ function php_install_command() } + if (!is_dir('/usr/local/www/packages/')) { + // Create the packages directory + exec("mkdir /usr/local/www/packages/"); + } + if (!is_dir('/usr/local/www/packages/tftp')) { - // Create the directory + // Create the tftp directory exec("mkdir /usr/local/www/packages/tftp"); } diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml index cf7a2a98..343110f5 100644 --- a/config/tftp/tftp.xml +++ b/config/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 1.0.3 + 1.0.4 TFTP: Settings /usr/local/pkg/tftp.inc @@ -60,7 +60,7 @@ Files - /tftp/tftp_files.php + /packages/tftp/tftp_files.php installedpackages->package->$packagename->configuration->tftp -- cgit v1.2.3 From 8cb1ca2f7873b63e7a15e156e72e3c487b62f16a Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 27 Mar 2009 18:38:03 -0600 Subject: TFTP adjust version --- config/tftp/tftp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml index 343110f5..fee6d28b 100644 --- a/config/tftp/tftp.xml +++ b/config/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 1.0.4 + 1.0.3 TFTP: Settings /usr/local/pkg/tftp.inc -- cgit v1.2.3 From 7e6fad76175d9e872063dff755c0f74fec866821 Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 27 Mar 2009 19:08:43 -0600 Subject: TFTP package make the backup deliver the backup file as a download, fix restore and add restore message --- config/tftp/tftp.inc | 3 ++- config/tftp/tftp_files.tmp | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'config') diff --git a/config/tftp/tftp.inc b/config/tftp/tftp.inc index 8649bc22..61d81b4a 100644 --- a/config/tftp/tftp.inc +++ b/config/tftp/tftp.inc @@ -274,8 +274,9 @@ function php_deinstall_command() unlink_if_exists("/usr/local/pkg/tftp.xml"); unlink_if_exists("/usr/local/pkg/tftp.inc"); unlink_if_exists("/usr/local/www/packages/tftp/tftp_files.php"); + exec("rm -R /usr/local/www/packages/tftp/"); - exec("rm -R /tftpboot"); + //exec("rm -R /tftpboot"); unlink_if_exists("/usr/local/etc/rc.d/tftp.sh"); unlink_if_exists("/tmp/pkg_mgr_tftp.log"); diff --git a/config/tftp/tftp_files.tmp b/config/tftp/tftp_files.tmp index f49ea76e..a5fb5ecc 100644 --- a/config/tftp/tftp_files.tmp +++ b/config/tftp/tftp_files.tmp @@ -37,18 +37,18 @@ if (($_GET['a'] == "download") && $_GET['t'] == "backup") { $filename = 'tftp.bak.tgz'; system('cd /;tar cvzf /tmp/tftp.bak.tgz tftpboot'); } -if (($_GET['a'] == "download") && file_exists("/tftpboot/".$filename)) { - +if (($_GET['a'] == "download") && file_exists("/tmp/".$filename)) { + session_cache_limiter('public'); - $fd = fopen("/tftpboot/".$filename, "rb"); + $fd = fopen("/tmp/".$filename, "rb"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); - header('Content-Disposition: attachment; filename="'.$filename.'"'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 - header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past - header("Content-Length: " . filesize("/tftpboot/".$filename)); + header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past + header("Content-Length: " . filesize("/tmp/".$filename)); fpassthru($fd); exit; } @@ -58,18 +58,18 @@ if ($_GET['a'] == "other") { if ($_GET['t'] == "restore") { $tmp = '/tmp/'; $filename = 'tftp.bak.tgz'; - + //extract a specific directory to /tftpboot if (file_exists('/tmp/'.$filename)) { //echo "The file $filename exists"; system('cd /; tar xvpfz /tmp/'.$filename); - system('chmod -R 744 /tftpboot/*'); + system('chmod -R 744 /tftpboot/*'); header( 'Location: tftp_files.php?savemsg=Backup+has+been+restored.' ) ; } else { header( 'Location: tftp_files.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ; - } - + } + exit; } } @@ -99,7 +99,8 @@ include("head.inc");

TFTP: Files

- @@ -169,9 +170,9 @@ if ($savemsg) { echo "

\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; if (file_exists('/tmp/tftp.bak.tgz')) { - echo " \n"; + echo " \n"; } echo "\n"; echo "\n"; -- cgit v1.2.3 From 3e799e432a10f46713c263d6540c2f834fe4778b Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 27 Mar 2009 19:10:37 -0600 Subject: TFTP package increment minor version --- config/tftp/tftp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml index fee6d28b..343110f5 100644 --- a/config/tftp/tftp.xml +++ b/config/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 1.0.3 + 1.0.4 TFTP: Settings /usr/local/pkg/tftp.inc -- cgit v1.2.3 From fdafc9b91db772878948b73a8d58eaec2d9fe180 Mon Sep 17 00:00:00 2001 From: mcrane Date: Fri, 27 Mar 2009 20:27:35 -0600 Subject: TFTP enable logging --- config/tftp/tftp.inc | 2 +- config/tftp/tftp.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/tftp/tftp.inc b/config/tftp/tftp.inc index 61d81b4a..40aed550 100644 --- a/config/tftp/tftp.inc +++ b/config/tftp/tftp.inc @@ -233,7 +233,7 @@ function php_install_command() write_rcfile(array( "file" => "tftp.sh", - "start" => "/usr/sbin/inetd", + "start" => "/usr/sbin/inetd -l", "stop" => "killall -9 inetd" ) ); diff --git a/config/tftp/tftp.xml b/config/tftp/tftp.xml index 343110f5..d8f1ea0b 100644 --- a/config/tftp/tftp.xml +++ b/config/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 1.0.4 + 1.0.5 TFTP: Settings /usr/local/pkg/tftp.inc -- cgit v1.2.3 From 8b828193e803bcf83bbfb70e6c6f2cd8c72851f2 Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Mon, 30 Mar 2009 16:57:38 -0400 Subject: Dashboard 0.7.5.2 - Fix error when IPSec has no tunnels defined. --- config/dashboard/dashboard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index bcb3a8ed..0e58b70f 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.5.1 + 0.7.5.2 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 4cb72cb340b940e9f9dad901b89b31eaf02e6800 Mon Sep 17 00:00:00 2001 From: Jim Pingle Date: Tue, 31 Mar 2009 12:08:42 -0400 Subject: Dashboard 0.7.5.3 - Attempt to fix uninstall/reinstall issues. --- config/dashboard/dashboard.inc | 34 ++++++++++++++++++++-------------- config/dashboard/dashboard.xml | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) (limited to 'config') diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc index 0eab0a3a..07f4610c 100644 --- a/config/dashboard/dashboard.inc +++ b/config/dashboard/dashboard.inc @@ -5,10 +5,16 @@ function dashboard_install() { assign_privs(); if(!file_exists("/usr/local/www/index.php.before_dashboard")) { /* backup the pre-dashboard files */ - mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); - mwexec("cp /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard"); - mwexec("cp /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard"); - mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard"); + mwexec("mv /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); + mwexec("mv /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard"); + mwexec("mv /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard"); + mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard"); + } else { + /* Move the files, since we do not know what version they are, don't try to keep them. */ + mwexec("mv /usr/local/www/index.php /usr/local/www/index.php.tmp"); + mwexec("mv /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.tmp"); + mwexec("mv /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.tmp"); + mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.tmp"); } mwexec("tar xzvpf /usr/local/pkg/widgets.tgz -C /"); assign_privs(); @@ -19,10 +25,10 @@ function dashboard_deinstall() { assign_privs(); if(file_exists("/usr/local/www/index.php.before_dashboard")) { /* restore the files prior to the dashboard package installation */ - mwexec("cp /usr/local/www/index.php.before_dashboard /usr/local/www/index.php"); - mwexec("cp /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc"); - mwexec("cp /usr/local/www/diag_logs_filter.php.before_dashboard /usr/local/www/diag_logs_filter.php"); - mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard /usr/local/www/diag_logs_filter_dynamic.php"); + mwexec("mv /usr/local/www/index.php.before_dashboard /usr/local/www/index.php"); + mwexec("mv /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc"); + mwexec("mv /usr/local/www/diag_logs_filter.php.before_dashboard /usr/local/www/diag_logs_filter.php"); + mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard /usr/local/www/diag_logs_filter_dynamic.php"); } assign_privs(); } @@ -35,12 +41,12 @@ function assign_privs() { mwexec("chown root:wheel /usr/local/www/stats.php"); mwexec("chown root:wheel /usr/local/www/diag_logs_filter.php"); mwexec("chown root:wheel /usr/local/www/diag_logs_filter_dynamic.php"); - mwexec("chmod a+rw /usr/local/www/index.php"); - mwexec("chmod a+rw /usr/local/www/fbegin.php"); - mwexec("chmod a+rw /usr/local/www/graph_cpu.php"); - mwexec("chmod a+rw /usr/local/www/stats.php"); - mwexec("chmod a+rw /usr/local/www/diag_logs_filter.php"); - mwexec("chmod a+rw /usr/local/www/diag_logs_filter_dynamic.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/index.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/fbegin.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/graph_cpu.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/stats.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter.php"); + mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter_dynamic.php"); } ?> \ No newline at end of file diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index 0e58b70f..3b6de1b0 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -46,7 +46,7 @@ Describe your package requirements here Currently there are no FAQ items provided. dashboard - 0.7.5.2 + 0.7.5.3 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3 From 26b0698cf6841b8b8704a52bce04d0070ba90642 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 2 Apr 2009 14:05:32 -0400 Subject: Add EPSV to Snort proprocessor's list of valid FTP commands --- config/snort/snort.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 20a03f93..5d6a2942 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -469,7 +469,7 @@ preprocessor ftp_telnet_protocol: \ ftp_cmds { LIST NLST SITE SYST STAT HELP NOOP } \ ftp_cmds { AUTH ADAT PROT PBSZ CONF ENC } \ ftp_cmds { FEAT OPTS CEL CMD MACB } \ - ftp_cmds { MDTM REST SIZE MLST MLSD } \ + ftp_cmds { MDTM REST SIZE MLST MLSD EPSV } \ ftp_cmds { XPWD XCWD XCUP XMKD XRMD TEST CLNT } \ alt_max_param_len 0 { CDUP QUIT REIN PASV STOU ABOR PWD SYST NOOP } \ alt_max_param_len 100 { MDTM CEL XCWD SITE USER PASS REST DELE RMD SYST TEST STAT MACB EPSV CLNT LPRT } \ -- cgit v1.2.3 From a66e40f7abe78944a3564f3bbf7de7a73e9d6717 Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 14:53:21 -0600 Subject: New pfSense package to manage xml cron items --- config/cron/cron.inc | 135 ++++++++++++++++++++++ config/cron/cron.tmp | 195 ++++++++++++++++++++++++++++++++ config/cron/cron.xml | 121 ++++++++++++++++++++ config/cron/cron_edit.tmp | 281 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 732 insertions(+) create mode 100644 config/cron/cron.inc create mode 100644 config/cron/cron.tmp create mode 100644 config/cron/cron.xml create mode 100644 config/cron/cron_edit.tmp (limited to 'config') diff --git a/config/cron/cron.inc b/config/cron/cron.inc new file mode 100644 index 00000000..5636111c --- /dev/null +++ b/config/cron/cron.inc @@ -0,0 +1,135 @@ +10^x|1024->2^x] + $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'); + $e=floor(log($bytes,$convention)); + return round($bytes/pow($convention,$e),2).' '.$s[$e]; +} + + + +function php_sync_package() +{ + + global $config; + //synch cron tab + configure_cron(); + +} + + +function php_install_command() +{ + + global $config; + conf_mount_rw(); + config_lock(); + + if (!is_dir('/usr/local/www/packages/')) { + exec("mkdir /usr/local/www/packages/"); + } + + if (!is_dir('/usr/local/www/packages/cron/')) { + exec("mkdir /usr/local/www/packages/cron/"); + } + + + //rename PHP files from .tmp to .php + exec("cp /tmp/cron.tmp /usr/local/www/packages/cron/cron.php"); + unlink_if_exists("/tmp/cron.tmp"); + + exec("cp /tmp/cron_edit.tmp /usr/local/www/packages/cron/cron_edit.php"); + unlink_if_exists("/tmp/cron_edit.tmp"); + + //write_config(); + + //write_rcfile(array( + // "file" => "cron.sh", + // "start" => "/usr/local/bin/php /usr/local/pkg/cron.php >> /var/log/cron.log &", + // "stop" => "rm /tmp/cron.pid" + // ) + //); + + php_sync_package(); + //$handle = popen("/usr/local/etc/rc.d/cron.sh start", "r"); + //pclose($handle); + + //if (pkg_is_service_running('cron')) { + //documentation purposes + //} + + conf_mount_ro(); + config_unlock(); + +} + + +function deinstall_command() +{ + + conf_mount_rw(); + config_lock(); + $handle = popen("/usr/local/etc/rc.d/cron.sh stop", "r"); + unlink_if_exists("/usr/local/pkg/cron.xml"); + unlink_if_exists("/usr/local/www/cron.inc"); + exec("rm -R /usr/local/www/packages/cron"); + //unlink_if_exists("/usr/local/etc/rc.d/cron.sh"); + conf_mount_ro(); + config_unlock(); + +} + +?> \ No newline at end of file diff --git a/config/cron/cron.tmp b/config/cron/cron.tmp new file mode 100644 index 00000000..5eacd1c2 --- /dev/null +++ b/config/cron/cron.tmp @@ -0,0 +1,195 @@ + + + + + +

Cron:

+ +
+ + +
+ +
+ + + + + +
+ +
+"; +//print_info_box_np("This is an info box."); +//echo"
"; +//endif; + +?> + + + + +

+ Cron controls the scheduling of commands. +

+ For more information see: http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html +

+
+ + + + + + + + + + + + 0) { + + foreach ($a_cron as $ent) { + + ?> + + + + + + + + + + + + + + + + + + + +
MinuteHourWhoCommand + + + + + + +
+ +
+   + +   + +   + +   + + + + + + +
+
+ + + + + +
+
+ +
+ + +
+
+
+
+
+
+
+
+ +
+ +
+ + + + + diff --git a/config/cron/cron.xml b/config/cron/cron.xml new file mode 100644 index 00000000..15d7fd12 --- /dev/null +++ b/config/cron/cron.xml @@ -0,0 +1,121 @@ + + + + + + + + Cron + Describe your package requirements here + Currently there are no FAQ items provided. + Cron Settings + 0.1 + Settings + /usr/local/pkg/cron.inc + + cron + cron settings. +
Services
+ cron.xml + /packages/cron/cron.php +
+ + cron + cron.sh + cron + PHP run from a command line as a service. + + + + Settings + /pkg_edit.php?xml=cron.xml&id=0 + + + + Settings + /packages/cron.php + + + + installedpackages->package->$packagename->configuration->cron + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/cron/cron.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.com/packages/config/cron/cron.inc + + + /tmp/ + 0755 + http://www.pfsense.com/packages/config/cron/cron.tmp + + + /tmp/ + 0755 + http://www.pfsense.com/packages/config/cron/cron_edit.tmp + + + + Variable One + var1 + Enter the variable one here. + input + + + Variable Two + var1 + Enter the variable one here. + input + + + + + + php_sync_package(); + + + php_sync_package(); + + + php_install_command(); + + + deinstall_command(); + +
\ No newline at end of file diff --git a/config/cron/cron_edit.tmp b/config/cron/cron_edit.tmp new file mode 100644 index 00000000..9922e350 --- /dev/null +++ b/config/cron/cron_edit.tmp @@ -0,0 +1,281 @@ + + + + + + +

Cron: Edit

+ + + +
+ + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ".htmlspecialchars($pconfig['php'])."\n"; + ?> + + + + + + + + +
minute + +
hour + +
mday + +
month + +
wday + +
who + +
command + +
  + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+ + + + -- cgit v1.2.3 From 0b6bfe46ae8af7e140dced3a33d24d52fcff5c4f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 6 Apr 2009 17:24:17 -0400 Subject: Fix Call to undefined function sync_package_sipproxd_users() --- config/siproxd.inc | 17 +++++++++++++++++ config/siproxd.xml | 2 +- config/siproxdusers.xml | 21 ++------------------- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'config') diff --git a/config/siproxd.inc b/config/siproxd.inc index fee47a90..be1ac196 100644 --- a/config/siproxd.inc +++ b/config/siproxd.inc @@ -27,6 +27,23 @@ POSSIBILITY OF SUCH DAMAGE. */ +function sync_package_sipproxd_users() { + conf_mount_rw(); + config_lock(); + global $config; + $fout = fopen("/usr/local/etc/siproxd_passwd.cfg","w"); + fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n"); + if($config['installedpackages']['siproxdusers']['config'] != "") { + foreach($config['installedpackages']['siproxdusers']['config'] as $rowhelper) { + fwrite($fout, $rowhelper['username'] . " " . $rowhelper['password'] . "\n"); + } + } + fclose($fout); + conf_mount_ro(); + config_unlock(); + system("/usr/bin/killall -HUP siproxd"); +} + function siproxd_generate_rules($type) { global $config; diff --git a/config/siproxd.xml b/config/siproxd.xml index deccf90d..c79c722f 100644 --- a/config/siproxd.xml +++ b/config/siproxd.xml @@ -44,7 +44,7 @@ siproxdsettings 0.5.13_pfs2 siproxd: Settings - /usr/local/pkg/siproxd.inc + /usr/local/pkg/siproxd.inc /pkg_edit.php?xml=siproxd.xml&id=0 siproxd diff --git a/config/siproxdusers.xml b/config/siproxdusers.xml index a25418f9..a36e0554 100644 --- a/config/siproxdusers.xml +++ b/config/siproxdusers.xml @@ -48,6 +48,7 @@ siproxdusers 0.5.9 siproxd: Users + /usr/local/pkg/siproxd.inc Settings @@ -91,27 +92,9 @@ - function sync_package_sipproxd_users() - { - conf_mount_rw(); - config_lock(); - global $config; - $fout = fopen("/usr/local/etc/siproxd_passwd.cfg","w"); - fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n"); - if($config['installedpackages']['siproxdusers']['config'] != "") { - foreach($config['installedpackages']['siproxdusers']['config'] as $rowhelper) { - fwrite($fout, $rowhelper['username'] . " " . $rowhelper['password'] . "\n"); - } - } - fclose($fout); - conf_mount_ro(); - config_unlock(); - system("/usr/bin/killall -HUP siproxd"); - } sync_package_sipproxd_users(); sync_package_sipproxd_users(); - - + \ No newline at end of file -- cgit v1.2.3 From c4426dac0da44f0080785868fc9d53c035478b8a Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 15:28:41 -0600 Subject: Cron package add additional fields to the list, fix link to edit. --- config/cron/cron.tmp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/cron/cron.tmp b/config/cron/cron.tmp index 5eacd1c2..17bb3cc1 100644 --- a/config/cron/cron.tmp +++ b/config/cron/cron.tmp @@ -95,13 +95,16 @@ if ($config_change == 1) {
- + - - - - + + + + + + +
MinuteHourWhoCommandminutehourmdaymonthwdaywhocommand @@ -123,6 +126,7 @@ if ($config_change == 1) { foreach ($a_cron as $ent) { ?> + + + + @@ -139,7 +152,7 @@ if ($config_change == 1) { - +
  @@ -130,6 +134,15 @@ if ($config_change == 1) {   +   + +   + +   +   - +
@@ -153,7 +166,7 @@ if ($config_change == 1) { ?>
@@ -166,7 +179,7 @@ if ($config_change == 1) { - +
-- cgit v1.2.3 From 34791a81ef20f06aeb93fc84243c346da984bbd6 Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 15:32:36 -0600 Subject: Cron package increment version --- config/cron/cron.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/cron/cron.xml b/config/cron/cron.xml index 15d7fd12..4fbe7ab6 100644 --- a/config/cron/cron.xml +++ b/config/cron/cron.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Cron Settings - 0.1 + 0.2 Settings /usr/local/pkg/cron.inc -- cgit v1.2.3 From 7dd374f607fd71775bae43d0ac17c4e97495b8aa Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 16:49:16 -0600 Subject: Cron package monitor process --- config/cron/cron.inc | 31 +++++++++---------------------- config/cron/cron.tmp | 2 +- config/cron/cron.xml | 8 ++++---- 3 files changed, 14 insertions(+), 27 deletions(-) (limited to 'config') diff --git a/config/cron/cron.inc b/config/cron/cron.inc index 5636111c..380ecd05 100644 --- a/config/cron/cron.inc +++ b/config/cron/cron.inc @@ -48,25 +48,14 @@ function pkg_is_service_running($servicename) } } -function byte_convert( $bytes ) { - - if ($bytes<=0) - return '0 Byte'; - - $convention=1000; //[1000->10^x|1024->2^x] - $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'); - $e=floor(log($bytes,$convention)); - return round($bytes/pow($convention,$e),2).' '.$s[$e]; -} - - - function php_sync_package() { global $config; //synch cron tab configure_cron(); + $handle = popen("/usr/local/etc/rc.d/cron.sh start", "r"); + pclose($handle); } @@ -96,17 +85,15 @@ function php_install_command() //write_config(); - //write_rcfile(array( - // "file" => "cron.sh", - // "start" => "/usr/local/bin/php /usr/local/pkg/cron.php >> /var/log/cron.log &", - // "stop" => "rm /tmp/cron.pid" - // ) - //); + write_rcfile(array( + "file" => "cron.sh", + "start" => "/usr/sbin/cron -s &", + "stop" => "kill -9 `cat /var/run/cron.pid`" + ) + ); php_sync_package(); - //$handle = popen("/usr/local/etc/rc.d/cron.sh start", "r"); - //pclose($handle); - + //if (pkg_is_service_running('cron')) { //documentation purposes //} diff --git a/config/cron/cron.tmp b/config/cron/cron.tmp index 17bb3cc1..110dd8da 100644 --- a/config/cron/cron.tmp +++ b/config/cron/cron.tmp @@ -90,7 +90,7 @@ if ($config_change == 1) {

Cron controls the scheduling of commands.

- For more information see: http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html + For more information see: http://www.freebsd.org/doc/en/books/handbook/configtuning-cron.html

diff --git a/config/cron/cron.xml b/config/cron/cron.xml index 4fbe7ab6..f6338c7c 100644 --- a/config/cron/cron.xml +++ b/config/cron/cron.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Cron Settings - 0.2 + 0.1.2 Settings /usr/local/pkg/cron.inc @@ -52,10 +52,10 @@ /packages/cron/cron.php - cron + Cron cron.sh - cron - PHP run from a command line as a service. + /usr/sbin/cron + The cron utility is used to manage commands on a schedule. -- cgit v1.2.3 From ccdbdd994a1fbad3fb3c997da54ad209100dbd0b Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 16:58:06 -0600 Subject: cron package update package list --- config/cron/cron.tmp | 4 ++-- config/cron/cron.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/cron/cron.tmp b/config/cron/cron.tmp index 110dd8da..8750febc 100644 --- a/config/cron/cron.tmp +++ b/config/cron/cron.tmp @@ -51,7 +51,7 @@ include("head.inc"); -

Cron:

+

Cron: Settings

@@ -166,7 +166,7 @@ if ($config_change == 1) { ?> - +
diff --git a/config/cron/cron.xml b/config/cron/cron.xml index f6338c7c..d7c5f9bd 100644 --- a/config/cron/cron.xml +++ b/config/cron/cron.xml @@ -41,7 +41,7 @@ Describe your package requirements hereCurrently there are no FAQ items provided.Cron Settings - 0.1.2 + 0.1.3Settings/usr/local/pkg/cron.inc -- cgit v1.2.3 From 754e9f4c2bb6136b755001e076ef64e22faad95a Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 17:07:03 -0600 Subject: cron package after editing cron item stop and start cron --- config/cron/cron.inc | 2 ++ config/cron/cron.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/cron/cron.inc b/config/cron/cron.inc index 380ecd05..63059a04 100644 --- a/config/cron/cron.inc +++ b/config/cron/cron.inc @@ -54,6 +54,8 @@ function php_sync_package() global $config; //synch cron tab configure_cron(); + $handle = popen("/usr/local/etc/rc.d/cron.sh stop", "r"); + pclose($handle); $handle = popen("/usr/local/etc/rc.d/cron.sh start", "r"); pclose($handle); diff --git a/config/cron/cron.xml b/config/cron/cron.xml index d7c5f9bd..83e1affa 100644 --- a/config/cron/cron.xml +++ b/config/cron/cron.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Cron Settings - 0.1.3 + 0.1.4 Settings /usr/local/pkg/cron.inc -- cgit v1.2.3 From 81372f3fb6e45543837b7e0746b9c5f4f2b50c93 Mon Sep 17 00:00:00 2001 From: mcrane Date: Mon, 6 Apr 2009 17:20:27 -0600 Subject: cron package work on package monitoring the service correctly. --- config/cron/cron.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/cron/cron.xml b/config/cron/cron.xml index 83e1affa..856747c2 100644 --- a/config/cron/cron.xml +++ b/config/cron/cron.xml @@ -41,20 +41,20 @@ Describe your package requirements here Currently there are no FAQ items provided. Cron Settings - 0.1.4 + 0.1.5 Settings /usr/local/pkg/cron.inc - cron + Cron cron settings.
Services
cron.xml /packages/cron/cron.php
- Cron + cron cron.sh - /usr/sbin/cron + cron The cron utility is used to manage commands on a schedule. -- cgit v1.2.3