Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Author: jorgelustosa <jorgelustosa@gmail.com>

	modified:   config/zebedee/zebedee.inc
	modified:   config/zebedee/zebedee.xml
	modified:   config/zebedee/zebedee_keys.php
	modified:   config/zebedee/zebedee_log.php
	modified:   config/zebedee/zebedee_tunnels.xml
	new file:   config/zebedee/zebedee_view_config.php
  • Loading branch information...
commit de9464bb8687573c9884e1ecc81fd215538c9d08 1 parent 8e52790
@jorgelustosa authored Charlie committed
View
46 config/zebedee/zebedee.inc
@@ -71,20 +71,20 @@ keygenlevel {$zebedee_config['keygenlevel']}
compression {$zebedee_config['compression']}:{$zebedee_config['compression_level']}
keylength {$zebedee_config['keylength']}
keylifetime {$zebedee_config['keylifetime']}
-maxbufsize {$zebedee_config['maxbufsize']}
-checkidfile '/usr/local/etc/clients.id' # Arquivo de chaves publicas
+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);
- //"logfile '/var/log/zbd/TRF.log' # Arquivo de LOG " ;
-
-
-// print_r($zebedee_config) ;
-
-// exit ;
+ // manual restart of zebede
+ exec("/usr/local/etc/rc.d/zebedee.sh ") ;
+ //system('/usr/local/etc/rc.d/zebedee.sh');
+// system('/usr/bin/killall zebedee');
+// system('/usr/local/bin/zebedee -t -f /usr/local/etc/server.zbd');
}
@@ -123,10 +123,6 @@ function zebedee_key()
global $config;
$zebedee_config=$config['installedpackages']['zebedeekeys']['config'];
-
- //print_r($_REQUEST) ;
- //$_REQUEST['id'] = $_REQUEST['id'] -1 ;
-
$priv = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
if(!$priv)
@@ -148,6 +144,19 @@ function zebedee_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");
@@ -160,15 +169,10 @@ function zebedee_start(){
global $config;
$start=<<<EOF
- sysctl kern.ipc.nmbclusters=65536
- sysctl kern.ipc.somaxconn=16384
- sysctl kern.maxfiles=131072
- sysctl kern.maxfilesperproc=104856
- sysctl kern.threads.max_threads_per_proc=4096
- /usr/local/sbin/zebedee start
+ /usr/local/bin/zebedee -t -f /usr/local/etc/server.zbd
EOF;
- $stop = "/usr/local/sbin/zebedee stop\n";
+ $stop = "killall zebedee stop\n";
log_error("Writing rc_file");
write_rcfile(array("file" => "zebedee.sh", "start" => $start, "stop" => $stop));
@@ -178,8 +182,8 @@ EOF;
if ($config['installedpackages']['zebedee']['config'][0]['enable_zebedee']){
log_error("Reloading/starting zebedee");
system('/bin/chmod +x /usr/local/etc/rc.d/zebedee.sh');
- mwexec_bg("/usr/local/sbin/zebedee reload || /usr/local/etc/rc.d/postfix.sh start");
- log_error("Postfix setup completed");
+ mwexec_bg("/usr/local/etc/rc.d/zebedee.sh start");
+ log_error("Zebedee setup completed");
}
else{
log_error("Stopping zebedee");
View
13 config/zebedee/zebedee.xml
@@ -8,7 +8,7 @@
/* ========================================================================== */
/*
zebedee.xml
- part of the Postfix package for pfSense
+ part of the Zebedee package for pfSense
Copyright (C) 2010 Erik Fonnesbeck
Copyright (C) 2011 Marcello Coutinho
Copyright (C) 2011 Jorge Lustosa
@@ -124,7 +124,7 @@
</tab>
<tab>
<text>View log files</text>
- <url>/zebedee_view_log.php</url>
+ <url>/zebedee_log.php</url>
</tab>
</tabs>
<fields>
@@ -147,6 +147,15 @@
<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>
View
9 config/zebedee/zebedee_keys.php
@@ -30,6 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+
+
require("guiconfig.inc");
$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
@@ -39,7 +41,7 @@
$pgtitle = "Zebedee Tunneling";
include("head.inc");
-
+error_reporting(0);
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
@@ -70,6 +72,7 @@
$zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ;
$next_row = sizeof($zebede_keys) ;
+ if($next_row == 1)$next_row =0 ;
?>
</td>
@@ -96,10 +99,10 @@
</tr>
<?php $i = 0; foreach ($zebede_keys as $key): ?>
<tr>
- <td class="listlr gray">
+ <td class="listlr">
<?=htmlspecialchars($key['ident']);?>
</td>
- <td class="listr gray">
+ <td class="listr">
<?=htmlspecialchars($key['public_key']);?>
</td>
<td class="list" nowrap>
View
2  config/zebedee/zebedee_log.php
@@ -30,7 +30,7 @@
require("guiconfig.inc");
if($_REQUEST['getactivity']) {
- $varnishstatlogs = `tail -f /var/log/zebedee.log`;
+ $varnishstatlogs = `cat /var/log/zebedee.log`;
echo "<h2>Zebedee Server logs as of " . date("D M j G:i:s T Y") . "</h2>";
echo $varnishstatlogs;
exit;
View
2  config/zebedee/zebedee_tunnels.xml
@@ -71,7 +71,7 @@
</tab>
<tab>
<text>View log files</text>
- <url>/zebedee_view_log.php</url>
+ <url>/zebedee_log.php</url>
</tab>
</tabs>
<fields>
View
97 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="100%">
+<?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="100%">
+<?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>
Please sign in to comment.
Something went wrong with that request. Please try again.