From fd946c7e242eaf8f3668f4956c0975a37dbf42a2 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 28 Apr 2010 22:11:51 -0600 Subject: The console menu does not show if the terminal type is not cons25 - not sure why. Changed to cons25 to allow the menu to work on the serial console when enabling it through the web GUI. Ticket #316 --- etc/inc/pfsense-utils.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index c6b897c..193718a 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1094,9 +1094,9 @@ function setup_serial_port() { foreach($ttys_split as $tty) { if(stristr($tty, "ttyd0") or stristr($tty, "ttyu0")) { if(isset($config['system']['enableserial'])) { - fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup on secure\n"); + fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 on secure\n"); } else { - fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" dialup off secure\n"); + fwrite($fd, "ttyu0 \"/usr/libexec/getty bootupcli\" cons25 off secure\n"); } } else { fwrite($fd, $tty . "\n"); -- cgit v1.1 From 5a7d04bf55989cf8cb23c793084285e861b28fae Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Apr 2010 08:50:10 +0000 Subject: Resolves #554. Correct path to tftp-proxy. --- etc/inc/filter.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 6254ee8..aec0757 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1097,7 +1097,7 @@ function filter_nat_rules_generate() { // Open inetd.conf write handle $inetd_fd = fopen("/var/etc/inetd.conf","w"); /* add tftp protocol helper */ - fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy\ttftp-proxy -v\n"); + fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/libexec/tftp-proxy\ttftp-proxy -v\n"); if(isset($config['nat']['rule'])) { if(!isset($config['system']['disablenatreflection'])) { -- cgit v1.1 From ecac770c1a1faa0a4be31e7d45f0e51b765f4d59 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Thu, 29 Apr 2010 02:59:48 -0600 Subject: Allow gitsync to properly switch branches or repositories. Resolves #523 --- etc/phpshellsessions/gitsync | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 6491851..d49ac65 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -125,25 +125,15 @@ exec("mkdir -p /root/pfsense/$branch"); // Git 'er done! if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) { echo "===> Fetching updates...\n"; + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url $GIT_REPO"); exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch"); exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git clean -f -f -x -d"); - if($branch == "master") { - $git_cmd = array( - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin" - ); - run_cmds($git_cmd); - } else { - $git_cmd = array( - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout master", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch -D $branch", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin", - "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -b $branch origin/$branch" - ); - run_cmds($git_cmd); - } + $git_cmd = array( + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch $branch origin/$branch 2>/dev/null", + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -f $branch 2>/dev/null", + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard origin/$branch" + ); + run_cmds($git_cmd); } else { exec("mkdir -p $CODIR/pfSenseGITREPO"); echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO\n"; -- cgit v1.1 From b696422827193d3f165e077f2b56e575022fd553 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Thu, 29 Apr 2010 03:02:10 -0600 Subject: Add gitsync support for merging from other repositories. --- etc/phpshellsessions/gitsync | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index d49ac65..e67452b 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -97,6 +97,21 @@ if(!$found) { } } +$merge_repos = array(); +if(!$command_split[2] && !$argv[3]) { + do { + echo "\nAdd a custom RCS branch URL (HTTP) to merge in or press enter for none.\n\n"; + $merge_repo = readline("> "); + if(!empty($merge_repo)) { + $merge_branch = readline("Merge which branch [master]? "); + if($merge_branch == "") + $merge_repos[] = array('repo' => $merge_repo, 'branch' => 'master'); + else if($merge_branch) + $merge_repos[] = array('repo' => $merge_repo, 'branch' => $merge_branch); + } + } while(!empty($merge_repo)); +} + if($branch == "RESTORE" && $g['platform'] == "pfSense") { if(!file_exists("/root/cvssync_backup.tgz")) { echo "Sorry, we could not find a previous CVSSync backup file.\n"; @@ -149,6 +164,17 @@ if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) { } } +foreach($merge_repos as $merge_repo) { + echo "===> Merging branch {$merge_repo['branch']} from {$merge_repo['repo']}\n"; + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git pull {$merge_repo['repo']} {$merge_repo['branch']}", $output_str, $ret); + unset($output_str); + if($ret <> 0) { + echo "\nMerge failed. Aborting sync.\n\n"; + run_cmds($git_cmd); + exit; + } +} + exec("mkdir -p /tmp/lighttpd/cache/compress/"); // Nuke CVS and pfSense tarballs -- cgit v1.1 From 7d35ed789061a755127ac4b2dde533c30e4bdee1 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Apr 2010 10:34:36 +0000 Subject: Create rules for openvpn/l2tp/pppoe/pptp when switching to manual outbound nat so the user can do less work. --- usr/local/www/firewall_nat_out.php | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 90ffe43..07d696e 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -136,6 +136,77 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $a_out[] = $natent; } } + /* PPTP subnet */ + if($config['pptpd']['mode'] == "server") { + if (is_ipaddr($config['pptpd']['localip'])) { + if($config['pptpd']['pptp_subnet'] <> "") + $ossubnet = $config['pptpd']['pptp_subnet']; + else + $ossubnet = "32"; + $osn = gen_subnet($config['pptpd']['localip'], $osn); + $natent = array(); + $natent['source']['network'] = "{$osn}/{$ossubnet}"; + $natent['sourceport'] = ""; + $natent['descr'] = "Auto created rule for PPTP server"; + $natent['target'] = ""; + $natent['interface'] = "pptp"; + $natent['destination']['any'] = true; + $natent['natport'] = ""; + $a_out[] = $natent; + } + } + /* PPPoE subnet */ + if($config['pppoe']['mode'] == "server") { + if (is_ipaddr($config['pppoe']['localip'])) { + if($config['pppoe']['pppoe_subnet'] <> "") + $ossubnet = $config['pppoe']['pptp_subnet']; + else + $ossubnet = "32"; + $osn = gen_subnet($config['pppoe']['localip'], $osn); + $natent = array(); + $natent['source']['network'] = "{$osn}/{$ossubnet}"; + $natent['sourceport'] = ""; + $natent['descr'] = "Auto created rule for PPPoE server"; + $natent['target'] = ""; + $natent['interface'] = "pppoe"; + $natent['destination']['any'] = true; + $natent['natport'] = ""; + $a_out[] = $natent; + } + } + /* L2TP subnet */ + if($config['l2tp']['mode'] == "server") { + if (is_ipaddr($config['l2tp']['localip'])) { + if($config['l2tp']['l2tp_subnet'] <> "") + $ossubnet = $config['l2tp']['pptp_subnet']; + else + $ossubnet = "32"; + $osn = gen_subnet($config['l2tp']['localip'], $osn); + $natent = array(); + $natent['source']['network'] = "{$osn}/{$ossubnet}"; + $natent['sourceport'] = ""; + $natent['descr'] = "Auto created rule for L2TP server"; + $natent['target'] = ""; + $natent['interface'] = "l2tp"; + $natent['destination']['any'] = true; + $natent['natport'] = ""; + $a_out[] = $natent; + } + } + /* add openvpn interfaces */ + if($config['openvpn']['openvpn-server']) { + foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) { + $natent = array(); + $natent['source']['network'] = $ovpnsrv['tunnel_network']; + $natent['sourceport'] = ""; + $natent['descr'] = "Auto created rule for OpenVPN server"; + $natent['target'] = ""; + $natent['interface'] = "openvpn"; + $natent['destination']['any'] = true; + $natent['natport'] = ""; + $a_out[] = $natent; + } + } $savemsg = "Default rules for each interface have been created."; } break; -- cgit v1.1 From 932364e7729cf979382173b3a8079fc1bf53f09c Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Thu, 29 Apr 2010 03:57:36 -0600 Subject: Default to and display the last used repository URL in gitsync. --- etc/phpshellsessions/gitsync | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index e67452b..4176dfe 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -48,10 +48,18 @@ if(file_exists("/root/cvssync_backup.tgz")) { $branches = array_merge($branches, $tmp); } +if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) { + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str, $ret); + if(is_array($output_str) && !empty($output_str[0])) + $GIT_REPO = $output_str[0]; + unset($output_str); +} + if($command_split[2]) { $branch = $command_split[2]; } else { if(!$argv[3]) { + echo "\nCurrent repository is $GIT_REPO\n"; echo "\nPlease select which branch you would like to sync against:\n\n"; foreach($branches as $branchname => $branchdesc) { echo "{$branchname} \t {$branchdesc}\n"; -- cgit v1.1