mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-26 15:56:38 +02:00
8a4856fa8b
If BUFFERPOOL dbuf_put would return -1, but at some places !dbuf_put was used, I've changed it so it will return 0 (so use !dbuf_put now, don't use dbuf_put(...) < 0 :P). I also added some nice warning thing. I couldn't send from the send routine because that's risky ;). And...... I also doubled the default BUFFERPOOL, so if you leave everything the default then BUFFERPOOL is now 52Mb instead of 26Mb, which should be ok for now.
592 lines
12 KiB
Bash
Executable File
592 lines
12 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Config script for UnrealIRCd
|
|
# (C) 2001 The UnrealIRCd Team
|
|
#
|
|
# This configure script is free software; the UnrealIRCd Team gives
|
|
# unlimited permission to copy, distribute and modify as long as the
|
|
# copyright headers stay intact
|
|
#
|
|
#
|
|
# Rewritten completely to be an interface to autoconf by codemastr
|
|
# This was inspired by the config by Michael Graff (explorer@flame.org)
|
|
# but was written from scratch
|
|
|
|
# In order to be faster than the old Config, this assumes that all information
|
|
# in the cache file is valid and therefore doesn't check it, so if you messed with
|
|
# default values thats your problem :P
|
|
|
|
|
|
RUN_CONFIGURE () {
|
|
ARG=""
|
|
if [ "$NOSPOOF" = "1" ] ; then
|
|
ARG="$ARG--enable-nospoof "
|
|
fi
|
|
if [ -n "$HUB" ] ; then
|
|
ARG="$ARG--enable-hub "
|
|
fi
|
|
if [ "$CRYPTOIRCD" = "1" ] ; then
|
|
if test x"$SSLDIR" = "x" ; then
|
|
ARG="$ARG--enable-ssl "
|
|
else
|
|
ARG="$ARG--enable-ssl=$SSLDIR "
|
|
fi
|
|
fi
|
|
if [ "$ZIPLINKS" = "1" ] ; then
|
|
if test x"$ZIPLINKSDIR" = "x" ; then
|
|
ARG="$ARG--enable-ziplinks "
|
|
else
|
|
ARG="$ARG--enable-ziplinks=$ZIPLINKSDIR "
|
|
fi
|
|
fi
|
|
if [ "$INET6" = "1" ] ; then
|
|
ARG="$ARG--enable-inet6 "
|
|
fi
|
|
if [ "$STANDARD_THREADS" = "1" ] ; then
|
|
ARG="$ARG--enable-standardthreads "
|
|
fi
|
|
ARG="$ARG--with-listen=$LISTEN_SIZE "
|
|
ARG="$ARG--with-dpath=$DPATH "
|
|
ARG="$ARG--with-spath=$SPATH "
|
|
ARG="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH "
|
|
ARG="$ARG--with-sendq=$MAXSENDQLENGTH "
|
|
ARG="$ARG--with-bufferpool=$BUFFERPOOL "
|
|
ARG="$ARG--with-hostname=$DOMAINNAME "
|
|
ARG="$ARG--with-permissions=$DEFPERM "
|
|
ARG="$ARG--with-fd-setsize=$MAXCONNECTIONS "
|
|
ARG="$ARG--enable-dynamic-linking "
|
|
ARG="$ARG $EXTRAPARA "
|
|
CONF="./configure $ARG"
|
|
echo $CONF
|
|
$CONF
|
|
if [ "$CRYPTOIRCD" = "1" ] ; then
|
|
if [ ! -f server.req.pem ]; then
|
|
export OPENSSLPATH
|
|
make pem
|
|
cat .SICI
|
|
read cc
|
|
else
|
|
echo "SSL certificate already existing, no need to regenerate"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
c=""
|
|
n=""
|
|
NOSPOOF=""
|
|
DPATH="`pwd`"
|
|
SPATH="`pwd`/src/ircd"
|
|
HUB="1"
|
|
DOMAINNAME=`hostname`
|
|
DEFPERM="0600"
|
|
CRYPTOIRCD=""
|
|
SSLDIR=""
|
|
ZIPLINKS=""
|
|
ZIPLINKSDIR=""
|
|
LISTEN_SIZE="5"
|
|
NICKNAMEHISTORYLENGTH="2000"
|
|
MAXSENDQLENGTH="3000000"
|
|
BUFFERPOOL="18"
|
|
MAXCONNECTIONS="1024"
|
|
INET6=""
|
|
EXTRAPARA=""
|
|
STANDARD_THREADS="1"
|
|
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
|
|
c="\c"
|
|
else
|
|
n="-n"
|
|
fi
|
|
|
|
|
|
#parse arguments
|
|
NOCACHE=""
|
|
NOINTRO=""
|
|
if [ "$1" = "--help" ] ; then
|
|
echo "Config utility for UnrealIRCd"
|
|
echo "-----------------------------"
|
|
echo "Syntax: ./Config [options]"
|
|
echo "-nocache Ignore settings saved in config.settings"
|
|
echo "-nointro Skip intro (release notes, etc)"
|
|
echo "-quick Skip questions, go straight to configure"
|
|
echo "-C Clean ./configure cache"
|
|
exit 0
|
|
fi
|
|
if [ "$1" = "-nocache" -o "$2" = "-nocache" ] ; then
|
|
NOCACHE="1"
|
|
fi
|
|
if [ "$1" = "-nointro" -o "$2" = "-nointro" ] ; then
|
|
NOINTRO="1"
|
|
fi
|
|
|
|
if [ -f "config.settings" -a -z "$NOCACHE" ] ; then
|
|
. config.settings
|
|
fi
|
|
|
|
if [ "$1" = "-C" -o "$2" = "-C" ] ; then
|
|
rm -f config.cache
|
|
fi
|
|
|
|
if [ "$1" = "-quick" -o "$1" = "-q" -o "$2" = "-quick" ] ; then
|
|
echo "running quick config"
|
|
RUN_CONFIGURE
|
|
exit 0
|
|
fi
|
|
|
|
clear
|
|
|
|
if [ -f ".CHANGES.NEW" -a -z "$NOINTRO" ] ; then
|
|
more .CHANGES.NEW
|
|
echo $n "[Enter to continue]"
|
|
read cc
|
|
clear
|
|
fi
|
|
if [ -f ".RELEASE.NOTES" -a -z "$NOINTRO" ] ; then
|
|
more .RELEASE.NOTES
|
|
echo $n "[Enter to continue]"
|
|
read cc
|
|
clear
|
|
fi
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$NOSPOOF" = "1" ] ; then
|
|
TEST="Yes"
|
|
else
|
|
TEST="No"
|
|
fi
|
|
echo ""
|
|
echo "Many older operating systems have an insecure TCP/IP stack"
|
|
echo "which may be vulnerable to IP spoofing attacks, if you run"
|
|
echo "an operating system that is vulnerable to such attacks"
|
|
echo "enable this option. If you aren't sure if your OS is vulnerable"
|
|
echo "you should still enable it."
|
|
echo ""
|
|
echo "Do you have an insecure operating system and therefore want to"
|
|
echo "use the server anti-spoof protection?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Yy]*)
|
|
NOSPOOF="1"
|
|
;;
|
|
[Nn]*)
|
|
NOSPOOF=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Yes or No"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST="$DPATH"
|
|
echo ""
|
|
echo "What directory are all the server configuration files in?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
DPATH=$TEST
|
|
else
|
|
DPATH=$cc
|
|
fi
|
|
|
|
TEST="$SPATH"
|
|
echo ""
|
|
echo "What is the path to the ircd binary including the name of the binary?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
SPATH=$TEST
|
|
else
|
|
SPATH=$cc
|
|
fi
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$HUB" = "1" ] ; then
|
|
TEST="Hub"
|
|
else
|
|
TEST="Leaf"
|
|
fi
|
|
echo ""
|
|
echo "Would you like to compile as a hub or as a leaf?"
|
|
echo "Type Hub to select hub and Leaf to select leaf."
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Hh]*)
|
|
HUB="1"
|
|
;;
|
|
[Ll]*)
|
|
HUB=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Hub or Leaf"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST="$DOMAINNAME"
|
|
echo ""
|
|
echo "What is the hostname of the server running your IRCd?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
DOMAINNAME=$TEST
|
|
else
|
|
DOMAINNAME=$cc
|
|
fi
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$DEFPERM"
|
|
echo ""
|
|
echo "What should the default permissions for your configuration files be? (Set this to 0 to disable)"
|
|
echo "It is strongly recommended that you use 0600 to prevent unwanted reading of the file"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
DEFPERM=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[0-9]*)
|
|
DEFPERM="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter a number"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
|
|
done
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$CRYPTOIRCD" = "1" ] ; then
|
|
TEST="Yes"
|
|
else
|
|
TEST="No"
|
|
fi
|
|
echo ""
|
|
echo "Do you want to support SSL (Secure Sockets Layer) connections?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Yy]*)
|
|
CRYPTOIRCD="1"
|
|
;;
|
|
[Nn]*)
|
|
CRYPTOIRCD=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Yes or No"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ "$CRYPTOIRCD" = "1" ] ; then
|
|
TEST=""
|
|
echo ""
|
|
echo "If you know the path to OpenSSL on your system, enter it here. If not"
|
|
echo "leave this blank"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
SSLDIR=""
|
|
else
|
|
SSLDIR=$cc
|
|
fi
|
|
fi
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$INET6" = "1" ] ; then
|
|
TEST="Yes"
|
|
else
|
|
TEST="No"
|
|
fi
|
|
echo ""
|
|
echo "Do you want to enable IPv6 support?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Yy]*)
|
|
INET6="1"
|
|
;;
|
|
[Nn]*)
|
|
INET6=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Yes or No"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$ZIPLINKS" = "1" ] ; then
|
|
TEST="Yes"
|
|
else
|
|
TEST="No"
|
|
fi
|
|
echo ""
|
|
echo "Do you want to enable ziplinks support?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Yy]*)
|
|
ZIPLINKS="1"
|
|
;;
|
|
[Nn]*)
|
|
ZIPLINKS=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Yes or No"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ "$ZIPLINKS" = "1" ] ; then
|
|
TEST=""
|
|
echo ""
|
|
echo "If you know the path to zlib on your system, enter it here. If not"
|
|
echo "leave this blank"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
ZIPLINKSDIR=""
|
|
else
|
|
ZIPLINKSDIR=$cc
|
|
fi
|
|
fi
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$LISTEN_SIZE"
|
|
echo ""
|
|
echo "What listen() backlog value do you wish to use? Some older servers"
|
|
echo "have problems with more than 5, others work fine with many more."
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
LISTEN_SIZE=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[1-9]*)
|
|
LISTEN_SIZE="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter a number"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$NICKNAMEHISTORYLENGTH"
|
|
echo ""
|
|
echo "How far back do you want to keep the nickname history?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
NICKNAMEHISTORYLENGTH=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[1-9]*)
|
|
NICKNAMEHISTORYLENGTH="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter a number"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$MAXSENDQLENGTH"
|
|
echo ""
|
|
echo "What is the maximum sendq length you wish to have?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
MAXSENDQLENGTH=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[1-9][0-9][0-9][0-9]*)
|
|
MAXSENDQLENGTH="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter a number greater than or equal to 1000"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$BUFFERPOOL"
|
|
echo ""
|
|
echo "How many buffer pools would you like?"
|
|
echo "This number will be multiplied by MAXSENDQLENGTH."
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
BUFFERPOOL=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[1-9]*)
|
|
BUFFERPOOL="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter a number"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
|
|
done
|
|
|
|
echo ""
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
TEST="$MAXCONNECTIONS"
|
|
echo ""
|
|
echo "How many file descriptors (or sockets) can the IRCd use?"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
MAXCONNECTIONS=$TEST
|
|
break
|
|
fi
|
|
case "$cc" in
|
|
[1-9][0-9][0-9]*)
|
|
MAXCONNECTIONS="$cc"
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must to enter a number greater than or equal to 100"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
TEST=""
|
|
while [ -z "$TEST" ] ; do
|
|
if [ "$STANDARD_THREADS" = "1" ] ; then
|
|
TEST="Yes"
|
|
else
|
|
TEST="No"
|
|
fi
|
|
echo ""
|
|
echo "Do you want use your OS's provided threads implementation (if not, it will maybe use the one Unreal finds)"
|
|
echo "If you experince problems with sudden lockups of the IRCd, and you're running Linux, you might want to say Yes here"
|
|
echo "A sideeffect, under Linux is that each thread is shown as a PID - meaning in ps it will show as a lot of ircd processes"
|
|
echo "You might want to know your sysadmins opinion on this if that is the case"
|
|
echo $n "[$TEST] -> $c"
|
|
read cc
|
|
if [ -z "$cc" ] ; then
|
|
cc=$TEST
|
|
fi
|
|
case "$cc" in
|
|
[Yy]*)
|
|
STANDARD_THREADS="1"
|
|
;;
|
|
[Nn]*)
|
|
STANDARD_THREADS=""
|
|
;;
|
|
*)
|
|
echo ""
|
|
echo "You must enter either Yes or No"
|
|
TEST=""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
echo ""
|
|
echo "Would you like any more parameters to configure?"
|
|
echo "Write them here:"
|
|
echo $n "[]-> $c"
|
|
read EXTRAPARA
|
|
|
|
rm -f config.settings
|
|
cat > config.settings << __EOF__
|
|
#
|
|
NOSPOOF="$NOSPOOF"
|
|
DPATH="$DPATH"
|
|
SPATH="$SPATH"
|
|
CRYPT_OPER_PASSWORD="$CRYPT_OPER_PASSWORD"
|
|
CRYPT_LINK_PASSWORD="$CRYPT_LINK_PASSWORD"
|
|
CRYPT_ILINE_PASSWORD="$CRYPT_ILINE_PASSWORD"
|
|
CRYPT_XLINE_PASSWORD="$CRYPT_XLINE_PASSWORD"
|
|
INET6="$INET6"
|
|
LISTEN_SIZE="$LISTEN_SIZE"
|
|
MAXSENDQLENGTH="$MAXSENDQLENGTH"
|
|
BUFFERPOOL="$BUFFERPOOL"
|
|
MAXCONNECTIONS="$MAXCONNECTIONS"
|
|
NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
|
|
HUB="$HUB"
|
|
DOMAINNAME="$DOMAINNAME"
|
|
DEFPERM="$DEFPERM"
|
|
CRYPTOIRCD="$CRYPTOIRCD"
|
|
SSLDIR="$SSLDIR"
|
|
ZIPLINKS="$ZIPLINKS"
|
|
ZIPLINKSDIR="$ZIPLINKSDIR"
|
|
STANDARD_THREADS="1"
|
|
EXTRAPARA="$EXTRAPARA"
|
|
__EOF__
|
|
RUN_CONFIGURE
|
|
cat << __EOF__
|
|
|
|
_______________________________________________________________________
|
|
| |
|
|
| UnrealIRCd Compile-Time Config |
|
|
|_______________________________________________________________________|
|
|
|_______________________________________________________________________|
|
|
| |
|
|
| Now all you have to do is type 'make' and let it compile. When that's |
|
|
| done, you will receive other instructions on what to do next. |
|
|
| |
|
|
|_______________________________________________________________________|
|
|
|_______________________________________________________________________|
|
|
| - The UnrealIRCd Team - |
|
|
| |
|
|
| * Stskeeps stskeeps@unrealircd.com |
|
|
| * codemastr codemastr@unrealircd.com |
|
|
|_______________________________________________________________________|
|
|
__EOF__
|
|
|