- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- $continue = 0;
- while (!$continue) {
- print "What is the maximum length of a quit message?\n";
- print "[\033[1;32m$config{MAX_QUIT}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{MAX_QUIT};
- }
- if ($var =~ /^\d+$/) {
- # We don't care what the number is, set it and be on our way.
- $config{MAX_QUIT} = $var;
- $continue = 1;
- print "\n";
- } else {
- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- $continue = 0;
- while (!$continue) {
- print "What is the maximum length of a channel topic?\n";
- print "[\033[1;32m$config{MAX_TOPIC}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{MAX_TOPIC};
- }
- if ($var =~ /^\d+$/) {
- # We don't care what the number is, set it and be on our way.
- $config{MAX_TOPIC} = $var;
- $continue = 1;
- print "\n";
- } else {
- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- $continue = 0;
- while (!$continue) {
- print "What is the maximum length of a kick message?\n";
- print "[\033[1;32m$config{MAX_KICK}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{MAX_KICK};
- }
- if ($var =~ /^\d+$/) {
- # We don't care what the number is, set it and be on our way.
- $config{MAX_KICK} = $var;
- $continue = 1;
- print "\n";
- } else {
- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- $continue = 0;
- while (!$continue) {
- print "What is the maximum length of a GECOS (real name) field?\n";
- print "[\033[1;32m$config{MAX_GECOS}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{MAX_GECOS};
- }
- if ($var =~ /^\d+$/) {
- # We don't care what the number is, set it and be on our way.
- $config{MAX_GECOS} = $var;
- $continue = 1;
- print "\n";
- } else {
- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- $continue = 0;
- while (!$continue) {
- print "What is the maximum length of an away message?\n";
- print "[\033[1;32m$config{MAX_AWAY}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{MAX_AWAY};
- }
- if ($var =~ /^\d+$/) {
- # We don't care what the number is, set it and be on our way.
- $config{MAX_AWAY} = $var;
- $continue = 1;
- print "\n";
- } else {
- print "You must enter a number in this field. Please try again.\n\n";
- }
- }
-
- # Code Optimisation
- print "Enter the Level Of Binary optimisation. This is a number between 0 and 3.
-The InspIRCd Team will NOT support any bug reports above 0. Also note,
-the IRCd behaviour will be different depending on this value. Please
-read the documentation for more information.
-
-The higher the number, the more optimised your binary will be. This
-value will default to 0 if you either don't enter a number, or enter
-a value outside the range.
-
-As always, if you are unsure, just press enter and accept the default.\n\n";
- print "[\033[1;32m$config{OPTIMITEMP}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{OPTIMITEMP};
- }
-
- if ($var eq "1") {
- $config{OPTIMITEMP} = 1;
- $config{OPTIMISATI} = "-O";
- } elsif ($var eq "2") {
- $config{OPTIMITEMP} = 2;
- $config{OPTIMISATI} = "-O2";
- } elsif ($var eq "3") {
- $config{OPTIMITEMP} = 3;
- $config{OPTIMISATI} = "-O3";
- } else {
- $config{OPTIMITEMP} = 0;
- $config{OPTIMISATI} = "-g";
- }
-}
-
-print "\n\033[1;32mPre-build configuration is complete!\033[0m\n\n";
-print "\033[0mBase install path:\033[1;32m\t\t$config{BASE_DIR}\033[0m\n";
-print "\033[0mConfig path:\033[1;32m\t\t\t$config{CONFIG_DIR}\033[0m\n";
-print "\033[0mModule path:\033[1;32m\t\t\t$config{MODULE_DIR}\033[0m\n";
-print "\033[0mLibrary path:\033[1;32m\t\t\t$config{LIBRARY_DIR}\033[0m\n";
-print "\033[0mMax connections:\033[1;32m\t\t$config{MAX_CLIENT}\033[0m\n";
-print "\033[0mMax User Channels:\033[1;32m\t\t$config{MAX_CHANNE}\033[0m\n";
-print "\033[0mMax Oper Channels:\033[1;32m\t\t$config{MAX_OPERCH}\033[0m\n";
-print "\033[0mMax nickname length:\033[1;32m\t\t$config{NICK_LENGT}\033[0m\n";
-print "\033[0mMax channel length:\033[1;32m\t\t$config{CHAN_LENGT}\033[0m\n";
-print "\033[0mMax mode length:\033[1;32m\t\t$config{MAXI_MODES}\033[0m\n";
-print "\033[0mMax ident length:\033[1;32m\t\t$config{MAX_IDENT}\033[0m\n";
-print "\033[0mMax quit length:\033[1;32m\t\t$config{MAX_QUIT}\033[0m\n";
-print "\033[0mMax topic length:\033[1;32m\t\t$config{MAX_TOPIC}\033[0m\n";
-print "\033[0mMax kick length:\033[1;32m\t\t$config{MAX_KICK}\033[0m\n";
-print "\033[0mMax name length:\033[1;32m\t\t$config{MAX_GECOS}\033[0m\n";
-print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\033[0m\n";
-print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.x\033[0m\n";
-print "\033[0mOptimization Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n";
-print "\033[0mCompiler program:\033[1;32m\t\t$config{CC}\033[0m\n";
-print "\033[0mStatic modules:\033[1;32m\t\t\t$config{STATIC_LINK}\033[0m\n";
-print "\033[0mIPv6 Support:\033[1;32m\t\t\t$config{IPV6}\033[0m\n";
-print "\033[0mIPv6 to IPv4 Links:\033[1;32m\t\t$config{SUPPORT_IP6LINKS}\033[0m\n";
-print "\033[0mGnuTLS Support:\033[1;32m\t\t\t$config{USE_GNUTLS}\033[0m\n";
-print "\033[0mOpenSSL Support:\033[1;32m\t\t$config{USE_OPENSSL}\033[0m\n\n";
-
-if ($config{USE_GNUTLS} eq "y") {
- $failed = 0;
- open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
- close(TMP);
- if ($failed) {
- print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
- chdir("src/modules");
- system("ln -s extra/m_ssl_gnutls.cpp");
- system("ln -s extra/ssl_cert.h");
- chdir("../..");
- }
- getmodules();
- if ($interactive)
- {
- $failed = 0;
- open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
- close(TMP);
- open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
- close(TMP);
- if ($failed) {
- print "SSL Certificates Not found, Generating.. \n\n
-*************************************************************
-* Generating the Private Key may take some time, go grab a *
-* Coffee. Even better, to generate some more entropy if it *
-* is taking a while, open another console and type du / a *
-* few times and get that HD going :) Then answer the *
-* Questions which follow. If you are unsure, just hit enter *
-*************************************************************\n\n";
- system("certtool --generate-privkey --outfile key.pem");
- system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
- print "\nCertificate generation complete, copying to config directory... ";
- system("mv key.pem $config{CONFIG_DIR}/key.pem");
- system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
- print "Done.\n\n";
- } else {
- print "SSL Certificates found, skipping.\n\n"
- }
- }
- else
- {
- print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
- }
-} elsif ($config{USE_OPENSSL} eq "y") {
- $failed = 0;
- open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
- close(TMP);
- if ($failed) {
- print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
- chdir("src/modules");
- system("ln -s extra/m_ssl_openssl.cpp");
- system("ln -s extra/ssl_cert.h");
- chdir("../..");
- }
- getmodules();
- $failed = 0;
- if ($interactive)
- {
- open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
- close(TMP);
- open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
- close(TMP);
- if ($failed) {
- print "SSL Certificates Not found, Generating.. \n\n
-*************************************************************
-* Generating the certificates may take some time, go grab a *
-* coffee, or something. *
-*************************************************************\n\n";
- system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
- system("openssl dhparam -out dhparams.pem 1024");
- print "\nCertificate generation complete, copying to config directory... ";
- system("mv key.pem $config{CONFIG_DIR}/key.pem");
- system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
- system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
- print "Done.\n\n";
- } else {
- print "SSL Certificates found, skipping.\n\n"