# Server name in the IRC network, must contain at least one dot
# (".") and be unique in the IRC network. Required!
- Name = irc.the.net
+ Name = irc.example.net
# Info text of the server. This will be shown by WHOIS and
# LINKS requests for example.
# maximum nick name length!
;MaxNickLength = 9
+ # Set this hostname for every client instead of the real one.
+ # Please note: don't use the percentage sign ("%"), it is reserved for
+ # future extensions!
+ ;CloakHost = irc.example.net
+
+ # Set every clients' user name to their nick name
+ ;CloakUserToNick = yes
+
[Features]
# Do any DNS lookups when a client connects to the server.
;DNS = yes
# IRC name of the remote server, must match the "Name" variable in
# the [Global] section of the other server (when using ngIRCd).
- ;Name = irc2.the.net
+ ;Name = irc2.example.net
# Internet host name or IP address of the peer (only required when
# this server should establish the connection).
- ;Host = connect-to-host.the.net
+ ;Host = connect-to-host.example.net
# IP address to use as _source_ address for the connection. if
# unspecified, ngircd will let the operating system pick an address.
Maximum length of an user nick name (Default: 9, as in RFC 2812). Please
note that all servers in an IRC network MUST use the same maximum nick name
length!
+.TP
+\fBCloakHost\fR
+Set this hostname for every client instead of the real one. Default: empty,
+don't change.
+.PP
+.RS
+.B Please note:
+.br
+Don't use the percentage sign ("%"), it is reserved for future extensions!
+.RE
+.TP
+\fBCloakUserToNick\fR
+Set every clients' user name to their nick name and hide the one supplied
+by the IRC client. Default: no.
.SH [OPERATOR]
.I [Operator]
sections are used to define IRC Operators. There may be more than one
assert( Client != NULL );
assert( Hostname != NULL );
- strlcpy( Client->host, Hostname, sizeof( Client->host ));
+ if (strlen(Conf_CloakHost)) {
+ strlcpy( Client->host, Conf_CloakHost, sizeof( Client->host ));
+ } else {
+ strlcpy( Client->host, Hostname, sizeof( Client->host ));
+ }
} /* Client_SetHostname */
strlcpy( Client->id, ID, sizeof( Client->id ));
+ if (Conf_CloakUserToNick)
+ strlcpy( Client->user, ID, sizeof( Client->user ));
+
/* Hash */
Client->hash = Hash( Client->id );
} /* Client_SetID */
assert( Client != NULL );
assert( User != NULL );
+ if (Conf_CloakUserToNick) return;
+
if (Idented) {
strlcpy(Client->user, User, sizeof(Client->user));
} else {
printf(" MaxConnections = %ld\n", Conf_MaxConnections);
printf(" MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
printf(" MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
- printf(" MaxNickLength = %u\n\n", Conf_MaxNickLength - 1);
+ printf(" MaxNickLength = %u\n", Conf_MaxNickLength - 1);
+ printf(" CloakHost = %s\n", Conf_CloakHost);
+ printf(" CloakUserToNick = %s\n\n", yesno_to_str(Conf_CloakUserToNick));
puts("[FEATURES]");
printf(" DNS = %s\n", yesno_to_str(Conf_DNS));
Conf_MaxJoins = 10;
Conf_MaxNickLength = CLIENT_NICK_LEN_DEFAULT;
+ strcpy(Conf_CloakHost, "");
+ Conf_CloakUserToNick = false;
+
#ifdef SYSLOG
#ifdef LOG_LOCAL5
Conf_SyslogFacility = LOG_LOCAL5;
Config_Error_TooLong( Line, Var );
return;
}
+ if( strcasecmp( Var, "CloakHost" ) == 0 ) {
+ /* Client hostname */
+ len = strlcpy( Conf_CloakHost, Arg, sizeof( Conf_CloakHost ));
+ if (len >= sizeof( Conf_CloakHost ))
+ Config_Error_TooLong( Line, Var );
+ return;
+ }
+ if( strcasecmp( Var, "CloakUserToNick" ) == 0 ) {
+ /* Use client nick name as user name */
+ Conf_CloakUserToNick = Check_ArgIsTrue( Arg );
+ return;
+ }
if( strcasecmp( Var, "Info" ) == 0 ) {
/* Info text of server */
len = strlcpy( Conf_ServerInfo, Arg, sizeof( Conf_ServerInfo ));
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** Flag indicating if remote IRC operators are allowed to manage this server */
GLOBAL bool Conf_AllowRemoteOper;
+/** Cloaked hostname of the clients */
+GLOBAL char Conf_CloakHost[CLIENT_ID_LEN];
+
+/** Use nick name as user name? */
+GLOBAL bool Conf_CloakUserToNick;
+
/** Enable all DNS functions? */
GLOBAL bool Conf_DNS;
} /* IRC_QUIT */
+#ifndef STRICT_RFC
+
+/**
+ * Handler for HTTP command, e.g. GET and POST
+ *
+ * We handle these commands here to avoid the quite long timeout when
+ * some user tries to access this IRC daemon using an web browser ...
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @returns CONNECTED or DISCONNECTED.
+ */
+GLOBAL bool
+IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req )
+{
+ Req->argc = 1;
+ Req->argv[0] = "Oops, HTTP request received? This is IRC!";
+ return IRC_QUIT(Client, Req);
+} /* IRC_QUIT_HTTP */
+
+#endif
+
+
/**
* Handler for the IRC "PING" command.
*
GLOBAL bool IRC_PING PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_PONG PARAMS((CLIENT *Client, REQUEST *Req));
GLOBAL bool IRC_QUIT PARAMS((CLIENT *Client, REQUEST *Req));
+GLOBAL bool IRC_QUIT_HTTP PARAMS((CLIENT *Client, REQUEST *Req));
#endif
{ "WHOWAS", IRC_WHOWAS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
#ifdef IRCPLUS
{ "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, 0, 0 },
+#endif
+#ifndef STRICT_RFC
+ { "GET", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
+ { "POST", IRC_QUIT_HTTP, CLIENT_UNKNOWN, 0, 0, 0 },
#endif
{ NULL, NULL, 0x0, 0, 0, 0 } /* Ende-Marke */
};