Compare commits

...

13 Commits

Author SHA1 Message Date
Mario Fetka
e93717a4b2 Support debian wheezy 2020-03-11 13:43:10 +01:00
Mario Fetka
2922ea63dd Bump 2020-03-11 11:41:00 +01:00
Mario Fetka
1cf12e925f Merge tag 'upstream/0.2'
Upstream version 0.2
2020-03-11 11:39:29 +01:00
Mario Fetka
5708e35ee0 Imported Upstream version 0.2 2020-03-11 11:39:28 +01:00
Mario Fetka
95e3e33c9b Update 2020-03-10 18:21:33 +01:00
Mario Fetka
b5dab798ff Update 2020-03-10 18:19:29 +01:00
Mario Fetka
22c4f0cca9 Update 2020-03-10 16:08:38 +01:00
Mario Fetka
ba47ff1aa4 Update 2020-03-10 16:01:36 +01:00
Mario Fetka
203d50f764 Update 2020-03-10 15:38:52 +01:00
Mario Fetka
0ea78d15e0 Update 2020-03-10 15:19:28 +01:00
Mario Fetka
37c832d989 Update 2020-03-10 15:01:12 +01:00
Mario Fetka
a3554d3f89 Update 2020-03-10 14:34:51 +01:00
Mario Fetka
247682b863 Intial commit 2020-03-10 14:33:46 +01:00
16 changed files with 160 additions and 7 deletions

@ -7,8 +7,10 @@ compiler:
install:
# for unit tests
- sudo apt-get install -y check
- sudo apt-get install -y libsubunit-dev
# for static code analysis
- sudo apt-get install -y cppcheck rats
# - sudo apt-get install -y cppcheck
# - sudo apt-get install -y rats
# for test code coverage
- sudo apt-get install -y lcov
- gem install coveralls-lcov
@ -23,8 +25,8 @@ script:
- git clone --depth 10 https://github.com/proftpd/proftpd.git
- cp mod_proxy_protocol.c proftpd/contrib/
- cd proftpd
- ./configure LIBS="-lm -lrt -pthread" --enable-devel=coverage --enable-tests --with-module=mod_proxy_protocol
- ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel=coverage --enable-tests --with-module=mod_proxy_protocol
- make
- make clean
- ./configure LIBS="-lm -lrt -pthread" --enable-devel=coverage --enable-dso --enable-tests --with-shared=mod_proxy_protocol
- ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel=coverage --enable-dso --enable-tests --with-shared=mod_proxy_protocol
- make

13
debian/changelog vendored Normal file

