# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # ftp-proxy # ftp-proxy/Makefile # ftp-proxy/pkg-descr # ftp-proxy/distinfo # ftp-proxy/files # ftp-proxy/files/ftp-proxy.sh # ftp-proxy/pkg-message # echo c - ftp-proxy mkdir -p ftp-proxy > /dev/null 2>&1 echo x - ftp-proxy/Makefile sed 's/^X//' >ftp-proxy/Makefile << 'END-of-ftp-proxy/Makefile' X# New ports collection makefile for: ftp-proxy X# Date created: 4. March 2007 X# Whom: Christian Ludwig X# X# $FreeBSD$ X# X XPORTNAME= ftp-proxy XPORTVERSION= 4.0p0 XCATEGORIES= ftp XMASTER_SITES= http://www.chrissicool.net/projects/ftp-proxy/distfiles/ X XMAINTAINER= chrissicool@chrissicool.net XCOMMENT= A port of OpenBSD's ftp-proxy X XLIB_DEPENDS= event:${PORTSDIR}/devel/libevent X XMAN8= ftp-proxy.8 XMANCOMPRESSED= yes X XPLIST_FILES= sbin/ftp-proxy \ X etc/rc.d/ftp-proxy.sh X XCFLAGS+= -I${PREFIX}/include X X.include X X.if ${OSVERSION} < 502106 XIGNORE= is only for 5.3 and above X.endif X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/ftp-proxy ${PREFIX}/sbin X ${INSTALL_SCRIPT} ${FILESDIR}/ftp-proxy.sh ${PREFIX}/etc/rc.d X ${INSTALL_MAN} ${WRKSRC}/ftp-proxy.8.gz ${PREFIX}/man/man8 X X.include END-of-ftp-proxy/Makefile echo x - ftp-proxy/pkg-descr sed 's/^X//' >ftp-proxy/pkg-descr << 'END-of-ftp-proxy/pkg-descr' XA ftp proxy for firewalled connections, Xusing pf's anchors and rules. XThis is a port of the OpenBSD ftp-proxy. X XWWW: http://www.openbsd.org/ END-of-ftp-proxy/pkg-descr echo x - ftp-proxy/distinfo sed 's/^X//' >ftp-proxy/distinfo << 'END-of-ftp-proxy/distinfo' XMD5 (ftp-proxy-4.0p0.tar.gz) = 1defe7411ed13966910d1ec25784db86 XSHA256 (ftp-proxy-4.0p0.tar.gz) = cabd125a011d6548f40c72e29a254e71decde306f55ff5d037018cb33901867f XSIZE (ftp-proxy-4.0p0.tar.gz) = 13381 END-of-ftp-proxy/distinfo echo c - ftp-proxy/files mkdir -p ftp-proxy/files > /dev/null 2>&1 echo x - ftp-proxy/files/ftp-proxy.sh sed 's/^X//' >ftp-proxy/files/ftp-proxy.sh << 'END-of-ftp-proxy/files/ftp-proxy.sh' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: ftp-proxy X# REQUIRE: DAEMON X# X# NOTE for FreeBSD 5.0+: X# If you want this script to start with the base rc scripts X# move ftp-proxy.sh to /etc/rc.d/ftp-proxy X# Define these ftp-proxy_* variables in one of these files: X# /etc/rc.conf X# /etc/rc.conf.local X# /etc/rc.conf.d/ftp-proxy X# X# DO NOT CHANGE THESE DEFAULT VALUES HERE X# X Xftpproxy_enable=${ftp-proxy_enable:-"NO"} # Enable ftp-proxy Xftpproxy_flags=${ftp-proxy_flags:-""} # Flags to ftp-proxy program X#ftpproxy_program="%%PREFIX%%/sbin/ftp-proxy" # Location of ftp-proxy X X. %%RC_SUBR%% X Xname="ftp-proxy" Xrcvar=`set_rcvar` Xcommand="%%PREFIX%%/sbin/${name}" X Xload_rc_config $name X Xrun_rc_command "$1" END-of-ftp-proxy/files/ftp-proxy.sh echo x - ftp-proxy/pkg-message sed 's/^X//' >ftp-proxy/pkg-message << 'END-of-ftp-proxy/pkg-message' X=================================================================== XTo make use of the proxy, pf.conf(5) needs the following rules. All Xanchors are mandatory. Adjust the rules as needed. X XIn the NAT section: X X nat-anchor "ftp-proxy/*" X rdr-anchor "ftp-proxy/*" X rdr pass on $int_if proto tcp from $lan to any port 21 -> \ X 127.0.0.1 port 8021 X XIn the rule section: X X anchor "ftp-proxy/*" X pass out proto tcp from $proxy to any port 21 keep state X XAdd the following line to your /etc/rc.conf to enable the proxy on Xstartup: X X ftpproxy_enable="YES" X XPlease consult the man page ftp-proxy(8) for more information. X=================================================================== END-of-ftp-proxy/pkg-message exit