ngIRCd 27
- - autogen.sh: Prefere automake 1.11 over other releases because this is the
+ - The server "Name" in the "[Global]" section of the configuration file no
+ longer needs to be set: When not set (or empty), ngIRCd now tries to
+ deduce a valid IRC server name from the local host name ("node name"),
+ possibly adding a ".host" extension when the host name does not contain a
+ dot (".") which is required in an IRC server name ("ID").
+ This new behaviour, with all configuration parameters now being optional,
+ allows running ngIRCd without any configuration file at all.
+ - autogen.sh: Prefer automake 1.11 over other releases because this is the
last release supporting "de-ANSI-fication" using the included ansi2knr tool.
- And becuase we _want_ to support old K&R platforms, we try hard to use this
+ And because we _want_ to support old K&R platforms, we try hard to use this
release of automake when available to generate our build system.
Note: This is only relevant for you if you are building from Git sources.
- Autodetect support for IPv6 by default: Until now, IPv6 support was disabled
# make sure that they correspond to your installation and setup!
# Server name in the IRC network, must contain at least one dot
- # (".") and be unique in the IRC network. Required!
- Name = irc.example.net
+ # (".") and be unique in the IRC network. When not set, ngIRCd tries
+ # to deduce a valid IRC server name from the local host name.
+ ;Name = irc.example.net
# Information about the server and the administrator, used by the
# ADMIN command. Not required by server but by RFC!
These settings depend on your personal preferences, so you should make sure
that they correspond to your installation and setup!
.TP
-\fBName\fR (string; required)
+\fBName\fR (string)
Server name in the IRC network. This is an individual name of the IRC
server, it is not related to the DNS host name. It must be unique in the
-IRC network and must contain at least one dot (".") character.
+IRC network and must contain at least one dot (".") character. When not set,
+ngIRCd tries to deduce a valid IRC server name from the local host name.
.TP
\fBAdminInfo1\fR, \fBAdminInfo2\fR, \fBAdminEMail\fR (string)
Information about the server and the administrator, used by the ADMIN
#include <grp.h>
#include <sys/types.h>
#include <dirent.h>
+#include <netdb.h>
#include "ngircd.h"
#include "conn.h"
/* Validate configuration settings. */
int i, servers, servers_once;
+ struct hostent *h;
bool config_valid = true;
char *ptr;
NGIRCd_ConfFile);
}
+ if (!Conf_ServerName[0]) {
+ /* No server name configured, try to get a sane name from the
+ * host name. Note: the IRC server name MUST contain
+ * at least one dot, so the "node name" is not sufficient! */
+ gethostname(Conf_ServerName, sizeof(Conf_ServerName));
+ if (Conf_DNS) {
+ /* Try to get a proper host name ... */
+ h = gethostbyname(Conf_ServerName);
+ if (h)
+ strlcpy(Conf_ServerName, h->h_name,
+ sizeof(Conf_ServerName));
+ }
+ if (!strchr(Conf_ServerName, '.')) {
+ /* (Still) No dot in the name! */
+ strlcat(Conf_ServerName, ".host",
+ sizeof(Conf_ServerName));
+ }
+ Config_Error(LOG_WARNING,
+ "No server name configured, using host name \"%s\".",
+ Conf_ServerName);
+ }
+
/* Validate configured server name, see RFC 2812 section 2.3.1 */
ptr = Conf_ServerName;
do {
break;
} while (*(++ptr));
- if (!Conf_ServerName[0] || !strchr(Conf_ServerName, '.'))
- {
- /* No server name configured! */
+ if (!Conf_ServerName[0] || !strchr(Conf_ServerName, '.')) {
config_valid = false;
Config_Error(LOG_ALERT,
"No (valid) server name configured in \"%s\" (section 'Global': 'Name')!",