diff options
-rw-r--r-- | docs/conf/aliases/anope.conf.example | 20 | ||||
-rw-r--r-- | docs/conf/aliases/atheme.conf.example | 25 | ||||
-rw-r--r-- | docs/conf/inspircd.conf.example | 20 | ||||
-rw-r--r-- | docs/conf/modules.conf.example | 15 | ||||
-rw-r--r-- | docs/conf/services/anope.conf.example | 9 | ||||
-rw-r--r-- | docs/conf/services/atheme.conf.example | 52 | ||||
-rw-r--r-- | docs/conf/services/generic.conf.example | 45 | ||||
-rw-r--r-- | make/template/main.mk | 6 | ||||
-rw-r--r-- | src/modules/m_alias.cpp | 11 |
9 files changed, 133 insertions, 70 deletions
diff --git a/docs/conf/aliases/anope.conf.example b/docs/conf/aliases/anope.conf.example deleted file mode 100644 index 4d1441473..000000000 --- a/docs/conf/aliases/anope.conf.example +++ /dev/null @@ -1,20 +0,0 @@ -# Aliases for nickserv, chanserv, operserv, memoserv, hostserv, botserv -<alias text="NICKSERV" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -<alias text="CHANSERV" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -<alias text="OPERSERV" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -<alias text="MEMOSERV" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> -<alias text="HOSTSERV" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -<alias text="BOTSERV" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> - -# Shorthand aliases for nickserv, chanserv, operserv, memoserv, hostserv, botserv -<alias text="NS" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -<alias text="CS" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -<alias text="OS" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -<alias text="MS" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> -<alias text="HS" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -<alias text="BS" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> - -# /id [account] <password> -# Identify for a nickname -<alias text="ID" format="*" replace="PRIVMSG NickServ :IDENTIFY $2-" requires="NickServ" uline="yes"> -<alias text="IDENTIFY" format="*" replace="PRIVMSG NickServ :IDENTIFY $2-" requires="NickServ" uline="yes"> diff --git a/docs/conf/aliases/atheme.conf.example b/docs/conf/aliases/atheme.conf.example deleted file mode 100644 index 7a0bc015a..000000000 --- a/docs/conf/aliases/atheme.conf.example +++ /dev/null @@ -1,25 +0,0 @@ -# Aliases for nickserv, chanserv, operserv, memoserv -<alias text="NICKSERV" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -<alias text="CHANSERV" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -<alias text="OPERSERV" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -<alias text="MEMOSERV" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> -<alias text="GAMESERV" replace="PRIVMSG GameServ :$2-" requires="GameServ" uline="yes"> -<alias text="BOTSERV" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> -<alias text="HOSTSERV" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -<alias text="ALIS" replace="PRIVMSG ALIS :$2-" requires="ALIS" uline="yes"> - -# Shorthand aliases for nickserv, chanserv, operserv, memoserv -<alias text="NS" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -<alias text="CS" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -<alias text="OS" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -<alias text="MS" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> -<alias text="GS" replace="PRIVMSG GameServ :$2-" requires="GameServ" uline="yes"> -<alias text="BS" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> -<alias text="HS" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -<alias text="LS" replace="PRIVMSG ALIS :$2-" requires="ALIS" uline="yes"> - -# /id [channel] <password> -# Identify for a channel or nickname -<alias text="ID" format="#*" replace="PRIVMSG ChanServ :IDENTIFY $2 $3" requires="ChanServ" uline="yes"> -<alias text="ID" format="*" replace="PRIVMSG NickServ :IDENTIFY $2-" requires="NickServ" uline="yes"> - diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index e7eea0210..3f545e567 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -867,11 +867,7 @@ nick="ChanServ" # reason: Reason to display on /nick. - reason="Reserved For Services"> - -<badnick nick="NickServ" reason="Reserved For Services"> -<badnick nick="OperServ" reason="Reserved For Services"> -<badnick nick="MemoServ" reason="Reserved For Services"> + reason="Reserved for a network service"> <badhost # host: ident@hostname to ban. @@ -959,6 +955,20 @@ # Settings similar to Charybdis IRCd defaults. #<include file="examples/modules/charybdis.conf.example"> +#-#-#-#-#-#-#-#-#-#-#-# SERVICES CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-# +# # +# If you use services you will probably want to include one of the # +# following files which set up aliases, nick reservations and filter # +# exemptions for services pseudoclients: # +# +# Anope users should uncomment this: +#<include file="examples/services/anope.conf.example"> +# +# Atheme users should uncomment this: +#<include file="examples/services/atheme.conf.example"> +# +# Users of other services should uncomment this: +#<include file="examples/services/generic.conf.example"> ######################################################################### # # diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 5aa5bb158..020a15ded 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -135,18 +135,6 @@ # If a non-oper attempts to use the alias, it will # # appear to not exist. # # # -#<alias text="NICKSERV" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -#<alias text="CHANSERV" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -#<alias text="OPERSERV" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -#<alias text="BOTSERV" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> -#<alias text="HOSTSERV" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -#<alias text="MEMOSERV" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> -#<alias text="NS" replace="PRIVMSG NickServ :$2-" requires="NickServ" uline="yes"> -#<alias text="CS" replace="PRIVMSG ChanServ :$2-" requires="ChanServ" uline="yes"> -#<alias text="OS" replace="PRIVMSG OperServ :$2-" requires="OperServ" uline="yes" operonly="yes"> -#<alias text="BS" replace="PRIVMSG BotServ :$2-" requires="BotServ" uline="yes"> -#<alias text="HS" replace="PRIVMSG HostServ :$2-" requires="HostServ" uline="yes"> -#<alias text="MS" replace="PRIVMSG MemoServ :$2-" requires="MemoServ" uline="yes"> # # An example of using the format value to create an alias with two # different behaviours depending on the format of the parameters. @@ -159,8 +147,7 @@ # # This alias fixes a glitch in xchat 2.6.x and above and the way it # assumes IDENTIFY must be prefixed by a colon (:) character. It should -# be placed ABOVE the default NICKSERV alias (the first example) listed -# above. +# be placed ABOVE the default NICKSERV alias. # #<alias text="NICKSERV" format=":IDENTIFY *" replace="PRIVMSG NickServ :IDENTIFY $3-" # requires="NickServ" uline="yes"> diff --git a/docs/conf/services/anope.conf.example b/docs/conf/services/anope.conf.example new file mode 100644 index 000000000..603bb538d --- /dev/null +++ b/docs/conf/services/anope.conf.example @@ -0,0 +1,9 @@ +# This file contains aliases and nickname reservations which are used +# by Anope. See https://www.anope.org/ for more information on Anope. + +# This file inherits from the generic config to avoid repetition. +<include file="examples/services/generic.conf.example"> + +# /GLOBAL <message> +# Sends a global notice. +<alias text="GLOBAL" format="*" replace="PRIVMSG $requirement :GLOBAL $2-" requires="Global" uline="yes" operonly="yes"> diff --git a/docs/conf/services/atheme.conf.example b/docs/conf/services/atheme.conf.example new file mode 100644 index 000000000..dae1dfce2 --- /dev/null +++ b/docs/conf/services/atheme.conf.example @@ -0,0 +1,52 @@ +# This file contains aliases and nickname reservations which are used +# by Atheme. See http://atheme.net for more information on Atheme. + +# This file inherits from the generic config to avoid repetition. +<include file="examples/services/generic.conf.example"> + +# Long hand aliases for services pseudoclients. +<alias text="ALIS" replace="PRIVMSG $requirement :$2-" requires="ALIS" uline="yes"> +<alias text="CHANFIX" replace="PRIVMSG $requirement :$2-" requires="ChanFix" uline="yes"> +<alias text="GAMESERV" replace="PRIVMSG $requirement :$2-" requires="GameServ" uline="yes"> +<alias text="GLOBAL" replace="PRIVMSG $requirement :$2-" requires="Global" uline="yes" operonly="yes"> +<alias text="GROUPSERV" replace="PRIVMSG $requirement :$2-" requires="GroupServ" uline="yes"> +<alias text="HELPSERV" replace="PRIVMSG $requirement :$2-" requires="HelpServ" uline="yes"> +<alias text="INFOSERV" replace="PRIVMSG $requirement :$2-" requires="GroupServ" uline="yes"> +<alias text="PROXYSCAN" replace="PRIVMSG $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes"> +<alias text="RPGSERV" replace="PRIVMSG $requirement :$2-" requires="RPGServ" uline="yes"> + +# Short hand aliases for services pseudoclients. +<alias text="CF" replace="PRIVMSG $requirement :$2-" requires="ChanFix" uline="yes"> +<alias text="GL" replace="PRIVMSG $requirement :$2-" requires="Global" uline="yes" operonly="yes"> +<alias text="GS" replace="PRIVMSG $requirement :$2-" requires="GroupServ" uline="yes"> +<alias text="IS" replace="PRIVMSG $requirement :$2-" requires="InfoServ" uline="yes"> +<alias text="LS" replace="PRIVMSG $requirement :$2-" requires="ALIS" uline="yes"> +<alias text="PS" replace="PRIVMSG $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes"> +<alias text="RS" replace="PRIVMSG $requirement :$2-" requires="RPGServ" uline="yes"> + +# These short hand aliases conflict with other pseudoclients. You can enable +# them but you will need to comment out the uncommented ones above first, +#<alias text="GS" replace="PRIVMSG $requirement :$2-" requires="GameServ" uline="yes"> +#<alias text="HS" replace="PRIVMSG $requirement :$2-" requires="HelpServ" uline="yes"> + +# Prevent clients from using the nicknames of services pseudoclients. +<badnick nick="ALIS" reason="Reserved for a network service"> +<badnick nick="ChanFix" reason="Reserved for a network service"> +<badnick nick="GameServ" reason="Reserved for a network service"> +<badnick nick="GroupServ" reason="Reserved for a network service"> +<badnick nick="HelpServ" reason="Reserved for a network service"> +<badnick nick="InfoServ" reason="Reserved for a network service"> +<badnick nick="Proxyscan" reason="Reserved for a network service"> +<badnick nick="RPGServ" reason="Reserved for a network service"> +<badnick nick="SaslServ" reason="Reserved for a network service"> + +# Exempt services pseudoclients from filters. +<exemptfromfilter target="ALIS"> +<exemptfromfilter target="ChanFix"> +<exemptfromfilter target="GameServ"> +<exemptfromfilter target="GroupServ"> +<exemptfromfilter target="HelpServ"> +<exemptfromfilter target="InfoServ"> +<exemptfromfilter target="Proxyscan"> +<exemptfromfilter target="RPGServ"> +<exemptfromfilter target="SaslServ"> diff --git a/docs/conf/services/generic.conf.example b/docs/conf/services/generic.conf.example new file mode 100644 index 000000000..6904d31d8 --- /dev/null +++ b/docs/conf/services/generic.conf.example @@ -0,0 +1,45 @@ +# This file contains aliases and nickname reservations which are used +# by all common services implementations. + +# Long hand aliases for services pseudoclients. +<alias text="BOTSERV" replace="PRIVMSG $requirement :$2-" requires="BotServ" uline="yes"> +<alias text="CHANSERV" replace="PRIVMSG $requirement :$2-" requires="ChanServ" uline="yes"> +<alias text="HOSTSERV" replace="PRIVMSG $requirement :$2-" requires="HostServ" uline="yes"> +<alias text="MEMOSERV" replace="PRIVMSG $requirement :$2-" requires="MemoServ" uline="yes"> +<alias text="NICKSERV" replace="PRIVMSG $requirement :$2-" requires="NickServ" uline="yes"> +<alias text="OPERSERV" replace="PRIVMSG $requirement :$2-" requires="OperServ" uline="yes" operonly="yes"> +<alias text="STATSERV" replace="PRIVMSG $requirement :$2-" requires="StatServ" uline="yes"> + +# Short hand aliases for services pseudoclients. +<alias text="BS" replace="PRIVMSG $requirement :$2-" requires="BotServ" uline="yes"> +<alias text="CS" replace="PRIVMSG $requirement :$2-" requires="ChanServ" uline="yes"> +<alias text="HS" replace="PRIVMSG $requirement :$2-" requires="HostServ" uline="yes"> +<alias text="MS" replace="PRIVMSG $requirement :$2-" requires="MemoServ" uline="yes"> +<alias text="NS" replace="PRIVMSG $requirement :$2-" requires="NickServ" uline="yes"> +<alias text="OS" replace="PRIVMSG $requirement :$2-" requires="OperServ" uline="yes" operonly="yes"> +<alias text="SS" replace="PRIVMSG $requirement :$2-" requires="StatServ" uline="yes"> + +# /ID [account] <password> +# Identifies to a services account. +<alias text="ID" format="*" replace="PRIVMSG $requirement :IDENTIFY $2-" requires="NickServ" uline="yes"> +<alias text="IDENTIFY" format="*" replace="PRIVMSG $requirement :IDENTIFY $2-" requires="NickServ" uline="yes"> + +# Prevent clients from using the nicknames of services pseudoclients. +<badnick nick="BotServ" reason="Reserved for a network service"> +<badnick nick="ChanServ" reason="Reserved for a network service"> +<badnick nick="Global" reason="Reserved for a network service"> +<badnick nick="HostServ" reason="Reserved for a network service"> +<badnick nick="MemoServ" reason="Reserved for a network service"> +<badnick nick="NickServ" reason="Reserved for a network service"> +<badnick nick="OperServ" reason="Reserved for a network service"> +<badnick nick="StatServ" reason="Reserved for a network service"> + +# Exempt services pseudoclients from filters. +<exemptfromfilter target="BotServ"> +<exemptfromfilter target="ChanServ"> +<exemptfromfilter target="Global"> +<exemptfromfilter target="HostServ"> +<exemptfromfilter target="MemoServ"> +<exemptfromfilter target="NickServ"> +<exemptfromfilter target="OperServ"> +<exemptfromfilter target="StatServ"> diff --git a/make/template/main.mk b/make/template/main.mk index c2babe8f6..50feb8f8d 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -218,8 +218,8 @@ install: target @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(DATPATH) @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(LOGPATH) @-$(INSTALL) -d -m $(INSTMODE_DIR) $(BINPATH) - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/aliases @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/modules + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/services @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MANPATH) @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH) [ "$(BUILDPATH)/bin/" -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH) @@ -238,9 +238,9 @@ install: target -$(INSTALL) -m $(INSTMODE_LIB) @CONFIGURE_DIRECTORY@/inspircd-genssl.1 $(MANPATH) 2>/dev/null -$(INSTALL) -m $(INSTMODE_BIN) tools/genssl $(BINPATH)/inspircd-genssl 2>/dev/null -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples - -$(INSTALL) -m $(INSTMODE_LIB) *.pem $(CONPATH) 2>/dev/null - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example $(CONPATH)/examples/aliases -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example $(CONPATH)/examples/modules + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/services/*.example $(CONPATH)/examples/services + -$(INSTALL) -m $(INSTMODE_LIB) *.pem $(CONPATH) 2>/dev/null @echo "" @echo "*************************************" @echo "* INSTALL COMPLETE! *" diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 9184b10af..c6e53f0cf 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -271,7 +271,7 @@ class ModuleAlias : public Module if (crlf == std::string::npos) { - DoCommand(a->ReplaceFormat, user, c, safe); + DoCommand(a->ReplaceFormat, user, c, safe, a); return 1; } else @@ -280,13 +280,13 @@ class ModuleAlias : public Module std::string scommand; while (commands.GetToken(scommand)) { - DoCommand(scommand, user, c, safe); + DoCommand(scommand, user, c, safe, a); } return 1; } } - void DoCommand(const std::string& newline, User* user, Channel *chan, const std::string &original_line) + void DoCommand(const std::string& newline, User* user, Channel *chan, const std::string &original_line, Alias* a) { std::string result; result.reserve(newline.length()); @@ -328,6 +328,11 @@ class ModuleAlias : public Module result.append(user->dhost); i += 5; } + else if (!newline.compare(i, 12, "$requirement", 12)) + { + result.append(a->RequiredNick); + i += 11; + } else result.push_back(c); } |