From 00cd97160ae8909ca12b8807a8114cad1f6a06b1 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 27 Aug 2013 18:30:59 +0200 Subject: Update example configs, README.md and more - Fix typos, remove misleading information, rephrase a few sentences - Add info about hmac- hash types - Remove (the code which used this was removed in 96e4434 - @SaberUK) - Change inspircd.github.org to inspircd.org --- docs/conf/modules.conf.example | 98 +++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 54 deletions(-) (limited to 'docs/conf/modules.conf.example') diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 7a6c478f1..71cc9e8c6 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -210,7 +210,7 @@ # Allow opers (channels/auspex) to see see all joins/parts/kicks in the channel # # Exemptchanops can be used to adjust the level at which users become visible or -# the level at which they can see the full membe list of the channel. +# the level at which they can see the full member list of the channel. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Autoop module: Adds basic channel access controls via the +w listmode. @@ -265,7 +265,7 @@ # capsmap="ABCDEFGHIJKLMNOPQRSTUVWXYZ! "> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Block color module: Blocking color-coded messages with cmode +c +# Block color module: Blocking color-coded messages with chan mode +c # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -274,7 +274,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # CallerID module: Adds usermode +g which activates hybrid-style -# callerid (== block all private messages unless you /accept first) +# callerid: block all private messages unless you /accept first # # #-#-#-#-#-#-#-#-#-#-#- CALLERID CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# @@ -398,7 +398,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Channel Names module: Allows disabling channels which have certain -# characters in the channel name such as bold, colorcodes, etc which +# characters in the channel name such as bold, colorcodes, etc. which # can be quite annoying and allow users to on occasion have a channel # that looks like the name of another channel on the network. # @@ -530,8 +530,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Clones module: Adds an oper command /CLONES for detecting cloned -# users. Warning: This module may be resource intensive when its -# command is issued, use with care. +# users. Warning: This command may be resource intensive when it is +# issued, use with care. # This module is oper-only. # To use, CLONES must be in one of your oper class blocks. # @@ -580,7 +580,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Channel cycle module. Server side /hop, with +ilk etc bypass. +# Channel cycle module. Server side /hop, with +ilk etc. bypass. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -619,8 +619,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Custom prefixes: allows for channel prefixes to be added. -# This can replace m_chanprotect and m_halfop, except for services that -# recognise those modules by name +# This replaces m_chanprotect and m_halfop. # # # name The name of the mode, must be unique from other modes @@ -631,9 +630,11 @@ # ranktoset The numeric rank required to set/unset this mode. Defaults to rank. # depriv Can you remove the mode from yourself? Defaults to yes. # -# +# # # +# +# Do /reloadmodule m_customprefix.so after changing the settings of this module. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Custom title module: Adds the /TITLE command which allows for trusted @@ -722,7 +723,7 @@ # Glob masks are accepted here also. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Devoice Module: Let users devoice themselves. +# Devoice Module: Let users devoice themselves using /devoice #chan. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -829,7 +830,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# HIDECHANS module: Allows opers to hide their channels list from non- +# HIDECHANS module: Allows users to hide their channels list from non- # opers by setting user mode +I on themselves. # # @@ -937,7 +938,7 @@ # # The following block can be used to control which extensions are # enabled. -# +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Join flood module: Adds support for join flood protection (+j) @@ -1073,7 +1074,7 @@ # are specified in a tag that the oper is part of. This is so # # you can control who has access to this possible dangerous command. # # If your server is locked and you get disconnected, do a REHASH from # -# shell to open up again. +# shell to open up again. # # # This module is oper-only. # @@ -1082,7 +1083,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Map hiding module: replaces /MAP and /LINKS output to users with a # # message to see a website, set by maphide="http://link.to/site" in # -# the security tag, instead. # +# the tag, instead. # # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1175,10 +1176,10 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# No nicks module: Adds the +N channel mode, as well as the +b N: -# extended bantype. +N stops all users from changing their nick, -# the +b N: extban stops anyone from matching a +b N:nick!user@host -# mask from changing their nick. +# No nicks module: Adds the +N channel mode, as well as the N extban. +# +N stops all users from changing their nick, the N extban stops +# anyone from matching a +b N:nick!user@host mask from changing their +# nick. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1192,7 +1193,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Network buisness join module +# Network business join module # Allows an oper to join a channel using /OJOIN, giving them +Y on the # channel which makes them immune to kick/deop/etc. # @@ -1224,7 +1225,7 @@ # If you are using the m_operjoin.so module, specify options here: # # # # channel - The channel name to join, can also be a comma # -# seperated list eg. "#channel1,#channel2". # +# separated list eg. "#channel1,#channel2". # # # # override - Lets the oper join walking thru any modes that # # might be set, even bans. Use "yes" or "no". # @@ -1256,7 +1257,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Oper MOTD module: Provides support for seperate message of the day +# Oper MOTD module: Provides support for separate message of the day # on oper-up # This module is oper-only. # @@ -1288,7 +1289,7 @@ # Oper levels module: Gives each oper a level and prevents # actions being taken against higher level opers # Specify the level as the 'level' parameter of the tag -# # This module is oper-only. +# This module is oper-only. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1315,7 +1316,7 @@ # You can also use $user for the user ident string. forwardmsg="NOTICE $nick :*** Forwarding PASS to $nickrequired" - # cmd: Command for the nick to run when it recieves a connect + # cmd: Command for the nick to run when it receives a connect # password. cmd="PRIVMSG $nickrequired :IDENTIFY $pass"> @@ -1395,7 +1396,7 @@ # Optional - If you specify to use the m_randquote.so module, then # # specify below the path to the randquotes.conf file. # # # -# +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Redirect module: Adds channel redirection (mode +L) # @@ -1427,8 +1428,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Regular Expression Provider for POSIX Regular Expressions. # You shouldn't need any additional libraries on a POSIX-compatible -# system (ie: any Linux, BSD, but not Windows). You must have at least -# 1 provider loaded to use m_filter or m_rline. +# system (i.e.: any Linux, BSD, but not Windows). You must have at +# least 1 provider loaded to use m_filter or m_rline. # On POSIX-compliant systems, regex syntax can be found by using the # command: 'man 7 regex'. # @@ -1597,7 +1598,7 @@ # and is similar in operation to the way asuka and ircu handle services. # # At the same time, this offers +r for users and channels to mark them -# as identified seperately from the idea of a master account, which +# as identified separately from the idea of a master account, which # can be useful for services which are heavily nick-as-account centric. # # This replaces m_services from 1.1 and earlier. @@ -1624,8 +1625,6 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SETNAME module: Adds the /SETNAME command -# This module is oper-only. -# To use, SETNAME must be in one of your oper class blocks. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1645,7 +1644,7 @@ # it directly affects the mode object itself. # @@ -1671,20 +1670,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# GnuTLS ssl module: Adds support for client-server SSL using GnuTLS, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# GnuTLS SSL module: Adds support for SSL connections using GnuTLS, +# if enabled. You must answer 'yes' in ./configure when asked or +# manually symlink the source for this module from the directory +# src/modules/extra, if you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_gnutls # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL Info module: Allows users to retrieve information about other @@ -1702,20 +1697,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# OpenSSL ssl module: Adds support for client-server SSL using OpenSSL, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# OpenSSL SSL module: Adds support for SSL connections using OpenSSL, +# if enabled. You must answer 'yes' in ./configure when asked or symlink +# the source for this module from the directory src/modules/extra, if +# you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_openssl # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Strip color module: Adds the channel mode +S @@ -1798,7 +1789,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Test line module: Adds the /TLINE command, used to test how many -# users a /GLINE or /ZLINE etc would match. +# users a /GLINE or /ZLINE etc. would match. # This module is oper-only. # To use, TLINE must be in one of your oper class blocks. # @@ -1811,10 +1802,9 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # UHNAMES support module: Adds support for the IRCX style UHNAMES # extension, which displays ident and hostname in the names list for -# each user, saving clients from doing a WHO on the channel. Note that -# this module is not widely supported yet. If a client does not support -# UHNAMES it will not enable it, this will not break incompatible -# clients. +# each user, saving clients from doing a WHO on the channel. +# If a client does not support UHNAMES it will not enable it, this will +# not break incompatible clients. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1824,8 +1814,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Userip module: Adds the /USERIP command -# This module is oper-only. -# To use, USERIP must be in one of your oper class blocks. +# Allows users to query their own IP, also allows opers to query the IP +# of anyone else. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -- cgit v1.2.3 From 261d5bb566f6383efea99e73c933a2af6f408341 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 9 Jul 2013 20:21:33 +0200 Subject: m_permchannels Add the ability to save listmodes --- docs/conf/modules.conf.example | 4 ++- src/modules/m_permchannels.cpp | 74 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) (limited to 'docs/conf/modules.conf.example') diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 71cc9e8c6..54a667f34 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1357,7 +1357,9 @@ # whenever +P is set, unset, or the topic/modes on a +P channel is changed. # If you want to do this, set the filename below, and uncomment the include. # -# +# If 'listmodes' is true then all list modes (+b, +I, +e, +g...) will be +# saved. Defaults to false. +# # # # You may also create channels on startup by using the block. diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 1bcb2ac17..04171585b 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -22,9 +22,15 @@ /* $ModDesc: Provides support for channel mode +P to provide permanent channels */ +struct ListModeData +{ + std::string modes; + std::string params; +}; + // Not in a class due to circular dependancy hell. static std::string permchannelsconf; -static bool WriteDatabase() +static bool WriteDatabase(Module* mod, bool save_listmodes) { FILE *f; @@ -58,6 +64,44 @@ static bool WriteDatabase() if (!chan->IsModeSet('P')) continue; + std::string chanmodes = chan->ChanModes(true); + if (save_listmodes) + { + ListModeData lm; + + // Bans are managed by the core, so we have to process them separately + lm.modes = std::string(chan->bans.size(), 'b'); + for (BanList::const_iterator j = chan->bans.begin(); j != chan->bans.end(); ++j) + { + lm.params += j->data; + lm.params += ' '; + } + + // All other listmodes are managed by modules, so we need to ask them (call their + // OnSyncChannel() handler) to give our ProtoSendMode() a list of modes that are + // set on the channel. The ListModeData struct is passed as an opaque pointer + // that will be passed back to us by the module handling the mode. + FOREACH_MOD(I_OnSyncChannel, OnSyncChannel(chan, mod, &lm)); + + if (!lm.modes.empty()) + { + // Remove the last space + lm.params.erase(lm.params.end()-1); + + // If there is at least a space in chanmodes (that is, a non-listmode has a parameter) + // insert the listmode mode letters before the space. Otherwise just append them. + std::string::size_type p = chanmodes.find(' '); + if (p == std::string::npos) + chanmodes += lm.modes; + else + chanmodes.insert(p, lm.modes); + + // Append the listmode parameters (the masks themselves) + chanmodes += ' '; + chanmodes += lm.params; + } + } + std::string chants = ConvToStr(chan->age); std::string topicts = ConvToStr(chan->topicset); const char* items[] = @@ -73,7 +117,7 @@ static bool WriteDatabase() " topicsetby=", chan->setby.c_str(), " modes=", - chan->ChanModes(true), + chanmodes.c_str(), ">\n" }; @@ -170,6 +214,7 @@ class ModulePermanentChannels : public Module { PermChannel p; bool dirty; + bool save_listmodes; public: ModulePermanentChannels() : p(this), dirty(false) @@ -213,7 +258,9 @@ public: virtual void OnRehash(User *user) { - permchannelsconf = ServerInstance->Config->ConfValue("permchanneldb")->getString("filename"); + ConfigTag* tag = ServerInstance->Config->ConfValue("permchanneldb"); + permchannelsconf = tag->getString("filename"); + save_listmodes = tag->getBool("listmodes"); } void LoadDatabase() @@ -296,7 +343,7 @@ public: void OnBackgroundTimer(time_t) { if (dirty) - WriteDatabase(); + WriteDatabase(this, save_listmodes); dirty = false; } @@ -332,6 +379,25 @@ public: } } + void ProtoSendMode(void* opaque, TargetTypeFlags type, void* target, const std::vector& modes, const std::vector& translate) + { + // We never pass an empty modelist but better be sure + if (modes.empty()) + return; + + ListModeData* lm = static_cast(opaque); + + // Append the mode letters without the trailing '+' (for example "IIII", "gg") + lm->modes.append(modes[0].begin()+1, modes[0].end()); + + // Append the parameters + for (std::vector::const_iterator i = modes.begin()+1; i != modes.end(); ++i) + { + lm->params += *i; + lm->params += ' '; + } + } + virtual Version GetVersion() { return Version("Provides support for channel mode +P to provide permanent channels",VF_VENDOR); -- cgit v1.2.3