Skip to content

Commit

Permalink
Add ftp-proxy plugin (opnsense#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbrendel authored and fichtner committed Sep 27, 2016
1 parent 6f63e21 commit e79baf0
Showing 18 changed files with 1,060 additions and 0 deletions.
28 changes: 28 additions & 0 deletions net/ftp-proxy/+POST_DEINSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DIFF='--- filter.inc.ftpproxy 2016-09-21 16:38:53.947075272 +0200
+++ filter.inc.orig 2016-09-21 16:47:29.239370565 +0200
@@ -1450,7 +1450,6 @@

$natrules = "no nat proto carp\n";
$natrules .= "no rdr proto carp\n";
- $natrules .= "nat-anchor \"ftp-proxy/*\"\n";
$natrules .= "nat-anchor \"natearly/*\"\n";

$natrules .= "nat-anchor \"natrules/*\"\n\n";
@@ -1703,7 +1702,6 @@
unset($tonathosts, $tonathosts_array, $numberofnathosts);
}

- $natrules .= "rdr-anchor \"ftp-proxy/*\"\n";
$natrules .= "\n# Load balancing\n";
$natrules .= "rdr-anchor \"relayd/*\"\n";

@@ -2482,7 +2480,6 @@

$ipfrules = "";

- $ipfrules .= "anchor \"ftp-proxy/*\"\n";
/* relayd */
$ipfrules .= "anchor \"relayd/*\"\n";
/* OpenVPN user rules from radius */'

echo "$DIFF" | patch -b -p1 /usr/local/etc/inc/filter.inc
28 changes: 28 additions & 0 deletions net/ftp-proxy/+POST_INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DIFF='--- filter.inc.orig 2016-09-21 16:39:02.853045967 +0200
+++ filter.inc.ftpproxy 2016-09-21 16:38:53.947075272 +0200
@@ -1450,6 +1450,7 @@

$natrules = "no nat proto carp\n";
$natrules .= "no rdr proto carp\n";
+ $natrules .= "nat-anchor \"ftp-proxy/*\"\n";
$natrules .= "nat-anchor \"natearly/*\"\n";

$natrules .= "nat-anchor \"natrules/*\"\n\n";
@@ -1702,6 +1703,7 @@
unset($tonathosts, $tonathosts_array, $numberofnathosts);
}

+ $natrules .= "rdr-anchor \"ftp-proxy/*\"\n";
$natrules .= "\n# Load balancing\n";
$natrules .= "rdr-anchor \"relayd/*\"\n";

@@ -2480,6 +2482,7 @@

$ipfrules = "";

+ $ipfrules .= "anchor \"ftp-proxy/*\"\n";
/* relayd */
$ipfrules .= "anchor \"relayd/*\"\n";
/* OpenVPN user rules from radius */'

echo "$DIFF" | patch -b -p1 /usr/local/etc/inc/filter.inc
7 changes: 7 additions & 0 deletions net/ftp-proxy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PLUGIN_NAME= ftp-proxy
PLUGIN_VERSION= 0.1
PLUGIN_COMMENT= Control ftp-proxy processes
PLUGIN_MAINTAINER= [email protected]
PLUGIN_PRIVATE= yes

.include "../../Mk/plugins.mk"
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* Copyright (C) 2016 EURO-LOG AG
*
* 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.
*
*/

namespace OPNsense\FtpProxy\Api;

use \OPNsense\Base\ApiControllerBase;
use \OPNsense\FtpProxy\FtpProxy;

/**
* Class ServiceController
* @package OPNsense\FtpProxy
*/
class ServiceController extends ApiControllerBase
{
}
Loading

0 comments on commit e79baf0

Please sign in to comment.