@ -0,0 +1,13 @@
proftpd-mod-proxy-protocol (0.2-1) UNRELEASED; urgency=medium
* Update build
* Bump to new release
-- Mario Fetka <mario.fetka@gmail.com> Wed, 11 Mar 2020 11:40:24 +0100
proftpd-mod-proxy-protocol (0.1-1) unstable; urgency=low
[ Fabrizio Regalli ]
* Initial Release. (Closes: #623228)
-- Francesco Paolo Lovergine <frankie@debian.org> Tue, 11 Oct 2011 12:29:18 +0200

1
debian/compat vendored Normal file

@ -0,0 +1 @@
9

21
debian/control vendored Normal file

@ -0,0 +1,21 @@
Source: proftpd-mod-proxy-protocol
Section: net
Priority: optional
Maintainer: ProFTPD Maintainance Team <pkg-proftpd-maintainers@alioth-lists.debian.net>
Uploaders: Francesco Paolo Lovergine <frankie@debian.org>
Build-Depends: debhelper (>= 9.20120909), proftpd-dev (>= 1.3.3~)
Standards-Version: 4.1.4
Homepage: http://www.castaglia.org/proftpd/modules/mod_proxy_protocol.html
Vcs-Browser: https://salsa.debian.org/debian-proftpd-team/proftpd-mod-proxy-protocol
Vcs-Git: https://salsa.debian.org/debian-proftpd-team/proftpd-mod-proxy-protocol.git
Package: proftpd-mod-proxy-protocol
Architecture: any
Depends: proftpd-basic (>= 1.3.3d-4~), ${misc:Depends}, ${shlibs:Depends}, ${proftpd:Depends}
Description: ProFTPD module mod_proxy-protocol
The mod_proxy-protocol module attempts to prevent such bottlenecks by forcibly
flushing to disk the buffers used for files open for writing after a
certain number of bytes have been written (for example, after 128 KB
has been written to a file). This prevents the buffer cache from being
dominated by data from files being written, freeing up space for data
for files being read.

30
debian/copyright vendored Normal file

@ -0,0 +1,30 @@
Format: http://dep.debian.net/deps/dep5/
Upstream-Name: mod_proxy_protocol
Upstream-Contact: TJ Saunders
Source: http://www.castaglia.org/proftpd/modules/mod_proxy_protocol.html
Files: *
Copyright: 2007-2010, TJ Saunders
License: GPL-2+
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
Files: debian/*
Copyright: 2011, Fabrizio Regalli <fabreg@fabreg.it>
License: GPL-2+

@ -0,0 +1,2 @@
usr/lib/proftpd
usr/share/proftpd/templates

@ -0,0 +1,9 @@
Document: proftpd-mod-proxy-protocol
Title: Documentation for the mod_msg ProFTPD
Author:
Abstract: Configuration reference, modules documentation, FAQs and HOWTOs
Section: System/Administration
Format: HTML
Index: /usr/share/doc/proftpd-mod-proxy-protocol/mod_proxy_protocol.html
Files: /usr/share/doc/proftpd-mod-proxy-protocol/*.html

@ -0,0 +1,2 @@
README.md
mod_proxy_protocol.html

@ -0,0 +1 @@
debian/templates/proxy_protocol.conf usr/share/doc/proftpd-mod-proxy-protocol/

@ -0,0 +1 @@
usr/share/doc/proftpd-mod-proxy-protocol/proxy-protocol.conf usr/share/proftpd/templates/proxy-protocol.conf

24
debian/rules vendored Executable file

@ -0,0 +1,24 @@
#!/usr/bin/make -f
# -*- makefile -*-
export DH_VERBOSE=1
VERSION=$(shell grep PROFTPD_VERSION_TEXT /usr/include/proftpd/version.h|cut -d\" -f2)
MODULE_NAME=mod_proxy_protocol
DEBNAME=proftpd-mod-proxy-protocol
CFLAGS := -Wno-implicit-function-declaration
%:
dh $@ --without python-support
override_dh_auto_build:
DESTDIR=$(CURDIR)/debian/$(DEBNAME) CFLAGS=$(CFLAGS) prxs -c $(MODULE_NAME).c
override_dh_auto_install:
DESTDIR=$(CURDIR)/debian/$(DEBNAME) CFLAGS=$(CFLAGS) prxs -i -c $(MODULE_NAME).c
override_dh_gencontrol:
cat /usr/share/proftpd/proftpd-substvars >>$(CURDIR)/debian/$(DEBNAME).substvars
dh_gencontrol
override_dh_auto_clean:
DESTDIR=$(CURDIR)/debian/$(DEBNAME) CFLAGS=$(CFLAGS) prxs -d $(MODULE_NAME).c

1
debian/source/format vendored Normal file

@ -0,0 +1 @@
3.0 (quilt)

20
debian/templates/proxy_protocol.conf vendored Normal file

@ -0,0 +1,20 @@
#
# Proftpd sample configuration for mod_fsync.
<IfModule mod_proxy_protocol.c>
#The ProxyProtocolEngine directive enables the
#expectation and handling of protocols which provide
#information on proxied connections; support for these
#protocols is provided by mod_proxy_protocol.
ProxyProtocolEngine on
#The ProxyProtocolTimeout directive is used to configure
#the amount of time, in seconds, that mod_proxy_protocol
#will wait to receive the full expected proxy information.
#If the full information is not received within the given
#number of seconds, the connection to the client is closed.
ProxyProtocolTimeout 3sec
# Necessary to allow data transfers
AllowForeignAddress on
</IfModule>

2
debian/watch vendored Normal file

@ -0,0 +1,2 @@
version=3
http://www.castaglia.org/proftpd/modules/proftpd-mod-fsync-([\d\.]+)\.tar\.gz

@ -1,6 +1,6 @@
/*
* ProFTPD - mod_proxy_protocol
* Copyright (c) 2013-2017 TJ Saunders
* Copyright (c) 2013-2020 TJ Saunders
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,7 +26,11 @@
#include "conf.h"
#include "privs.h"
#define MOD_PROXY_PROTOCOL_VERSION "mod_proxy_protocol/0.1"
#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */
#define MOD_PROXY_PROTOCOL_VERSION "mod_proxy_protocol/0.2"
/* Make sure the version of proftpd is as necessary. */
#if PROFTPD_VERSION_NUMBER < 0x0001030504

@ -140,6 +140,27 @@ of <code>LoadModule</code> directives; the last of which would be:
LoadModule mod_proxy_protocol.c
</pre>
<b>Note</b> that using <code>mod_proxy_protocol</code> as a shared module
is <i>required</i> in cases where you want to use both
<code>mod_proxy_protocol</code> <i>and</i> <code>mod_ifsession</code>. For
example, perhaps you want to use <code>mod_ifsession</code> to change the
behavior of some module, <i>e.g.</i> <code>mod_ban</code>, based on the IP
address of the original client. This means that <code>mod_proxy_protocol</code>
would need to hande the connection <i>first</i>, so that it can decode the
<code>PROXY</code> protocol and set the correct client IP address.
<i>However</i>, the ProFTPD build system is hardcoded to ensure that the
<code>mod_ifsession</code> will always be first -- <i>if</i> using static
modules. By using <i>shared</i> modules, you can enforce the proper ordering
using the <code>LoadModule</code> directive, like so:
<pre>
&lt;IfModule mod_dso.c&gt;
...
LoadModule mod_ifsession.c
LoadModule mod_proxy_protocol.c
&lt;/IfModule&gt;
</pre>
The <i>last</i> module loaded will be the <i>first</i> module called.
<p>
<b>Trusting Senders of Proxy Data</b><br>
Use of these proxy protocols means changes in audit trails and/or client
@ -227,11 +248,10 @@ to your existing server:
<p>
<hr>
<font size=2><b><i>
&copy; Copyright 2013-2017 TJ Saunders<br>
&copy; Copyright 2013-2019 TJ Saunders<br>
All Rights Reserved<br>
</i></b></font>
<hr>
</body>
</html>