aboutsummaryrefslogtreecommitdiffstats
path: root/config/zebedee
diff options
context:
space:
mode:
Diffstat (limited to 'config/zebedee')
-rwxr-xr-xconfig/zebedee/zebedee.inc329
-rwxr-xr-xconfig/zebedee/zebedee.sh6
-rw-r--r--config/zebedee/zebedee.xml298
-rw-r--r--config/zebedee/zebedee_del_key.php54
-rw-r--r--config/zebedee/zebedee_get_key.php44
-rw-r--r--config/zebedee/zebedee_key_details.xml115
-rw-r--r--config/zebedee/zebedee_keys.php145
-rw-r--r--config/zebedee/zebedee_log.php112
-rw-r--r--config/zebedee/zebedee_sync.xml117
-rwxr-xr-xconfig/zebedee/zebedee_tunnels.xml127
-rw-r--r--config/zebedee/zebedee_view_config.php97
11 files changed, 1444 insertions, 0 deletions
diff --git a/config/zebedee/zebedee.inc b/config/zebedee/zebedee.inc
new file mode 100755
index 00000000..d66a269b
--- /dev/null
+++ b/config/zebedee/zebedee.inc
@@ -0,0 +1,329 @@
+<?php
+/*
+ zebedee.inc
+ part of the Postfix package for pfSense
+ Copyright (C) 2010 Erik Fonnesbeck
+ Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011 Jorge Lustosa
+
+ 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_once("util.inc");
+require_once("functions.inc");
+require_once("pkg-utils.inc");
+require_once("globals.inc");
+
+function zb_text_area_decode($text){
+ return preg_replace('/\r\n/', "\n",base64_decode($text));
+}
+
+function zb_get_real_interface_address($iface) {
+ global $config;
+ $iface = convert_friendly_interface_to_real_interface_name($iface);
+ $line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6"));
+ list($dummy, $ip, $dummy2, $netmask) = explode(" ", $line);
+ return array($ip, long2ip(hexdec($netmask)));
+}
+
+function sync_package_zebedee() {
+ global $config;
+
+
+ $zebedee_config=$config['installedpackages']['zebedee']['config'][0];
+
+# set Default values
+if($zebedee_config['keylength']=="")$zebedee_config['keylength']="256" ;
+if($zebedee_config['keylifetime']=="")$zebedee_config['keylifetime']="36000" ;
+if($zebedee_config['maxbufsize']=="")$zebedee_config['maxbufsize']="16383" ;
+
+
+# Write main zebedee configuration file
+$fd = fopen("/usr/local/etc/server.zbd", "w");
+$cfg_file = <<<EOF
+verbosity {$zebedee_config['verbosity']}
+server true
+detached {$zebedee_config['detached']}
+udpmode {$zebedee_config['udpmode']}
+ipmode {$zebedee_config['ipmode']}
+keygenlevel {$zebedee_config['keygenlevel']}
+compression {$zebedee_config['compression']}:{$zebedee_config['compression_level']}
+keylength {$zebedee_config['keylength']}
+keylifetime {$zebedee_config['keylifetime']}
+maxbufsize {$zebedee_config['maxbufsize']}
+logfile '/var/log/zebedee.log'
+checkidfile '/usr/local/etc/clients.id'
+include '/usr/local/etc/tunnels.zbd'
+EOF;
+
+ fwrite($fd, $cfg_file);
+ fclose($fd);
+
+ // manual restart of zebede
+ mwexec_bg("/usr/local/etc/rc.d/zebedee.sh");
+
+}
+
+function zebedee_tunnels() {
+ global $config;
+
+ $zebedee_config=$config['installedpackages']['zebedeetunnels']['config'][0]['row'];
+ $redirect = $config['installedpackages']['zebedeetunnels']['config'][0]['redirect'] ;
+
+ foreach ($zebedee_config as $k => $v)
+ {
+ // especify only one port for this host
+ if($v['port']=="") $end=" " ; else $end = ":".$v['port'] ;
+ $tunnels .= "target ".$v['ipaddress'].$end."\n" ;
+ }
+
+
+# Write tunnels and targets configuration file
+$fd = fopen("/usr/local/etc/tunnels.zbd", "w");
+$cfg_file = <<<EOF
+{$tunnels}
+redirect {$redirect}
+EOF;
+
+ fwrite($fd, $cfg_file);
+ fclose($fd);
+
+ // manual restart of zebede
+ mwexec_bg("/usr/local/etc/rc.d/zebedee.sh");
+
+}
+
+
+function zebedee_key()
+{
+
+ global $config;
+
+ $zebedee_config=$config['installedpackages']['zebedeekeys']['config'];
+ $priv = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
+
+ if(!$priv)
+ {
+ $gen_private_key = exec("/usr/local/bin/zebedee -p >> /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
+ $public_key = exec("/usr/local/bin/zebedee -P -f /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
+ $private_key = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv ") ;
+ }
+ else
+ {
+ $private_key = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv ") ;
+ $public_key = exec("/usr/local/bin/zebedee -P -f /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
+ }
+
+ $private_key = substr($private_key,12,40) ;
+ $public_key = substr($public_key,0,40) ;
+ $config['installedpackages']['zebedeekeys']['config'][$_REQUEST['id']]['private_key'] = $private_key ;
+ $config['installedpackages']['zebedeekeys']['config'][$_REQUEST['id']]['public_key'] = $public_key ;
+
+ write_config();
+
+ // write clients.id file
+ foreach ($config['installedpackages']['zebedeekeys']['config'] as $key)
+ {
+ $clients .= $key["public_key"]." ".$key["ident"]."\n" ;
+ }
+
+ $fd = fopen("/usr/local/etc/clients.id", "w");
+$cfg_file = <<<EOF
+{$clients}
+EOF;
+ fwrite($fd, $cfg_file);
+ fclose($fd);
+
+ // redirect
+ header("Location: zebedee_keys.php");
+
+ exit ;
+
+}
+
+
+function zebedee_start(){
+ global $config;
+
+ //need be implemented
+
+
+}
+
+function zebedee_validate_input($post, &$input_errors) {
+ foreach ($post as $key => $value)
+ {
+ if (empty($value))
+ continue;
+ if($key == "greet_time" && !preg_match("/(\d+),(\d+)(s|m|h|w)/",$value))
+ $input_errors[] = "Wrong greet time sintax.";
+ if($key == "message_size_limit" && !is_numeric($value))
+ $input_errors[] = "Message size limit must be numeric.";
+ if($key == "process_limit" && !is_numeric($value))
+ $input_errors[] = "Process limit must be numeric.";
+ if($key == "freq" && (!preg_match("/^\d+(h|m|d)$/",$value) || $value == 0))
+ $input_errors[] = "A valid number with a time reference is required for the field 'Frequency'";
+ if (substr($key, 0, 2) == "dc" && !is_hostname($value))
+ $input_errors[] = "{$value} is not a valid host name.";
+ if (substr($key, 0, 6) == "domain" && is_numeric(substr($key, 6))) {
+ if (!is_domain($value))
+ $input_errors[] = "{$value} is not a valid domain name.";
+ } else if (substr($key, 0, 12) == "mailserverip" && is_numeric(substr($key, 12))) {
+ if (empty($post['domain' . substr($key, 12)]))
+ $input_errors[] = "Domain for {$value} cannot be blank.";
+ if (!is_ipaddr($value) && !is_hostname($value))
+ $input_errors[] = "{$value} is not a valid IP address or host name.";
+ }
+ }
+}
+
+function zebedee_php_install_command() {
+ sync_package_zebedee();
+}
+
+function zebedee_php_deinstall_command() {
+
+
+ mwexec_bg("killall -9 zebedee");
+
+ sleep(1);
+ conf_mount_rw();
+ unlink_if_exists("/usr/local/etc/rc.d/zebedee.sh");
+ conf_mount_ro();
+}
+
+/* Uses XMLRPC to synchronize the changes to a remote node */
+function zebedee_sync_on_changes() {
+ global $config, $g;
+ log_error("[zebedee] zebedee xml_rpc is starting.");
+ $synconchanges = $config['installedpackages']['zebedeesync']['config'][0]['synconchanges'];
+ if(!$synconchanges)
+ return;
+ foreach ($config['installedpackages']['zebedeesync']['config'] as $rs ){
+ foreach($rs['row'] as $sh){
+ $sync_to_ip = $sh['ipaddress'];
+ $password = $sh['password'];
+ if($password && $sync_to_ip)
+ zebedee_do_xmlrpc_sync($sync_to_ip, $password);
+ }
+ }
+ log_error("[zebedee] postfix_xmlrpc_sync.php is ending.");
+}
+
+/* Do the actual XMLRPC sync */
+function zebedee_do_xmlrpc_sync($sync_to_ip, $password) {
+ global $config, $g;
+
+ if(!$password)
+ return;
+
+ if(!$sync_to_ip)
+ return;
+
+ $xmlrpc_sync_neighbor = $sync_to_ip;
+ 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_to_ip;
+
+ /* xml will hold the sections to sync */
+ $xml = array();
+ $xml['zebedee'] = $config['installedpackages']['zebedee'];
+ $xml['zebedeetunnels'] = $config['installedpackages']['zebedeetunnels'];
+ $xml['zebedeekeys'] = $config['installedpackages']['zebedeekeys'];
+ $xml['zebedeesync'] = $config['installedpackages']['zebedeesync'];
+
+ /* assemble xmlrpc payload */
+ $params = array(
+ XML_RPC_encode($password),
+ XML_RPC_encode($xml)
+ );
+
+ /* set a few variables needed for sync code borrowed from filter.inc */
+ $url = $synchronizetoip;
+ log_error("Beginning Postfix 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', $password);
+ if($g['debug'])
+ $cli->setDebug(1);
+ /* send our XMLRPC message and timeout after 250 seconds */
+ $resp = $cli->send($msg, "250");
+ if(!$resp) {
+ $error = "A communications error occurred while attempting zebedee XMLRPC sync with {$url}:{$port}.";
+ log_error($error);
+ file_notice("sync_settings", $error, "Zebedee Settings Sync", "");
+ } elseif($resp->faultCode()) {
+ $cli->setDebug(1);
+ $resp = $cli->send($msg, "250");
+ $error = "An error code was received while attempting zebedee XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ log_error($error);
+ file_notice("sync_settings", $error, "Postfix Settings Sync", "");
+ } else {
+ log_error("Zebedee XMLRPC sync successfully completed with {$url}:{$port}.");
+ }
+
+ /* tell zebedee to reload our settings on the destionation sync host. */
+ $method = 'pfsense.exec_php';
+ $execcmd = "require_once('/usr/local/pkg/zebedee.inc');\n";
+ $execcmd .= "sync_package_zebedee();";
+
+ /* assemble xmlrpc payload */
+ $params = array(
+ XML_RPC_encode($password),
+ XML_RPC_encode($execcmd)
+ );
+
+ log_error("zebedee XMLRPC reload data {$url}:{$port}.");
+ $msg = new XML_RPC_Message($method, $params);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
+ $cli->setCredentials('admin', $password);
+ $resp = $cli->send($msg, "250");
+ if(!$resp) {
+ $error = "A communications error occurred while attempting zebedee XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
+ log_error($error);
+ file_notice("sync_settings", $error, "zebedee Settings Sync", "");
+ } elseif($resp->faultCode()) {
+ $cli->setDebug(1);
+ $resp = $cli->send($msg, "250");
+ $error = "An error code was received while attempting zebedee XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ log_error($error);
+ file_notice("sync_settings", $error, "zebedee Settings Sync", "");
+ } else {
+ log_error("zebedee XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
+ }
+
+}
+
+?>
diff --git a/config/zebedee/zebedee.sh b/config/zebedee/zebedee.sh
new file mode 100755
index 00000000..b431ffec
--- /dev/null
+++ b/config/zebedee/zebedee.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ ! -d "/usr/local/etc/zebedee" ]; then
+mkdir /usr/local/etc/zebedee
+fi
+killall zebedee
+/usr/local/bin/zebedee -t -f /usr/local/etc/server.zbd &
diff --git a/config/zebedee/zebedee.xml b/config/zebedee/zebedee.xml
new file mode 100644
index 00000000..b3554e62
--- /dev/null
+++ b/config/zebedee/zebedee.xml
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ zebedee.xml
+ part of the Zebedee package for pfSense
+ Copyright (C) 2010 Erik Fonnesbeck
+ Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011 Jorge Lustosa
+
+
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>zebedee</name>
+ <version>0.1</version>
+ <title>Zebedee Tunneling</title>
+ <include_file>/usr/local/pkg/zebedee.inc</include_file>
+ <menu>
+ <name>Zebedee</name>
+ <tooltiptext>Configure Zebedee</tooltiptext>
+ <section>Services</section>
+ <url>pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
+ </menu>
+ <service>
+ <name>zebedee</name>
+ <rcfile>zebedee.sh</rcfile>
+ <executable>master</executable>
+ </service>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee.inc</item>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_tunnels.xml</item>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_key_details.xml</item>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_sync.xml</item>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_del_key.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_keys.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_log.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee_view_config.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/zebedee/zebedee.sh</item>
+ <prefix>/usr/local/etc/rc.d/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+<tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Tunnels</text>
+ <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Keys</text>
+ <url>/zebedee_keys.php</url>
+ </tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>View config files</text>
+ <url>/zebedee_view_config.php</url>
+ </tab>
+ <tab>
+ <text>View log files</text>
+ <url>/zebedee_log.php</url>
+ </tab>
+</tabs>
+ <fields>
+ <field>
+ <name>Zebedee General Settings</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Enable Zebedee</fielddescr>
+ <fieldname>enable_zebedee</fieldname>
+ <type>checkbox</type>
+ <description></description>
+ </field>
+ <field>
+ <fielddescr>Listen interface(s)</fielddescr>
+ <fieldname>enabled_interface</fieldname>
+ <description><![CDATA[Interface(s) that daemon will bind to.]]></description>
+ <type>interfaces_selection</type>
+ <required/>
+ <default_value>WAN</default_value>
+ </field>
+ <field>
+ <fielddescr>External Address</fielddescr>
+ <fieldname>external_address</fieldname>
+ <type>input</type>
+ <size>60</size>
+ <description>
+ This specifies the external name are put in client.zbd file in field serverhost. Ex: 200.111.111.22 or zebedee.pfsense.org
+ </description>
+ </field>
+ <field>
+ <fielddescr>Verbosity</fielddescr>
+ <fieldname>verbosity</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>0</name><value>0</value></option>
+ <option><name>1</name><value>1</value></option>
+ <option><name>2</name><value>2</value></option>
+ </options>
+ <description>
+ This is an integer specifying the level of message logging with 0 being just error messages and 5 giving excruciating detail of the message traffic. The default (and generally most useful level) is 1.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Detached</fielddescr>
+ <fieldname>detached</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>enabled</name><value>true</value></option>
+ <option><name>disabled</name><value>false</value></option>
+ </options>
+ <description>
+ This is a boolean indicating whether the process should detach itself from the controlling terminal and run in the background (in UNIX terms, to run as a daemon). This is valid for both client and server and is true by default.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Udp Mode</fielddescr>
+ <fieldname>udpmode</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>enabled</name><value>true</value></option>
+ <option><name>disabled</name><value>false</value></option>
+ </options>
+ <description>
+ By default Zebedee handles connection-oriented TCP/IP traffic. If this keyword is set true Zebedee handles UDP/IP connectionless traffic instead.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Ipmode</fielddescr>
+ <fieldname>ipmode</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>tcp</name><value>tcp</value></option>
+ <option><name>udp</name><value>udp</value></option>
+ <option><name>both</name><value>both</value></option>
+ </options>
+ <description>
+ Zebedee client or server can handle both TCP and UDP traffic simultaneously. This is controlled by the ipmode keyword. It can have a value of tcp, udp or both.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Keygenlevel</fielddescr>
+ <fieldname>keygenlevel</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>0</name><value>0</value></option>
+ <option><name>1</name><value>1</value></option>
+ <option><name>2</name><value>2</value></option>
+ </options>
+ <description>
+ This is an integer between 0 and 2 inclusive that determines how strong the private key generation in Zebedee should be. The default is 2 (the strongest) and you should generally not change this unless connection set-up performance becomes unacceptable.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Compression</fielddescr>
+ <fieldname>compression</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>zlib</name><value>zlib</value></option>
+ <option><name>bzip2</name><value>bzip2</value></option>
+ </options>
+ <description>
+ Zebedee can support both zlib and, if enabled when it is built, bzip2 compression. This keyword specifies the type and level of compression to be used
+ </description>
+ </field>
+ <field>
+ <fielddescr>Compression Level</fielddescr>
+ <fieldname>compression_level</fieldname>
+ <type>select</type>
+ <options>
+ <option><name>0</name><value>0</value></option>
+ <option><name>1</name><value>1</value></option>
+ <option><name>2</name><value>2</value></option>
+ <option><name>3</name><value>3</value></option>
+ <option><name>4</name><value>4</value></option>
+ <option><name>5</name><value>5</value></option>
+ <option><name>6</name><value>6</value></option>
+ <option><name>7</name><value>7</value></option>
+ <option><name>8</name><value>8</value></option>
+ <option><name>9</name><value>9</value></option>
+ </options>
+ <description>
+ The level specifies the maximum compression level to used (9 is the maximum and 0 is no compression). The actual compression level used will be the minimum of the client and server values. For these purposes all bzip2 levels (except 0) are considered to be greater than all zlib levels so if either client or server does not support bzip2 the protocol degrades gracefully to using zlib.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Keylength</fielddescr>
+ <fieldname>keylength</fieldname>
+ <type>input</type>
+ <size>5</size>
+ <description>
+ This is an integer specifying the maximum key length (in bits) for the Blowfish encryption. It should be a multiple of 4 between 4 and 576. The key length used will be the minimum of the client and server values
+ </description>
+ </field>
+ <field>
+ <fielddescr>Keylifetime</fielddescr>
+ <fieldname>keylifetime</fieldname>
+ <type>input</type>
+ <size>5</size>
+ <description>
+ If the value of this parameter is non-zero it causes the client to request the re-use of a previously established shared secret key for deriving session keys for subsequent connections. This means that on the first connection between a Zebedee client and server the full key exchange dialogue will take place to establish a shared secret key. On subsequent connections, until the key expires, the same secret key will be reused to generate a new session key. Once the key expires a new key exchange will automatically be performed when necessary.
+ </description>
+ </field>
+ <field>
+ <fielddescr>Maxbufsize</fielddescr>
+ <fieldname>maxbufsize</fieldname>
+ <type>input</type>
+ <size>5</size>
+ <description>
+ This specifies the size, in bytes, of the buffer Zebedee will use to read data from applications. The actual size of buffer used will be the minimum of the client and server values.
+ </description>
+ </field>
+ </fields>
+ <custom_php_install_command>
+ zebedee_php_install_command();
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ zebedee_php_deinstall_command();
+ </custom_php_deinstall_command>
+ <custom_php_validation_command>
+ zebedee_validate_input($_POST, &amp;$input_errors);
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_zebedee();
+ </custom_php_resync_config_command>
+</packagegui>
diff --git a/config/zebedee/zebedee_del_key.php b/config/zebedee/zebedee_del_key.php
new file mode 100644
index 00000000..ae9522b7
--- /dev/null
+++ b/config/zebedee/zebedee_del_key.php
@@ -0,0 +1,54 @@
+<?php
+/*
+ zebedee_del_key.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
+ Copyright (C) 2010 Marcello Coutinho
+ Copyright (C) 2010 Jorge Lustosa
+
+ 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");
+
+$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
+if(strstr($pfSversion, "1.2"))
+ $one_two = true;
+
+$zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ;
+
+// remove item
+unset($zebede_keys[$_REQUEST['id']]) ;
+
+$config['installedpackages']['zebedeekeys']['config'] = $zebede_keys ;
+write_config() ;
+
+
+// redirect
+header("Location: zebedee_keys.php");
+
+
+?>
+
+
diff --git a/config/zebedee/zebedee_get_key.php b/config/zebedee/zebedee_get_key.php
new file mode 100644
index 00000000..f0af0b8a
--- /dev/null
+++ b/config/zebedee/zebedee_get_key.php
@@ -0,0 +1,44 @@
+<?
+
+require_once("pkg-utils.inc");
+
+$id= $_REQUEST['id'] ;
+//echo "<pre>" ;
+$external = $config['installedpackages']['zebedee']['config'][0]['external_address'] ;
+$chave = $config['installedpackages']['zebedeekeys']["config"][$id] ;
+
+//print_r($chave['row']) ;
+
+
+
+foreach ($chave['row'] as $k => $v)
+{
+ // especify only one port for this host
+// if($v['port']=="") $end=" " ; else $end = ":".$v['port'] ;
+ $tunnels .= "tunnel ".$v['loc_port'].":".$v['ipaddress'].":".$v['rmt_port']."\r\n" ;
+}
+
+
+header('Content-Type: application/download');
+header('Content-Disposition: filename=client.txt');
+
+$chave_result = <<<EOF
+verbosity 2
+server false
+message {$chave["ident"]}
+detached true
+privatekey "{$chave["private_key"]}"
+ipmode both
+compression zlib:9
+
+serverhost {$external}
+
+{$tunnels}
+
+EOF;
+
+
+echo $chave_result ;
+
+
+?> \ No newline at end of file
diff --git a/config/zebedee/zebedee_key_details.xml b/config/zebedee/zebedee_key_details.xml
new file mode 100644
index 00000000..98f3151c
--- /dev/null
+++ b/config/zebedee/zebedee_key_details.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* ========================================================================== */
+/*
+ zebedee_tunnels.xml
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
+ Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011 Jorge Lustosa
+
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>zebedeekeys</name>
+ <version>0.1</version>
+ <title>Zebedee key</title>
+ <include_file>/usr/local/pkg/zebedee.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Keys</text>
+ <url>/zebedee_keys.php</url>
+ </tab>
+ </tabs>
+ <fields>
+ <field>
+ <type>listtopic</type>
+ <fieldname>targets</fieldname>
+ <name>Identificatin</name>
+ </field>
+
+
+ <field>
+ <fielddescr>Name</fielddescr>
+ <fieldname>ident</fieldname>
+ <type>input</type>
+ <size>10</size>
+ <disabled>true</disabled>
+ </field>
+
+ <field>
+ <type>listtopic</type>
+ <fieldname>targets</fieldname>
+ <name>Targets</name>
+ </field>
+ <field>
+ <fielddescr>Remote Server</fielddescr>
+ <fieldname>none</fieldname>
+ <type>rowhelper</type>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>Local Port</fielddescr>
+ <fieldname>loc_port</fieldname>
+ <description>Password for remote server.</description>
+ <type>input</type>
+ <size>5</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>IP Address</fielddescr>
+ <fieldname>ipaddress</fieldname>
+ <description>IP Address of remote server</description>
+ <type>input</type>
+ <size>20</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Remote Port</fielddescr>
+ <fieldname>rmt_port</fieldname>
+ <description>Destionation Port</description>
+ <type>input</type>
+ <size>5</size>
+ </rowhelperfield>
+ </rowhelper>
+ </field>
+ </fields>
+ <custom_php_resync_config_command>
+ zebedee_key();
+ </custom_php_resync_config_command>
+ <custom_delete_php_command>
+ zebedee_del_key();
+ </custom_delete_php_command>
+ <custom_php_command_before_form>
+ unset($_POST['temp']);
+ </custom_php_command_before_form>
+</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_keys.php b/config/zebedee/zebedee_keys.php
new file mode 100644
index 00000000..f762c7cc
--- /dev/null
+++ b/config/zebedee/zebedee_keys.php
@@ -0,0 +1,145 @@
+<?php
+/*
+ zebedee_keys.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
+ Copyright (C) 2010 Marcello Coutinho
+ Copyright (C) 2010 Jorge Lustosa
+
+ 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");
+
+$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
+if(strstr($pfSversion, "1.2"))
+ $one_two = true;
+
+$pgtitle = "Zebedee Tunneling";
+include("head.inc");
+
+error_reporting(0);
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+
+<?php if($one_two): ?>
+<p class="pgtitle"><?=$pgtitle?></font></p>
+<?php endif; ?>
+
+<?php if ($savemsg) print_info_box($savemsg); ?>
+
+<form action="varnishstat_view_config.php" method="post">
+
+<div id="mainlevel">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+
+
+
+<?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
+ $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
+ $tab_array[] = array(gettext("Keys"), true, "/zebedee_keys.php");
+ $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
+ $tab_array[] = array(gettext("View Configuration"), false, "/zebedee_view_config.php");
+ $tab_array[] = array(gettext("View log files"), false, "/zebedee_log.php");
+ display_top_tabs($tab_array);
+
+ $zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ;
+ $next_row = sizeof($zebede_keys) ;
+ if($next_row == 1 && !array_key_exists("config", $config['installedpackages']["zebedeekeys"]))$next_row =0 ;
+
+ //echo "<pre>" ;
+ //print_r($config['installedpackages']);
+?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="listhdrr"><?=gettext("Identifier"); ?></td>
+ <td class="listhdr"><?=gettext("Public key"); ?></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td width="20" heigth="17"></td>
+ <td width="20" heigth="17"></td>
+ <td width="20" heigth="17"></td>
+
+ <td align="left"><a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $next_row?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php $i = 0; foreach ($zebede_keys as $key): ?>
+ <tr>
+ <td class="listlr">
+ <?=htmlspecialchars($key['ident']);?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($key['public_key']);?>
+ </td>
+ <td class="list" nowrap>
+ <a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $i?>">
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a>
+ <a href="/zebedee_del_key.php?id=<?php echo $i?>"><img height="17" border="0" width="17" src="./themes/pfsense_ng/images/icons/icon_x.gif"></a>
+ <a alt="Download client.zbd file" href="/zebedee_get_key.php?id=<?php echo $i?>" target="_blank"><img height="17" border="0" width="17" src="./themes/pfsense_ng/images/icons/icon_right.gif" alt="Download client.zbd file"></a>
+ </td>
+ </tr>
+ <?php $i++; endforeach; ?>
+
+
+ <tr>
+ <td class="list" colspan="2"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td width="20" heigth="17"></td>
+ <td width="20" heigth="17"></td>
+ <td width="20" heigth="17"></td>
+
+ <td><a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $next_row?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+
+ </div>
+ </td>
+ </tr>
+ </table>
+</div>
+</form>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/zebedee/zebedee_log.php b/config/zebedee/zebedee_log.php
new file mode 100644
index 00000000..3e1ac98d
--- /dev/null
+++ b/config/zebedee/zebedee_log.php
@@ -0,0 +1,112 @@
+<?php
+/*
+ varnishstat_view_logs.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2006 Scott Ullrich <sullrich@gmail.com>
+ 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($_REQUEST['getactivity']) {
+ $varnishstatlogs = `tail -n 100 /var/log/zebedee.log`;
+ echo "<h2>Zebedee Server logs as of " . date("D M j G:i:s T Y") . "</h2>";
+ echo $varnishstatlogs;
+ exit;
+}
+
+$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
+if(strstr($pfSversion, "1.2"))
+ $one_two = true;
+
+$pgtitle = "Zebedee: Logs";
+include("head.inc");
+
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ function getlogactivity() {
+ var url = "/zebedee_log.php";
+ var pars = 'getactivity=yes';
+ var myAjax = new Ajax.Request(
+ url,
+ {
+ method: 'post',
+ parameters: pars,
+ onComplete: activitycallback
+ });
+ }
+ function activitycallback(transport) {
+ $('varnishstatlogs').innerHTML = '<font face="Courier"><pre>' + transport.responseText + '</pre></font>';
+ setTimeout('getlogactivity()', 2500);
+ }
+ setTimeout('getlogactivity()', 1000);
+ </script>
+<?php include("fbegin.inc"); ?>
+
+<?php if($one_two): ?>
+<p class="pgtitle"><?=$pgtitle?></font></p>
+<?php endif; ?>
+
+<?php if ($savemsg) print_info_box($savemsg); ?>
+
+<div id="mainlevel">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+<?php
+
+$tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
+ $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
+ $tab_array[] = array(gettext("Keys"), false, "/zebedee_keys.php");
+ $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
+ $tab_array[] = array(gettext("View Configuration"), false, "/zebedee_view_config.php");
+ $tab_array[] = array(gettext("View log files"), true, "/zebedee_log.php");
+ display_top_tabs($tab_array);
+
+?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+ <form action="zebedee_log.php" method="post">
+ <div id="varnishstatlogs">
+ <pre>One moment please, loading logs...</pre>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+</div>
+</form>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/zebedee/zebedee_sync.xml b/config/zebedee/zebedee_sync.xml
new file mode 100644
index 00000000..e2649fc8
--- /dev/null
+++ b/config/zebedee/zebedee_sync.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* ========================================================================== */
+/*
+ zebedee_sync.xml
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
+ Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011 Jorge Lustosa
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>zebedeesync</name>
+ <version>1.1</version>
+ <title>Zebedee: Manual Sync</title>
+ <include_file>/usr/local/pkg/zebedee.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Tunnels</text>
+ <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Keys</text>
+ <url>/zebedee_keys.php</url>
+ </tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>View config files</text>
+ <url>/zebedee_view_config.php</url>
+ </tab>
+ <tab>
+ <text>View log files</text>
+ <url>/zebedee_log.php</url>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->zebedee</configpath>
+ <fields>
+ <field>
+ <type>listtopic</type>
+ <fieldname>temp</fieldname>
+ <name>Enable Zebedee configuration sync</name>
+ </field>
+ <field>
+ <fielddescr>Automatically sync Zebedee configuration changes</fielddescr>
+ <fieldname>synconchanges</fieldname>
+ <description>pfSense will automatically sync changes to the hosts defined below.</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Remote Server</fielddescr>
+ <fieldname>none</fieldname>
+ <type>rowhelper</type>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>IP Address</fielddescr>
+ <fieldname>ipaddress</fieldname>
+ <description>IP Address of remote server</description>
+ <type>input</type>
+ <size>20</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Password for remote server.</description>
+ <type>password</type>
+ <size>20</size>
+ </rowhelperfield>
+ </rowhelper>
+ </field>
+ </fields>
+ <custom_php_resync_config_command>
+ zebedee_sync_on_changes();
+ </custom_php_resync_config_command>
+ <custom_php_command_before_form>
+ unset($_POST['temp']);
+ </custom_php_command_before_form>
+</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_tunnels.xml b/config/zebedee/zebedee_tunnels.xml
new file mode 100755
index 00000000..419835be
--- /dev/null
+++ b/config/zebedee/zebedee_tunnels.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* ========================================================================== */
+/*
+ zebedee_tunnels.xml
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
+ Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011 Jorge Lustosa
+
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>zebedeetunnels</name>
+ <version>0.1</version>
+ <title>Zebedee Tunneling</title>
+ <include_file>/usr/local/pkg/zebedee.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Tunnels</text>
+ <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Keys</text>
+ <url>/zebedee_keys.php</url>
+ </tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>View config files</text>
+ <url>/zebedee_view_config.php</url>
+ </tab>
+ <tab>
+ <text>View log files</text>
+ <url>/zebedee_log.php</url>
+ </tab>
+ </tabs>
+ <fields>
+ <field>
+ <type>listtopic</type>
+ <fieldname>targets</fieldname>
+ <name>Targets</name>
+ </field>
+ <field>
+ <fielddescr>Remote Server</fielddescr>
+ <fieldname>none</fieldname>
+ <type>rowhelper</type>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>IP Address</fielddescr>
+ <fieldname>ipaddress</fieldname>
+ <description>IP Address of remote server</description>
+ <type>input</type>
+ <size>20</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Port</fielddescr>
+ <fieldname>port</fieldname>
+ <description>Password for remote server.</description>
+ <type>input</type>
+ <size>5</size>
+ </rowhelperfield>
+ </rowhelper>
+ </field>
+ <field>
+ <type>listtopic</type>
+ <fieldname>Redirect Ports</fieldname>
+ <name>Redirect Ports</name>
+ </field>
+ <field>
+ <fielddescr>Redirects</fielddescr>
+ <fieldname>redirect</fieldname>
+ <type>textarea</type>
+ <cols>80</cols>
+ <rows>2</rows>
+ <description>
+ separated by comma. Ex 80,443,22
+ </description>
+ </field>
+
+ </fields>
+ <custom_php_resync_config_command>
+ zebedee_tunnels();
+ </custom_php_resync_config_command>
+ <custom_php_command_before_form>
+ unset($_POST['temp']);
+ </custom_php_command_before_form>
+</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_view_config.php b/config/zebedee/zebedee_view_config.php
new file mode 100644
index 00000000..57cecc7e
--- /dev/null
+++ b/config/zebedee/zebedee_view_config.php
@@ -0,0 +1,97 @@
+<?php
+/*
+ varnish_view_config.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
+ 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");
+
+$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
+if(strstr($pfSversion, "1.2"))
+ $one_two = true;
+
+$pgtitle = "Zebedee: View Configuration";
+include("head.inc");
+
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+
+<?php if($one_two): ?>
+<p class="pgtitle"><?=$pgtitle?></font></p>
+<?php endif; ?>
+
+<?php if ($savemsg) print_info_box($savemsg); ?>
+
+<form action="zebedee_view_config.php" method="post">
+
+<div id="mainlevel">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+<?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
+ $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
+ $tab_array[] = array(gettext("Keys"), false, "/zebedee_keys.php");
+ $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
+ $tab_array[] = array(gettext("View Configuration"), true, "/zebedee_view_config.php");
+ $tab_array[] = array(gettext("View log files"), false, "/zebedee_log.php");
+ display_top_tabs($tab_array);
+?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+ <p class="pgtitle">/usr/local/etc/server.zbd</font></p>
+ <textarea id="zebedeetext" rows="20" cols="80">
+<?php
+ $config_file = file_get_contents("/usr/local/etc/server.zbd");
+ echo $config_file;
+?>
+ </textarea>
+ <p class="pgtitle">/usr/local/etc/tunnels.zbd</font></p>
+ <textarea id="zebedeetext" rows="20" cols="80">
+<?php
+ $config_file = file_get_contents("/usr/local/etc/tunnels.zbd");
+ echo $config_file;
+?>
+ </textarea>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+</div>
+</form>
+<?php include("fend.inc"); ?>
+</body>
+</html>