Skip to content

Commit

Permalink
add mod_defensible
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Sep 24, 2024
1 parent 7f30071 commit c7882f5
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 7 deletions.
2 changes: 2 additions & 0 deletions www/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ SUBDIR += midori
SUBDIR += minio
SUBDIR += minio-client
SUBDIR += mod_dav_svn
SUBDIR += mod_defensible
SUBDIR += mod_dnssd
SUBDIR += mod_evasive
SUBDIR += mod_fastcgi
SUBDIR += mod_http2
SUBDIR += mod_perl2
SUBDIR += mod_php81
SUBDIR += mod_php82
Expand Down
27 changes: 27 additions & 0 deletions www/mod_defensible/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
PORTNAME= mod_defensible
DISTVERSIONPREFIX= v
DISTVERSION= 1.5
CATEGORIES= www

MAINTAINER= [email protected]
COMMENT= Apache 2.4 module aiming to block IP listed in DNSBL
WWW= https://github.com/jd/mod_defensible

LICENSE= apache2

USES= apache

USE_GITHUB= yes
GH_ACCOUNT= jd

AP_FAST_BUILD= yes
AP_GENPLIST= yes
SHORTMODNAME= defensible

SRC_FILE= mod_defensible.c

post-patch:
${REINPLACE_CMD} 's,%%PORTVERSION%%,${PORTVERSION},' \
${WRKSRC}/mod_defensible.c

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions www/mod_defensible/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1642253279
SHA256 (jd-mod_defensible-v1.5_GH0.tar.gz) = 030f5cc41c80d6973eb893f1fbbe24427cd03855a89009d198384164c02a4082
SIZE (jd-mod_defensible-v1.5_GH0.tar.gz) = 5416
12 changes: 12 additions & 0 deletions www/mod_defensible/files/patch-mod_defensible.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- mod_defensible.c.orig 2012-04-03 14:50:25 UTC
+++ mod_defensible.c
@@ -19,7 +19,8 @@
*
*/

-#include <config.h>
+/*#include <config.h>*/
+#define VERSION "%%PORTVERSION%%"

#include "apr_strings.h"

9 changes: 9 additions & 0 deletions www/mod_defensible/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mod_defensible is a Apache 2.x module aiming to forbid IP listed
in DNSBL.

httpd.conf configuration example:

DnsblUse On
DnsblServers bsb.spamlookup.net bl.blbl.org opm.blitzed.org sbl-xbl.spamhaus.org

No UDNS support in this FreeBSD port version
6 changes: 1 addition & 5 deletions www/mod_dnssd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PKGNAMEPREFIX= ${APACHE_PKGNAMEPREFIX}

MAINTAINER= [email protected]
COMMENT= Apache module that provides DNS-SD capabilities
WWW= https://0pointer.de/lennart/projects/mod_dnssd/

LICENSE= apache2
LICENSE_FILE= ${WRKSRC}/LICENSE
Expand All @@ -25,11 +26,6 @@ post-configure:
${REINPLACE_CMD} -e 's|@APXS_STAGE@|-S LIBEXECDIR=${FAKE_DESTDIR}${TRUE_PREFIX}/${APACHEMODDIR}|' ${WRKSRC}/src/Makefile
${MKDIR} ${FAKE_DESTDIR}${TRUE_PREFIX}/${APACHEMODDIR}

#do-install:
# ${INSTALL_LIB} ${WRKSRC}/src/.libs/mod_dnssd.so ${FAKE_DESTDIR}${TRUE_PREFIX}/${APACHEMODDIR}
# ${INSTALL_LIB} ${WRKSRC}/src/.libs/mod_dnssd.a ${FAKE_DESTDIR}${TRUE_PREFIX}/${APACHEMODDIR}
# ${INSTALL_DATA} ${WRKSRC}/src/.libs/mod_dnssd.la ${FAKE_DESTDIR}${TRUE_PREFIX}/${APACHEMODDIR}

post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so

Expand Down
2 changes: 0 additions & 2 deletions www/mod_dnssd/pkg-descr
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
mod_dnssd is an Apache HTTPD module which adds Zeroconf support via DNS-SD
using Avahi.

WWW: http://0pointer.de/lennart/projects/mod_dnssd/
49 changes: 49 additions & 0 deletions www/mod_http2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
PORTNAME= mod_http2
DISTVERSION= 2.0.29
CATEGORIES= www
MASTER_SITES= https://github.com/icing/mod_h2/releases/download/v${DISTVERSION}/
PKGNAMEPREFIX= ${APACHE_PKGNAMEPREFIX}

