mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 15:34:47 +02:00
Update GeoIP question in ./Config and use some magic to support both
geoip_classic and geoip_mmdb in modules.default.conf with Conditional Config, a dynamic loadmodule line, and auto-updates. Somewhere in a later version, probably 6.2.5, we will default to mmdb for all cases.
This commit is contained in:
@@ -113,8 +113,8 @@ ARG="$ARG--enable-dynamic-linking "
|
||||
if [ "$GEOIP" = "classic" ]; then
|
||||
ARG="$ARG--enable-geoip-classic "
|
||||
fi
|
||||
if [ "$GEOIP" = "libmaxminddb" ]; then
|
||||
ARG="$ARG--enable-libmaxminddb "
|
||||
if [ "$GEOIP" = "mmdb" -o "$GEOIP" = "libmaxminddb" ]; then
|
||||
ARG="$ARG--enable-mmdb "
|
||||
fi
|
||||
if [ "$SANITIZER" = "asan" ]; then
|
||||
ARG="$ARG--enable-asan "
|
||||
@@ -281,7 +281,7 @@ OPEROVERRIDEVERIFY=""
|
||||
GENCERTIFICATE="1"
|
||||
EXTRAPARA=""
|
||||
SANITIZER=""
|
||||
GEOIP="classic"
|
||||
GEOIP="mmdb"
|
||||
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
|
||||
c="\c"
|
||||
else
|
||||
@@ -773,12 +773,12 @@ while [ -z "$TEST" ] ; do
|
||||
echo ""
|
||||
echo "GeoIP is a feature that allows converting an IP address to a location (country)"
|
||||
echo "Possible build options:"
|
||||
echo " classic: This is the DEFAULT geoip engine. It should work on all systems"
|
||||
echo " and receives automatic updates."
|
||||
echo "libmaxminddb: This uses the libmaxminddb library. If you want to use this, then"
|
||||
echo " you need to install the libmaxminddb library on your system first"
|
||||
echo " none: Don't build with any geoip library (geoip-csv is still built)"
|
||||
echo "Choose one of: classic, libmaxminddb, none"
|
||||
echo "classic: This is the classic (OLD) geoip engine. Slowly being phased out."
|
||||
echo " It receives automatic updates."
|
||||
echo " mmdb: This uses the build-in mmdb library. It is the NEW geoip engine."
|
||||
echo " It receives automatic updates as well."
|
||||
echo " none: Don't build classic, and load neither classic nor mmdb by default."
|
||||
echo "Choose one of: classic, mmdb, none"
|
||||
echo $n "[$TEST] -> $c"
|
||||
read cc
|
||||
if [ -z "$cc" ] ; then
|
||||
@@ -789,7 +789,7 @@ while [ -z "$TEST" ] ; do
|
||||
classic)
|
||||
GEOIP="$cc"
|
||||
;;
|
||||
libmaxminddb)
|
||||
mmdb)
|
||||
GEOIP="$cc"
|
||||
;;
|
||||
none)
|
||||
|
||||
@@ -467,5 +467,6 @@ AC_DEFUN([CHECK_GEOIP_CLASSIC],
|
||||
|
||||
GEOIP_CLASSIC_OBJECTS="geoip_classic.so"
|
||||
AC_SUBST(GEOIP_CLASSIC_OBJECTS)
|
||||
AC_DEFINE([GEOIP_ENGINE], ["geoip_classic"], [Classic GeoIP engine])
|
||||
]) dnl AS_IF(enable_geoip_classic)
|
||||
])
|
||||
|
||||
@@ -784,6 +784,7 @@ enable_werror
|
||||
enable_asan
|
||||
enable_libcurl
|
||||
enable_geoip_classic
|
||||
enable_mmdb
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1446,6 +1447,7 @@ Optional Features:
|
||||
--enable-libcurl=DIR enable libcurl (remote include) support
|
||||
--enable-geoip-classic=no/yes
|
||||
enable GeoIP Classic support
|
||||
--enable-mmdb=no/yes enable GeoIP mmdb support
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@@ -10133,6 +10135,25 @@ fi
|
||||
GEOIP_CLASSIC_OBJECTS="geoip_classic.so"
|
||||
|
||||
|
||||
printf "%s\n" "#define GEOIP_ENGINE \"geoip_classic\"" >>confdefs.h
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-mmdb was given.
|
||||
if test ${enable_mmdb+y}
|
||||
then :
|
||||
enableval=$enable_mmdb; enable_mmdb=$enableval
|
||||
else case e in #(
|
||||
e) enable_mmdb=no ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_mmdb" = "xyes"
|
||||
then :
|
||||
|
||||
printf "%s\n" "#define GEOIP_ENGINE \"geoip_mmdb\"" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
UNRLINCDIR="`pwd`/include"
|
||||
|
||||
@@ -930,6 +930,15 @@ CHECK_LIBCURL
|
||||
|
||||
CHECK_GEOIP_CLASSIC
|
||||
|
||||
dnl This does not do much anymore but..
|
||||
AC_ARG_ENABLE(mmdb,
|
||||
[AC_HELP_STRING([--enable-mmdb=no/yes],[enable GeoIP mmdb support])],
|
||||
[enable_mmdb=$enableval],
|
||||
[enable_mmdb=no])
|
||||
AS_IF([test "x$enable_mmdb" = "xyes"],
|
||||
[AC_DEFINE([GEOIP_ENGINE], ["geoip_mmdb"], [MMDB GeoIP engine])])
|
||||
|
||||
dnl Set to include dir
|
||||
UNRLINCDIR="`pwd`/include"
|
||||
|
||||
dnl This is at the end so the (potential) -std=gnu17 is not used
|
||||
|
||||
@@ -7,8 +7,14 @@ This is work in progress and may not always be a stable version.
|
||||
### Enhancements:
|
||||
|
||||
### Changes:
|
||||
* [GeoIP](https://www.unrealircd.org/docs/GeoIP): Move from `geoip_classic`
|
||||
to `geoip_mmdb` as the default backend, at least for new installations.
|
||||
* [GeoIP](https://www.unrealircd.org/docs/GeoIP):
|
||||
* We now ship with our own mmdb engine and `geoip_mmdb` (replacement for
|
||||
`geoip_maxmind`).
|
||||
* The `./Config` question on GeoIP now defaults to `mmdb`. Existing users
|
||||
who upgrade will keep their current setting (usually `classic`) for now.
|
||||
* Both `geoip_classic` and `geoip_mmdb` now receive automatic updates
|
||||
* You can `@define $NO_GEOIP_CONFIG "1"` to disable auto configuration
|
||||
and updates.
|
||||
|
||||
### Fixes:
|
||||
|
||||
|
||||
@@ -313,8 +313,21 @@ loadmodule "utf8only"; /* UTF8ONLY via set::utf8-only */
|
||||
loadmodule "portinfo"; /* storing local_port and server_port of users */
|
||||
loadmodule "isupport"; /* ISUPPORT / numeric 005 handling */
|
||||
|
||||
loadmodule "geoip_mmdb";
|
||||
@if $GEOIP_ENGINE != "none"
|
||||
loadmodule "$GEOIP_ENGINE";
|
||||
@endif
|
||||
|
||||
@if !defined(NO_GEOIP_CONFIG)
|
||||
@if module-loaded("geoip_classic")
|
||||
set {
|
||||
geoip-classic {
|
||||
ipv4-database "https://www.unrealircd.org/files/geo/classic/GeoIP.dat" { url-refresh 14d; url-fail warn; }
|
||||
ipv6-database "https://www.unrealircd.org/files/geo/classic/GeoIPv6.dat" { url-refresh 14d; url-fail warn; }
|
||||
asn-ipv4-database "https://www.unrealircd.org/files/geo/classic/GeoIPASNum.dat" { url-refresh 14d; url-fail warn; }
|
||||
asn-ipv6-database "https://www.unrealircd.org/files/geo/classic/GeoIPASNumv6.dat" { url-refresh 14d; url-fail warn; }
|
||||
}
|
||||
}
|
||||
@endif
|
||||
@if module-loaded("geoip_mmdb")
|
||||
set {
|
||||
geoip-mmdb {
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
/* Define the location of the documentation */
|
||||
#undef DOCDIR
|
||||
|
||||
/* MMDB GeoIP engine */
|
||||
#undef GEOIP_ENGINE
|
||||
|
||||
/* Define if you have getrusage */
|
||||
#undef GETRUSAGE_2
|
||||
|
||||
|
||||
@@ -433,6 +433,11 @@ void init_config_defines(void)
|
||||
add_nvplist(&config_defines, 0, "UNREALIRCD_VERSION_MAJOR", PATCH2);
|
||||
add_nvplist(&config_defines, 0, "UNREALIRCD_VERSION_MINOR", PATCH3);
|
||||
add_nvplist(&config_defines, 0, "UNREALIRCD_VERSION_SUFFIX", PATCH4);
|
||||
#ifdef GEOIP_ENGINE
|
||||
add_nvplist(&config_defines, 0, "GEOIP_ENGINE", GEOIP_ENGINE);
|
||||
#else
|
||||
add_nvplist(&config_defines, 0, "GEOIP_ENGINE", "none");
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Return the complete struct for a defined value */
|
||||
|
||||
Reference in New Issue
Block a user