aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rw-r--r--debian/control28
-rw-r--r--debian/copyright118
-rw-r--r--debian/dirs1
-rw-r--r--debian/gbp.conf3
-rwxr-xr-xdebian/init.d66
-rw-r--r--debian/patches/build-with-wolfssl.patch51
-rw-r--r--debian/patches/series1
-rw-r--r--debian/postinst21
-rw-r--r--debian/postrm14
-rwxr-xr-xdebian/rules21
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch2
13 files changed, 332 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..28e22d5
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+hopm (1.1.6-1) unstable; urgency=medium
+
+ * Initial release.
+
+ -- Unit 193 <unit193@ubuntu.com> Sat, 21 Mar 2020 23:56:16 -0400
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..e2679ad
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,28 @@
+Source: hopm
+Section: net
+Priority: optional
+Maintainer: Unit 193 <unit193@ubuntu.com>
+Build-Depends:
+ debhelper-compat (= 12),
+ bison,
+ flex,
+ libssl-dev <pkg.hopm.openssl>,
+ libwolfssl-dev <!pkg.hopm.openssl>
+Rules-Requires-Root: no
+Standards-Version: 4.5.0
+Homepage: https://github.com/ircd-hybrid/hopm/
+Vcs-Browser: https://git.unit193.net/cgit/users/unit193/hopm.git/
+Vcs-Git: https://git.unit193.net/cgit/users/unit193/hopm.git
+
+Package: hopm
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base
+Description: open-proxy monitoring bot designed for IRC servers
+ HOPM (Hybrid Open Proxy Monitor) is an open-proxy monitoring bot designed to
+ monitor an individual server (all servers on the network have to run their own
+ bot if the IRCD does not support `farconnect` user mode) with a local
+ operator {} block and monitor connections. When a client connects to a server,
+ HOPM will scan the connection for insecure proxies. Insecure proxies are
+ determined by attempting to connect the proxy back to another host (usually the
+ IRC server in question).
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..f29a878
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,118 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: hopm
+Source: https://github.com/ircd-hybrid/hopm/
+
+Files: *
+Copyright: 2002-2003 Erik Fears
+ 2014-2019 ircd-hybrid development team
+License: GPL-2+
+
+Files: src/compat.h src/negcache.*
+Copyright: 2002-2003, Andy Smith
+License: GPL-2+
+
+Files: src/compat.c
+Copyright: 1998-2015, Todd C. Miller <Todd.Miller@courtesan.com>
+ 2002, Andy Smith
+License: ISC and GPL-2+
+
+Files: src/config-parser.c src/config-parser.h
+Copyright: 1984-2019, Free Software Foundation, Inc
+License: GPL-3+
+
+Files: src/firedns.*
+Copyright: 2002, Ian Gulliver
+License: GPL-2
+
+Files: src/patricia.*
+Copyright: 1999-2013, The Regents of the University of Michigan
+ 1999-2013, Merit Network, Inc.
+ 2018, Dave Plonka <plonka@doit.wisc.edu>
+License: BSD-2-Clause
+
+Files: debian/*
+Copyright: 2018-2020 Unit 193 <unit193@ubuntu.com>
+License: ISC
+
+License: BSD-2-Clause
+ Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ .
+ 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "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 COPYRIGHT
+ HOLDER OR CONTRIBUTORS 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.
+
+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 <https://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".
+
+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.
+ .
+ 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 <https://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".
+
+License: GPL-3+
+ 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 the Free Software
+ Foundation; either version 3 of the License, or (at your option) any later
+ version.
+ .
+ This program 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 package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public License version 3
+ can be found in the file `/usr/share/common-licenses/GPL-3'.
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..359b438
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+var/log/hopm
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..5474c60
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+pristine-tar = True
+sign-tags = True
diff --git a/debian/init.d b/debian/init.d
new file mode 100755
index 0000000..13aed7d
--- /dev/null
+++ b/debian/init.d
@@ -0,0 +1,66 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hopm
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Should-Start: hopm
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Hybrid Open Proxy Monitor
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/hopm
+NAME=hopm
+DESC="hopm scanner"
+USER="irc"
+GROUP="irc"
+PIDDIR=/run/hopm
+PIDFILE=$PIDDIR/hopm.pid
+
+test -f $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Source defaults file; edit that file to configure this script.
+if [ -e /etc/default/hopm ]; then
+ . /etc/default/hopm
+fi
+
+
+case "$1" in
+ start)
+ if [ ! -d $PIDDIR ]; then
+ mkdir -p $PIDDIR
+ chown $USER:$USER $PIDDIR
+ fi
+ log_daemon_msg "Starting $DESC" "$NAME"
+ start-stop-daemon --start --quiet --user $USER --chuid $USER:$GROUP --pidfile $PIDFILE --exec $DAEMON
+ log_end_msg $?
+ ;;
+ stop)
+ log_daemon_msg "Stopping $DESC" "$NAME"
+ start-stop-daemon --stop --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ reload|force-reload)
+ log_daemon_msg "Reloading $DESC" "$NAME"
+ start-stop-daemon --stop --quiet --user $USER --signal HUP --pidfile $PIDFILE
+ log_end_msg $?
+ ;;
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/debian/patches/build-with-wolfssl.patch b/debian/patches/build-with-wolfssl.patch
new file mode 100644
index 0000000..6e80cad
--- /dev/null
+++ b/debian/patches/build-with-wolfssl.patch
@@ -0,0 +1,51 @@
+Description: Allow the use of WolfSSL's OpenSSL compat layer.
+Author: Unit 193 <unit193@ubuntu.com>
+Last-Update: 2019-09-14
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,6 +33,12 @@ AX_ARG_ENABLE_ASSERT
+ AX_ARG_ENABLE_WARNINGS
+ AX_ARG_ENABLE_EFENCE
+
++AC_CHECK_HEADERS([wolfssl/openssl/ssl.h],[
++ AC_SEARCH_LIBS([wolfSSL_CTX_new], [wolfssl])
++ AC_DEFINE([HAVE_LIBCRYPTO],[1])
++ AC_DEFINE([HAVE_WOLFSSL], 1, [Define if you have WolfSSL.])
++ AC_MSG_NOTICE([Falling back to WolfSSL])])
++
+ AC_CHECK_FUNCS(strlcpy strlcat)
+
+ AC_CONFIG_FILES(Makefile doc/Makefile src/Makefile src/libopm/Makefile src/libopm/src/Makefile)
+--- a/src/libopm/src/libopm.c
++++ b/src/libopm/src/libopm.c
+@@ -31,7 +31,13 @@
+ #include <stdlib.h>
+ #include <poll.h>
+ #ifdef HAVE_LIBCRYPTO
++#ifdef HAVE_WOLFSSL
++#include <wolfssl/options.h>
++#include <wolfssl/ssl.h>
++#include <wolfssl/openssl/ssl.h>
++#else
+ #include <openssl/ssl.h>
++#endif
+ #endif
+
+ #include "config.h"
+--- a/src/libopm/src/proxy.c
++++ b/src/libopm/src/proxy.c
+@@ -26,7 +26,13 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #ifdef HAVE_LIBCRYPTO
++#ifdef HAVE_WOLFSSL
++#include <wolfssl/options.h>
++#include <wolfssl/ssl.h>
++#include <wolfssl/openssl/ssl.h>
++#else
+ #include <openssl/ssl.h>
++#endif
+ #endif
+
+ #include "config.h"
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c493120
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+build-with-wolfssl.patch
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..412cc54
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure)
+ chown irc:adm /var/log/hopm
+ chgrp irc /etc/hopm/hopm.conf
+ chmod g+r,o-rwx /etc/hopm/hopm.conf
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+ *)
+ echo "ERROR: Postinst called with unknown argument!"
+ exit 0
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..1a637a5
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ purge)
+ rm -rf /var/log/hopm
+ ;;
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..969a374
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+#export DH_VERBOSE = 1
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DEB_CPPFLAGS_MAINT_APPEND = -DHOPM_LOGDIR="\"$$(localstatedir)/log/hopm\""
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure -- --sysconfdir=/etc/hopm
+
+override_dh_install:
+ sed -e s@var/run/hopm.pid@/run/hopm/hopm.pid@ \
+ -e s@var/log/scan.log@/var/log/hopm/scan.log@ \
+ doc/reference.conf > debian/hopm/etc/hopm/hopm.conf
+ dh_install
+
+override_dh_installinit:
+ dh_installinit --no-enable
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..ba3f5a8
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=4
+https://github.com/ircd-hybrid/hopm/releases .*/([\d.]+)\.tar\.gz