MAINTAINER= [email protected]
COMMENT= HTTP/2 modules for Apache httpd
WWW= https://github.com/icing/mod_h2

LICENSE= apache2
LICENSE_FILE= ${WRKSRC}/LICENSE

LIB_DEPENDS= libnghttp2.so:www/libnghttp2

USES= apache libtool ssl pkgconfig
GNU_CONFIGURE= yes

CONFIGURE_ARGS= --without-curl

MODULENAME= mod_h2

SUB_FILES= 200_mod_http2.conf 300_mod_proxy_http2.conf
PORTDOCS= README README.md

OPTIONS_DEFINE= DOCS

.include <bsd.port.pre.mk>

.if ${ARCH} == "i386" || ${ARCH:Marmv?} != ""
CFLAGS+= -Wno-error=tautological-constant-out-of-range-compare
.endif

post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEETCDIR}/modules.d
${INSTALL_DATA} ${WRKDIR}/200_mod_http2.conf \
${STAGEDIR}${PREFIX}/${APACHEETCDIR}/modules.d/200_mod_h2.conf.sample
${INSTALL_DATA} ${WRKDIR}/300_mod_proxy_http2.conf \
${STAGEDIR}${PREFIX}/${APACHEETCDIR}/modules.d/300_mod_proxy_h2.conf.sample
# Rename mod_http2 to mod_h2 to avoid conflict with Apache24
${MV} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/mod_http2.so \
${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so
${MV} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/mod_proxy_http2.so \
${STAGEDIR}${PREFIX}/${APACHEMODDIR}/mod_proxy_h2.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so \
${STAGEDIR}${PREFIX}/${APACHEMODDIR}/mod_proxy_h2.so
${RM} ${STAGEDIR}${DOCSDIR}/LICENSE

.include <bsd.port.post.mk>
3 changes: 3 additions & 0 deletions www/mod_http2/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1721124237
SHA256 (mod_http2-2.0.29.tar.gz) = 8c4e6219f87f35879fb166a3c08574dea4f454814f3b739b854675a03c6f2d4e
SIZE (mod_http2-2.0.29.tar.gz) = 1053126
8 changes: 8 additions & 0 deletions www/mod_http2/files/200_mod_http2.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To enable, uncomment the LoadModule line

# LoadModule http2_module %%APACHE_MODDIR%%/mod_h2.so

<IfModule http2_module>
Protocols h2 http/1.1
ProtocolsHonorOrder On
</IfModule>
8 changes: 8 additions & 0 deletions www/mod_http2/files/300_mod_proxy_http2.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To enable, uncomment the LoadModule line

# LoadModule proxy_http2_module %%APACHE_MODDIR%%/mod_proxy_h2.so

<IfModule proxy_http2_module>
# ProxyPass "/app" "h2://app.example.com"
# ProxyPassReverse "/app" "https://app.example.com"
</IfModule>
6 changes: 6 additions & 0 deletions www/mod_http2/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This port delivers advance bug- and security fixes for the Apache HTTP/2
Module. For most users, the www/apache24 bundled module is sufficient.

This Apache module implements the "h2" (HTTP2 over TLS) and "h2c" (HTTP2
over plain HTTP connections via Upgrade) for Apache httpd. You can enable
it for the whole server or for specific virtual hosts only.
35 changes: 35 additions & 0 deletions www/mod_http2/pkg-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[
{ type: install
message: <<EOM
NOTE: The default www/apache24 package already contains mod_h2.
This port exists for advance bug- and security fix delivery.

The module shlib file has been renamed from mod_http2 to mod_h2 to
allow the www/apache24 bundled and this (usually newer) module to
coexist. Change the LoadModule line in your Apache config from

LoadModule http2_module ${modDir}/mod_http2.so

to

LoadModule http2_module ${modDir}/mod_h2.so

to enable this port's module.
EOM
} ,
{ type: upgrade
message: <<EOM
The module shlib file has been renamed from mod_http2 to mod_h2 to
allow the www/apache24 bundled and this (usually newer) module to
coexist. Change the LoadModule line in your Apache config from

LoadModule http2_module ${modDir}/mod_http2.so

to

LoadModule http2_module ${modDir}/mod_h2.so

to enable this port's module.
EOM
}
]
4 changes: 4 additions & 0 deletions www/mod_http2/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@sample %%APACHEETCDIR%%/modules.d/200_mod_h2.conf.sample
@sample %%APACHEETCDIR%%/modules.d/300_mod_proxy_h2.conf.sample
%%APACHEMODDIR%%/mod_h2.so
%%APACHEMODDIR%%/mod_proxy_h2.so

0 comments on commit c7882f5

Please sign in to comment.