1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 12:23:13 +02:00

Compare commits

...

949 Commits

Author SHA1 Message Date
Adam a762391446 Anope 2.0.2 Release 2015-03-22 15:34:50 -04:00
Adam c070a00114 Fix m_ldap_oper to build 2015-03-22 15:34:49 -04:00
Adam e7c3090a70 Fix new version stuff with empty version extra 2015-03-22 14:38:29 -04:00
Adam 5dd6326eff Merge pull request #115 from aFreshMelon/aFreshMelon-patch-1
XML-RPC responses also don't have a methodName tag
2015-03-22 13:56:07 -04:00
Adam 535ad6fd70 Merge pull request #112 from attilamolnar/2.0+inspircdmlock
InspIRCd 2.0: Ensure ircd-side mlock and topic lock state is always what we think it should be
2015-03-22 13:56:01 -04:00
Robby- 5df4ac9a98 Make the signed kick/ban message format configurable. 2015-03-22 13:44:08 -04:00
Adam 4c54a3939f Change git version name back to what it was, which the core uses 2015-03-22 10:26:53 -04:00
Adam 3d09748d1c Fix typo in Changes 2015-03-22 10:26:26 -04:00
Sebastian Barfurth 36a4be7623 XML-RPC responses also don't have a methodName tag
Following http://xmlrpc.scripting.com/spec.html
2015-03-18 19:06:08 +01:00
Adam 5fc72660e4 Merge pull request #113 from attilamolnar/2.0+openssl
m_ssl_openssl: SSL context option changes
2015-03-12 17:53:52 -04:00
Adam 303e652a35 Only apply keepmodes on channel sync
Not sure why this was this way originally, it interfears with the
chanserv +r check to determine how new the channel is because it
restores +r. This seems to still work okay, though.
2015-03-12 17:52:38 -04:00
Adam e5447a8024 Update Changes.conf and Changes 2015-03-12 17:52:38 -04:00
Attila Molnar 1bee18fcf4 m_ssl_openssl: Allow disabling SSLv3 via the config 2015-03-12 19:35:07 +01:00
Attila Molnar a57e41304f m_ssl_openssl: Set sane default context options 2015-03-12 19:35:07 +01:00
Adam e0e8147ee0 Merge pull request #114 from anope/revert-99-extemp_protected
Revert "Added kickcheck override for users with protected privs"
2015-03-12 13:30:12 -04:00
Adam 41a24afa4f Revert "Added kickcheck override for users with protected privs" 2015-03-12 13:29:50 -04:00
Adam 4266d17e8c Update cmake version parsing code to deal with recent build version changes
Update Config.cs to no longer hardcode VS generators, it seems no longer necessary.
Fix new version system, cannot return C++ types from extern C functions
2015-03-12 11:20:18 -04:00
Adam 8d3fa47ab2 Merge pull request #99 from H7-25/extemp_protected
Added kickcheck override for users with protected privs
2015-03-12 08:15:59 -04:00
Adam 64781817ac Merge pull request #105 from miwob/master+use-uid-for-svsnick
- Change SendForceNickChange() to use UIDs
2015-03-12 08:15:49 -04:00
Adam 69c18f131f Merge pull request #106 from miwob/master+SendClientIntroduction
- Update SendClientIntroduction() to use * for account names instead of ...
2015-03-12 08:15:44 -04:00
Adam e030771cbc Merge pull request #107 from miwob/master+misc-hybrid-changes
- Misc updates to the hybrid protocol modules:
2015-03-12 08:15:38 -04:00
Adam 03f05d3948 Merge pull request #111 from aFreshMelon/fix-xmlrpc-response
Correct wrong XML response tag
2015-03-12 08:15:31 -04:00
Adam 32c4908c8c Document that m_ldap_authentication:disable_register_reason blocks grouping 2015-03-12 08:01:27 -04:00
Adam c5ff7c6868 Show passlen in PASSWORD_TOO_LONG 2015-03-12 08:00:12 -04:00
Attila Molnar 89257d9bce InspIRCd 2.0: Re-set server-side topiclock when an incoming METADATA topiclock from a bursting server changes it 2015-03-11 23:46:00 +01:00
Attila Molnar e47aacad0e InspIRCd 2.0: Re-set server-side mlock when an incoming METADATA mlock from a bursting server changes it 2015-03-11 23:46:00 +01:00
Attila Molnar 72ade225a7 InspIRCd 2.0: Pass use_server_side_topiclock and use_server_side_mlock references to METADATA handler 2015-03-11 23:46:00 +01:00
Attila Molnar a52af0d260 InspIRCd 2.0: Add METADATA handler, pass everything to inspircd12/metadata 2015-03-11 23:46:00 +01:00
Adam 92920f5a1c Only matches sqlines against channels if they begin with a # 2015-03-11 14:49:03 -04:00
Peter Tseng bf727285bc SendConfirmMail: Replace %E with new email
The old mailer message said the user is changing email "to %e", which is
changing TO the OLD email. But instead, the user is actually changing
the email to the new email.

We could change %e to be the new email, but maybe some users of Anope
have already configured their messages to assume %e is the old email. So
instead, add a new %E that is replaced with the new email.
2015-03-11 14:44:38 -04:00
Adam 310e95a92e Allow cs clone to clone levels too 2015-03-11 14:36:56 -04:00
Adam 78bff86dab Make cs_clone behave closer to how the help describes it 2015-03-11 14:24:42 -04:00
Adam 3f093d708f Normalize masks given to cs_kick, use entry to match them against users 2015-03-11 12:13:08 -04:00
Adam c3cc5804c3 Normalize masks given to cs_ban, use entry to match them against users 2015-03-11 11:26:12 -04:00
Adam dc58239c8a Remove cloak prior to applying vhost in insp20 fhost handler 2015-03-11 10:48:25 -04:00
Adam b67963353f Hide set desc because set description exists 2015-03-11 09:30:02 -04:00
Adam a899c04ec2 Strip color codes when looking up fantasy commands. 2015-03-11 09:16:32 -04:00
Adam fb17bc85ea Redesign m_ldap to no longer rely on undefined behavior
Accessing the same LDAP* from multiple threads at once is always
undefined, even if one thread is just polling ldap_result.

Instead keep one thread per connection and issue blocking queries on the
thread.
2015-03-11 08:48:08 -04:00
Sebastian Barfurth 474cd7a99b Correct wrong XML response tag 2015-03-07 19:05:41 +01:00
Adam 7de4b86b7f Move GIT_VERSION define to build.h, otherwise version.h is bumped per commit which forces a rebuild 2015-02-23 20:43:22 -05:00
miwob 76337bc04a - Misc updates to the hybrid protocol modules:
- best supported version is 8.2.x
  - fixed UID message handler to cope with account names being '*'
  - minium required TS version is TS6 now
2015-02-15 21:47:55 +01:00
miwob abe232601b - Update SendClientIntroduction() to use * for account names instead of 0 2015-02-15 21:33:22 +01:00
miwob 6ada3ec871 - Change SendForceNickChange() to use UIDs 2015-02-15 21:27:01 +01:00
H7-25 61a8dd57f7 Added kickcheck override for users with protected privs 2015-02-11 08:11:25 +01:00
Adam 94427b234c Merge pull request #102 from miwob/master+protocol-missing-modes
- Added some missing user modes to the ircd-hybrid protocol module
2015-02-10 19:18:46 -05:00
Adam fb3c819bee Merge pull request #103 from miwob/master+hybrid-misc-changes
Misc changes to the ircd-hybrid protocol module:
2015-02-10 19:18:40 -05:00
Adam f0c23e80a2 Merge pull request #104 from miwob/master+anope.de_DE.po-minor-update
- Minor update to anope.de_DE.po; removed double space + proper translat...
2015-02-10 19:18:30 -05:00
miwob 1e86c46000 - Minor update to anope.de_DE.po; removed double space + proper translation 2015-02-10 22:48:22 +01:00
miwob 2f49065500 Misc changes to the ircd-hybrid protocol module:
- Increase MaxModes to 6
  - SendLogout(): send "+d *" instead of "+d 0"
  - Update copyright year
  - Removed user mode +z from supported modes
2015-02-08 12:29:16 +01:00
miwob 41ae2dbefb - Added some missing user modes to the ircd-hybrid protocol module 2015-02-07 19:08:55 +01:00
Adam f44280a9c9 Merge pull request #101 from miwob/master+hybrid-protocol-no-globops-override
- Removed SendGlobopsInternal() override as it's basically a duplicate o...
2015-02-06 17:21:33 -05:00
Adam d147db9023 Merge pull request #100 from miwob/master+hybrid-protocol-cmode-ctcp
- Update ircd-hybrid protocol module to support channel mode 'C' (no CTC...
2015-02-06 17:21:30 -05:00
miwob f484a68dee - Removed SendGlobopsInternal() override as it's basically a duplicate of SendGlobopsInternal() in protocol.c 2015-02-06 20:28:30 +01:00
miwob 8550e22167 - Update ircd-hybrid protocol module to support channel mode 'C' (no CTCPs) 2015-02-06 19:39:31 +01:00
Adam 9834518b28 Fix os_mode to handle channels going away due to mode changes, and maybe cs_mode 2015-02-05 20:16:43 -05:00
Adam 64ca357b13 Make module version system work 2015-02-03 19:38:23 -05:00
Adam dc5039e994 Properly unescape xmlrpc 2015-02-03 18:42:35 -05:00
Adam 845ca576b4 More properly track topic change sources and allow users with access to change topics through topiclock 2015-01-28 22:57:15 -05:00
Adam 2264a206d2 Check virtual mode bases better 2015-01-26 15:10:18 -05:00
Adam d324e91520 Fix negatively locking param modes in default mlock 2015-01-26 13:16:25 -05:00
Adam 9ac1b4ba01 Merge pull request #98 from flotwig/patch-1
cs_entrymsg to use SET permission, not isFounder
2015-01-11 19:38:35 -05:00
Zach Bloomquist 7e0cb6d8ef cs_entrymsg to use SET permission, not isFounder
Correcting syntax error

(i don't actually know c++)
2015-01-11 19:29:33 -05:00
Adam 3055b7272b Fix m_xmlrpc server configuration option 2015-01-10 15:37:49 -05:00
Adam 969cd5dd6c Always use source name when logging server kicks 2015-01-10 15:29:19 -05:00
Adam 1f02278a1c Log user away messages 2015-01-10 15:24:48 -05:00
Adam 32007f81cf Add networkinfo:nick_chars option to allow configuring additional characters allowed in nicknames 2015-01-10 15:19:40 -05:00
Adam 609f87d39f Include botserv/* in default Services Administrator opertype to behave like 1.8 2015-01-10 15:19:40 -05:00
Adam e88925e587 Merge pull request #94 from webczat/2.0
Fix issue 1627.
2014-12-28 20:30:36 -05:00
Adam c46ec39e50 Only disable CMP0026 if it exists 2014-12-28 20:01:11 -05:00
Adam 9b2202dfee Merge pull request #93 from alexbarton/ngircd-fix-servertoken
ngIRCd protocol module: fix servertoken
2014-12-28 18:12:38 -05:00
Adam 03f6e26550 Merge pull request #95 from webczat/2.0x
fix chanserv.cpp using Get for bool extensible items
2014-12-28 18:11:37 -05:00
Adam c554e85063 Merge pull request #96 from webczat/termfork
Anope will now fork even when not started from a tty, like init scripts.
2014-12-28 18:10:40 -05:00
Adam 2892c9580f Replace spaces in opertypes with underscores in stats o 2014-12-28 18:09:37 -05:00
Adam 3c0994a89e Fix crash when non-users register channels 2014-12-28 18:08:58 -05:00
Adam e800afcfac Fix adding regmoderated mode twice in plexus 2014-12-28 18:08:39 -05:00
Adam 2ad697898f Disable CMP0026 warnings on cmake 3 2014-12-19 18:55:50 -05:00
Michał Zegan e4068249dd Anope will now fork even when not started from a tty, like init scrpits.
It is useful for init systems or startup scripts, because it allows easily waiting until services connect to the uplink, without them forking it wouldn't be possible to tell if they finished initialization or not unless they would communicate directly with init systems like systemd.
2014-12-12 19:53:30 +01:00
Michał Zegan d45cb5451e Fix issue 1627.
It required that the FHost message was rewritten for the insp20 protocol module instead of relying on inspircd12's version.
The insp20 version internally removes +x mode on host change.
2014-12-12 03:56:38 +01:00
Michał Zegan d9c9f2a407 Changed calls to Get() for bool extensible items to HasExt in the chanserv module, remove duplication of code. 2014-12-12 03:48:00 +01:00
Adam 7213413f8b Remove os exception move 2014-12-11 19:33:06 -05:00
Adam 516211c88a Add SAVE support to inspircd20 2014-12-07 19:32:21 -05:00
Robby- d576137f28 Update the dutch language file. 2014-12-07 17:42:00 +01:00
Adam e1f5e030bc Change webpanel access add to just add via the commands, split Command::Run into two so I can do this as I need to run named commands for it 2014-12-05 20:24:27 -05:00
Adam afffeb0a1d Update Kill() calls to pass source pointer instead of name 2014-12-05 17:27:08 -05:00
Adam 4fc71bb22f Link m_ldap against ldap_r not ldap 2014-12-02 15:49:14 -05:00
Alexander Barton d4732faf41 Correctly assign nicks to their respective host servers
Use the "server token" parameter of NICK commands to find the host server and
correctly assign the nick name to this server.

This allows Anope to correctly free all nick names again when (remote) servers
leave the network, which fixes arbitrary "KILL attacks" when such nick names
reconnect later on.

Initial debugging and patch by DukePyrolator, thanks a lot!
2014-11-30 21:50:11 +01:00
Alexander Barton 95684187b6 Fix server token assignment of servers in the network
1. the directly linked server, our upstream, always has token "1", and
2. for remote servers in the network, the token and description filds
   were interchanged during registration,

therefore up to now no server could be found by Server::Find() using its
assigned server token.
2014-11-30 21:49:34 +01:00
Adam 4f33b17f96 Move automatically identified for log message to users 2014-11-25 09:00:15 -05:00
Adam 0cdab86978 Set require_oper in /os oper 2014-11-24 22:10:12 -05:00
Adam 4f76bee273 Fix sid generator generating invalid sids after sid 999 2014-11-24 22:00:30 -05:00
Adam 8557a4161a Allow 0 ttb in flood kicker 2014-11-15 08:50:37 -05:00
Adam c9008cdafa Fix access dup check to account for accounts 2014-11-15 02:13:10 -05:00
Adam 8a7793da0c Fix bahamut mode handler 2014-11-08 04:31:56 -05:00
Adam 64b332730e Fix not removing zones from server->zones 2014-11-08 04:30:27 -05:00
Adam 36837330ae Fix typo in botserv.example.conf 2014-11-06 05:40:51 -05:00
Adam 8b64e46ef1 Show access denied if /os kick can't kick the target 2014-11-04 23:54:16 -05:00
Adam c4460784c2 Allow mlock to be enforced when unsetting defcon modes 2014-11-04 01:36:27 -05:00
Adam 408ec02406 Move chan register event prior to applying final mode changes, so cs_mode can set mlock on register. #1620 2014-11-04 00:09:00 -05:00
Adam 67fc8c3416 enc_bcrypt is no longer extra because it doesn't depend on external dependencies anymore 2014-11-03 23:50:40 -05:00
Adam fb2fd9e9d3 Fix log message when enabling botserv kickers 2014-11-03 23:45:22 -05:00
Adam 527e04275f Merge pull request #91 from Alef-Burzmali/2.0+fix-addakiller
Keep the akiller's name when updating the reason.
2014-11-03 23:43:50 -05:00
Adam c895bd2e59 Merge pull request #92 from Alef-Burzmali/2.0+update-fr
Update the French translation
2014-11-03 23:37:08 -05:00
Thomas Fargeix 94b2d1ac12 Update French language file. 2014-10-29 00:08:21 +01:00
Thomas Fargeix a76e074f6d Update the French install instructions. 2014-10-28 22:59:26 +01:00
Thomas Fargeix 2f004c2aab Keep the akiller's name when updating the reason.
The name of the oper issuing an akill or a sxline could be removed by updating the reason,
even though addkiller was enabled.
2014-10-24 23:49:02 +02:00
Adam b940077553 Validate credentials sent via sasl more 2014-10-16 21:38:46 -04:00
Adam c8ded08b43 Show extended strftime output for suspend info 2014-10-14 21:17:47 -04:00
Adam 62a01dcc87 Set access masks to the case of the nick they match, if any 2014-10-14 21:09:41 -04:00
Adam 0cd3bfa24f Fix module event prioritization which was broken with the newer
auto-attach event stuff.

Also remove logically dead code from os_defcon, and make os_defcon akill
similar masks to os_session when enforcing session akills.

Fixes #1618 which relies on os_session to be prioritized before
os_defcon.
2014-10-14 18:58:55 -04:00
Adam e46bcff324 Move nick register event to make it easier for modules to determine if a newly registered nick is confirmed or not. Add confirm event. 2014-10-12 19:25:39 -04:00
Adam 67719e8db1 Add exempts and optionally allow authenticated users past m_dnsbl 2014-10-12 15:03:51 -04:00
Adam 48be41cf7b Squit uplink when I receive an squit for myself 2014-10-12 14:34:15 -04:00
Adam 5ceee5df38 Hide dumb user notice if we are quitting 2014-10-12 14:32:17 -04:00
Thomas Fargeix 1c12976958 Add an operserv/oper/modify privilege.
The operserv/oper command privilege allows to add operators
with fewer or the same privileges as ourself.
This new privilege allows to have operators who can use operserv/oper
to see the list of operators and their privileges, but cannot add new
operators.
2014-10-12 10:54:11 -04:00
Thomas Fargeix 96583892c6 Add a chanserv/access/list privilege
Replace the existing chanserv/access/list command access,
only used in cs_xop, by a privilege with the same name.

It which allows read-only access to cs_access, cs_flags, cs_xop
and cs_akick, while the already-existing chanserv/access/modify
privilege allows to modify them.
2014-10-12 10:52:48 -04:00
Robby- 0991d4e199 operserv.example.conf: Add missing permission definition to os_defcon's command. Fixes bug #1617. 2014-10-09 23:35:38 +02:00
Adam 58233fb8bc Log when memos are sent 2014-10-06 14:06:36 -04:00
Adam be928b5bbc Clean up collide timers on identify, otherwise you can login and logout before the timer tick which will still enforce the collide 2014-10-06 14:06:36 -04:00
Adam 31bc1d6b82 Don't add duplicate akills in os_session 2014-10-06 14:06:36 -04:00
Adam 829ef1b7bd Clear pending collided state on release, fixes colliding users using recover into enforcers 2014-10-06 14:06:36 -04:00
Adam b068874f40 Add a confirmation reply to ns recover on an unidentified user with svsnick 2014-10-06 14:06:36 -04:00
Adam 18b3c572f4 ngircd doesn't allow sourceless messages 2014-10-06 14:06:36 -04:00
Adam af034928cb Remove auto cmake downloader Config stuff, which randomally doesn't work on some systems for no reason 2014-10-06 14:06:36 -04:00
Adam 8d40a750cc Update INSTALL to reflect cmake requirement 2014-10-06 14:06:36 -04:00
DukePyrolator 6a3f7c01b1 changed the engine of the chanstats table from InnoDB back to MyISAM to avoid increasing the auto_increment counter on each INSERT IGNORE. For existing tables please manually run 'ALTER TABLE anope_chanstats ENGINE=MyISAM'. 2014-09-14 11:36:05 +02:00
DukePyrolator 4c2bf72cb6 fixed typo in the last commit 2014-09-14 11:12:54 +02:00
DukePyrolator 8e7b742ec7 added missing support for operonly and silentoperonly in os_defcon 2014-09-14 11:11:22 +02:00
DukePyrolator 19b47c7bae fixed a possible crashbug in the german language file 2014-09-13 13:06:56 +02:00
Adam 3bdc81348a Fix unserializing badwords to not add dupes when unserializing an existing bw object 2014-09-01 13:11:21 -04:00
Adam bf8f62c32d Change Channel::GetModeList to return a copy of the mode list, not a
pair of lower/upper bound iterators.

Sometimes when iterating the list, like in cs_mode, we can modify the
contents of it, which combined with mlock always agressively trying to
readd modes to it can do bad things.
2014-08-24 16:39:04 -04:00
Robby- d417241a5b cs_set: Fix logging for SET SUCCESSOR to correctly log overrides. 2014-08-11 20:16:42 +02:00
Adam e5cb2018e5 List opertypes in /os oper info 2014-08-03 19:15:08 -04:00
Adam df6095fed2 Make botserv fantasy override its own privilege 2014-08-03 19:10:15 -04:00
Adam 8210e82a5e Fix some botserv help entries from showing when they shouldn't 2014-08-03 19:08:12 -04:00
Adam d6d72cd803 Add cs_mode:max config option 2014-08-03 18:57:00 -04:00
Adam 063d9bf5f6 Allow "modify" in flags to be optional 2014-08-03 18:33:56 -04:00
Adam 830e8617e6 Allow "set" in topic set to be optional 2014-08-03 18:28:54 -04:00
Adam cf89e10a4c Add ms_ignore:max config option 2014-08-03 18:22:03 -04:00
Adam 6842ad36f7 Do not allow unconfirmed users to send memos or request vhosts 2014-08-03 18:05:41 -04:00
Adam 24f17de4aa Fix stats u on Windows 2014-08-03 18:03:07 -04:00
Adam bbb04d4662 Fuzzy italian signkick help 2014-08-01 16:12:41 -04:00
Robby- 20052247c3 Regenerate anope.en_US.po 2014-07-27 08:05:54 +02:00
Robby- 8b61a529a2 Update the dutch language file. 2014-07-27 07:48:50 +02:00
Robby- 1137c50095 Fix a few help messages. 2014-07-27 07:34:02 +02:00
Adam 52d422d020 Merge pull request #81 from miwob/master+invite_ts
hybrid.cpp: add our own SendInvite() which sends the channel's timestamp...
2014-07-26 13:41:47 -04:00
Adam 43c460e593 Merge pull request #85 from attilamolnar/2.0+help
Correct the help text of options:useprivmsg ("defmsg" -> "msg")
2014-07-26 13:40:58 -04:00
Adam 17ba13bc95 Use ts version of services stamp when the account is unconfirmed on Unreal as 3.2.10.4 has changed thie behavior 2014-07-26 13:28:43 -04:00
Adam 60229b15d2 When object unserialization fails (due to not having dependency objects) bump the ts to try again later. 2014-07-26 13:24:52 -04:00
Adam 3c88f3b8cf Check modetimes in CheckModes before enabling bouncy modes 2014-07-15 17:02:14 -04:00
Adam 93cb5d06db Fix channelcount with clone 2014-07-11 01:02:02 -04:00
Adam 7a64d95f7c Fix Log() calls in m_ldap_oper 2014-07-11 00:22:32 -04:00
Attila Molnar ff66e15f38 Correct the help text of options:useprivmsg ("defmsg" -> "msg") 2014-07-04 04:39:12 +02:00
Adam 07902c03fd Check that the list of items isn't NULL when destructing types 2014-06-28 23:15:59 -04:00
Adam d9949320c7 Don't try to setuid down until after we signal the parent to exit, unless we're not forking. Also don't issue the run as root warning if we're going to setuid later. 2014-06-28 23:15:59 -04:00
Robby- b0ec178e85 Merge pull request #84 from Zantox/2.0
Minor cs_unban Lang Update @Robby-
Updated HostServ Command English Language
Updated ChanServ Command English Language
Updated BotServ Command English Language
2014-06-26 22:17:51 +02:00
Zantox f753a925ad Minor cs_unban Lang Update @Robby- 2014-06-26 22:14:10 +02:00
Zantox 74dbfe0699 Updated HostServ Command English Language 2014-06-25 02:16:09 -04:00
Zantox 3bea089793 Updated ChanServ Command English Language 2014-06-25 02:09:43 -04:00
Adam ff93355af8 Hold a reference to the type in Serialize::Checker in the event it goes away, and invalidate the type pointer of objects when the type goes away 2014-06-23 15:44:06 -04:00
Zantox 8fecad3039 Updated BotServ Command English Language 2014-06-23 07:47:26 -04:00
miwob 37bd2c238e hybrid.cpp: add our own SendInvite() which sends the channel's timestamp along the INVITE command. INVITE with channel TS will be mandatory in some future release of ircd-hybrid 2014-06-19 16:27:05 +02:00
Adam 9a947fa435 Correct some language strings 2014-06-17 08:37:19 -04:00
Adam 4f7868b125 Log more when unable to backup databases in db_flatfile 2014-06-15 04:50:26 -04:00
Adam 8066378471 Fix WindowsGetLanguage() 2014-06-10 22:00:26 -04:00
Adam ab27b792b0 Track SVSKILL on unreal 2014-06-09 17:18:21 -04:00
Adam f1c3bdd55e Correct wording of log message when ldap services are created 2014-06-09 17:16:55 -04:00
Adam 08edb15bea Fix help log output example 2014-06-09 16:44:15 -04:00
Adam 56c6ef4449 Fix information leak in cs_updown 2014-06-09 16:36:49 -04:00
Adam 6526d2d8b3 Fix Windows release build with gettext 2014-06-01 13:53:32 -04:00
Adam 76ab5c2c38 Update WIN32.txt reflecting new Windows stuff 2014-05-31 23:54:50 -04:00
Adam 54e98f017c Always log when the uplink socket errors, and give possibly helpful advise 2014-05-31 21:17:46 -04:00
Adam bb7706d0f7 Anope 2.0.2-git 2014-05-31 19:09:23 -04:00
Adam 16e0b72d2d Update FindGettext.cmake for new Windows stuff and fix language.cpp
compile
2014-05-31 18:30:50 -04:00
Adam b578e32531 Anope 2.0.1 Release 2014-05-30 20:57:32 -04:00
Adam 4d8e3b847d Fix f627a3bacd, really make BotInfo::Part fire events like the normal user part message does 2014-05-30 20:57:23 -04:00
Adam eaade23f9b Update language files 2014-05-30 18:14:55 -04:00
Adam f20bac996d Fix Windows build and update library names to the newer ones.
Also fix crash on Windows when unloading a module because it threw an
exception.
2014-05-30 18:14:55 -04:00
Adam 93bfd4cbe1 Updates Changes and Changes.conf 2014-05-30 16:16:54 -04:00
Adam 6620f9e9bd Don't allow setting -y on inspircd, secureops etc will try to enforce this 2014-05-30 15:16:03 -04:00
Adam dc64cfc940 Remove version.log 2014-05-30 15:16:03 -04:00
Adam f8829783d2 Queue the grouped nicks to update when NickCore::SetDisplay is called, since they serialize the display field 2014-05-30 15:16:03 -04:00
Adam d6e600f74b Fix access check in ns_group 2014-05-30 15:16:03 -04:00
Adam 5f7113bc0e Merge pull request #80 from attilamolnar/2.0+exampleconf
Fix the name of the SSL modules in comments in modules.conf.example
2014-05-30 15:15:43 -04:00
Robby- dc4daa25a7 example.chk: Use a more reliable way to detect if services are running. 2014-05-30 18:27:15 +02:00
Robby- 0cadaedfbe Update the dutch language file. 2014-05-30 18:24:42 +02:00
Attila Molnar 11ad788dfd Fix the name of the SSL modules in comments in modules.conf.example 2014-05-30 18:12:26 +02:00
Adam 38a60d9142 Merge pull request #78 from H7-25/it_IT
Updated italian lnguage file
2014-05-28 13:48:19 -04:00
Adam e8ad509aa5 Fix dlerror() on Windows and do not abort if err is not set 2014-05-27 12:55:03 -04:00
Adam 37b3ed8ef3 Do not normalize extban masks 2014-05-27 12:55:03 -04:00
Adam a6af422184 Set timer owner for nickserv timers 2014-05-27 12:55:03 -04:00
Adam 53acb73193 Fix default db name in db_flatfifle in a couple places 2014-05-27 12:55:03 -04:00
H7-25 57f6d4f49c Updated italian language 2014-05-22 21:24:38 +02:00
Adam d0467adea2 Merge pull request #79 from Jyzee/langFR-Patch
Make command group descriptions translatable.
2014-05-22 13:21:46 -04:00
Jyzee 16924f68c0 Update french language file. 2014-05-22 19:05:25 +02:00
Jyzee d280c48e6b Regenerate french language file. 2014-05-22 19:04:26 +02:00
Jyzee f0c0daa644 Make command group descriptions translatable. 2014-05-22 19:00:56 +02:00
Adam 7a2d027e1d Fix deflanguage from 4034b3054a, this shouldn't have been removed 2014-05-21 10:47:50 -04:00
Adam f627a3bacd Core prep for p10 stuff 2014-05-21 08:50:40 -04:00
Adam 5a1257b7f0 Fix extra space in log messages with logtype channel and no source 2014-05-21 08:40:54 -04:00
Adam 866f3f32ab Speed up akill xline checks
Cache xline nick, user, host, etc instead of rebuilding it everytime its
requested. Store users ip in sockaddr form and not string form to
prevent having to rebuild sockaddrs when checking xlines.

Also do not try to convert empty config values in Config::Get as this
can be rather common if a non string configuration value is not set, and
the cost of the ConvertException is great.
2014-05-20 21:16:00 -04:00
Adam 20ce170024 Show account names in log messages 2014-05-20 12:19:26 -04:00
Adam 4034b3054a Add English language file which users can edit to modify language strings 2014-05-20 11:41:05 -04:00
Adam e581158645 Fix two compile warnings in access.cpp on newer compiles 2014-05-20 10:00:34 -04:00
Adam 01021131ca Also search channel descriptions and topics in /cs list 2014-05-20 09:52:26 -04:00
Adam 13ea98a02e Fix server usercounter not being incremented when servers are bursting 2014-05-19 22:46:28 -04:00
Adam db56a61f86 Fixup previous commit when serializing access entries 2014-05-19 22:45:45 -04:00
Adam df321a118e Fix access lists showing the wrong mask if the display nick for a group
expires but the group still exists. This can cause access entries for
nicks to not be deleted whenever the nicks are deleted.
2014-05-14 19:10:23 -04:00
Adam 1931fcf0e5 Fix webpanel mode list to only show real list modes 2014-05-13 22:59:41 -04:00
Adam 63b02b8c97 Sanitize nuh masks more to prevent the other side from rewriting them, which screws with our internal tracking of them 2014-05-13 22:57:53 -04:00
Adam 1c8a77ab9f Accept an optional reason for svspart 2014-05-13 19:52:05 -04:00
Adam 0c7d53f81e Don't show both online from's if they have the same mask in ns_info 2014-05-13 18:38:14 -04:00
Adam bcc3ae5742 Merge pull request #76 from miwob/master
Update ircd-hybrid protocol module
2014-05-13 17:50:07 -04:00
Adam 4e67e0897a Merge pull request #77 from Cronus89/patch-2
Update Paramater length for os_dns to fix DNS SET
2014-05-13 17:47:33 -04:00
Michael Wobst 76a9538441 Fix compile warning in base64.cpp:B64Encode
/home/ircd/anope/src/base64.cpp: In function ‘void Anope::B64Encode(const Anope::string&, Anope::string&)’:
/home/ircd/anope/src/base64.cpp:85: warning: ‘input’ is used uninitialized in this function
2014-05-13 18:28:53 +02:00
Cronus89 91c7862579 Update Paramater length for os_dns to fix DNS SET 2014-05-13 11:12:00 -05:00
Michael Wobst 6b6bc81999 Update ircd-hybrid protocol module 2014-05-13 18:00:10 +02:00
Adam 1f2c385bb9 Add config options to ns_suspend and cs_suspend to configure which information is shown to non opers 2014-05-01 21:03:32 -04:00
Adam d79dd0b7d7 Pass password to nick register event so modules like m_ldap_authentication can create the respective account using the decrypted password which might not always be available 2014-05-01 18:38:17 -04:00
Adam 8b2e8137f6 Merge pull request #75 from attilamolnar/2.0+inspircd-globops
InspIRCd 2.0: Recognize GLOBOPS in CAPAB CAPABILITIES
2014-05-01 18:19:23 -04:00
Adam 732466d8f4 Merge pull request #74 from attilamolnar/2.0+fix-os-stats
Fix undefined symbol error when loading os_stats, caused by 82008d50
2014-05-01 18:19:01 -04:00
Attila Molnar 3049916ade Fix undefined symbol error when loading os_stats, caused by 82008d507c 2014-04-30 01:15:10 +02:00
Attila Molnar 0afd666f22 InspIRCd 2.0: Recognize GLOBOPS in CAPAB CAPABILITIES 2014-04-29 22:55:10 +02:00
Adam 8021a53ac4 Fix misc help output to not be case sensitive 2014-04-26 18:30:54 -04:00
Adam 0663f5e412 Fire the on user quit event when bots are deleted too 2014-04-26 17:45:16 -04:00
Adam 2ee496b8ac Change the "does not expire" string in ns_group to NO_EXPIRE which is translatable 2014-04-26 17:30:58 -04:00
Adam 3abb18721b Accept non server sources for SQUIT 2014-04-26 17:21:33 -04:00
Adam 4eb0a3bdb7 Fix ModeManager::RebuildStatusModes, not all modes are in GetChannelModes() at the time this is called 2014-04-26 15:24:19 -04:00
Adam 6a03eb69eb Add "virtual mode" support
This allows fully tracking extbans and other modes set by a different
underlying mode, such as InspIRCd's namedmodes

Add two configuration options to cs_ban to configure which mode is set
and whether or not to kick banned users.

Add default "mute" fantasy command to botserv.example.conf
2014-04-25 16:51:06 -04:00
Adam 4fa2a00bd5 Close timed out proxyscan sockets better 2014-04-25 16:47:10 -04:00
Adam 82008d507c Fix Stas::Unserialize to return the instance 2014-04-25 16:46:37 -04:00
Adam 2ab4f175a8 Don't allow users to join channels they are already in 2014-04-25 16:20:23 -04:00
Adam c9473bcc67 Fix botserv/kick/bolds desc 2014-04-24 17:10:06 -04:00
Adam 75ed5a9b59 Fix os_stats counters not saving with db_sql_live. Bleh. 2014-04-24 01:50:50 -04:00
Adam f010ab7dbf Resend ircd login name on /ns set display 2014-04-24 01:40:56 -04:00
Adam 00b2cc9ce6 Require at least user@host format for akills. Fix XLine::GetHost() not returning anything if an xline only has a host 2014-04-24 01:38:45 -04:00
Adam d52cc7bcbc Bug #1587 - fix bot change not properly reintroducing clients 2014-04-24 01:25:25 -04:00
Adam 63838fa77d Merge pull request #72 from attilamolnar/2.0+svsnickfix
Fix SVSNICK target being a nick even when UIDs are available
2014-04-20 02:03:03 -04:00
Attila Molnar e36f8143e3 Fix SVSNICK target being a nick even when UIDs are available 2014-04-19 14:35:50 +02:00
Adam 72b26043b2 Remove unused event.
Mark some oper only usermodes as oper only.
Fix reading SID in TS6_SID_Retrieve
2014-04-18 02:21:06 -04:00
Adam f369157906 Use OnChanRegistered instead of OnCreateChan to set default mlocks.
Because OnCreateChan is called from ChannelInfo's constructor, during
DB loading it could cause mode locks to be unserialized without having
all channels loaded, which breaks things.
2014-04-17 16:58:04 -04:00
Adam ba46b8e4ab Merge pull request #70 from Jyzee/langFR-Patch
Update French language file.
2014-04-09 02:26:24 -04:00
Jyzee 254901aace Update French language file. 2014-04-09 07:49:14 +02:00
Adam c1c45a5db9 Do not clear all extension items tied to objects when unserializing.
Instead, pass the old object to the unserialization functions and let
them incrementally update the object.
2014-04-07 15:28:07 -04:00
Adam a65e95837f Document that memo_mail can be in nickserv defaults. These should move to memoserv.conf one day. 2014-04-06 23:13:46 -04:00
Adam 43219d3906 Do not apply module changes on rehash until after the new config has been applied. Fix renaming opertypes on reload. 2014-04-06 23:01:10 -04:00
Adam 1f8dec4c24 Fix /os mode to not require a mode when setting param modes which taken no argument when setting 2014-04-06 18:09:36 -04:00
Adam fb5c5e3442 Set minus no arg on +l in all proto mods
Set oper modes/vhost on oper too, evan after iding
Add umode +q to plexus
2014-04-02 22:37:35 -04:00
Adam e357c39774 Add travis config 2014-04-01 23:34:02 -04:00
Adam 10732baec2 Fix compile error in cs_set_misc with C++11 enabled 2014-03-31 22:41:02 -04:00
Zantox 068c6989de Small Grammar Fix 2014-03-31 20:19:03 -04:00
Adam 317d55f3f1 Fix ns_set password to read the correct parameter.
Even though 1 is past the "end" of the vector, because vectors never
shrink and due to how the command parser works, it is always less than
the capacity, and almost always contains what is in params[0] (though
this is of course implementation dependant), which is why this was not
identified sooner, as it executes cleanly under valgrind on every machine I can find.
2014-03-31 20:11:36 -04:00
Adam 1397fda786 Bump to Anope 2.0.1-git 2014-03-31 20:10:51 -04:00
Adam 4ccc478830 Anope 2.0.0 Release 2014-03-23 08:58:02 -04:00
Adam 100ecbb9be Update version.log 2014-03-23 08:57:19 -04:00
Adam cdf636e696 Regen langauge files 2014-03-23 08:57:08 -04:00
Robby- 45878bf182 SASL: Also disallow suspended nicks to login using EXTERNAL mechanism. Improve the log message for failed logins. 2014-03-22 21:14:02 +01:00
Adam f1bec3999d Do not allow SASL login to suspended nicks 2014-03-22 07:21:22 -04:00
Adam a259244297 Make bouncymodes harder to trigger by only bumping server modcount when something changes 2014-03-20 10:53:27 -04:00
Adam c1da009de3 Show a better log message when disconnecting from the uplink 2014-03-19 02:40:48 -04:00
Robby- 4f412bc213 cs_set_misc: Add missing override capability for services operators, and logging. 2014-03-19 03:05:54 +01:00
Robby- 1882916dc4 Update the dutch language file. 2014-03-17 01:15:28 +01:00
Robby- f436ce9912 m_ssl_gnutls: Fix deprecation warnings when using newer GnuTLS versions. 2014-03-17 00:58:51 +01:00
Adam ef9729fb02 Mark all channels as syncing when we connect to our uplink. They will
finish syncing later when the uplink syncs. Normally the channel state
is fully synced here anyway, except if we do not know the modes the
uplink has yet.

Also fix a related issue with resetting chanels and bouncing modes on
our clients, if this is done prior to knowing which modes exist it would
silently fail.
2014-03-14 22:13:04 -04:00
Adam 296a75f2a9 Do not allow users to add certs that other users are using. Only allow adding certfps if the user is using it. 2014-03-13 20:07:50 -04:00
Adam bce7237d9f Set LDAP_OPT_NETWORK_TIMEOUT to 0 in m_ldap to prevent the asynchronous
library cals from blocking...

Fix multiple possible null pointer derefs if modules pass null
interfaces (none currently do, but it is allowed)

Fix memory leak from results when services are destructed

Timeout queries that never come back.
2014-03-11 09:45:34 -04:00
Robby- 85834e19dc Update the dutch language file.
ns_maxemail: Bold code 2 -> 002.
2014-03-10 22:30:41 +01:00
Adam ca6b3723a9 Merge pull request #64 from ShutterQuick/2.0+hsgroupsync
2.0+hsgroupsync
2014-03-10 07:32:24 -04:00
Adam 23b1086072 Merge pull request #63 from alexbarton/ngircd-fix-KILL
ngircd protocol module: really kill users
2014-03-10 07:31:34 -04:00
Adam 860deb14ce Do not send unregistered notice to users who are logged in, even if their nick isn't registered 2014-03-10 07:26:09 -04:00
Adam 62885fa462 Set nickserv's modesonid on login too 2014-03-10 05:04:25 -04:00
Adam 3fef01e35b Fix compile error in m_sasl_dh-aes and m_sasl_dh-blowfish on unusually old g++ versions 2014-03-10 04:56:17 -04:00
Adam b0597e35ec Do not allow nickserv/ungroup to bypass ns_maxemail, and allow opers to bypass ns_maxemail 2014-03-10 04:31:08 -04:00
Adam 8d1ad6fbe5 Make nickserv/glist show the correct expire time for unconfirmed nicks 2014-03-09 22:59:16 -04:00
Adam 750569201a Add missing space to session exception expiration message 2014-03-09 22:56:25 -04:00
Adam 1a1a781b72 Remove mail:restrict as it is no longer useful. Changes nickserv/resetpass default to allow normal users to use it. 2014-03-09 10:07:13 -04:00
DukePyrolator 4b5ce8a972 irc2sql: removed the currentusers field from the chan table, keeping it updated on each join/part eats too many ressources 2014-03-09 04:55:35 +01:00
Daniel Vassdal 98cfdd26c4 ns_group: Don't require a nick param when logged in 2014-03-06 04:55:30 -08:00
Daniel Vassdal 051a42b547 hs_group: Allow automatic HS GROUP-ing on NS GROUP, and allow vhosts to be per account rather than nick. 2014-03-06 04:55:30 -08:00
Adam 220e278213 Open database files using std::ios_base::binary in db_flatfile, which Windows can require 2014-03-05 20:23:44 -05:00
Alexander Barton 547fe0da1a ngircd protocol module: really kill users
ngIRCd doesn't send a QUIT for each user KILL'ed, so kill them immediately.
2014-03-05 10:26:54 +01:00
Adam 09bec79b47 Fix 2 crashes from removing the permanent channel mode from channels which do not exist 2014-03-04 04:15:32 -05:00
Adam 55a5affcb8 Do not allow guest nicks to exceed nicklen, and use a default enforcer ident/host if none is provided 2014-03-04 04:15:32 -05:00
Robby- a8b4297023 Update the dutch language file. 2014-03-03 19:20:56 +01:00
Adam 5969362425 When unserializing channels with persist, set their ts=now. If we are supposed to lower it later we will then. 2014-03-01 22:41:45 -05:00
Adam 3ceae33b16 Convert limit and key mlocks in db_old 2014-03-01 21:56:26 -05:00
Adam 5de4c1fc97 Set +x on plexus when vhosts are activated, fix desync from /hs off 2014-03-01 21:40:47 -05:00
Adam fd109048dd Make db_old load entrymsg 2014-03-01 21:20:32 -05:00
Adam a0747516ce Export interface for cs_entrymsg 2014-03-01 21:20:18 -05:00
Adam 605e1f2a03 Make chanserv/invite show who invited you 2014-03-01 21:12:27 -05:00
Adam dc23c58869 Fix botserv help to show the correct fantasy characters 2014-03-01 21:11:58 -05:00
Adam b7e646ec83 Allow opers with chanserv/administration to use fantasy, even if they don't have the access for it 2014-03-01 20:02:17 -05:00
Adam 4d54358745 When unserializating channels and persist is set, only assign chanserv if the perm channel mode doesnt exist 2014-03-01 19:59:40 -05:00
Adam ed0882ec04 Do not enforce mlock when enforcing mlock 2014-03-01 18:39:10 -05:00
Adam 526c4e4659 Check modes after applying mlocks in db_old 2014-03-01 18:38:14 -05:00
Adam b70f72bf2b Do not allow changing the email of unconfirmed accounts 2014-03-01 04:31:52 -05:00
Adam 2ad4c1906e Fix incorrect comment in modules.example.conf 2014-03-01 04:27:45 -05:00
Adam 049760cc7e Allow svsjoin/svspart on yourself 2014-02-28 00:30:35 -05:00
Adam e2ecec31b5 Hybrid does not let us add resvs as a server, but the core expects to be able to qline bot nicks before introducing the bots as a way to prevent collisions, so try harder to find a valid bot to send resvs on startup 2014-02-27 23:21:50 -05:00
Adam fee016bb84 Handle nick collisions somewhat instead of blindly overwriting the nicks
in memory, which does weird things.

For fun different ircds implement this differently (Unreal compares
timestamps, TS6 compares timestamps and user username/host), and whether
or not we get a kill for our user also varies, so just kill everyone.

This can't really happen anyway with properly set qlines, only if
services haven't yet set the qlines, or possibly in a bot add/nick
user introduce race, or with enforcers, which not many ircds require.
2014-02-27 22:42:54 -05:00
Adam d24fb03917 Allow registration=mail forceemail=false to work, and simply give fully registered accounts to people who do not provide an email to nickserv/register 2014-02-27 04:49:28 -05:00
Adam 5adc8bfefc Do not take modes from users in channels with secureops off if we are always lowering channels timestamps to their creations 2014-02-27 04:48:48 -05:00
Adam abcf0cde5a Remove unreachable code in config.cpp, this error is caught earlier 2014-02-26 19:32:25 -05:00
Adam 8f3bd314ed Fix not detecting eols in the config reader when the end of the line is the end of a multiline comment 2014-02-26 19:26:50 -05:00
Adam e2d456d4ce Do not setuid/gid down until after modules are loaded 2014-02-26 19:24:32 -05:00
Adam 96202ae545 Log successful SASL auths 2014-02-24 22:23:12 -05:00
H7-25 2b0229d4e2 Update the italian language file 2014-02-25 03:22:55 +01:00
Adam beaa3196b3 Update Spanish translation, from Isaac Fontal <i_fontal@hotmail.com> 2014-02-24 16:14:40 -05:00
Adam b6d771a114 Anope 2.0.0-rc4 Release 2014-02-24 00:31:07 -05:00
Adam d3ed756bd0 Update version.log (why do we keep this around?) 2014-02-24 00:30:57 -05:00
Adam f8308841a6 Package dlls in src/win32 on Windows 2014-02-24 00:30:47 -05:00
Adam 1dfdf36fc3 Fix m_ssl_gnutls to send its cert. Most of this is from Attila. 2014-02-24 00:06:38 -05:00
Adam 4ac3ade126 Use a more reliable way to detect if services are running in anoperc 2014-02-23 23:08:35 -05:00
Robby- 212abeb986 webcpanel: Update copyright year.
ns_cert: Bold code 2 -> 002.
2014-02-23 23:42:43 +01:00
Robby- 7d4427c313 Regenerated language files. 2014-02-23 05:24:06 +01:00
Adam e836be489e Store a cert->account map and use it for SASL EXTERNAL and certfp auth 2014-02-22 17:46:00 -05:00
Adam 1db5c555d6 Merge pull request #58 from attilamolnar/2.0+gnutlsdep
[WIP] Make m_ssl_gnutls work with at least GnuTLS v2.8
2014-02-22 13:46:36 -05:00
Attila Molnar bb1b015103 Make m_ssl_gnutls work with at least GnuTLS v2.8 2014-02-22 16:59:10 +01:00
Robby- e42684ac39 Update italian translation, from Simos. 2014-02-22 16:40:56 +01:00
H7-25 d7de7eee60 Italian language completed translation, first release 2014-02-22 15:58:36 +01:00
Robby- 0a390ad392 Regenerated language files, and updated dutch language file. 2014-02-22 15:56:34 +01:00
Adam aa6b12c5eb Fix Windows build 2014-02-21 21:54:01 -05:00
Adam e2bd08fbff Add some missing serial updates in os_dns 2014-02-21 20:50:23 -05:00
Adam 2047934060 Regenerate Italian language file 2014-02-21 19:57:31 -05:00
Adam e07dcbff08 Update italian translation, from Simos 2014-02-21 19:57:31 -05:00
Adam e3a8a45a61 Merge pull request #56 from ShutterQuick/2.0+noxcrypt
enc_bcrypt.cpp: Get rid of the libxcrypt dependency by including code fr...
2014-02-21 19:49:29 -05:00
Lee Holmes f1ad7fd582 fix comment, activate not active 2014-02-21 20:41:41 +00:00
lethality 43f2645b32 update help info 2014-02-20 20:07:38 +00:00
Daniel Vassdal b6935e706c enc_bcrypt.cpp: Get rid of the libxcrypt dependency by including code from libxcrypt, and move enc_bcrypt out of extras 2014-02-20 11:42:20 -08:00
lethality a3c845894d Updated services crontab location 2014-02-20 17:11:11 +00:00
lethality 5933a5e9b1 Merge remote branch 'upstream/2.0' into 2.0 2014-02-18 22:24:24 +00:00
Adam 109d8f431f Do not import forbids with wildcards in their names, how 1.8 treats wildcaded forbids depends on the IRCd 2014-02-18 13:04:16 -05:00
Adam 1edb7e776b Merge pull request #54 from attilamolnar/2.0+webcpanelfix
Don't create zero length DataBlocks in BinarySocket::Write()
2014-02-18 12:59:37 -05:00
Adam 928e2e1b7c Fix loading noexpire channels in db_old 2014-02-18 12:57:31 -05:00
Adam 5a140e4898 Merge pull request #55 from attilamolnar/2.0+alphabet
Alphabetically order modules in modules.example.conf
2014-02-18 12:54:22 -05:00
Attila Molnar f64393941e Alphabetically order modules in modules.example.conf ('r' < 's' and 'w' < 'x') 2014-02-18 13:00:46 +01:00
Adam 0db81ca46a Merge pull request #52 from attilamolnar/2.0+gnutls
Add support for SSL connections powered by GnuTLS
2014-02-17 22:21:08 -05:00
Adam 7f7144de1f Merge pull request #53 from attilamolnar/2.0+reuseaddrfix
Fix setsockopt() with SO_REUSEADDR not working due to wrong argument type
2014-02-17 22:20:38 -05:00
Attila Molnar 3883716883 Turn BinarySocket::Write() into a no-op when called with l == 0 2014-02-18 03:28:02 +01:00
Attila Molnar 5beea4eb7e Fix TemplateFileServer writing empty messages resulting in zero length DataBlocks being created and later passed to SocketIO::Send()
Found while testing m_ssl_gnutls, fix suggested by @Adam-
2014-02-18 03:27:12 +01:00
Attila Molnar 2d0fdb74d1 Fix setsockopt() with SO_REUSEADDR not working due to wrong argument type 2014-02-18 02:31:01 +01:00
Adam 80588fba81 Fix os_ignore to work correctly with SQL 2014-02-17 19:43:19 -05:00
Adam ef7dc94f88 Move most of the implementation details out of os_forbid.h, fixes crashing if a module adding a forbid is unloaded without removing the forbid 2014-02-17 19:39:25 -05:00
Adam 7b4eec9748 Remove docs/IRCD, it is very outdated and no longer correct at all 2014-02-17 13:53:45 -05:00
Adam baff417652 Move encryption.h to include/modules 2014-02-17 13:53:04 -05:00
Adam 7074944810 Fix not applying ipv[46]_cidr to connecting clients in os_session, #1573 2014-02-17 13:39:49 -05:00
Attila Molnar 1c39d25cca Add m_ssl_gnutls 2014-02-17 01:12:01 +01:00
lethality f1c5c27f3f Merge branch '2.0', remote branch 'upstream/2.0' into 2.0 2014-02-16 23:49:57 +00:00
Attila Molnar 9c0134ee2c Rename m_ssl to m_ssl_openssl and update docs 2014-02-17 00:41:36 +01:00
Adam 959fee5937 Fix Windows build 2014-02-16 18:28:39 -05:00
Adam 3854a5570f Merge pull request #51 from ShutterQuick/2.0+oldforbid
db_old.cpp: Correctly import forbidden nicks and chans
2014-02-16 16:07:36 -05:00
Daniel Vassdal ab1e0ebfb3 db_old.cpp: Correctly import forbidden nicks and chans 2014-02-16 12:56:27 -08:00
Adam cffe864900 Merge pull request #50 from ShutterQuick/bcrypt
Add enc_bcrypt
2014-02-16 14:10:25 -05:00
Daniel Vassdal bc1575318b modules.example.conf: Update examples for bcrypt - also clearify that m_sasl_dh* requires openssl 2014-02-16 11:07:37 -08:00
Daniel Vassdal a71d0f6757 enc_bcrypt: Add module 2014-02-16 11:07:36 -08:00
Adam 50d7bf710e Merge pull request #48 from ShutterQuick/2.0+nnghsasl
Add SASL mechanisms DH-AES and DH-BLOWFISH
2014-02-14 19:15:43 -05:00
Daniel Vassdal d44bcef31b modules.example.conf: Add info about m_sasl_dh-aes and m_sasl_dh-blowfish 2014-02-14 16:06:24 -08:00
Daniel Vassdal c0ce71e55a m_sasl_dh-blowfish: Add module 2014-02-14 15:12:25 -08:00
Daniel Vassdal 0eeb0caf08 m_sasl_dh-aes: Add module 2014-02-14 15:12:25 -08:00
Daniel Vassdal b13bded620 sasl.h, m_sasl.cpp: Move IdentifyRequest to the header 2014-02-14 15:03:42 -08:00
Daniel Vassdal 1b1180fda6 base64.cpp: B64Decode(): Don't crash on "=" 2014-02-14 13:42:21 -08:00
Daniel Vassdal a4ecfa5bc0 Anope::string: Add .data() 2014-02-14 13:05:01 -08:00
Daniel Vassdal 3c8009b495 sasl.h, m_sasl.cpp: Add RemoveSession(), DeleteSessions(), and have active sessions closed when a Mechanism is unloaded 2014-02-14 13:05:01 -08:00
Adam ca85df2d74 Don't convert XOP access entries to levels in db_old 2014-02-14 11:10:20 -05:00
Adam 5dfa6598c2 Do not sync channels in Channel::Reset if they are in the middle of syncing, and checkmodes in Channel::Sync. Fixes channel modes sometimes not being set if always_lower_ts is on 2014-02-14 11:09:53 -05:00
Adam f428d61045 Use better command access checking in webpanel for operserv/akill 2014-02-13 19:42:02 -05:00
Adam fc50edf046 Disable m_sasl by default 2014-02-12 14:49:22 -05:00
Adam 269c2786e9 Add SASL EXTERNAL support. Thanks to ShutterQuick for fixing and testing. 2014-02-12 14:39:41 -05:00
Adam 96fc940af7 Only trim newlines and carriage returns in BufferedSocket::GetLine 2014-02-11 19:25:44 -05:00
Adam 8c8e6d464a Make initial registration notices with mail less repetitive 2014-02-11 18:08:09 -05:00
Adam 22976b8a7c Fix flags +* or -* sometimes incorrectly reporting opers as overriding when they are not 2014-02-11 17:33:28 -05:00
Robby- 4dff710361 ns_suspend: Show the setter of the suspension and the reason when manually unsuspending. 2014-02-11 03:57:15 +01:00
Robby- fe80d2cded os_modinfo: Add ability to list only extra modules. 2014-02-11 02:26:00 +01:00
Adam 16dac87841 Regenerate anope.it_IT.po 2014-02-10 10:03:38 -05:00
H7-25 30c59562e0 Update Italian language translation 2014-02-10 09:57:24 -05:00
Adam 6d61a84286 Add an opertype priv "protected" to not allow services to kick a user.
Also classify ulines as protected
2014-02-09 18:51:52 -05:00
Adam f6b8596c7b Log memoserv/sendall 2014-02-09 10:59:36 -05:00
Adam da6760f606 Properly convert suspended nicks and channels in db_old 2014-02-07 13:28:07 -05:00
Adam ad962ad759 Allow other modules to suspend nicknames and channels without having to subclass suspendinfo 2014-02-07 13:12:57 -05:00
Adam 5327becf41 Allow other modules to be able to view and modify cs and ns set_misc data 2014-02-07 13:02:20 -05:00
Adam f43c99c5cc Merge pull request #46 from ShutterQuick/patch-1
Update cs_updown.cpp
2014-02-07 12:12:52 -05:00
ShutterQuick c0a491cb06 Update cs_updown.cpp
cs_updown: Make CS DOWN remove all modes, not just one
2014-02-07 18:04:16 +01:00
Adam 66cc965fd7 Ignore nonblocking errnors on socket operations 2014-02-05 15:26:03 -05:00
Adam 2440514a7b Document a little more accurrately the privilege stuff and document why the access lists behave as they do 2014-02-05 08:46:56 -05:00
Adam fad1da81a3 Process mode changes in ns_ajoin before joining users, fixes not being able to ajoin users to +R channels on Unreal 2014-02-05 08:46:56 -05:00
Adam bb0e2a9a07 Make it easier to use fantasy without botserv, and document it 2014-02-05 08:46:51 -05:00
Adam 4f8c4f8fef Actually just allow mode clear to take any mode name 2014-02-03 10:05:13 -05:00
Adam 25957111b2 Fix typo in mode clear, exempts -> excepts 2014-02-03 08:41:27 -05:00
Adam 9a8895359a Apply the last commit to cs_list 2014-02-02 03:21:02 -05:00
Adam 53f8db0198 Merge pull request #44 from ShutterQuick/2.0+listfix
ns_list: Fix typo (NS_SUSPENDED -> SUSPENDED)
2014-02-01 11:42:08 -08:00
Daniel Vassdal f94cb7fb11 ns_list: Fix typo (NS_SUSPENDED -> SUSPENDED) 2014-02-01 11:24:52 -08:00
Adam c30fb13a0c Merge pull request #43 from ShutterQuick/2.0+ajoinfix
2.0+ajoinfix
2014-02-01 11:12:39 -08:00
Daniel Vassdal 7926238fd2 Improve IsChannelValid() 2014-02-01 10:55:12 -08:00
Daniel Vassdal 211a944210 ns_ajoin: Treat ',' as a separator. 2014-02-01 10:35:10 -08:00
Daniel Vassdal cff61617e1 commasepstream: Add a allowempty param 2014-02-01 10:31:17 -08:00
Adam 4455d4346c Merge pull request #42 from ShutterQuick/2.0+saslfix
Have SASL login in on the account name instead of nick alias
2014-01-31 02:43:26 -08:00
Daniel Vassdal 405b41ec87 protocol/(inspircd12/unreal/charybdis): Have SASL login in on the account name instead of nick alias 2014-01-31 01:41:27 -08:00
Adam bacb276181 Use TBURST on hybrid to set topics 2014-01-28 14:45:21 -05:00
Adam 4c1f6b48d8 Merge pull request #40 from attilamolnar/2.0+csclonefix
Fix cs_clone allowing users to clone a channel to itself
2014-01-26 16:08:23 -08:00
Attila Molnar 53a78c2688 Fix cs_clone allowing users to clone a channel to itself 2014-01-26 20:06:36 +01:00
Robby- e61a283c02 Update language files. 2014-01-26 16:33:28 +01:00
Adam c3302194eb Anope 2.0.0-rc3 Release 2014-01-26 01:18:38 -05:00
Adam cd184596a2 Only have extras rerun config if it was successfully run before. Config can create the build directory even if cmake isn't found. 2014-01-26 01:17:58 -05:00
Adam f28b1142f5 Correct error message in gl_global to reference the right module 2014-01-26 01:15:19 -05:00
Adam 87230c17b7 Fix extra space in the unknown command error message 2014-01-26 01:14:58 -05:00
Adam a29b7897f0 Use the SQLine reason in the kick reason for sqlined channels 2014-01-26 01:14:28 -05:00
Adam e965bc3049 Revert "Rename db_old hash plain -> none which is what 1.8 calls it"
This reverts commit 9a9ca41750.
2014-01-26 01:03:43 -05:00
Adam 01780c9e7a Fix setname handler on unreal 2014-01-25 17:58:20 -05:00
Adam 4d3363f83f Anope 2.0.0-rc2 Release 2014-01-21 21:55:59 -05:00
Adam 75e27b6a47 Update version.log 2014-01-21 21:55:59 -05:00
Adam fbaca3f7a1 Update language files 2014-01-21 21:55:56 -05:00
Adam 81b01bb55b Fix missing colon in stats and top, fix smileys and actions count. Patch by bush. 2014-01-21 21:10:06 -05:00
Adam 1027ec667a Made the chanstats confs try and look similar to every other configuration file 2014-01-21 17:33:57 -05:00
Adam 4d9273efa4 Unbreak account stuff from commit ccae59430a. 2014-01-21 17:20:15 -05:00
Robby- 67c13b41ee Update and fix some more typos in the dutch language file. 2014-01-21 00:29:59 +01:00
Robby- 10386a39f0 Make the server connected (uplink) message more sane. 2014-01-21 00:28:40 +01:00
Adam dc19ea3993 Alias charybdis/uid -> ratbox/uid because grawity is weird 2014-01-20 02:19:06 -05:00
Adam 2261fa3fe7 Fix example config for bs_autoassign 2014-01-20 00:05:53 -05:00
Adam fab9f0fecc Change config readers bool logic to accept unrecognized values as yes 2014-01-19 19:03:19 -05:00
DukePyrolator df8d85d80a m_chanstats: fixed the config options NSDefChanstats and CSDefChanstats 2014-01-19 08:11:19 +01:00
DukePyrolator 4b192addd2 m_chanstats: do not count negative words if you have more smileys in a line than words 2014-01-17 06:49:49 +01:00
Adam d27594f8a6 Fix webcpanels chanserv/modes page 2014-01-15 16:59:32 -05:00
Adam 43aaaeab7e Mark m_sql_log, m_rewrite, and m_dnsbl as extra so they show up in modlist with no parameters, as they are "unusual" 2014-01-14 03:50:08 -05:00
Adam ccae59430a Call User::Login after sending the login event, in case a module wants to act on the fact that the ircd sees the user as logged in 2014-01-14 03:49:22 -05:00
Harakiri 974adb7ce1 Update French language file 2014-01-12 17:44:14 -05:00
Adam f3531e7564 Fix not initializing module in the main log constructor 2014-01-10 01:41:03 -05:00
Adam 15a27c69ba Move oper count and vhost stuff to set/remove mode internal 2014-01-09 17:01:18 -05:00
Adam 0b0db75ba5 Fix repeat kicker message to show the correct number of times a user can say the same thing before being kicked 2014-01-09 16:45:07 -05:00
Adam b90a9a339a Fix empty ttb in bs kick repeat on 2014-01-09 16:09:38 -05:00
Adam 64f9aed761 Hook to OnUserLogin instead of OnNickIdentify in ns_ajoin 2014-01-09 15:46:04 -05:00
Adam 56f2cbeb62 Remove help access levels from help output because it no longer exists 2014-01-09 15:44:58 -05:00
Adam 9a9ca41750 Rename db_old hash plain -> none which is what 1.8 calls it 2014-01-09 15:42:31 -05:00
Adam e19661e1de Make DNSBL log message use the module type and give it a category too 2014-01-09 15:41:49 -05:00
Adam 09879c5c15 Fix compile with -std=c++11 2014-01-06 13:59:14 -05:00
Adam 12f55e4711 Hide +s channels from /cs list output to non opers 2014-01-06 12:54:29 -05:00
Adam 43c56541d5 Add a small note about the extras script in docs/INSTALL 2014-01-06 00:19:19 -05:00
Adam d3078850d2 Merge pull request #39 from DanielOaks/cs-status-channelname
Add the channel name to reply of cs-status, useful for applications
2014-01-05 15:39:09 -08:00
Daniel Oaks d4f7db122d Add the channel name to reply of cs-status, useful for applications 2014-01-06 09:37:08 +10:00
Adam 201ad9c191 Always run uid/sid generation loop at least once to not reuse older ids immediately 2014-01-04 17:54:04 -05:00
Adam 45c0bf8f32 Fix recovering enforcers not properly quitting them 2014-01-04 17:45:58 -05:00
Adam d64855b35b Allow m_sql_authentication to disable email changing similar to m_ldap_authentication 2014-01-04 13:44:47 -05:00
Adam 4617fdbf3d Make /cs status use the chanserv/auspex privilege instead of chanserv/access/modify, as it only views channel access 2014-01-04 13:41:08 -05:00
Adam ac204745c8 Also make m_sql_authentication block nick grouping if it is disabling registration 2014-01-04 12:24:04 -05:00
Adam e1ce6174ce Move modules/stats under extras because it depends on m_mysql, update its config a bit to look similar to all of the other config files 2014-01-03 19:54:14 -05:00
Adam 2781b6946d Add an explicit privilege for os_config's modify 2014-01-02 11:44:18 -05:00
Adam 1e502c8450 Update os_config 2014-01-02 11:41:49 -05:00
Adam 004c4cbe5f Move modules out of extras that dont have external dependencies 2014-01-02 11:03:33 -05:00
Adam 072202c181 Have db_old load news.db too 2014-01-02 10:56:57 -05:00
Adam 595dad4ec1 Update copyright to 2014. This was done with:
find include/ src/ lang/ docs/ modules/ *.* Config -exec sed -i 's/-20.. Anope Team/-2014 Anope Team/i' {} \;
2014-01-01 20:48:38 -05:00
Adam a374e245fd Make inspircds module class names not conflict because it confuses OSX 2014-01-01 16:21:38 -05:00
Adam 6e6543d3ed I don't think this OnBotKick to hold channels is necessary anymore as Sync should cover everything now, and this causes weird things when the last user in a channel kicks themselves out using the bot. Also handle users rejoining a channel while its held better. 2013-12-31 16:12:21 -05:00
Adam 6124af68cc Show the command name and not service name in the access denied log messages 2013-12-31 15:31:56 -05:00
Adam f21b40bfb4 Set last_realname in m_ldap_authentication when new nicks are registered 2013-12-30 10:50:15 -05:00
Adam 567700b5a6 Also have m_ldap_authentication disable nick grouping if registration is disabled 2013-12-30 10:42:07 -05:00
Adam 3b80da9cbd Fix loading kicker ttb data 2013-12-30 10:34:57 -05:00
Robby- c519119197 Don't expire ignores when NoExpire is enabled. 2013-12-29 05:27:36 +01:00
Robby- 780bc7ca14 Do not translate command parameters that do not have translatable strings in them, or are not meant to be translated in the first place. 2013-12-28 23:28:30 +01:00
Adam 3d12752655 Fix naming collision between modes +g and +G on inspircd, rename the common badwords censor mode to censor 2013-12-28 09:39:16 -05:00
Adam 9c0ceed36a Readd channel description to ns alist output 2013-12-27 17:24:52 -05:00
Adam 187973c16a Allow inverting opertype privs and commands, to make them behave like the log settings 2013-12-27 17:20:47 -05:00
Adam 072631aa38 Fix forbid add message to show the correct type 2013-12-27 17:15:07 -05:00
Adam b638b653d2 Fix crash when channels are registered that do not exist by non users 2013-12-27 17:12:01 -05:00
Adam 0fb2b60cff Fix xmlrpc dochannel example 2013-12-26 21:06:26 -05:00
Adam 16f3f0cbc0 Don't leak ldap results 2013-12-26 21:06:07 -05:00
Adam b28db7bc55 Fix crash with badwords of type 'end' and possibly when messages contain only control codes. Also fix matching single words at the beginning of lines. 2013-12-26 17:33:06 -05:00
Adam 9bf9cfcf5e If using db_flatfile:fork, don't allow multiple saves to happen at one time on shutdown/restart wait for any pending saves to finish 2013-12-26 16:08:56 -05:00
Adam 0c9750a22b Default the founder privilege to level 10000 as I had originally intended. Document set fonder usage in cs_levels help. 2013-12-26 15:19:48 -05:00
DukePyrolator 69c5aeca57 updated the extras script to find the cmake binary installed by ./Config 2013-12-26 19:44:41 +01:00
DukePyrolator 59c3c1326b m_chanstats: 1) fixed the SASET message 2) decreased the size of some VARCHAR fields, this hopefully fixes the 'key too long' error on some systems. 2013-12-26 18:46:20 +01:00
Adam 5829d7da39 Add a config option for whether or not to reset the TS of persistent channels to their registration date 2013-12-26 12:06:39 -05:00
Adam 2f29c1388c Fix not setting the persist flag on newly registered channels when the permanent channel mode is set prior to registering or during registration 2013-12-26 11:39:35 -05:00
Adam fc0e8264c0 Fix dropping channels in the webpanel 2013-12-26 08:02:19 -05:00
Adam 19eccf0cae Fix setting english language in db_old, document how not setting defaultlanguage really works 2013-12-25 15:16:04 -05:00
Adam dbf5106c09 Fix sqline on hybrid 2013-12-25 14:29:41 -05:00
Adam 3029a2db1a Don't epxire forbids when noexpire mode is on 2013-12-24 20:58:06 -05:00
Adam 53df61b4c2 Make webcpanel's nickserv alist behave more like /ns alist 2013-12-24 20:48:09 -05:00
Adam 7d27689d05 Set a description for the resend command 2013-12-24 20:20:47 -05:00
Adam 421e194c5a If last usermask and last realhost are the same, don't show both because duh 2013-12-24 18:19:44 -05:00
Adam c442bc18af Do not allow /cs clone access to add duplicate masks to the access list or allow growing the list pass accessmax. Fix reading botservs case sensitive config option. Give a better error message when trying to clone badwords if there is no botserv. 2013-12-22 08:37:49 -05:00
Adam 1c02961b60 Anope 2.0.0-rc1 Release 2013-12-20 22:57:58 -05:00
Adam 268d529078 Update version.log 2013-12-20 22:57:56 -05:00
Adam 4bc4b98ac7 Regenerate language files 2013-12-20 22:56:38 -05:00
Adam e8b42607e6 Update Changes and Changes.conf 2013-12-20 22:56:34 -05:00
Adam e792865a04 Fix reading unconfirmed expire config value when register type is set to mail 2013-12-20 20:24:40 -05:00
Adam 2b5a1d8c8f Fix deleting multiple access entries when one of them matches your access group 2013-12-20 19:48:20 -05:00
Adam 7cf21342f4 Merge pull request #33 from Robby-/1.9-nllangupdate
Update the dutch language file for new and modified strings, and fix some more typos while we're at it.
2013-12-20 12:18:44 -08:00
Adam ba8a646a33 Add missing syntax to botserv kicker help 2013-12-20 14:57:06 -05:00
Robby- fa50252c77 Update the dutch language file for new and modified strings, and fix some more typos while we're at it. 2013-12-20 20:15:30 +01:00
Adam 46bb2de866 Document hs reject's reason 2013-12-20 02:28:35 -05:00
DukePyrolator c2e9b8080b Revert "m_chanstats: changed the default value of some fields to NULL instead of ''"
This reverts commit 6ff83c3407.
2013-12-20 07:34:49 +01:00
Adam c0cd76a0a5 Don't leak opers and opertypes on /os reload, fix not updating opertypes on non conf opers on rehash 2013-12-19 21:34:21 -05:00
Adam ab6cd3b26c Fix a few commands not being able to find non conf opers 2013-12-19 20:35:09 -05:00
Adam 275f2fd374 Fix db_old assigning empty greets to users who did not have a greet. Fix debug log message in extensible.cpp 2013-12-19 08:24:21 -05:00
Adam c4d4107412 Channel::Sync can delete the channel, so safely iterate them when syncing from a server burst 2013-12-19 07:32:46 -05:00
DukePyrolator ae5da11389 irc2sql: fixed not storing ssl information on inspircd 2013-12-19 07:16:17 +01:00
Adam e6544a06f4 Update last_modes when keepmodes is set on or off 2013-12-17 11:02:06 -05:00
Adam 1ab7d53649 Set pending mode changes immediately when an object is removed from the mode stacker. And fix mlock creator from cs set persist on. 2013-12-17 10:58:02 -05:00
Adam d709c819d2 Default build type to release 2013-12-16 12:50:49 -05:00
DukePyrolator 2ad4a8667f irc2sql: fixed small typo 2013-12-15 16:52:08 +01:00
DukePyrolator 6ff83c3407 m_chanstats: changed the default value of some fields to NULL instead of '' 2013-12-15 16:24:22 +01:00
DukePyrolator adbc5a0e65 irc2sql: improved handling of netsplits 2013-12-14 09:56:51 +01:00
Adam f9a4a0fbef Log all admin commands by default. I was trying to give an example of log settings, but people seem to leave the default and then get confused when it only logs operserv commands 2013-12-13 18:41:01 -05:00
Adam a282a5c9c4 Fix 96af354ad5 to not burst topics if they are not set 2013-12-10 20:17:29 -05:00
Adam 3ddfa2fc1d Explain how to setup the locales on Ubuntu 2013-12-10 20:15:34 -05:00
Adam 50f430fb23 Document which modules are extra and how to enable them 2013-12-09 21:18:01 -05:00
DukePyrolator 1b4d62e2bc irc2sql: fixed incorrect usercount for channels and servers after netsplit, fixed not displaying the channelmodes 2013-12-09 05:57:36 +01:00
Adam 43f608ff2b Merge pull request #32 from Harak/1.9
Updated french installation instructions.
2013-12-03 23:58:57 -08:00
Harak f0313a45cb Updated french installation instructions. 2013-12-03 22:09:06 +01:00
Adam 96af354ad5 Send channel topics on initial burst, sync chanels after db load, and try to after unserializing persist on 2013-12-02 02:01:39 -05:00
Adam b5966cf99e Fix crash from loading exceptions with db_old and then unloading db_old 2013-12-01 21:16:50 -05:00
Adam faab2c6793 Fix 5e4d52ad47 more 2013-12-01 18:58:20 -05:00
DukePyrolator c6f85b9312 made the chanstats fantasy modules work again. 2013-12-01 12:09:34 +01:00
Adam 5e4d52ad47 Fix 1542937d64 2013-12-01 05:00:28 -05:00
Adam 6628e714c7 Require email address to be passed to resetpass 2013-11-30 02:18:20 -05:00
Adam 0f9e931fa6 Revert "Fix session user logoff hook"
This reverts commit 3b8f1cd59f.
2013-11-24 22:00:01 -05:00
Adam 1f6385c095 Merge pull request #29 from Robby-/1.9-nllangupdate
Update the dutch language file for new and modified strings, and fix some typos while we're at it.
2013-11-24 14:11:52 -08:00
Robby- be044c9d6e Update the dutch language file for new and modified strings, and fix some typos while we're at it. 2013-11-24 22:04:27 +01:00
Adam 90aa576fb3 Fix/clean/clarify some stuff found by coverity scan 2013-11-23 22:12:33 -05:00
DukePyrolator 77e5744341 fixed webcpanel not html escaping displayed memos, bug reported by Mietzie 2013-11-22 01:22:24 +01:00
Adam e1264a5913 Re-find dependant protocol modules on unload, they can be reloaded from under us while we are running 2013-11-21 18:06:38 -05:00
Adam 18f423226c This actually can't happen, but this is what was meant 2013-11-21 17:38:54 -05:00
Adam c967a4ce88 Shrink nick and channel default flags in db_old, otherwise converted nicks/channels always end up with the defaults enabled, even if they explicitly have them set off. Fix setting nickserv defaults to none. 2013-11-21 17:31:18 -05:00
Adam 1542937d64 Hybrid has no quit on kill, so internally kill users when killed 2013-11-21 11:34:42 -05:00
Adam 3b8f1cd59f Fix session user logoff hook 2013-11-21 11:20:10 -05:00
Adam fbbdedf17e OnJoinChannel can modify the ts for a channel, so update keep_their_modes in the sjoin handler before processing a user. Otherwise we can desync and think users have a channel status when they really don't. 2013-11-20 18:10:26 -05:00
Adam b75faefea4 Don't claim to support SAVE on charybdis... 2013-11-19 10:06:22 -05:00
Adam 676db0ba6f Actually we can use this ssl ext type which apparently does exist 2013-11-18 18:36:37 -05:00
Adam b2802d0beb Give a reason why we cant clear nonssl users on ircds with no ssl usermode 2013-11-18 17:18:00 -05:00
Adam 826ae9b6c0 Make /ms check better able to tell if youve recently sent a memo to someone 2013-11-18 17:18:00 -05:00
Adam 2c3e8a76c9 Check override permission in cs_flags for modifying existing entries too 2013-11-18 17:18:00 -05:00
Adam 0bb23f3f4d Merge pull request #27 from Cronus89/patch-1
Update placeholder text for hostmask
2013-11-18 07:53:45 -08:00
Adam b36498149d Merge pull request #28 from Robby-/1.9+cslevels
cs_access: Fixed disabling channel levels. Also, correctly log /cs levels commands.
2013-11-18 07:53:36 -08:00
Adam f6cf978d0c Show the correct setting name in /ns help set message 2013-11-18 10:52:28 -05:00
Adam aeebaed4b2 Default adding to 1 in mlock add/del, always reply with something even if the input is invalid 2013-11-18 10:49:54 -05:00
Robby- faabff0261 cs_access: Fixed disabling channel levels. Also, correctly log /cs levels commands as an override or a normal command at the time it is executed, so, right before levels actually get modified. 2013-11-18 07:17:40 +01:00
Adam cba811bc6b Default nogroupchange to on, update comment to make sense 2013-11-17 23:35:57 -05:00
Cronus89 dcae3d7bda Fix placeholder for akill.html 2013-11-17 19:37:19 -06:00
Adam fc69b68891 Don't default /cs list or /ns list to require oper privs 2013-11-16 16:38:10 -05:00
Adam 15e527fa70 Add missing .founder checks to cs_flags 2013-11-16 15:14:15 -05:00
Adam 3ccf26fda4 Delete notify/client sockets when m_dns is unloaded 2013-11-16 14:55:03 -05:00
Adam c0b0ee1b39 Make /cs up set modes you have the priv for, but not the auto priv, because Robby says so 2013-11-16 13:33:20 -05:00
Adam b353e1db79 Also check command names in cs_log when seeing if a newly added entry already exists. Also force command names lowercase when looking them up. 2013-11-16 12:05:20 -05:00
Adam 3edce88698 Fix default level names for access change/list in db_old 2013-11-16 10:39:25 -05:00
Adam 9e1fb11f93 Tell people why they cant disable the founder level instead of claiming it doesn't exist 2013-11-16 10:22:18 -05:00
Adam 316c280a57 Add help for /cs set keepmodes 2013-11-16 10:20:35 -05:00
Adam cc2a999b4e Allow founders to change flags even if they don't have any matching access entries on the channel 2013-11-16 10:04:26 -05:00
Adam 51a9f64adb Use the source's sync state and not mine when processing sjoins to determine whether or not to sync the channel on creation, instead sync it when the server syncs. 2013-11-16 09:38:13 -05:00
Adam 332fd23927 Add general:hideregisteredcommands to hide commands that require you to be identified to use. This changes the behavior of hideprivilegedcommands to only hide commands users don't have the oper privileges to execute. 2013-11-15 15:10:23 -05:00
Adam 1aca2922af Allow mlocking +r on ratbox/whatever else 2013-11-15 14:24:33 -05:00
Adam b65fd34a39 Set the default db name to anope.db 2013-11-12 20:12:56 -05:00
Adam c9f4c2db1f try/catch cs_access AccessUnserialize just incase, don't crash if ns_ajoin is loaded before the protocol module 2013-11-12 19:19:21 -05:00
Adam d1248d1249 Merge pull request #25 from Robby-/1.9-nsidfaillogacctnames
ns_identify: When logging failures, also show the account name, and that it exists or not.
2013-11-09 05:40:58 -08:00
Adam afc5c91a09 Do not grant auto privileges to founders if they match other access
entries. This allows channel founders to disable auto +qo without
having to globally disable autoop or the levels.
2013-11-09 05:51:38 -05:00
Adam aa6c3f3474 Show (none) on flags list if a user is on the access list but has no flags 2013-11-09 05:47:14 -05:00
Adam 2a35151d12 Remove db_plain 2013-11-09 05:41:10 -05:00
Adam fa7cee9759 Don't allow users to remove non-flags access entries that are >= them with /cs flags, also spotted by TGS 2013-11-08 17:47:13 -05:00
Jens Voß 431b2e6768 Merge pull request #26 from Cronus89/patch-1
CREATE EVENT chanstats_event_cleanup_weekly failed due to calculating im...
2013-11-04 21:44:08 -08:00
Adam 853e926920 Merge pull request #23 from Phr33d0m/1.9
Some fixes here and there
2013-11-04 15:05:10 -08:00
Denis M. (Phr33d0m) 8267407a78 Add a couple of usability and aesthetic changes, fix the half-broken chanlist functionality, add a couple of missing ESCAPED_CHANNEL vars
Add missing ESCAPED_CHANNEL
Changed EMAIL_TYPE to FORCE_EMAIL. Now makes more sense
Make it more obvious when the 'email' field is optional
Add a 'Retry' button to go back to the registration page
Fixed broken chanlist functionality. Before even if the user clicked on the channels nothing happened, now it goes straight to the 'set' page (at least something happens)
Small fix, disable the 'Save' button if user has no SET powers
Add another missing ESCAPED_CHANNEL
Add a more clear definition of what hostmasks are allowed in that field, either user@host or nick\!user@host
Fix wrongly placed var
Changed some aesthetics
2013-11-04 23:59:55 +01:00
Cronus89 a831e5d306 CREATE EVENT chanstats_event_cleanup_weekly failed due to calculating improper start of week. 2013-11-03 21:41:01 -06:00
Robby- b901dfee84 ns_identify: When logging failures, also show the account name, and that it exists or not. 2013-11-04 02:59:16 +01:00
Adam 6e8d2bf09d Attempt #3 2013-11-01 05:19:48 -04:00
Adam 70e9b20274 Fix release build, not too sure why this is, compiler seems to infer this as a copy of ChanAccess 2013-11-01 05:12:30 -04:00
Adam 4ee9021adb Compare access entries created with the levels access system by access level and not by privilege set, as two entries can have the same privset but different levels, but still represent two different levels of access. This prevented users from adding other users at a lower access level when that level had the same privset as them. Spotted by TSG. 2013-11-01 04:58:38 -04:00
Adam c8db362bca Cleanup some access(group) comparison logic in access.cpp 2013-11-01 04:56:17 -04:00
Adam c710625cd3 Use Config::GetClient for looking up services for command{} blocks which lessens the insanity of renaming services 2013-11-01 02:07:35 -04:00
Adam ac2f8bf64d People often seem to get tripped up by this, so document more clearly 2013-11-01 02:04:21 -04:00
Adam 04e7fa493a Don't take modes in SetCorrectModes if the user has the ME privilege 2013-11-01 02:04:21 -04:00
Adam f7692ec77f Merge pull request #24 from Robby-/1.9+fixes
1.9+fixes
2013-10-28 01:37:47 -07:00
Robby- 4a1d32c5fd Fix logging when identifying with an SSL certificate fingerprint. 2013-10-28 09:30:56 +01:00
Robby- 498da95205 Stop requesting identification when changing nicks to a registered nick, and the current client certificate fingerprint matches one on the nickname's list. 2013-10-28 09:30:20 +01:00
Robby- 710d4848bd Fix kill and killquick default expiry times.
ns_access and ns_cert: Fix accessmax defaults, also state in the config that 0 is not a valid value.
2013-10-28 09:25:17 +01:00
Robby- bd3bed2118 Fix some typos and touch up the configs a little. 2013-10-28 09:13:53 +01:00
Adam fe31b0a666 Fix m_httpd not passing non post data to other modules correctly & close connections immediately when we are done flushing data 2013-10-27 20:33:37 -04:00
DukePyrolator 1f97d6d879 fixed a small error that causes irc2sql to not compile 2013-10-27 18:10:15 +01:00
DukePyrolator 4bd5649105 fixed make install not installing the new example config files 2013-10-27 04:53:57 +01:00
DukePyrolator b5af310f8a added the irc2sql gateway module 2013-10-26 18:42:58 +02:00
DukePyrolator 2cfc97053f moved some config options from example.conf to nickserv.example.conf 2013-10-26 18:33:07 +02:00
DukePyrolator 6cde65a57f new event OnSetDisplayedHost 2013-10-26 18:33:07 +02:00
Adam 7cb35eeedf Make nickserv's confirmemailchanges option work 2013-10-22 03:44:06 -04:00
Adam f0318fdbe8 Fix some typos of language 2013-10-19 03:43:04 -04:00
Adam 93a83da771 Fix os_dns not using remove_split_servers and fix remove_split_servers=true readd_connected_servers=false causing delinked servers to remaing in pooled+not active state 2013-10-19 03:42:12 -04:00
Adam 0ff1bb9d5b Bump for 1.9.10-git 2013-10-14 01:19:42 -04:00
Adam c0dea5ef30 Anope 1.9.9 Release 2013-10-12 15:28:49 -04:00
Adam fd4ac7f6fc Update version.log 2013-10-12 15:28:49 -04:00
Adam e635f547d6 Update language files 2013-10-12 15:28:48 -04:00
Adam 7167cff703 Update changes and changes.conf sort of 2013-10-12 15:05:42 -04:00
DukePyrolator b844154857 fixed a typo in the last commit, reported by Robby 2013-10-10 18:12:48 +02:00
DukePyrolator 5e56dfdb1a replaced the country name in the Language header in the language files by four letter codes 2013-10-10 07:51:35 +02:00
Adam e1d460e211 Call OnBotPrivmsg after checking if the message is a ctcp, not before. fix typo in opersrev.example.conf 2013-10-09 16:27:16 -04:00
DukePyrolator 9ea6fb25b9 set the Language header in the language files so msgfmt doesnt complain 2013-10-09 22:10:08 +02:00
DukePyrolator 7755668679 updated docs/EVENTS 2013-10-06 22:07:01 +02:00
Adam 569efbb66b Fix Windows build 2013-10-05 13:29:34 -04:00
Robby- 696801430b anope.nl_NL.po: Translate newly added string, and fix some spelling/grammar. 2013-10-05 13:22:56 -04:00
Adam 1b08ba8f41 Always show expire time for nicks in /ns info to opers, even if the user is online
Make Anope::strftime show "now" if the time is now
Fix typo in nickalias.cpp for the type of the last_seen field, spotted by grawity
2013-10-05 13:21:28 -04:00
Adam 277f735505 Hide expires in /cs info if the channel is actively in use as it confuses people 2013-10-05 01:07:51 -04:00
Robby- f63a2bdfb4 Big update of the Dutch language file.
cs_ban: Merge the syntaxes into one.
2013-10-05 00:49:12 -04:00
Robby- feb412bdb1 cs_mode: Fix override in /cs mode set. 2013-10-05 00:33:03 -04:00
Robby- ab856683c7 os_news: Add some logging. 2013-10-05 00:33:03 -04:00
Robby- 97d7c21193 Fix logging for log type 'other'.
os_ignore: Log expired ignores to the normal log level.
cs_drop: Allow Services Operators to actually drop channels in Read-Only mode.
os_akill, os_sxline, cs_akick: Log deletions by number.
2013-10-05 00:33:03 -04:00
Adam e5b8435769 Fix not setting -r when channels are deleted 2013-10-05 00:33:03 -04:00
Adam e589080827 Fix /ns alist showing a header/column header if the user has no access 2013-10-05 00:33:03 -04:00
Adam 257b10ee91 Hide privileged commands in ns help set and cs help set if configured 2013-10-05 00:33:03 -04:00
Adam 353ee5cc93 Fix xline uid generation when the one chosen already exists 2013-10-05 00:33:03 -04:00
Adam b094132c9d Log akill deleteions by number 2013-10-05 00:33:03 -04:00
Robby- 82006b868f cs_entrymsg: Check for the correct override privilege.
Make some more commands check if Read-Only mode is active.
cs_flags: Show a meaningful message when a user is not found on the access list.
os_set: Add missing capabilities to the readonly help output.
OperServ: Add logging to certain commands.
NickServ: Undo logging for listings.
2013-10-05 00:33:03 -04:00
Robby- ba5a3f5f00 Don't explicitly reference services nicks.
os_forbid: If NickServ is available, have it send the forbid reason instead of OperServ.
2013-10-05 00:33:02 -04:00
Adam 7b6c08b53a Exempt ulines/myself from bounce mode check 2013-09-29 17:22:25 -04:00
Robby- 47b692f9ae os_session: Add some empty lines to the session help command to improve readability. 2013-09-29 15:42:22 -04:00
Robby- ed06609ae1 NickServ: Change a few log wordings and add missing log calls to some commands.
ns_suspend and cs_suspend: Fix log wording, and correct syntax to show the reason is optional.
2013-09-29 15:42:22 -04:00
Robby- 32a57150ec ns_access: Allow LIST by Services Operators on suspended nicks. Change wording.
ns_ajoin: Fix the number of command parameters. Check for nick suspension. Do not allow just any Services Operator to access other users' AJOIN, require nickserv/ajoin. Change wording.
ns_cert: Add ability for Services Operators to modify other users' certificate lists.
2013-09-29 15:42:22 -04:00
Robby- 2a5e8f1890 cs_akick: Make the default autokick reason translatable.
os_forbid: It is required to specify a reason.
2013-09-29 15:42:22 -04:00
Robby- a04c320b4b cs_set: Fix showing expiry time in INFO output.
cs_sync: Check for the correct override privilege.
2013-09-29 15:42:22 -04:00
Robby- 4221a507cc Fix NickServ default nick expiry time. 2013-09-29 15:42:22 -04:00
Adam 44dd8d07d9 Add chanserv:always_lower_ts config option to always lower registered
channels timestamps to the creation time which fixes some race
conditions regarding users joining empty registered channels and doing
things prior to the -o from services coming through.

Without always_lower_ts attempt to bounce mode changes from bad users,
which will work okay in most cases.
2013-09-29 15:41:32 -04:00
Adam f7aa69b596 Correct expiretmeout and updatetimeout descriptions in example.conf, it is no longer triggerd by /os update 2013-09-29 13:04:12 -04:00
DukePyrolator d5ecc39104 display modechars instead of modenames in cpanel channelmodes 2013-09-29 04:23:33 +02:00
Adam 84a02d2709 Remove "Nick" reference from the /os ignore del message, as it can only contain hostmasks 2013-09-27 20:11:51 -04:00
Adam 4b059beb24 Replace this silly random code generation code with something more sane looking 2013-09-27 20:07:07 -04:00
Adam b319fb089c Fix compile warnings and errors found by clang 2013-09-27 19:11:02 -04:00
Adam 17196887ad Allow modifying mlock on nonexistant (but registered) channels 2013-09-27 19:11:02 -04:00
Adam 02d67f682a Allow /os forbid list <type> 2013-09-27 19:11:02 -04:00
Adam b306108740 Fix /os ignore del on nicks 2013-09-27 19:11:02 -04:00
Robby- 12a0311aaa Add missing columns to os_forbid. Make most lists with dates use the shorter output format. 2013-09-27 19:11:02 -04:00
Adam cf653fc084 Fix ms del all not actually deleting some memos
Fix numbering of memos in ms list
2013-09-27 19:11:02 -04:00
Adam 5cc7fc0387 Fix ms list crash 2013-09-27 19:11:02 -04:00
Robby- 832bc35135 Fix a few more modules to look in the right places for certain settings. 2013-09-27 19:11:02 -04:00
Robby- 06c5914820 Fix akillids to work again. os_session: Add missing num to del syntax and add missing expiry column. 2013-09-27 19:11:02 -04:00
Robby- bf67b9ee5c Make column titles in listings translatable.
Make some more strings translatable, and remove some that don't need translation at all.

Make expirytimes and units translatable.

Make predefined messages in listings also translatable.

Make the remaining command descriptions translatable.

Make some ns/cs info strings equal to dedupe in translation file. Add missing no-autoop setting to cs info output. Make some strings translatable.
2013-09-27 19:11:02 -04:00
Adam 829c169063 Translate strftime correctly 2013-09-27 19:11:02 -04:00
Adam 4948120b69 Translate SendSyntax() and spacify it properly 2013-09-27 19:11:02 -04:00
Adam 994471f5a7 Align info formatters with translated keys? 2013-09-27 19:11:02 -04:00
Adam 80c02740d0 Translate listformatter properly 2013-09-27 19:11:02 -04:00
Adam df3c0b7b52 Fix various commands to properly report a given expiry time is invalid 2013-09-27 19:11:02 -04:00
Robby- 45702992ac ns_cert, ns_set: Make strings equal for one translation instance 2013-09-27 19:11:02 -04:00
Robby- 9756f96b85 example.conf: nickserv:emailregistration -> nickserv:registration 2013-09-27 19:11:02 -04:00
Robby- 6ac0364f74 Fix os_stats to display SQLINEs and SNLINEs on non-supporting IRCds 2013-09-27 19:11:02 -04:00
Robby- 4f820a7d41 Fix typos, remove dead language defines.
os_set: Add missing debug text in help output.
2013-09-27 19:11:02 -04:00
Adam 5f7127dd92 Don't send regex qlines and nlines to the IRCd 2013-09-27 19:11:01 -04:00
Adam dcb3ff7d34 Dont send BURST twice on inspircd
Drop matching nicks on forbid.
2013-09-27 19:10:49 -04:00
Adam 1107b92699 Drop matching channels on forbid, and enforce nick forbids even on IRCds
with no qlines
2013-09-27 18:02:26 -04:00
Adam 3b0b1bc80e Don't send SQLines unless the IRCd supports it 2013-09-27 18:02:26 -04:00
Adam b60b23fd48 Only allow using os_oper add and del if you have the privileges for what
you are giving or taking.
2013-09-27 17:21:46 -04:00
Robby- 5aac6377c2 Correctly detect override in cs_ban on masks 2013-09-27 17:21:31 -04:00
Adam 20856fb59c Remove +r etc when channels are deleted 2013-09-27 17:21:20 -04:00
Robby- 7545763cd4 Added missing override capabilities and log calls to some ChanServ commands 2013-09-27 17:21:20 -04:00
Adam 1818b19eba Fix cs_mode lock reply if nothing is done
Fix not clearing forbids when os_forbid is unloaded
Apply nick and chan forbids when added
Fix loading forbids until after the service is constructed
2013-09-27 16:33:56 -04:00
Adam abc7e4b423 Fix os_news to not load items until the news service is constructed
Fix session exceptions not expirigin
2013-09-27 16:33:03 -04:00
Adam e5ece18ee7 Readonlyize many commands 2013-09-20 21:09:35 -04:00
Adam 8641b995c4 Merge the two memo del events into one. Since they had the same name it was confusing the event system 2013-09-20 15:21:32 -04:00
Adam b880240d72 Make os_session akill ip ranges and not individual user's ips 2013-09-19 13:35:52 -04:00
Adam 5ce90ba7d1 Fix not updating last_seen on expire nick for nicks with secure off. Don't show Expires in /ns info if the nick is online currently as it confuses people 2013-09-19 12:38:28 -04:00
Adam 98bae827e1 Require confirmation in /cs drop by requesting the channel name twice 2013-09-16 15:54:09 -04:00
Adam e3c05efe5e Remove static variables from functions in modules which causes them to be marked as gnu unique objects, which breaks dlclose()/dlopen() on g++ 4.5+ 2013-09-16 06:47:42 -04:00
Adam 8cbaf7e990 Update Spanish translation, from Isaac Fontal <i_fontal@hotmail.com> 2013-09-12 07:20:26 -04:00
Adam 339f41aebc Fix allowing duplicate entries on the snline list
Have proto mods recognize cidr ranges as zlineable IPs
Remove operserv/global from global.conf because its dumb
Fix example config ~botserv/set example to work as expected
2013-09-08 21:53:06 -04:00
Adam 55e4ef9d3a Fix logging /os set list. Enforce snlines on ircds that can't have snlines set by just killing the user. Fix double call to OnMatch() when a user matches an xline 2013-09-08 06:02:35 -04:00
Adam f63e4ceebe Alpabetize channels in /ns alist and on webcpanels chanserv page 2013-09-08 04:55:03 -04:00
Adam b005089f2f Dont allow multiple list modes with the same param on the mode list at once 2013-09-03 19:58:40 -04:00
Adam 1b42e26642 Cap mode stacker max line length 2013-09-03 19:40:03 -04:00
Adam 4691351167 Cleanup previous commit
Fix log messages from commands send through webpanel
Don't show OperServ section to non opers
2013-09-03 18:51:18 -04:00
DukePyrolator 404debf789 updated the chanserv section in webcpanel 2013-09-03 04:37:09 +02:00
DukePyrolator 752a5ca1b7 add vhost support for hybrid 2013-08-31 08:46:56 +02:00
Adam e1a1cf0e6f Dont crash on HasPriv() on an empty access group 2013-08-29 23:22:48 -04:00
Adam 3fabc2f831 Fix ns_ajoin on unregisterd +i channels 2013-08-29 23:13:29 -04:00
Adam 59ea36c831 Move Serialize::Types to construct after the corresponding extensible items they require when unserializing 2013-08-27 03:18:43 -04:00
Adam fac880664c Make chanserv:require not default to r 2013-08-27 02:56:54 -04:00
Adam 7f890ce98d Log parameters given to /cs mode set. Add logging to /os ignore. 2013-08-26 02:05:41 -04:00
Adam 50e1a3e96c Fix status mlocks. Fix reply from lock add. 2013-08-26 02:00:25 -04:00
Adam 6b79349e6c Fix User::IsIdentified with check_nick, do not remove +r on bursting clients until after server sync 2013-08-25 23:26:45 -04:00
Adam 678f54903d Fix not resetting channel status modes on our clients when a channel ts lowers 2013-08-25 22:57:26 -04:00
Adam 714a4a3004 Remove unnecesary mlock code in cs_mode, change mode set events to never bounce modes set by bots or servers, as it was possible to get modules to fight with each other 2013-08-25 21:33:52 -04:00
Adam 34826f71c7 Merge pull request #22 from fgsch/misc
Better ngIRCd support
2013-08-25 01:49:42 -07:00
Adam 847cceaba3 Create persistent channels on startup, which used to work and got lost somewhere
Fix some oddities with using persistent channels with no botserv
Send list modes to uplink when bursting
Fix issues with persist + keepmodes
Fix /os modes clear all not clearing all status modes
Fix operwall on ratbox/plexus
Dont apply mlock in SetCorrectModes since that just recursively calls itself unncessarially
Change command logging to show the command name and not the service name
2013-08-25 04:48:43 -04:00
Adam 09046e3c99 Show what kind of nick protection is enabled in /ns info 2013-08-25 04:48:43 -04:00
Adam 00a19529c3 Add logging to several operserv commands 2013-08-25 04:48:43 -04:00
Adam 446b3a910d Save unconfirmed status and passcodes in the database.
Fix db_sql_live to not reinsert all records if there are extra columns.
Plexus has no chmode +r
2013-08-25 04:48:43 -04:00
Federico G. Schwindt 76f5d4b316 Sort parameters and correct comments 2013-08-25 04:54:35 +01:00
Federico G. Schwindt 9b59925144 For ngIRCd, on nick change set mode -R 2013-08-25 04:54:32 +01:00
Federico G. Schwindt 243d781e99 Add login support for ngIRCd
This is implemented via the accountname METADATA command
2013-08-24 17:56:46 +01:00
Jens Voß 8be5f53f1f Merge pull request #21 from Phr33d0m/1.9
Use CDN for the rest of the .js files
2013-08-23 09:59:28 -07:00
Denis M. (Phr33d0m) cd49bb40c2 Use CDN for the rest of the .js files 2013-08-23 11:57:32 +02:00
Adam ef3d115bae Merge branch '1.9' of github.com:anope/anope into 1.9 2013-08-23 04:42:24 -04:00
Adam 9f1178ec58 Remove SSL cert verification because we dont use it 2013-08-23 04:36:02 -04:00
Adam 3bc2db561b Fix reading post data in m_httpd 2013-08-23 04:13:08 -04:00
Adam fad603e7a4 Merge pull request #20 from Phr33d0m/1.9
Redesign body of the pages.
2013-08-23 00:03:58 -07:00
n0kS Phr33d0m 5f006bf139 Fixed an incorrect layout, a couple of typos and a wrong form action 2013-08-23 08:42:45 +02:00
n0kS Phr33d0m aaa12cc018 Use a local copy of the background image 2013-08-23 08:11:24 +02:00
n0kS Phr33d0m 2238db8338 Make the navbar brand a different font to distinguish it from the rest of the navbar links. 2013-08-23 08:06:47 +02:00
Adam 4d1492d444 Remove webpanel:ssl configuration option because its dumb 2013-08-23 01:14:00 -04:00
n0kS Phr33d0m 5c4414e4a5 Removed innecessary logo width, the img-responsive will take care of that. 2013-08-23 07:05:57 +02:00
n0kS Phr33d0m 6f9b77e336 Don't use an external svg logo anymore, but a local png one. 2013-08-23 07:04:09 +02:00
Adam 154fa25e8f Fix m_httpd handling fragmented http requests 2013-08-23 00:57:36 -04:00
n0kS Phr33d0m 9793062007 Merge branch '1.9' of github.com:anope/anope into 1.9 2013-08-23 06:43:57 +02:00
n0kS Phr33d0m f86dc247e5 Redesign body of the pages. Now they have a distiguished panel heading and panel body. Also added background colour to currently selected section. 2013-08-23 06:39:23 +02:00
Adam 2b1f75a313 Fix m_httpd enabling ssl if m_ssl is loaded after it 2013-08-22 22:45:20 -04:00
Adam 5ac0c9a327 Fix previous commit 2013-08-22 17:33:16 -04:00
Adam e8763d5b3c Always set +o on users who have access for it, even if higher modes have a prefix 2013-08-22 01:48:17 -04:00
Adam ce7a32a994 Do not have cs_access try to represent non levels access entries as levels access entries. Sometimes it cant accurately be done and it confuses people. 2013-08-22 01:13:28 -04:00
Adam 0c1cc08e28 Update readme more 2013-08-21 23:22:27 -04:00
Adam e12e4e6956 Update readme 2013-08-21 23:20:05 -04:00
Adam 52535cf6fb Merge pull request #19 from Phr33d0m/1.9
A completely rewritten Control Panel
2013-08-21 20:17:20 -07:00
n0kS Phr33d0m 121d0a6e5b Fix a typo and remove unnecessary 'effects' 2013-08-22 03:27:29 +02:00
n0kS Phr33d0m 34535814e4 A completely rewritten Control Panel using some bootstrapping, jquery and lots of CSS 2013-08-22 02:37:43 +02:00
n0kS Phr33d0m 8bcc6840ce Nuking the old design with fire 2013-08-22 02:36:01 +02:00
n0kS Phr33d0m 08d113332c Fix incorrect GET method as we are submitting POST data 2013-08-22 02:32:04 +02:00
Adam 765943062e Always require the registered channel mode is set. Comment out default config requiring "r" as some ircds use it for registered users only 2013-08-21 01:35:57 -04:00
Adam 17cca42d48 Make maxaliases=0 really mean no limit 2013-08-21 01:27:14 -04:00
Adam 760fdc4049 Fix not setting vhost on nickserv update 2013-08-18 14:42:59 -04:00
Adam ead4aa7ed9 Fix 318 raw being sent for uids on ts6 ircds 2013-08-17 14:05:01 -04:00
Adam 65911dd1be Replace some get calls on <bool> extenisble types with hasext 2013-08-14 19:50:08 -04:00
Adam 4abfdcbb9c Do not default mlock +r, it is unnecessray and only clutters up the mlock list 2013-08-14 18:24:04 -04:00
Adam de5c8c0d38 Fix some issues with suspend 2013-08-12 15:45:50 -04:00
Adam 8e011bbb78 Respond to remote whois on inspircd for users on us that aren't service bots 2013-08-12 15:44:28 -04:00
Adam f15a9749f9 Use less strict valid ident checks on hybrid, unreal, and inspircd 2013-08-12 14:36:49 -04:00
Adam f1956b039d Remove channels from accesss lists when they expire/drop 2013-08-11 17:14:39 -04:00
Adam 53d5b7c29e Fix chanserv opersonly setting 2013-08-11 16:04:10 -04:00
Adam 812cb04fde Add DNS Notify support 2013-08-11 15:48:46 -04:00
Adam 1314d5b4f1 Fix cs_kee_pmodes default 2013-08-11 15:38:09 -04:00
Adam 490601de3a Fix chghost on charybdis 2013-08-11 12:25:58 -04:00
Adam c7aab50bff Support DNS ANY query type 2013-08-10 23:28:58 -04:00
Adam c507c78d5a Do not have ratbox or plexus pull modes from hybrid, it is entirely too confusing. Also fix cs_mode config 2013-08-10 17:59:31 -04:00
Adam 58c05687bf Add "simple seen" mode to cs_seen 2013-08-10 17:43:13 -04:00
Adam f8cdcc65c6 Merge pull request #18 from fgsch/1.9
Add certificate fingerprint support for ngIRCd
2013-08-10 14:26:27 -07:00
Adam 10a918f9e1 Default some listmax config settings to 50 2013-08-10 12:33:27 -04:00
Adam e4d1769a8b Add os_info 2013-08-10 12:29:12 -04:00
Adam 7cd80a2131 Fix logging LOG_NORMAL logs in m_sqllog. Fix/add more compat extensible items to ChannelInfo::Unserialize 2013-08-08 03:03:57 +00:00
Federico G. Schwindt 9d6f88de39 Add certificate fingerprint support for ngIRCd 2013-08-07 23:44:58 +01:00
Adam b93d650b1f Revert "Shrink to fit module event vectors when modules are removed from them"
Sometimes the events call the function the event is in, which causes a resize
while the original function is iterating.

This reverts commit 7f1b5552dc.
2013-08-07 21:19:49 +00:00
Adam c480695369 Fix db_sql to not remove objects when shutting down, as some modules that unload before it when shutting down remove their items then 2013-08-07 19:40:05 +00:00
Adam 7f1b5552dc Shrink to fit module event vectors when modules are removed from them 2013-08-07 17:27:18 +00:00
Adam 4865a8cfff Add m_sql_log 2013-08-07 16:44:35 +00:00
Adam 1efd289488 Fix inspircd jupe mess again, it wasn't working when juping servers that didn't already exist 2013-08-07 15:03:11 +00:00
Adam 83e4b183ea Add keepmodes setting 2013-08-01 14:07:56 +00:00
Adam 1e625b6837 Use MessageSource as the source for many IRCDProto funcs
Keep track of what user modes are oper only/server only/etc
2013-08-01 13:39:35 +00:00
Adam 402c624e45 Move chanstats stuff to stats/ 2013-07-29 12:02:40 +00:00
Adam fde83f6564 Rethink jupe/squit thing somewhat. Workaround for the inspircd rsquit/squit mess 2013-07-26 21:40:16 -04:00
Adam f0f43cf426 Fix build on late versions of cmake 2.4 2013-07-26 12:57:36 -04:00
Adam 3dc64bac4d Fix issues with 'Me' related to previous commit 2013-07-26 08:45:44 -04:00
Adam 2450a64bf4 Interally quit servers when juped 2013-07-26 07:38:42 -04:00
Adam b48293a632 Merge pull request #17 from fgsch/1.9
Fix levels on the ngircd module
2013-07-23 10:04:44 -07:00
Federico G. Schwindt e908dc0dc7 Make ChannelModeStatus level mandatory
Levels are used in Channel::SetCorrectModes() when removing modes.
2013-07-23 18:03:32 +01:00
Federico G. Schwindt 378c9203df Squashed commit of the following from Federico G. Schwindt <fgsch@lodoss.net>:
Date:   Mon Jul 22 22:40:07 2013 +0100

    Correct pasto

    Use proper name for included file.

Date:   Mon Jul 22 22:30:23 2013 +0100

    Indent defaults

Date:   Mon Jul 22 22:28:50 2013 +0100

    Correct option name

    signkicklevel is really signkick_level.

Date:   Mon Jul 22 22:25:24 2013 +0100

    Ensure some of the options are persisted

    Correct type for memo_signon, memo_receive, memo_mail and memo_hardmax so
    they're serialized.

Date:   Mon Jul 22 22:23:36 2013 +0100

    Add missing newline

plus additional suggestions from fgs
2013-07-22 23:45:08 -04:00
Adam 779f3788c9 More validation stuff from fgs 2013-07-21 18:29:35 -04:00
Adam 604da89813 More basic config validation, and fix crash when no uplinks are configured. spotted by fgs 2013-07-21 03:59:59 -04:00
Adam e11abdc4f0 Fix m_ldap service names from defaulting ldap/ldap/main 2013-07-21 00:37:21 -04:00
Adam 5aac04dffe Move SendLogin() back to User::Identify, it was moved at some point? but doesn't as intended in ::Login 2013-07-21 00:23:24 -04:00
Adam 7480fbda2b Fix removing old connections in m_ldap and m_mysql 2013-07-20 23:36:20 -04:00
Adam 9629ccb374 Fix more compile warnings found on newer g++ versions 2013-07-20 19:46:13 -04:00
Adam cb70d976ba Change cs_xop access check to use command order 2013-07-20 09:19:52 -04:00
Adam 6db0186947 Fix not setting the correct compile flags on modules and fix the resulting warnings 2013-07-20 03:06:20 -04:00
Adam 492eac20a8 Fix restoring topics on uplink sync 2013-07-20 03:06:20 -04:00
Adam c8511a625d Fix unserializaing seeninfos 2013-07-20 03:06:20 -04:00
DukePyrolator f6b915a169 added whois support to the ngircd protocol module, thanks to fgs for sending the patch 2013-07-19 22:28:33 +02:00
DukePyrolator 02c1724d75 some updates to the german langfile, thanks to kaylee for translating 2013-07-19 22:11:40 +02:00
Adam 7e87bb69fc Default xlines to be set by me 2013-07-15 23:59:19 -04:00
Adam aae522d72b Fix ModeManager::GetStatusChar 2013-07-15 23:23:54 -04:00
Adam 0a821640bb Fix deleting seeninfos 2013-07-14 20:37:42 -04:00
Adam 37733dea65 Fix Extensible<bool>::Set with a value (which is redundant due to the bool specailization) 2013-07-14 03:16:23 -04:00
Adam eabb9c0c11 Fix deleting badwords/modes/logs etc 2013-07-08 20:35:04 -04:00
Adam b103d16eb1 Fix loading some older compat flags and showing noexpire on /ns info 2013-07-08 15:48:37 -04:00
DukePyrolator e3b6ae3649 added missing NOTICE support to hybrid. sorry 2013-07-08 07:42:35 +02:00
Adam 0ff48e1538 Move op/deop/etc back to an actual command, its too hard to use cs_log with it as rewrites. Allow cs_log to work with either command names or service names. 2013-07-07 23:13:29 -04:00
Adam 53038d83bf Wipe services's module dir prior to make install 2013-07-07 23:13:16 -04:00
DukePyrolator 2ea594d677 added protocol support for incoming NOTICEs 2013-07-08 05:05:13 +02:00
DukePyrolator e957c7b2d2 m_dnsbl: updated the url to DroneBL in modules.example.conf 2013-07-08 05:04:04 +02:00
Adam 9a4f27e0a3 Only set stuff in ExtensibleUnserialize if there is something to set 2013-07-05 02:19:06 -04:00
Adam fccc4a4fa6 Fix sometimes not unloading all modules on shutdown 2013-07-05 02:09:43 -04:00
Adam 4325073524 Fix ns_set_misc and cs_set_misc 2013-07-05 02:09:27 -04:00
Adam 55199f0a4c Read most of the old common flags for compat 2013-07-04 23:05:30 -04:00
Adam 7edc76f7fb Fix deleting mode locks 2013-07-04 23:05:30 -04:00
Adam 3fbdde5e18 Fix Extensible dtor 2013-07-04 20:04:51 -04:00
Adam 9f8b4ac382 Allow access and flags to take privilege names 2013-07-04 01:21:14 -04:00
Adam 998925c90a Fix rehashing via SIGHUP and m_mysql 2013-07-04 01:19:40 -04:00
Adam 7f971043bc Allow channels on access lists 2013-07-03 22:45:00 -04:00
Adam c2e1a8a3e2 Fix some warnings and errors reported by valgrind 2013-07-03 19:44:13 -04:00
Adam c62b3cb275 Fix a few issues found by Attila (invalid array access in channel set events, os_chankill inf loop) 2013-07-02 01:56:13 -04:00
Adam 1a3d9a016d Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module. 2013-07-01 22:17:52 -04:00
DukePyrolator 518182ac92 m_mysql: handle multiple result sets returned from multiple statements or procedure calls 2013-06-30 05:28:01 +02:00
DukePyrolator 7d0e063300 added the missing accessmax option to the ns_cert configuration block 2013-06-22 17:06:48 +02:00
DukePyrolator 5e36d848d5 pseudoclients now trigger OnJoinChannel and OnPartChannel 2013-06-22 13:41:05 +02:00
DukePyrolator fee461f3d0 added support for CertFP on hybrid 2013-06-22 13:40:19 +02:00
Adam 1773eef143 Don't enforce usestrictprivmsg on TS6 IRCds and cache the value of usestrictprivmsg 2013-06-19 20:53:40 -04:00
KindOne 7704ee7107 Removed inspircd 1.1 reference from conf. Corrected a few spelling issues. 2013-06-19 20:07:15 -04:00
Adam 5ac1e9175d Set vhosts when users id to an account (and not a nick), add account arg to user ctor to ease handling users who connect already identified 2013-06-19 19:03:56 -04:00
DukePyrolator 5695c9e079 fixed a typo in the last commit. sorry. 2013-06-18 08:01:36 +02:00
DukePyrolator f92b0d6ea0 added support for hybrids new umode +S (client is connected via SSL/TLS) 2013-06-18 07:48:07 +02:00
DukePyrolator fc527b464a checking for ssl users when ajoining ssl only channels on inspircd, fixes 1466 2013-06-18 07:35:47 +02:00
Adam a93b315bd3 Fix cidr::match with odd cidr ranges 2013-06-15 23:27:01 -04:00
DukePyrolator 5246424dc0 added an 'extras' script to enable/disable extra modules before compile 2013-06-15 07:11:50 +02:00
Adam 1316147a8c Update Spanish translation, courtesy of Isaac Fontal 2013-06-15 00:09:25 +00:00
Adam 70319ab8be Fix usestrictprivmsg /msg vs / logic 2013-06-13 20:50:59 -04:00
Adam 7dd358972a Fix possible crash in Extensible::ExtensibleUnserialize if a null entry is in it 2013-06-12 02:33:30 +00:00
Adam d463ae3b1e Allow users to change their language to english when the default language is not 2013-06-12 02:30:21 +00:00
lethality ebda113f44 Made the message for unconfirmed nicks relevant to the ns_register registration setting 2013-06-06 17:28:59 +01:00
lethality 6ab6eca0a6 fixed typo, though I doubt it affects anyone/anything 2013-06-05 20:56:16 +01:00
Adam b1ba1ec8ac Made sepstream::GetToken less recursiveish 2013-06-01 21:58:08 -04:00
Adam 9956da18e3 Move OnJoinChannel event to trigger after the user has completely joined and document it more about what you should and shouldnt do in it 2013-06-01 21:56:52 -04:00
Adam b56e71ab14 Move CheckKick event to Channel and make os_forbid use it instead of kicking users in the join event, which does bad things 2013-06-01 14:55:45 -04:00
Adam 6f45d72497 Made m_mysql's Escape() function safe against escaping strings > BUFSIZE 2013-05-31 18:34:21 -04:00
Adam f5c01bf617 Fix /hs waiting 2013-05-31 01:44:32 -04:00
Adam 06bad31b18 Fix Channel::SetCorrectModes to never remove modes <= voice (currently secureops enforces everything, inclurding voice) 2013-05-28 22:17:22 -04:00
Adam 576aaff3da Don't compare system time to a users timestamp to determine when to collide with a user, if the time on services vs the ircd are different it does weird things 2013-05-28 21:07:07 -04:00
Adam c5bc8fab32 Include <iterator> in services.h as now more than one file uses it 2013-05-28 13:51:23 -04:00
Adam f6e2ebe145 Fixup last commit. We have events in log's destructor so we cant log messages from it, and this check in modulemanager is bogus/has a typo 2013-05-28 13:43:45 -04:00
Adam 37b3535543 Initially attach all modules to all events, and detach them as the events are run if they are not implemented per module 2013-05-27 19:36:37 -04:00
Adam c21e8d9204 Fix webcpanel build 2013-05-26 19:34:58 -04:00
Adam 22658d63bd Get rid of the remaining references in the core to specific services. Move more stuff out of the core to the proper modules. 2013-05-26 17:13:11 -04:00
Adam f2dee1e1d6 Update INSTALL and place some example link configurations in example.conf 2013-05-26 15:27:28 -04:00
Michael Wobst 968ef349d6 Update Hybrid protocol module for Hybrid 8.1 2013-05-25 15:47:56 -04:00
Adam d6640ed5ee Give an error message when the configuration file ends with an unterminated block 2013-05-25 14:08:50 -04:00
Adam aabc217a6b Fix /join 0 2013-05-20 23:45:41 -04:00
DukePyrolator d82391e46d made our database backup filenames more readable 2013-05-20 06:42:38 +02:00
Adam 7aa02864d2 Mark service:channels as a "botchannel" and don't try to hold them on sync, as the client should always be in the channel 2013-05-19 01:11:55 -04:00
Adam 2a8202c832 Give botserv bots assigned by persist the same botmodes as normal bots, fix some typos, remove unused variable 2013-05-18 23:45:10 -04:00
Adam be4a39ceb6 Fix desync when empty permanent channels are dropped on ircds that no have permanent channel mode 2013-05-18 15:47:26 -04:00
Adam a3dc75c61c Ignore define{} blocks defining directives to itself 2013-05-18 14:46:42 -04:00
Adam 14dc142a92 Add botserv bot usermode config option 2013-05-18 14:26:18 -04:00
Adam 51b7d53108 Add a config option for the default log bot 2013-05-18 13:08:26 -04:00
Adam 3253455792 Tabify some stuff in config.cpp 2013-05-18 12:25:26 -04:00
Adam 879b310580 Fix Windows build 2013-05-18 00:27:03 -04:00
Adam 5ff3aa7209 Yet another variable shadowing error which only show on newer gcc versions 2013-05-17 23:45:02 -04:00
Adam ca93122a68 You would think my compiler would at least warn me about this. but no. 2013-05-17 23:20:24 -04:00
Adam 2428264315 Add Redis database support 2013-05-17 23:04:18 -04:00
Adam cc4a14b0ba Removed some hard coded command names in help output 2013-05-17 22:53:55 -04:00
DukePyrolator 934b584374 do not validate nicks from ulined servers. this also fixes bug #1521 2013-05-15 03:23:20 +02:00
DukePyrolator 4237d49d41 improved handling of mlocks and topiclocks on inspircd 2013-05-12 11:09:34 +02:00
Charles Kingsley 1c36de5ab1 Fix config to default prepend_channel true for fantasy 2013-05-11 17:13:01 +01:00
Charles Kingsley da948be089 Update botserv.example.conf for xop fantasy commands 2013-05-11 17:06:16 +01:00
Adam 9384a4f088 Fix ChannelMode::CanSet 2013-05-10 16:17:24 -04:00
Charles Kingsley 4d62c673fa Fix typo in example.conf - thx rodr1go 2013-05-10 20:18:48 +01:00
Adam 7426b3b04a Readd check for users.size() == 1 before holding channels 2013-05-08 20:53:28 -04:00
Adam 735e234c2c Fixed some issues and desyncs with creating empty permanent channels on startup & dropping empty channels 2013-05-08 20:26:45 -04:00
Adam 735f0ba6cf Fix crash when we kill users because of a double free 2013-05-08 18:26:23 -04:00
Adam 9ee7c825e1 Check for peace being on before denying a mode change in cs_mode 2013-05-08 18:15:39 -04:00
Adam 912103ec13 Allow using sxlines on ircds that do not support them, since we always enforce them anyway 2013-05-08 11:31:20 -04:00
Adam f843e7bd90 Fix suspend info output in info and improved it 2013-05-08 11:13:48 -04:00
Adam d7e2ab688b Add activate_on_set option for hostserv 2013-05-08 10:40:46 -04:00
Adam 5e7085130e Fix reading multi line quotes from the conf with blank lines or lines with only whitespace 2013-05-08 10:12:31 -04:00
Adam 9b07e163c0 Make sockaddrs/cidr not throw on invalid ips to give us an easier/cheaper way to test for a valid IP 2013-05-08 09:50:43 -04:00
Adam 6859decfb8 Fix setting some default flags, reading fantasy blocks, and minusers setting being off by 1 2013-05-07 00:24:37 -04:00
Adam e23baf4297 Allow /os exception to contain CIDR masks 2013-05-07 00:06:02 -04:00
Adam c7f77b3b66 Fix a few issues with the poll socketengine 2013-05-06 23:48:18 -04:00
Adam 6578829fa6 Use I_OnUserQuit for os_session because I_OnPreUserLogoff gets called too late, after the users server can be gone. Fix a couple other small things 2013-05-06 22:18:38 -04:00
Adam ef06226521 Update the rest of modules.example.conf, default inspircd status modes to a sane rank incase they are prefixless, and 50 other things 2013-05-06 07:40:43 -04:00
Adam 4c669b947f Merge pull request #14 from attilamolnar/1.9+inspmodes
InspIRCd: Recognize a few more channel modes that weren't recognized
2013-05-05 22:49:29 -07:00
Adam 3fbb493d57 Fix extras build 2013-05-06 01:38:27 -04:00
DukePyrolator 223aa65cfa removed an unused variable 2013-05-06 07:28:23 +02:00
Adam fe54dfb37f Don't forget to CloseHandle threads on win32, spotted by Attila 2013-05-05 23:47:45 -04:00
Adam 3f5f84c92c The const char* specialization of this no longer works 2013-05-05 21:18:47 -04:00
Adam 5b3f81ea78 That doesn't work either, just don't use references.
find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
2013-05-05 21:05:43 -04:00
Adam 3e8752fe66 The default arguments are references to temporaries which fall out of scope once the function returns, so we can't use them. gcc is just nice. cronus sucks. also validate a few more config options 2013-05-05 20:38:57 -04:00
Adam 57c2b65f08 Move module header files to include/modules to fix naming conflicts with system headers 2013-05-05 03:30:08 -04:00
Adam a118946e65 Fix Windows 2013-05-05 03:04:01 -04:00
Adam ee2dcf11b8 Cache timeoutcheck and fix a typo in example.conf 2013-05-05 02:49:32 -04:00
Adam e91de41278 Add an option to sepstream to allow it to return empty tokens if multiple separators are found in a row 2013-05-05 02:00:33 -04:00
Adam 10b5b00db4 Dont check for noquit/quitstorm, check and be sure all users are gone regardless 2013-05-05 01:58:45 -04:00
Adam 2044b4d3ad Cleanup of dns stuff based on stuff found making inspircd's module 2013-05-05 01:57:24 -04:00
Adam 1d0bb9b26b Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. 2013-05-05 01:55:04 -04:00
Adam 781defb707 Move extras header files out of extras so when users copy modules out they dont need the headers too 2013-04-16 01:58:29 -05:00
Adam 16c124d34e Rewrote modules/CMakeLists.txt and do not build the 'extras' modules, if users want them built they should copy or symlink them out of extras 2013-04-15 01:00:45 -05:00
Adam f08dbced60 Allow assigning service bots via /invite 2013-04-14 17:39:01 -05:00
Adam baabc91ead Fix a few of the earlier changes to os_forbid 2013-04-13 16:36:39 -05:00
Adam 81483ae5e7 Fix build on Solaris 2013-04-13 06:05:17 +00:00
Adam 003140bf60 Fix Windows build 2013-04-12 16:20:51 -05:00
Adam b405484fb9 Fix OSX buld and a warning in modulemanager.cpp 2013-04-12 17:19:29 -04:00
Adam 9a45626379 Hack around calculate_depends not able to find libintl.h, since we deal with that later 2013-04-12 15:45:52 -05:00
Adam 10d10d057e Update Win32 build instructions slightly 2013-04-12 15:44:54 -05:00
Adam aa2844a3fc Fix not attaching cs_xop to I_OnReload 2013-04-12 02:48:24 -05:00
Adam 42c640a9b5 /ns drop help was pretty much a complete lie, so fixed it. Also require a nick param to /ns drop 2013-04-12 01:32:53 -05:00
Adam 066fc5801b Fix m_ssl 2013-04-12 01:14:56 -05:00
Adam 416eaa1e66 Explain how privileges associate themselves with modes 2013-04-11 15:58:59 -05:00
Adam ac19a5c24b Fix memoserv/rsend reply 2013-04-11 15:35:39 -05:00
Adam 6f9dd282d2 Use SetCorrectModes to set the inital modes on a founder once they register a channel 2013-04-11 15:28:53 -05:00
Adam c56d72ba84 Remove more OPDEOP references 2013-04-11 02:28:36 -05:00
Adam db4ed1cfaf Merge chanserv saset and set back into one command since it no longer needs to be separated... replace chanserv/set privilege with chanserv/administration. Dont tell users to use 'help' for more help if there is no help. 2013-04-11 00:51:08 -05:00
Adam cb64d806c1 Remove the need for having to set syntax to "" for commands with no syntax 2013-04-11 00:20:24 -05:00
Adam 4f9b7874d6 Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it 2013-04-11 00:08:28 -05:00
Adam 207c46c871 Move some of the modules in extras/ that arent really extra out of extras. Mark our modules as VENDOR and allow modules to have multple types. 2013-04-10 22:26:40 -05:00
Adam 957cb2bf93 Use the mode names inspircd gives us to add modes if we don't recognize it 2013-04-09 16:27:25 -05:00
Adam b244c74479 Allow privilege descs to be read from the config to override the defaults 2013-04-09 14:51:39 -05:00
Adam b76b2e11c8 Made privilege names case insensitive 2013-04-09 14:48:24 -05:00
Adam b35665bb54 Rename OPDEOP and OPDEOPME privileges to be similar to the other status privileges 2013-04-09 14:33:54 -05:00
Adam c3eb5b885d And my bots initially start with no server.. 2013-04-09 04:23:29 -05:00
Adam 6faf4e3823 'Me' can not exist when channels are created 2013-04-09 04:13:49 -05:00
Adam 325b018ed0 Add a default method for user's SendModeInternal 2013-04-09 00:00:52 -05:00
Adam 0a3d27a91f Made XOP privileges configurable 2013-04-08 23:37:42 -05:00
Adam bcd85ca682 Fix OperType::GetCommands 2013-04-08 01:05:25 -05:00
Adam ac40c53fe4 Fix /ns set display 2013-04-08 01:02:45 -05:00
Adam 2eae82da5c Check the channel secure option isn't set in ChannelInfo::AccessFor too 2013-04-08 01:01:27 -05:00
Adam 72493b7305 Fix secureops 2013-04-08 00:42:07 -05:00
Adam 1a37e1c048 Made auto* chanserv privileges not hard coded.
Made cs_statusupdate not remove status on users if they still match other entries.
Move privilege descriptions out of the config
2013-04-08 00:19:07 -05:00
Adam fb7fef7a84 Optimizations of much of the more commonly used code 2013-04-07 23:46:44 -05:00
Adam 36602224b8 Remove the runtime module directory on non-windows because we no longer overwrite modules on install without deleting them first 2013-04-06 19:34:35 -05:00
Adam ccecfdf445 Made the missing dependencies message from cmake more descriptive for modules 2013-04-06 19:03:07 -05:00
Adam 32d1184c00 Use the return from BufferedSocket::ProcessRead() and don't just assume its true 2013-04-06 17:08:25 -05:00
Adam 6a46a08a85 This worked before but is a little weird 2013-04-06 16:58:04 -05:00
Adam 7a2e6aa5c2 Add more logging to bs_set, cs_set, and ns_set 2013-04-06 16:43:56 -05:00
attilamolnar 34b5f9ce6e InspIRCd: Recognize a few more channel modes that weren't recognized 2013-04-06 23:10:26 +02:00
Adam f77eb0a282 Let non founders still /cs ban by wildcard mask, but limit the number of people it will kick 2013-04-06 15:59:38 -05:00
Adam 302a409136 Unset +P from perm channels when expiring 2013-04-06 15:44:03 -05:00
Adam 0b3b9fe128 Fix toggling topiclock when the channel setting is changed 2013-04-06 15:26:52 -05:00
Adam f71c7865fc Fix generic mode support 2013-04-06 15:06:39 -05:00
Adam 4ecf20b3f5 Fix ns_lists command group 2013-04-05 16:59:27 -05:00
Adam a5b8788014 Made the securefounder checks in cs_set more consistent 2013-04-05 16:27:12 -05:00
Adam 3cc7950c4b Fix not constructing the /bs set greet command 2013-04-05 15:45:03 -05:00
Adam 854bc4db0c Move around some of Init() to fork() before initing the socket engine, as some engines cant survive a fork() 2013-04-04 22:12:48 -05:00
Adam dbc77279bf Fix applying some sxlines to users on add 2013-04-04 18:52:35 -05:00
Adam c4ef566a65 Fix /hs reject syntax 2013-04-04 18:45:45 -05:00
Adam 66376335ab Fix defcon taking action on new clients 2013-04-04 15:14:17 -05:00
DukePyrolator 823bc01f66 mentioned the charybdis protocol support in the readme and example config 2013-04-02 07:02:38 +02:00
DukePyrolator 947ad6f73a fixed using language files for third party modules 2013-04-01 10:26:19 +02:00
DukePyrolator 06c8a1ef50 Revert "added include/version.h to .gitignore"
This reverts commit b3fd861b3e.
2013-04-01 09:46:55 +02:00
DukePyrolator b3fd861b3e added include/version.h to .gitignore 2013-04-01 09:42:59 +02:00
Adam 62262f4b0d Fix typo in Mode message handler 2013-03-31 00:43:11 -05:00
Adam 6e0dc0e210 Add networkinfo:modelistsize config option to set the max size of b/e/I lists 2013-03-31 00:43:11 -05:00
Adam 7e7556f064 Merge usefulness of Timer and CallBack classes into Timer, and fix it to really work 2013-03-30 23:39:43 -05:00
Adam 111d6a9178 Fix loading ttb from databases 2013-03-30 22:40:20 -05:00
Adam d23817604c Add /bs set banexpire command to configure if/when botserv bans expire 2013-03-30 22:08:51 -05:00
Adam 4694c7afb4 Split up bs_kick subcommands into real subcommands 2013-03-30 19:08:07 -05:00
Adam a52293336f This reference to see if nickcores go away during command execution is no longer necessary 2013-03-29 23:51:45 -05:00
Adam f24e17f8b4 Fix /bs set private 2013-03-29 23:50:51 -05:00
Adam 2b208de02f Fix detecting module langauge files 2013-03-29 23:50:51 -05:00
DukePyrolator 4eb5d153c0 uuups, we already have the year 2013 2013-03-30 05:42:17 +01:00
DukePyrolator 0451dd3d0d added charybdis protocol support 2013-03-30 05:21:54 +01:00
Adam c3e4f1bf7e Fix build from earlier merge 2013-03-22 18:41:23 -05:00
Adam f122f104c4 Merge remote branch 'attila/1.9+timermanager' into 1.9 2013-03-22 11:52:42 -05:00
Adam deedb3bdd7 Dont call SetCloakedHost in users constructor, just set chost, because SetCloakedHost logs a message like the user just changed their host 2013-03-22 11:46:30 -05:00
Adam d27aa03500 Merge branch '1.9' of github.com:anope/anope into 1.9 2013-03-21 23:40:16 -05:00
Adam dcffa5da6f Properly cleanup after entrymsglists and ajoinlists when destructed 2013-03-21 23:39:39 -05:00
Adam 221e79f50d Check for null pointers in HasMLock/SetMLock/RemoveMLock, cs_register can pass it some sometimes/possibly other places 2013-03-21 23:33:40 -05:00
attilamolnar d5a453b663 Improve TimerManager
Instead of adding timers into a vector and sorting them every time a timer is added, use a multimap
2013-03-20 19:42:50 +01:00
Adam a2d69fa431 Merge pull request #13 from attilamolnar/1.9+inspversionfix
InspIRCd: Don't reply to VERSION
2013-03-20 09:45:40 -07:00
Adam 6a0e4418f4 Check that channels still exist before nulling their ci pointer in channelinfos destructor
Change the persist setting on a channel to mean only that it is being
enforced ircd-side
2013-03-20 11:39:16 -05:00
attilamolnar 68eeac67c9 InspIRCd: Don't reply to VERSION
InspIRCd sends all known version strings at burst and remembers the version strings sent to it. When a client does a /version <server> the cached version string is sent.
2013-03-19 19:16:13 +01:00
Adam 731912f01e Add db_sql:import config option so we can know for sure whether or not we want a database import 2013-03-18 12:16:51 -05:00
Adam 51963915ba Remove remaining disable_ns_register references in example config 2013-03-16 21:53:03 -05:00
Adam 810685cb73 Have db_flatfile store object ids if they are set, even though it doesn't use them, so that if other database modules that use them are loaded they can keep track of objects properly 2013-03-16 20:08:39 -05:00
Adam 1a0e6b0be3 Allow autokicking real names, extbans, and channels 2013-03-15 12:27:08 -05:00
Adam 81c89bb708 Fix missing dependencies message to include the source folder, there is no specific source file on modules with multiple source files 2013-03-15 07:43:17 -05:00
Adam 01620e849a Update nickserv defult names for kill/killquick, hide email, usermask, and quit 2013-03-14 20:51:28 -05:00
Adam 4c74020a69 Add group and hide setings to fantasy{} blocks 2013-03-14 09:03:48 -05:00
Adam b95b8f0aae Fix setting BSDefFlags from the config 2013-03-14 09:03:48 -05:00
Adam 1ff7a7c1f1 Refactor mask/entry code, allow full matching (against users real host/ip) if their displayed host is their real real host. Also match against cloaked host even if full matching is not being done 2013-03-13 14:40:49 -05:00
Adam 1d16629a6d Allow opers to override chanserv kick/ban, botserv say/act, and akick's peace setting 2013-03-13 09:45:15 -05:00
Adam 72aa27ede5 Allow m_ldap_authentication to block email changes if emails are controlled by ldap, don't tell users they must change their email during initial user registration 2013-03-13 09:02:31 -05:00
Adam 05223dbe6d Identify requests hold command sources and users can disconnect between the request being dispatched and when it returns, so don't assume the source user pointer is always valid 2013-03-10 03:23:00 -05:00
DukePyrolator 06d43baf93 update the users password after a successful ldap authentication 2013-03-03 10:58:39 +01:00
DukePyrolator 5f74662100 improved the operserv mode command 2013-03-03 10:57:53 +01:00
Adam 2c68312d72 Bump for Anope 1.9.9-git 2013-03-03 02:04:33 -05:00
442 changed files with 89879 additions and 73894 deletions
+16
View File
@@ -0,0 +1,16 @@
language: cpp
compiler:
- gcc
before_script:
- mkdir build
- cd build
- cmake -DINSTDIR:STRING=~/services -DDEFUMASK:STRING=077 -DCMAKE_BUILD_TYPE:STRING=DEBUG -DUSE_RUN_CC_PL:BOOLEAN=ON ..
script:
- make
notifications:
irc:
- "irc.anope.org#anope-devel"
+28 -17
View File
@@ -2,6 +2,12 @@
cmake_minimum_required(VERSION 2.4 FATAL_ERROR) cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
if(COMMAND cmake_policy) if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif(POLICY CMP0026)
if(POLICY CMP0007)
cmake_policy(SET CMP0007 OLD)
endif(POLICY CMP0007)
endif(COMMAND cmake_policy) endif(COMMAND cmake_policy)
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows) # If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
@@ -80,7 +86,7 @@ set(DEFAULT_LIBRARY_DIRS)
set(DEFAULT_INCLUDE_DIRS) set(DEFAULT_INCLUDE_DIRS)
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes # If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
# First look for the compiler's default library directories # First look for the compiler's default library directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find only the part after "libraries: " # Find only the part after "libraries: "
@@ -146,7 +152,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(DEFAULT_INCLUDE_DIRS) if(DEFAULT_INCLUDE_DIRS)
remove_list_duplicates(DEFAULT_INCLUDE_DIRS) remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
endif(DEFAULT_INCLUDE_DIRS) endif(DEFAULT_INCLUDE_DIRS)
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") endif(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed # If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
if(MSVC) if(MSVC)
@@ -162,12 +168,12 @@ if(MSVC)
if(WSDK2008_PATH STREQUAL "/registry") if(WSDK2008_PATH STREQUAL "/registry")
# If not found, look for the 2003 SDK under HKCU # If not found, look for the 2003 SDK under HKCU
get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE) get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
if(WSDK2003_PATH STREQUAL "/regsitry") if(WSDK2003_PATH STREQUAL "/registry")
# The SDK was never found, set the path to nothing # The SDK was never found, set the path to nothing
set(WSDK_PATH "") set(WSDK_PATH "")
else(WSDK2003_PATH STREQUAL "/regsitry") else(WSDK2003_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2003_PATH}") set(WSDK_PATH "${WSDK2003_PATH}")
endif(WSDK2003_PATH STREQUAL "/regsitry") endif(WSDK2003_PATH STREQUAL "/registry")
else(WSDK2008_PATH STREQUAL "/registry") else(WSDK2008_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2008_PATH}") set(WSDK_PATH "${WSDK2008_PATH}")
endif(WSDK2008_PATH STREQUAL "/registry") endif(WSDK2008_PATH STREQUAL "/registry")
@@ -408,16 +414,14 @@ endif(NOT LOGS_DIR)
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS) read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
# Iterate through the strings found # Iterate through the strings found
foreach(VERSION_STR ${VERSIONS}) foreach(VERSION_STR ${VERSIONS})
# Get the length of the string string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
string(LENGTH ${VERSION_STR} VERSION_LEN) # Depends on CMP0007 OLD
# Subtract 16 from the string's length (8 for VERSION_, 5 more for the type, 2 for the space and leading quote, 1 for the trailing quote) list(LENGTH VERSION_OUT VERSION_LEN)
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 16") list(GET VERSION_OUT 0 VERSION_TYPE)
# Extract the type from the string if(${VERSION_LEN} GREATER 1)
string(SUBSTRING ${VERSION_STR} 8 5 VERSION_TYPE) list(GET VERSION_OUT 1 VERSION_DATA)
# Extract the actual value from the string set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
string(SUBSTRING ${VERSION_STR} 15 ${VERSION_NUM_LEN} VERSION) endif(${VERSION_LEN} GREATER 1)
# Set the version type to the value extract from above
set(VERSION_${VERSION_TYPE} ${VERSION})
endforeach(VERSION_STR ${VERSIONS}) endforeach(VERSION_STR ${VERSIONS})
# Default build version to 0 # Default build version to 0
@@ -483,12 +487,13 @@ get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# At install time, create the following additional directories # At install time, create the following additional directories
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")") install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")") install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")") if(WIN32)
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
endif(WIN32)
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory # On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
if(NOT WIN32 AND RUNGROUP) if(NOT WIN32 AND RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")") install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")") install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/runtime\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")") install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
endif(NOT WIN32 AND RUNGROUP) endif(NOT WIN32 AND RUNGROUP)
# On Windows platforms, install extra files # On Windows platforms, install extra files
@@ -496,8 +501,14 @@ if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
DESTINATION ${BIN_DIR} DESTINATION ${BIN_DIR}
) )
# Package any DLLs in src/win/
file(GLOB EXTRA_DLLS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${Anope_SOURCE_DIR}/src/win32/*.dll")
install(FILES ${EXTRA_DLLS} DESTINATION ${BIN_DIR})
endif(WIN32) endif(WIN32)
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
# Only process the CPack section if we have CPack # Only process the CPack section if we have CPack
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Various options for CPack # Various options for CPack
+5 -38
View File
@@ -2,7 +2,7 @@
# #
# Configuration script for Services. # Configuration script for Services.
# #
# Anope (c) 2003-2011 Anope team # Anope (c) 2003-2014 Anope Team
# Contact us at team@anope.org # Contact us at team@anope.org
# #
# This program is free but copyrighted software; see the file COPYING for # This program is free but copyrighted software; see the file COPYING for
@@ -130,7 +130,7 @@ export ECHO2 ECHO2SUF
INSTDIR=$HOME/services INSTDIR=$HOME/services
RUNGROUP= RUNGROUP=
UMASK= UMASK=
DEBUG="yes" DEBUG="no"
USE_RUN_CC_PL="no" USE_RUN_CC_PL="no"
USE_PCH="no" USE_PCH="no"
EXTRA_INCLUDE_DIRS= EXTRA_INCLUDE_DIRS=
@@ -176,42 +176,9 @@ done
which cmake > /dev/null which cmake > /dev/null
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
clear clear
if exists "cmake-bin" ; then : echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org or through your system's package manager."
else echo "If you have installed CMake already, ensure it is in your PATH environment variable."
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org" exit 0
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
if [ `uname` = "Linux" ] ; then
echo ""
echo "Config can attempt to install CMake for you now, which"
echo "will take approximately 50 MB of disk space."
echo "Would you like to install CMake now?"
echo2 "[y] "
read YN
if [ "$YN" = "n" ] ; then
exit 0
fi
echo "Downloading CMake... this may take a minute or two."
wget -q http://anope.org/cmake/linux-i386.php -O cmake-bin.tar.gz
if [ $? -ne 0 ] ; then
rm -f cmake-bin.tar.gz
echo "Unable to download CMake"
exit 0
fi
mkdir -p cmake-bin
tar zxf cmake-bin.tar.gz -C cmake-bin
rm -f cmake-bin.tar.gz
echo "Done!"
else
exit 0
fi
fi
CMAKE_BIN=`find cmake-bin -name cmake`
CMAKE_BIN="`pwd`/`dirname $CMAKE_BIN`"
PATH="$PATH:$CMAKE_BIN"
fi fi
########################################################################### ###########################################################################
BIN
View File
Binary file not shown.
+42 -48
View File
@@ -208,7 +208,7 @@ macro(read_from_file FILE REGEX STRINGS)
endif(REGEX STREQUAL "") endif(REGEX STREQUAL "")
else(CMAKE26_OR_BETTER) else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we need to do this manually, firstly we read the file in # For CMake 2.4.x, we need to do this manually, firstly we read the file in
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS) execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
# Next we replace all newlines with semicolons # Next we replace all newlines with semicolons
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS}) string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL "") if(REGEX STREQUAL "")
@@ -359,24 +359,22 @@ macro(find_includes SRC INCLUDES)
endmacro(find_includes) endmacro(find_includes)
############################################################################### ###############################################################################
# calculate_depends(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> [<optional output variable for includes>]) # calculate_depends(<source filename> [<optional output variable for includes>])
# #
# This macro is used in most of the src (sub)directories to calculate the # This macro is used in most of the src (sub)directories to calculate the
# header file dependencies for the given source file. # header file dependencies for the given source file.
############################################################################### ###############################################################################
macro(calculate_depends SRC SKIP VERBOSE) macro(calculate_depends SRC)
# Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not # Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not
set(CHECK_ANGLE_INCLUDES FALSE) set(CHECK_ANGLE_INCLUDES FALSE)
# Check for a third argument # Check for a third argument
if(${ARGC} GREATER 3) if(${ARGC} GREATER 1)
set(CHECK_ANGLE_INCLUDES TRUE) set(CHECK_ANGLE_INCLUDES TRUE)
endif(${ARGC} GREATER 3) endif(${ARGC} GREATER 1)
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on # Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
find_includes(${SRC} INCLUDES) find_includes(${SRC} INCLUDES)
# Reset the list of headers to empty # Reset the list of headers to empty
set(HEADERS) set(HEADERS)
# Reset skip
set(${SKIP} FALSE)
# Iterate through the strings containing #include (if any) # Iterate through the strings containing #include (if any)
foreach(INCLUDE ${INCLUDES}) foreach(INCLUDE ${INCLUDES})
# Extract the filename from the #include line # Extract the filename from the #include line
@@ -402,16 +400,16 @@ macro(calculate_depends SRC SKIP VERBOSE)
endif(FOUND_DEFAULT) endif(FOUND_DEFAULT)
endforeach(DEFAULT_INCLUDE_DIR) endforeach(DEFAULT_INCLUDE_DIR)
if(FOUND_IN_DEFAULTS EQUAL -1) if(FOUND_IN_DEFAULTS EQUAL -1)
find_in_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES) find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
if(FOUND_IN_INCLUDES EQUAL -1) if(FOUND_IN_INCLUDES EQUAL -1)
append_to_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}") append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
endif(FOUND_IN_INCLUDES EQUAL -1) endif(FOUND_IN_INCLUDES EQUAL -1)
endif(FOUND_IN_DEFAULTS EQUAL -1) endif(FOUND_IN_DEFAULTS EQUAL -1)
else(FOUND_${FILENAME}_INCLUDE) else(FOUND_${FILENAME}_INCLUDE)
set(${SKIP} TRUE) # XXX
if(VERBOSE) if(NOT ${FILENAME} STREQUAL "libintl.h")
message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.") message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
endif(VERBOSE) endif(NOT ${FILENAME} STREQUAL "libintl.h")
endif(FOUND_${FILENAME}_INCLUDE) endif(FOUND_${FILENAME}_INCLUDE)
endif(CHECK_ANGLE_INCLUDES) endif(CHECK_ANGLE_INCLUDES)
endif(QUOTE_TYPE STREQUAL "angle brackets") endif(QUOTE_TYPE STREQUAL "angle brackets")
@@ -419,12 +417,12 @@ macro(calculate_depends SRC SKIP VERBOSE)
endmacro(calculate_depends) endmacro(calculate_depends)
############################################################################### ###############################################################################
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> <output variable for linker flags> <output variable for extra depends>) # calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
# #
# This macro is used in most of the module (sub)directories to calculate the # This macro is used in most of the module (sub)directories to calculate the
# library dependencies for the given source file. # library dependencies for the given source file.
############################################################################### ###############################################################################
macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS) macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
# Set up a temporary LDFLAGS for this file # Set up a temporary LDFLAGS for this file
set(THIS_LDFLAGS "${LDFLAGS}") set(THIS_LDFLAGS "${LDFLAGS}")
# Reset extra dependencies # Reset extra dependencies
@@ -433,14 +431,16 @@ macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS)
set(LIBRARY_PATHS) set(LIBRARY_PATHS)
# Reset libraries # Reset libraries
set(LIBRARIES) set(LIBRARIES)
# Default to not skipping this file
set(${SKIP} FALSE)
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */ # Check to see if there are any lines matching: /* RequiredLibraries: [something] */
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES) if(WIN32)
read_from_file(${SRC} "/\\\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
else(WIN32)
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
endif(WIN32)
# Iterate through those lines # Iterate through those lines
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES}) foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
# Strip off the /* RequiredLibraries: and */ from the line # Strip off the /* RequiredLibraries: and */ from the line
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY}) string(REGEX REPLACE "/\\*[ \t]*Required.*Libraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Replace all commas with semicolons # Replace all commas with semicolons
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY}) string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Iterate through the libraries given # Iterate through the libraries given
@@ -464,38 +464,32 @@ macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS)
append_to_list(LIBRARIES "${LIBRARY}") append_to_list(LIBRARIES "${LIBRARY}")
endif(MSVC) endif(MSVC)
else(FOUND_${LIBRARY}_LIBRARY) else(FOUND_${LIBRARY}_LIBRARY)
# Skip this file # In the case of the library not being found, we fatally error so CMake stops trying to generate
set(${SKIP} TRUE) message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
if(VERBOSE)
# In the case of the library not being found, we fatally error so CMake stops trying to generate
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
endif(VERBOSE)
endif(FOUND_${LIBRARY}_LIBRARY) endif(FOUND_${LIBRARY}_LIBRARY)
endforeach(LIBRARY) endforeach(LIBRARY)
endforeach(REQUIRED_LIBRARY) endforeach(REQUIRED_LIBRARY)
if(NOT ${SKIP}) # Remove duplicates from the library paths
# Remove duplicates from the library paths if(LIBRARY_PATHS)
if(LIBRARY_PATHS) remove_list_duplicates(LIBRARY_PATHS)
remove_list_duplicates(LIBRARY_PATHS) endif(LIBRARY_PATHS)
endif(LIBRARY_PATHS) # Remove diplicates from the libraries
# Remove diplicates from the libraries if(LIBRARIES)
if(LIBRARIES) remove_list_duplicates(LIBRARIES)
remove_list_duplicates(LIBRARIES) endif(LIBRARIES)
endif(LIBRARIES) # Iterate through library paths and add them to the linker flags
# Iterate through library paths and add them to the linker flags foreach(LIBRARY_PATH ${LIBRARY_PATHS})
foreach(LIBRARY_PATH ${LIBRARY_PATHS}) find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS) if(FOUND_IN_DEFAULTS EQUAL -1)
if(FOUND_IN_DEFAULTS EQUAL -1) set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}") endif(FOUND_IN_DEFAULTS EQUAL -1)
endif(FOUND_IN_DEFAULTS EQUAL -1) endforeach(LIBRARY_PATH)
endforeach(LIBRARY_PATH) # Iterate through libraries and add them to the linker flags
# Iterate through libraries and add them to the linker flags foreach(LIBRARY ${LIBRARIES})
foreach(LIBRARY ${LIBRARIES}) append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}") endforeach(LIBRARY)
endforeach(LIBRARY) set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}") set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
endif(NOT ${SKIP})
endmacro(calculate_libraries) endmacro(calculate_libraries)
############################################################################### ###############################################################################
+6 -14
View File
@@ -2,33 +2,25 @@
if(NOT WIN32) if(NOT WIN32)
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE}) find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS}) find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
find_library(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE}) find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT) if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE) set(GETTEXT_FOUND TRUE)
if(GETTEXT_LIBRARY)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
endif(GETTEXT_LIBRARY)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT) endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
else(NOT WIN32) else(NOT WIN32)
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE}) find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS}) find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE}) find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY) if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE) set(GETTEXT_FOUND TRUE)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY) set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
endif(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
endif(NOT WIN32) endif(NOT WIN32)
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use # If we found everything we need set variables correctly for lang/CMakeLists.txt to use
if(GETTEXT_FOUND) if(GETTEXT_FOUND)
include_directories("${GETTEXT_INCLUDE}") include_directories("${GETTEXT_INCLUDE}")
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT}) set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
if(WIN32)
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
else(WIN32)
if(GETTEXT_LIBRARY)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY} ${ICONV_LIBRARY})
endif(GETTEXT_LIBRARY)
endif(WIN32)
endif(GETTEXT_FOUND) endif(GETTEXT_FOUND)
+1 -1
View File
@@ -1,6 +1,6 @@
# Only install example.chk and example.conf from this directory # Only install example.chk and example.conf from this directory
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file) # NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
set(DATA example.chk botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf) set(DATA example.chk botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
install(FILES ${DATA} install(FILES ${DATA}
DESTINATION ${CONF_DIR} DESTINATION ${CONF_DIR}
) )
+167 -80
View File
@@ -3,13 +3,23 @@
*/ */
/* /*
* First, create the service. * First, create the service. If you do not want to have a 'BotServ', but do want the ability to have
* Note that an easy way to rename this service is to define{} the client name to something else. * ChanServ assigned to channels for the use of fantasy commands, you may delete the below 'service' block.
*
* Note that deleting a 'service' block for a pseudoclient that is already online will not remove the
* client, the client becomes no different from a normal service bot, so you will have to use botserv/bot
* to manually delete the client.
*
* You may then want to map some of the below commands to other services, like placing botserv/bot on
* OperServ so you can delete the below client, and mapping assign and unassign to ChanServ so users are
* able to control whether or not ChanServ is in the channel. You may also want to map botserv/set/nobot
* to OperServ so you can restrict who can assign the other core service clients.
*/ */
service service
{ {
/* /*
* The name of the BotServ client. * The name of the BotServ client.
* If you change this value, you probably want to change the client directive in the configuration for the botserv module too.
*/ */
nick = "BotServ" nick = "BotServ"
@@ -56,17 +66,16 @@ service
* *
* Provides essential functionality for BotServ. * Provides essential functionality for BotServ.
*/ */
module { name = "botserv" } module
/*
* Configuration for BotServ provided by bs_main.
*/
botserv
{ {
name = "botserv"
/* /*
* The name of the client that should be BotServ. * The name of the client that should be BotServ.
*
* This directive is optional.
*/ */
name = "BotServ" client = "BotServ"
/* /*
* The default bot options for newly registered channels. Note that changing these options * The default bot options for newly registered channels. Note that changing these options
@@ -82,7 +91,7 @@ botserv
* *
* This directive is optional, if left blank, there will be no defaults. * This directive is optional, if left blank, there will be no defaults.
*/ */
defaults="greet fantasy" defaults = "greet fantasy"
/* /*
* The minimum number of users there must be in a channel before the bot joins it. The best * The minimum number of users there must be in a channel before the bot joins it. The best
@@ -91,19 +100,6 @@ botserv
*/ */
minusers = 1 minusers = 1
/*
* The maximum number of entries a single bad words list can have. Setting it too high can
* reduce performance slightly.
*/
badwordsmax = 32
/*
* The amount of time that data for a user is valid in BotServ. If the data exceeds this time,
* it is reset or deleted depending on the case. Do not set it too high, otherwise your
* resources will be slightly affected.
*/
keepdata = 10m
/* /*
* The bots are currently not affected by any modes or bans when they try to join a channel. * The bots are currently not affected by any modes or bans when they try to join a channel.
* But some people may want to make it act like a real bot, that is, for example, remove all * But some people may want to make it act like a real bot, that is, for example, remove all
@@ -116,26 +112,17 @@ botserv
#smartjoin = yes #smartjoin = yes
/* /*
* If set, the bots will use a kick reason that does not state the word when it is kicking. * Modes to set on service bots when they join channels, comment this out for no modes
* This is especially useful if you have young people on your network.
* *
* This directive is optional. * This directive is optional.
*/ */
gentlebadwordreason = yes botmodes = "ao"
/* /*
* If set, BotServ will use case sensitive checking for badwords. * User modes to set on service bots. Read the comment about the service:modes directive
* * on why this can be a bad idea to set.
* This directive is optional.
*/ */
#casesensitive = yes #botumodes = "i"
/*
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
*/
#fantasycharacter = "!."
} }
/* /*
@@ -155,22 +142,27 @@ command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
/* /*
* bs_assign * bs_assign
* *
* Provides the commands botserv/assign and botserv/unassign. * Provides the commands:
* botserv/assign - Used to assign BotServ bots to channels
* botserv/unassign - Used to unassign BotServ bots
* botserv/set/nobot - Used to prohibit channels from being assigned BotServ bots.
* *
* Used for assigning and unassigning bots to channels. * Used for assigning and unassigning bots to channels.
*/ */
module { name = "bs_assign" } module { name = "bs_assign" }
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; } command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; }
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; } command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
/* /*
* bs_autoassign * bs_autoassign
* *
* Allows service bots to be automatically assigned to channels upon registration. * Allows service bots to be automatically assigned to channels upon registration.
*/ */
#module { name = "bs_autoassign" } #module
bs_autoassign
{ {
name = "bs_autoassign"
/* /*
* Automatically assign ChanServ to channels upon registration. * Automatically assign ChanServ to channels upon registration.
*/ */
@@ -184,7 +176,22 @@ bs_autoassign
* *
* Used for controlling the channel badword list. * Used for controlling the channel badword list.
*/ */
module { name = "bs_badwords" } module
{
name = "bs_badwords"
/*
* The maximum number of entries a single bad words list can have.
*/
badwordsmax = 32
/*
* If set, BotServ will use case sensitive checking for badwords.
*
* This directive is optional.
*/
#casesensitive = yes
}
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; } command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; }
/* /*
@@ -195,7 +202,7 @@ command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords";
* Used for administrating BotServ bots. * Used for administrating BotServ bots.
*/ */
module { name = "bs_bot" } module { name = "bs_bot" }
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; } command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission = "botserv/bot"; }
/* /*
* bs_botlist * bs_botlist
@@ -231,53 +238,145 @@ command { service = "BotServ"; name = "INFO"; command = "botserv/info"; }
/* /*
* bs_kick * bs_kick
* *
* Provides the command botserv/kick. * Provides the commands:
* botserv/kick - Dummy help wrapper for the KICK command.
* botserv/kick/amsg - Configures BotServ's AMSG kicker.
* botserv/kick/badwords - Configures BotServ's badwords kicker.
* botserv/kick/bolds - Configures BotServ's bold text kiceker.
* botserv/kick/caps - Configures BotServ's capital letters kicker.
* botserv/kick/colors - Configures BotServ's color kicker.
* botserv/kick/flood - Configures BotServ's flood kicker.
* botserv/kick/italics - Configures BotServ's italics kicker.
* botserv/kick/repeat - Configures BotServ's repeat kicker.
* botserv/kick/reverses - Configures BotServ's reverse kicker.
* botserv/kick/underlines - Configures BotServ's reverse kicker.
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
* *
* Used for configuring what bots should kick for. * Used for configuring what bots should kick for.
*/ */
module { name = "bs_kick" } module
{
name = "bs_kick"
/*
* The amount of time that data for a user is valid in BotServ. If the data exceeds this time,
* it is reset or deleted depending on the case. Do not set it too high, otherwise your
* resources will be slightly affected.
*/
keepdata = 10m
/*
* If set, the bots will use a kick reason that does not state the word when it is kicking.
* This is especially useful if you have young people on your network.
*
* This directive is optional.
*/
gentlebadwordreason = yes
}
command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; } command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
command { service = "BotServ"; name = "KICK AMSG"; command = "botserv/kick/amsg"; }
command { service = "BotServ"; name = "KICK BADWORDS"; command = "botserv/kick/badwords"; }
command { service = "BotServ"; name = "KICK BOLDS"; command = "botserv/kick/bolds"; }
command { service = "BotServ"; name = "KICK CAPS"; command = "botserv/kick/caps"; }
command { service = "BotServ"; name = "KICK COLORS"; command = "botserv/kick/colors"; }
command { service = "BotServ"; name = "KICK FLOOD"; command = "botserv/kick/flood"; }
command { service = "BotServ"; name = "KICK ITALICS"; command = "botserv/kick/italics"; }
command { service = "BotServ"; name = "KICK REPEAT"; command = "botserv/kick/repeat"; }
command { service = "BotServ"; name = "KICK REVERSES"; command = "botserv/kick/reverses"; }
command { service = "BotServ"; name = "KICK UNDERLINES"; command = "botserv/kick/underlines"; }
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
/* /*
* bs_set * bs_set
* *
* Provides the commands: * Provides the commands:
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
* botserv/set/nobot - Used to prohibit specific channels from being assigned BotServ bots.
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels. * botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
*
* Used for setting options such as kickers and fantasy replies.
*/ */
module { name = "bs_set" } module { name = "bs_set" }
command { service = "BotServ"; name = "SET"; command = "botserv/set"; } command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; } command { service = "BotServ"; name = "SET BANEXPIRE"; command = "botserv/set/banexpire"; }
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; } command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
/* Fantasy commands /*
* greet
*
* Provides the commands:
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels.
*/
module { name = "greet" }
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
/*
* GREET privilege.
*
* Used by 'greet'.
*
* Users with this privilege have their greet shown when they join channels.
*/
privilege
{
name = "GREET"
rank = 40
level = 5
flag = "g"
xop = "AOP"
}
/*
* fantasy
*
* Allows 'fantaisist' commands to be used in channels.
*
* Provides the commands:
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
*/
module
{
name = "fantasy"
/*
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
*/
#fantasycharacter = "!."
}
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
/*
* Fantasy commands
* *
* Fantasy commands can be executed in channels that have a BotServ bot by prefixing the * Fantasy commands can be executed in channels that have a BotServ bot by prefixing the
* command with one of the fantasy characters configured in botserv:fantasycharacter. * command with one of the fantasy characters configured in botserv's fantasycharacter
* directive.
* *
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior. * Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
*/ */
fantasy { name = "ACCESS"; command = "chanserv/access"; } fantasy { name = "ACCESS"; command = "chanserv/access"; }
fantasy { name = "AKICK"; command = "chanserv/akick"; } fantasy { name = "AKICK"; command = "chanserv/akick"; }
fantasy { name = "AOP"; command = "chanserv/aop"; } fantasy { name = "AOP"; command = "chanserv/xop"; }
fantasy { name = "BAN"; command = "chanserv/ban"; } fantasy { name = "BAN"; command = "chanserv/ban"; }
fantasy { name = "CLONE"; command = "chanserv/clone"; } fantasy { name = "CLONE"; command = "chanserv/clone"; }
fantasy { name = "DEHALFOP"; command = "chanserv/modes"; }
fantasy { name = "DEOP"; command = "chanserv/modes"; }
fantasy { name = "DEOWNER"; command = "chanserv/modes"; }
fantasy { name = "DEPROTECT"; command = "chanserv/modes"; }
fantasy { name = "DEVOICE"; command = "chanserv/modes"; }
fantasy { name = "DOWN"; command = "chanserv/down"; } fantasy { name = "DOWN"; command = "chanserv/down"; }
fantasy { name = "ENFORCE"; command = "chanserv/enforce"; } fantasy { name = "ENFORCE"; command = "chanserv/enforce"; }
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; } fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
fantasy { name = "FLAGS"; command = "chanserv/flags"; } fantasy { name = "FLAGS"; command = "chanserv/flags"; }
fantasy { name = "HALFOP"; command = "chanserv/modes"; }
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; } fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; }
fantasy { name = "HOP"; command = "chanserv/hop"; } fantasy { name = "HOP"; command = "chanserv/xop"; }
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; } fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; }
fantasy { name = "INVITE"; command = "chanserv/invite"; } fantasy { name = "INVITE"; command = "chanserv/invite"; }
fantasy { name = "K"; command = "chanserv/kick"; } fantasy { name = "K"; command = "chanserv/kick"; }
@@ -287,9 +386,13 @@ fantasy { name = "LEVELS"; command = "chanserv/levels"; }
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; } fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
fantasy { name = "LOG"; command = "chanserv/log"; } fantasy { name = "LOG"; command = "chanserv/log"; }
fantasy { name = "MODE"; command = "chanserv/mode"; } fantasy { name = "MODE"; command = "chanserv/mode"; }
fantasy { name = "QOP"; command = "chanserv/qop"; } fantasy { name = "MUTE"; command = "chanserv/ban"; kick = no; mode = "QUIET"; }
fantasy { name = "OP"; command = "chanserv/modes"; }
fantasy { name = "OWNER"; command = "chanserv/modes"; }
fantasy { name = "PROTECT"; command = "chanserv/modes"; }
fantasy { name = "QOP"; command = "chanserv/xop"; }
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; } fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; }
fantasy { name = "SOP"; command = "chanserv/sop"; } fantasy { name = "SOP"; command = "chanserv/xop"; }
fantasy { name = "STATUS"; command = "chanserv/status"; } fantasy { name = "STATUS"; command = "chanserv/status"; }
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; } fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
fantasy { name = "SYNC"; command = "chanserv/sync"; } fantasy { name = "SYNC"; command = "chanserv/sync"; }
@@ -297,21 +400,5 @@ fantasy { name = "TOPIC"; command = "chanserv/topic"; }
fantasy { name = "UNBAN"; command = "chanserv/unban"; } fantasy { name = "UNBAN"; command = "chanserv/unban"; }
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; } fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
fantasy { name = "UP"; command = "chanserv/up"; } fantasy { name = "UP"; command = "chanserv/up"; }
fantasy { name = "VOP"; command = "chanserv/vop"; } fantasy { name = "VOICE"; command = "chanserv/modes"; }
fantasy { name = "VOP"; command = "chanserv/xop"; }
/* Use m_rewrite to rewrite the op, deop, etc. fantasy commands (see chanserv.conf). */
fantasy { name = "OWNER"; command = "rewrite"; }
fantasy { name = "DEOWNER"; command = "rewrite"; }
fantasy { name = "PROTECT"; command = "rewrite"; }
fantasy { name = "DEPROTECT"; command = "rewrite"; }
fantasy { name = "OP"; command = "rewrite"; }
fantasy { name = "DEOP"; command = "rewrite"; }
fantasy { name = "HALFOP"; command = "rewrite"; }
fantasy { name = "DEHALFOP"; command = "rewrite"; }
fantasy { name = "VOICE"; command = "rewrite"; }
fantasy { name = "DEVOICE"; command = "rewrite"; }
+322 -361
View File
File diff suppressed because it is too large Load Diff
+11 -5
View File
@@ -3,9 +3,10 @@
* Make sure BotServ, ChanServ and NickServ are running. * Make sure BotServ, ChanServ and NickServ are running.
*/ */
module { name = "m_chanstats" } module
chanstats
{ {
name = "m_chanstats"
/* /*
* The name of this engine. * The name of this engine.
* This must match with the name of an SQL engine block. * This must match with the name of an SQL engine block.
@@ -25,10 +26,9 @@ chanstats
/* /*
* Enable Chanstats for newly registered nicks / channels. * Enable Chanstats for newly registered nicks / channels.
* Set it to 0 to disable it.
*/ */
NSDefChanstats = 1 ns_def_chanstats = yes
CSDefChanstats = 1 cs_def_chanstats = yes
} }
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; } command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; } command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
@@ -37,9 +37,15 @@ command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/sa
module { name = "cs_fantasy_stats" } module { name = "cs_fantasy_stats" }
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; } command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; } command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; }
fantasy { name = "STATS"; command = "chanserv/stats"; }
fantasy { name = "GSTATS"; command = "chanserv/gstats"; }
module { name = "cs_fantasy_top" } module { name = "cs_fantasy_top" }
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; } command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; }
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; } command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; }
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; } command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; }
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; } command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; }
fantasy { name = "TOP"; command = "chanserv/top"; }
fantasy { name = "TOP10"; command = "chanserv/top10"; }
fantasy { name = "GTOP"; command = "chanserv/gtop"; }
fantasy { name = "GTOP10"; command = "chanserv/gtop10"; }
+2 -1
View File
@@ -37,7 +37,8 @@ cd $ANOPATH
if [ -f "$ANODATA/$ANOPIDF" ] if [ -f "$ANODATA/$ANOPIDF" ]
then then
ANOPID=`cat "$ANODATA/$ANOPIDF"` ANOPID=`cat "$ANODATA/$ANOPIDF"`
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ] kill -0 $ANOPID 2>/dev/null
if [ $? -eq 0 ]
then then
exit exit
fi fi
+279 -208
View File
@@ -21,6 +21,15 @@
* foo = bar * foo = bar
* } * }
* *
* Note that nameless blocks are allowed and are often used with comments to allow
* easily commenting an entire block, for example:
* #foobar
* {
* moo = "cow"
* foo = bar
* }
* is an entirely commented block.
*
* Keys are case insensitive. Values depend on what key - generally, information is * Keys are case insensitive. Values depend on what key - generally, information is
* given in the key comment. The quoting of values (and most other syntax) is quite * given in the key comment. The quoting of values (and most other syntax) is quite
* flexible, however, please do not forget to quote your strings: * flexible, however, please do not forget to quote your strings:
@@ -40,11 +49,6 @@
* *
* "86400", "86400s", "1440m", "24h", "1d" * "86400", "86400s", "1440m", "24h", "1d"
* *
* CAUTION:
* Please note that your services might _CRASH_ if you add more format-
* strings (%s, %d, etc.) to custom messages than Anope needs. Use the
* default messages to see how many format-strings are needed.
*
* In the documentation for each directive, one of the following will be * In the documentation for each directive, one of the following will be
* included to indicate whether an option is required: * included to indicate whether an option is required:
* *
@@ -75,17 +79,8 @@
/* /*
* [OPTIONAL] Defines * [OPTIONAL] Defines
* *
* You can define values to other values, which can be used to easially change * You can define values to other values, which can be used to easily change
* every value in the configuration. For example, use: * many values in the configuration. at once.
*
* define
* {
* name = "ChanServ"
* value = "ChannelServ"
* }
*
* To replace every occurance of ChanServ with ChannelServ in the configuration file,
* and in every included configuration file (such as chanserv.example.conf).
*/ */
/* /*
@@ -106,19 +101,17 @@ define
* the output from it will be included into your configuration. * the output from it will be included into your configuration.
*/ */
/* #include
include
{ {
type = "file" type = "file"
name = "some.conf" name = "some.conf"
} }
include #include
{ {
type = "executable" type = "executable"
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf" name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
} }
*/
/* /*
* [REQUIRED] IRCd Config * [REQUIRED] IRCd Config
@@ -126,6 +119,37 @@ include
* This section is used to set up Anope to connect to your IRC network. * This section is used to set up Anope to connect to your IRC network.
* This section can be included multiple times, and Anope will attempt to * This section can be included multiple times, and Anope will attempt to
* connect to each server until it finally connects. * connect to each server until it finally connects.
*
* Each uplink IRCd should have a corresponding configuration to allow Services
* to link to it.
*
* An example configuration for InspIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* <link name="services.localhost.net"
* ipaddr="127.0.0.1"
* port="7000"
* sendpass="mypassword"
* recvpass="mypassword">
* <uline server="services.localhost.net" silent="yes">
* <bind address="127.0.0.1" port="7000" type="servers">
*
* An example configuration for UnrealIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* link services.localhost.net
* {
* username *;
* hostname *;
* bind-ip "127.0.0.1";
* port 7000;
* hub *;
* password-connect "mypassword";
* password-receive "mypassword";
* class servers;
* };
* ulines { services.localhost.net; };
* listen 127.0.0.1:7000;
*/ */
uplink uplink
{ {
@@ -144,7 +168,7 @@ uplink
/* /*
* Enable if Services should connect using SSL. * Enable if Services should connect using SSL.
* You must have m_ssl loaded for this to work. * You must have an SSL module loaded for this to work.
*/ */
ssl = no ssl = no
@@ -155,7 +179,7 @@ uplink
* *
* Refer to your IRCd documentation for how this is to be done. * Refer to your IRCd documentation for how this is to be done.
*/ */
port = 6667 port = 7000
/* /*
* The password to send to the IRC server for authentication. * The password to send to the IRC server for authentication.
@@ -188,7 +212,7 @@ serverinfo
/* /*
* The local address that Services will bind to before connecting to the remote * The local address that Services will bind to before connecting to the remote
* server. This may be useful for multihomed hosts. If ommited, Services will let * server. This may be useful for multihomed hosts. If omitted, Services will let
* the Operating System choose the local address. This directive is optional. * the Operating System choose the local address. This directive is optional.
* *
* If you don't know what this means or don't need to use it, just leave this * If you don't know what this means or don't need to use it, just leave this
@@ -205,13 +229,13 @@ serverinfo
/* /*
* The filename containing the Services process ID. The path is relative to the * The filename containing the Services process ID. The path is relative to the
* services root directory. If not given, defaults to "data/services.pid". * services root directory.
*/ */
pid = "data/services.pid" pid = "data/services.pid"
/* /*
* The filename containing the Message of the Day. The path is relative to the * The filename containing the Message of the Day. The path is relative to the
* services root directory. If not given, defaults to "conf/services.motd". * services root directory.
*/ */
motd = "conf/services.motd" motd = "conf/services.motd"
} }
@@ -224,8 +248,8 @@ serverinfo
* *
* Supported: * Supported:
* - bahamut * - bahamut
* - charybdis
* - hybrid * - hybrid
* - inspircd11
* - inspircd12 * - inspircd12
* - inspircd20 * - inspircd20
* - ngircd * - ngircd
@@ -233,7 +257,26 @@ serverinfo
* - ratbox * - ratbox
* - unreal * - unreal
*/ */
module { name = "inspircd12" } module
{
name = "inspircd20"
/*
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
* services immediately reversing mode changes for locked modes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_mlock = yes
/*
* Some protocol modules can enforce topic locks server-side. This reduces the spam caused by
* services immediately reversing topic changes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_topiclock = yes
}
/* /*
* [REQUIRED] Network Information * [REQUIRED] Network Information
@@ -251,28 +294,68 @@ networkinfo
/* /*
* Set this to the maximum allowed nick length on your network. * Set this to the maximum allowed nick length on your network.
* Be sure to set this correctly, as setting this wrong can result in * Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network. This directive is optional, * Services being disconnected from the network.
* but recommended.
*/ */
nicklen = 31 nicklen = 31
/* Set this to the maximum allowed ident length on your network. /* Set this to the maximum allowed ident length on your network.
* Be sure to set this correctly, as setting this wrong can result in * Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network. This directive is optional, * Services being disconnected from the network.
* but recommended.
*/ */
userlen = 10 userlen = 10
/* Set this to the maximum allowed hostname length on your network. /* Set this to the maximum allowed hostname length on your network.
* Be sure to set this correctly, as setting this wrong can result in * Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network. This directive is optional, * Services being disconnected from the network.
* but recommended.
*/ */
hostlen = 64 hostlen = 64
/* Set this to the maximum allowed channel length on your network. /* Set this to the maximum allowed channel length on your network.
*/ */
chanlen = 32 chanlen = 32
/* The maximum number of list modes settable on a channel (such as b, e, I).
* Comment out or set to 0 to disable.
*/
modelistsize = 100
/*
* Characters allowed in nicknames. This always includes the characters described
* in RFC1459, and so does not need to be set for normal behavior. Changing this to
* include characters your IRCd doesn't support will cause your IRCd and/or Services
* to break. Multibyte characters are not supported, nor are escape sequences.
*
* It is recommended you DON'T change this.
*/
#nick_chars = ""
/*
* The characters allowed in hostnames. This is used for validating hostnames given
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
* recommended unless you know for sure your IRCd supports whatever characters you are
* wanting to use. Telling services to set a vHost containing characters your IRCd
* disallows could potentially break the IRCd and/or Services.
*
* It is recommended you DON'T change this.
*/
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
/*
* If set to true, allows vHosts to not contain dots (.).
* Newer IRCds generally do not have a problem with this, but the same warning as
* vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
allow_undotted_vhosts = false
/*
* The characters that are not allowed to be at the very beginning or very ending
* of a vHost. The same warning as vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
disallow_start_or_end = ".-"
} }
/* /*
@@ -303,11 +386,6 @@ options
*/ */
casemap = "ascii" casemap = "ascii"
/*
* The maximum length of passwords
*/
passlen = 32
/* /*
* This key is used to initiate the random number generator. This number * This key is used to initiate the random number generator. This number
* MUST be random as you want your passcodes to be random. Don't give this * MUST be random as you want your passcodes to be random. Don't give this
@@ -321,19 +399,6 @@ options
*/ */
#seed = 9866235 #seed = 9866235
/*
* Allows Services to continue file write operations (i.e. database saving)
* even if the original file cannot be backed up. Enabling this option may
* allow Services to continue operation under conditions where it might
* otherwise fail, such as a nearly-full disk.
*
* NOTE: Enabling this option can cause irrecoverable data loss under some
* conditions, so make CERTAIN you know what you're doing when you enable it!
*
* This directive is optional, and you are discouraged against enabling it.
*/
#nobackupokay = yes
/* /*
* If set, Services will perform more stringent checks on passwords. If this * If set, Services will perform more stringent checks on passwords. If this
* isn't set, Services will only disallow a password if it is the same as the * isn't set, Services will only disallow a password if it is the same as the
@@ -370,15 +435,12 @@ options
badpasstimeout = 1h badpasstimeout = 1h
/* /*
* Sets the delay between automatic database updates. This time is reset by * Sets the delay between automatic database updates.
* the OperServ UPDATE command.
*/ */
updatetimeout = 5m updatetimeout = 5m
/* /*
* Sets the delay between checks for expired nicknames and channels. The * Sets the delay between checks for expired nicknames and channels.
* OperServ UPDATE command will also cause a check for expiration and reset
* this timer.
*/ */
expiretimeout = 30m expiretimeout = 30m
@@ -400,43 +462,17 @@ options
* will use doing this. Higher values will cause less accurate timing but * will use doing this. Higher values will cause less accurate timing but
* less CPU usage. * less CPU usage.
* *
* This shouldn't be set any higher than 10 seconds, and 1 second is best
* if your system is powerful enough (or your network small enough) to
* handle it. 0 will cause the timeout list to be checked every time
* through the main loop, which will probably slow down Services too much
* to be useful on most networks.
*
* Note that this value is not an absolute limit on the period between * Note that this value is not an absolute limit on the period between
* checks of the timeout list; the previous may be as great as readtimeout * checks of the timeout list; the previous may be as great as readtimeout
* (above) during periods of inactivity. * (above) during periods of inactivity.
* *
* If this directive is not given, it will default to 0. See the 2nd paragraph * If this directive is not given, it will default to 0.
* above for performance impacts if you do this.
*/ */
timeoutcheck = 3s timeoutcheck = 3s
/*
* Sets the number of days backups of databases are kept. If you don't give it,
* or if you set it to 0, Services won't backup the databases.
*
* NOTE: Services must run 24 hours a day for this feature to work.
*
* This directive is optional, but recommended.
*/
keepbackups = 3
/*
* If set, Services will require a reason when a FORBID is added, else the
* reason is optional. This directive also applies to SUSPENDed channels as
* well.
*
* This directive is optional.
*/
forceforbidreason = yes
/* /*
* If set, this will allow users to let Services send PRIVMSGs to them * If set, this will allow users to let Services send PRIVMSGs to them
* instead of NOTICEs. Also see the defmsg option of nickserv:defaults, * instead of NOTICEs. Also see the "msg" option of nickserv:defaults,
* which also toggles the default communication (PRIVMSG or NOTICE) to * which also toggles the default communication (PRIVMSG or NOTICE) to
* use for unregistered users. * use for unregistered users.
* *
@@ -452,9 +488,7 @@ options
* Nick@ServerName - e.g. NickServ@localhost.net. This should be used in * Nick@ServerName - e.g. NickServ@localhost.net. This should be used in
* conjunction with IRCd aliases. This directive is optional. * conjunction with IRCd aliases. This directive is optional.
* *
* When using Bahamut, this option will NOT work if the uplink server is * This option will have no effect on some IRCds, such as TS6 IRCds.
* configured as a services hub. The serviceshub option is not designed to
* be used with Anope.
*/ */
#usestrictprivmsg = yes #usestrictprivmsg = yes
@@ -464,35 +498,6 @@ options
*/ */
#hidestatso = yes #hidestatso = yes
/*
* Prevents users from registering their nick if they are not connected
* for at least the given number of seconds.
*
* This directive is optional.
*/
#nickregdelay = 30
/*
* If set, forbids the registration of nicks that contain an existing
* nick with Services access. For example, if Tester is a Services Oper,
* you can't register NewTester or Tester123 unless you are an IRC
* Operator.
*
* NOTE: If you enable this, you will have to be logged in as an IRC
* operator in order to register a Services Root nick when setting up
* Anope for the first time.
*
* This directive is optional.
*/
#restrictopernicks = yes
/*
* The number of LOGON/OPER news items to display when a user logs on.
*
* This directive is optional, if no set it will default to 3.
*/
#newscount = 3
/* /*
* A space-separated list of ulined servers on your network, it is assumed that * A space-separated list of ulined servers on your network, it is assumed that
* the servers in this list are allowed to set channel modes and Services will * the servers in this list are allowed to set channel modes and Services will
@@ -505,27 +510,21 @@ options
#ulineservers = "stats.your.network" #ulineservers = "stats.your.network"
/* /*
* Modes to set on service bots when they join channels, comment this out for no modes * How long to wait between connection retries with the uplink(s).
*
* This directive is optional.
*/ */
botmodes = "ao" retrywait = 60s
/* /*
* How long to wait between connection retries, in seconds. * If set, Services will hide commands that users don't have the privilege to execute
*/
retrywait = 60
/*
* If set, Services will hide commands that users don't have the privileges to execute
* from HELP output. * from HELP output.
*/ */
hideprivilegedcommands = yes hideprivilegedcommands = yes
/* /*
* If set, Services do not allow ownership of nick names, only ownership of accounts. * If set, Services will hide commands that users can't execute because they are not
* logged in from HELP output.
*/ */
nonicknameownership = no hideregisteredcommands = yes
/* The regex engine to use, as provided by the regex modules. /* The regex engine to use, as provided by the regex modules.
* Leave commented to disable regex matching. * Leave commented to disable regex matching.
@@ -533,6 +532,21 @@ options
* Note for this to work the regex module providing the regex engine must be loaded. * Note for this to work the regex module providing the regex engine must be loaded.
*/ */
regexengine = "regex/pcre" regexengine = "regex/pcre"
/*
* A list of languages to load on startup that will be available in /nickserv set language.
* Useful if you translate Anope to your language. (Explained further in docs/LANGUAGE).
* Note that english should not be listed here because it is the base language.
*
* Removing .UTF-8 will instead use the default encoding for the language, eg. iso-8859-1 for western European languages.
*/
languages = "ca_ES.UTF-8 de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 hu_HU.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ru_RU.UTF-8 tr_TR.UTF-8"
/*
* Default language that non- and newly-registered nicks will receive messages in.
* Set to "en" to enable English. Defaults to the language the system uses.
*/
#defaultlanguage = "es_ES.UTF-8"
} }
/* /*
@@ -603,7 +617,7 @@ include
/* /*
* [OPTIONAL] NickServ * [OPTIONAL] NickServ
* *
* Includes memoserv.example.conf, which is necessary for NickServ functionality. * Includes nickserv.example.conf, which is necessary for NickServ functionality.
* *
* Remove this block to disable NickServ. * Remove this block to disable NickServ.
*/ */
@@ -657,6 +671,12 @@ log
*/ */
#source = "" #source = ""
/*
* The bot used to log generic messages which have no predefined sender if there
* is a channel in the target directive.
*/
bot = "Global"
/* /*
* The number of days to keep logfiles, only useful if you are logging to a file. * The number of days to keep logfiles, only useful if you are logging to a file.
* Set to 0 to never delete old logfiles. * Set to 0 to never delete old logfiles.
@@ -693,14 +713,14 @@ log
* create, destroy, join, part, kick, leave, mode * create, destroy, join, part, kick, leave, mode
* *
* Valid user options are: * Valid user options are:
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper * connect, disconnect, quit, nick, ident, host, mode, maxusers, oper, away
* *
* Rawio and debug are simple yes/no answers, there are no types for them. * Rawio and debug are simple yes/no answers, there are no types for them.
* *
* Note that modules may add their own values to these options. * Note that modules may add their own values to these options.
*/ */
admin = "operserv/*" admin = "*"
override = "chanserv/* nickserv/* memoserv/set botserv/* ~botserv/set" override = "chanserv/* nickserv/* memoserv/set ~botserv/set botserv/*"
commands = "~operserv/* *" commands = "~operserv/* *"
servers = "*" servers = "*"
#channels = "~mode *" #channels = "~mode *"
@@ -716,7 +736,7 @@ log
log log
{ {
target = "globops" target = "globops"
admin = "global/* operserv/global operserv/mode operserv/kick operserv/akill operserv/s*line operserv/noop operserv/jupe operserv/oline operserv/set operserv/svsnick operserv/svsjoin operserv/svspart nickserv/getpass */drop" admin = "global/* operserv/mode operserv/kick operserv/akill operserv/s*line operserv/noop operserv/jupe operserv/oline operserv/set operserv/svsnick operserv/svsjoin operserv/svspart nickserv/getpass */drop"
servers = "squit" servers = "squit"
users = "oper" users = "oper"
other = "expire/* bados akill/*" other = "expire/* bados akill/*"
@@ -737,27 +757,33 @@ log
* *
* Available privileges: * Available privileges:
* botserv/administration - Can view and assign private BotServ bots * botserv/administration - Can view and assign private BotServ bots
* botserv/fantasy - Can use fantasy commands without the FANTASIA privilege
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
* chanserv/access/list - Can view channel access and akick lists, but not modify them
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce * chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
* chanserv/auspex - Can see any information with /chanserv info * chanserv/auspex - Can see any information with /chanserv info
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames * chanserv/no-register-limit - May register an unlimited number of channels and nicknames
* chanserv/set - Can modify the settings of any channel (incl. changing of the owner!) * chanserv/kick - Can kick and ban users from channels through ChanServ
* memoserv/info - Can see any information with /memoserv info * memoserv/info - Can see any information with /memoserv info
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel * memoserv/set-limit - Can set the limit of max stored memos on any user and channel
* memoserv/no-limit - Can send memos through limits and throttles * memoserv/no-limit - Can send memos through limits and throttles
* nickserv/access - Can modify other users access list * nickserv/access - Can modify other users access and certificate lists
* nickserv/alist - Can see the access list of other users * nickserv/alist - Can see the channel access list of other users
* nickserv/auspex - Can see any information with /nickserv info * nickserv/auspex - Can see any information with /nickserv info
* nickserv/confirm - Can confirm other users nicknames * nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks * nickserv/drop - Can drop other users nicks
* operserv/config - Can modify services's configuration
* operserv/oper/modify - Can add and remove operators with at most the same privileges
* protected - Can not be kicked from channels by Services
* *
* Available commands: * Available commands:
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private * botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private
* botserv/set/nobot * botserv/set/nobot
* *
* chanserv/access/list chanserv/drop chanserv/getkey chanserv/invite * chanserv/drop chanserv/getkey chanserv/invite
* chanserv/list chanserv/suspend chanserv/topic * chanserv/list chanserv/suspend chanserv/topic
* *
* chanserv/saset/bantype chanserv/saset/description chanserv/saset/email * chanserv/saset/bantype chanserv/saset/description chanserv/saset/email chanserv/saset/keepmodes
* chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/restricted * chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/restricted
* chanserv/saset/peace chanserv/saset/persist chanserv/saset/private * chanserv/saset/peace chanserv/saset/persist chanserv/saset/private
* chanserv/saset/secure chanserv/saset/securefounder chanserv/saset/secureops * chanserv/saset/secure chanserv/saset/securefounder chanserv/saset/secureops
@@ -766,12 +792,13 @@ log
* *
* memoserv/sendall memoserv/staff * memoserv/sendall memoserv/staff
* *
* nickserv/getpass nickserv/getemail nickserv/suspend * nickserv/getpass nickserv/getemail nickserv/suspend nickserv/ajoin
* nickserv/resetpass nickserv/release nickserv/list * nickserv/list
* *
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password * nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password
* nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message * nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message
* nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire * nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
* nickserv/saset/keepmodes
* *
* hostserv/set hostserv/del hostserv/list * hostserv/set hostserv/del hostserv/list
* *
@@ -780,7 +807,7 @@ log
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen * operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist * operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
* operserv/chankill operserv/akill operserv/sqline operserv/snline operserv/userlist * operserv/chankill operserv/akill operserv/sqline operserv/snline operserv/userlist
* operserv/global operserv/oper operserv/config operserv/umode operserv/logsearch * operserv/oper operserv/config operserv/umode operserv/logsearch
* operserv/modload operserv/jupe operserv/set operserv/noop * operserv/modload operserv/jupe operserv/set operserv/noop
* operserv/quit operserv/update operserv/reload operserv/restart * operserv/quit operserv/update operserv/reload operserv/restart
* operserv/shutdown operserv/svs operserv/oline operserv/kill * operserv/shutdown operserv/svs operserv/oline operserv/kill
@@ -812,7 +839,7 @@ opertype
inherits = "Helper, Another Helper" inherits = "Helper, Another Helper"
/* What commands (see above) this opertype may use */ /* What commands (see above) this opertype may use */
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline" commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
/* What privs (see above) this opertype has */ /* What privs (see above) this opertype has */
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm" privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm"
@@ -834,7 +861,7 @@ opertype
inherits = "Services Operator" inherits = "Services Operator"
commands = "chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svs operserv/stats operserv/oline operserv/noop operserv/forbid global/* operserv/global" commands = "botserv/* chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svs operserv/stats operserv/oline operserv/noop operserv/forbid global/*"
privs = "*" privs = "*"
} }
@@ -858,7 +885,7 @@ opertype
* As with all permissions, make sure to only give trustworthy people access to Services. * As with all permissions, make sure to only give trustworthy people access to Services.
*/ */
oper #oper
{ {
/* The nickname of this services oper */ /* The nickname of this services oper */
#name = "nick1" #name = "nick1"
@@ -886,19 +913,17 @@ oper
#vhost = "oper.mynet" #vhost = "oper.mynet"
} }
/* #oper
oper
{ {
name = "nick2" name = "nick2"
type = "Services Administrator" type = "Services Administrator"
} }
oper #oper
{ {
name = "nick3" name = "nick3"
type = "Helper" type = "Helper"
} }
*/
/* /*
* [OPTIONAL] Mail Config * [OPTIONAL] Mail Config
@@ -916,8 +941,8 @@ mail
/* /*
* If set, this option enables the mail commands in Services. You may choose * If set, this option enables the mail commands in Services. You may choose
* to disable it if you have no Sendmail-compatible mailer installed. Whilst * to disable it if you have no Sendmail-compatible mailer installed. Whilst
* this directive (and entire block) is optional, it is required if the * this directive (and entire block) is optional, it is required if
* nickserv:emailregistration is set to yes. * nickserv:registration is set to yes.
*/ */
usemail = yes usemail = yes
@@ -940,18 +965,6 @@ mail
*/ */
sendfrom = "services@localhost.net" sendfrom = "services@localhost.net"
/*
* If set, RESETPASS will be restricted to services operators with access to
* nickserv/resetpass in their opertype:commands.
* This directive is optional.
*
* WARNING: If you choose to not enable this option, you should limit the
* number of processes that the services user can have at a time (you can
* create a special user for this; remember to NEVER launch Services as
* root).
*/
restrict = yes
/* /*
* This controls the minimum amount of time a user must wait before sending * This controls the minimum amount of time a user must wait before sending
* another e-mail after they have sent one. It also controls the minimum time * another e-mail after they have sent one. It also controls the minimum time
@@ -1005,7 +1018,7 @@ mail
emailchange_subject = "Email confirmation" emailchange_subject = "Email confirmation"
emailchange_message = "Hi, emailchange_message = "Hi,
You have requested to change your email address to %e. You have requested to change your email address from %e to %E.
Please type \" /msg NickServ CONFIRM %c \" to confirm this change. Please type \" /msg NickServ CONFIRM %c \" to confirm this change.
If you don't know why this mail was sent to you, please ignore it silently. If you don't know why this mail was sent to you, please ignore it silently.
@@ -1041,80 +1054,90 @@ mail
* You should only use this to upgrade old databases to a newer database format by loading * You should only use this to upgrade old databases to a newer database format by loading
* other database modules in addition to this one, which will be used when saving databases. * other database modules in addition to this one, which will be used when saving databases.
*/ */
#module { name = "db_old" } #module
db_old
{ {
name = "db_old"
/* /*
* This is the encryption type used by the databases. This must be set correctly or * This is the encryption type used by the databases. This must be set correctly or
* your passwords will not work. Valid options are: md5, oldmd5, sha1, and plain. * your passwords will not work. Valid options are: md5, oldmd5, sha1, and plain.
* You must also be sure to load the correct encryption module below in the Encryption
* Modules section so that your passwords work.
*/ */
#hash = "md5" #hash = "md5"
} }
/* /*
* [DEPRECATED] db_plain * [RECOMMENDED] db_flatfile
*
* This is the flatfile database format from Anope-1.9.2 to Anope-1.9.5.
* To convert from this format, load both this and db_flatfile. Be sure to name db_flatfile's
* target database to something else. Start Anope then shut down so the new database will be written.
* Then unload this and restart Anope, loading from the new database.
*/
#module { name = "db_plain" }
db_plain
{
/*
* The database name db_plain should use
*/
database = "anope.db"
}
/*
* db_flatfile
* *
* This is the default flatfile database format. * This is the default flatfile database format.
*/ */
module { name = "db_flatfile" } module
db_flatfile
{ {
name = "db_flatfile"
/* /*
* The database name db_flatfile should use * The database name db_flatfile should use
*/ */
database = "anope.db" database = "anope.db"
/*
* Sets the number of days backups of databases are kept. If you don't give it,
* or if you set it to 0, Services won't backup the databases.
*
* NOTE: Services must run 24 hours a day for this feature to work.
*
* This directive is optional, but recommended.
*/
keepbackups = 3
/*
* Allows Services to continue file write operations (i.e. database saving)
* even if the original file cannot be backed up. Enabling this option may
* allow Services to continue operation under conditions where it might
* otherwise fail, such as a nearly-full disk.
*
* NOTE: Enabling this option can cause irrecoverable data loss under some
* conditions, so make CERTAIN you know what you're doing when you enable it!
*
* This directive is optional, and you are discouraged against enabling it.
*/
#nobackupokay = yes
/* /*
* If enabled, services will fork a child process to save databases. * If enabled, services will fork a child process to save databases.
* *
* This is only useful with very large databases, with hundreds * This is only useful with very large databases, with hundreds
* of thousands of objects, that have a noticeable delay from * of thousands of objects, that have a noticeable delay from
* writing databases. * writing databases.
*
* If your database is large enough cause a noticeable delay when
* saving you should consider a more powerful alternative such
* as db_sql or db_redis, which incrementally update their
* databases asynchronously in real time.
*/ */
fork = no fork = no
} }
/* /*
* db_sql * db_sql and db_sql_live
* *
* This module allows saving and loading databases using one of the SQL engines. * db_sql module allows saving and loading databases using one of the SQL engines.
* This module loads the databases once on startup, then incrementally updates * This module loads the databases once on startup, then incrementally updates
* objects in the database as they are changed within Anope in real time. Changes * objects in the database as they are changed within Anope in real time. Changes
* to the SQL tables not done by Anope will have no effect and will be overwritten. * to the SQL tables not done by Anope will have no effect and will be overwritten.
* *
*/ * db_sql_live module allows saving and loading databases using one of the SQL engines.
#module { name = "db_sql" }
/*
* db_sql_live
*
* This module allows saving and loading databases using one of the SQL engines.
* This module reads and writes to SQL in real time. Changes to the SQL tables * This module reads and writes to SQL in real time. Changes to the SQL tables
* will be immediately reflected into Anope. This module should not be loaded * will be immediately reflected into Anope. This module should not be loaded
* in conjunction with db_sql, except during the initial import of existing * in conjunction with db_sql.
* databases to SQL. *
*/ */
#module { name = "db_sql_live" } #module
db_sql
{ {
name = "db_sql"
#name = "db_sql_live"
/* /*
* The SQL service db_sql(_live) should use, these are configured in modules.conf. * The SQL service db_sql(_live) should use, these are configured in modules.conf.
* For MySQL, this should probably be mysql/main. * For MySQL, this should probably be mysql/main.
@@ -1126,6 +1149,39 @@ db_sql
* Do not use the same prefix for other programs. * Do not use the same prefix for other programs.
*/ */
#prefix = "anope_db_" #prefix = "anope_db_"
/* Whether or not to import data from another database module in to SQL on startup.
* If you enable this, be sure that the database services is configured to use is
* empty and that another database module to import from is loaded before db_sql.
* After you enable this and do a database import you should disable it for
* subsequent restarts.
*
* Note that you can not import databases using db_sql_live. If you want to import
* databases and use db_sql_live you should import them using db_sql, then shut down
* and start services with db_sql_live.
*/
import = false
}
/*
* db_redis.
*
* This module allows using Redis (http://redis.io) as a database backend.
* This module requires that m_redis is loaded and configured properly.
*
* Redis 2.8 supports keyspace notifications which allows Redis to push notifications
* to Anope about outside modifications to the database. This module supports this and
* will internally reflect any changes made to the database immediately once notified.
* See docs/REDIS for more information regarding this.
*/
#module
{
name = "db_redis"
/*
* Redis database to use. This must be configured with m_redis.
*/
engine = "redis/main"
} }
/* /*
@@ -1149,8 +1205,9 @@ db_sql
* encrypted by this module. Old passwords stored in another encryption method are * encrypted by this module. Old passwords stored in another encryption method are
* automatically re-encrypted by the primary encryption module on next identify. * automatically re-encrypted by the primary encryption module on next identify.
* *
* NOTE: enc_old is Anope's previous (broken) MD5 implementation, if your databases * NOTE: enc_old is Anope's previous (broken) MD5 implementation which is present in
* were made using that module, continue to use it and do not use enc_md5. * versions prior to Anope 1.7.17. If your databases were made using that module,
* use this and not enc_md5.
* *
* NOTE: enc_sha1 relies on how the OS stores 2+ byte data internally, and is * NOTE: enc_sha1 relies on how the OS stores 2+ byte data internally, and is
* potentially broken when moving between 2 different OSes, such as moving from * potentially broken when moving between 2 different OSes, such as moving from
@@ -1161,6 +1218,7 @@ db_sql
* *
*/ */
#module { name = "enc_bcrypt" }
module { name = "enc_sha256" } module { name = "enc_sha256" }
#module { name = "enc_md5" } #module { name = "enc_md5" }
#module { name = "enc_sha1" } #module { name = "enc_sha1" }
@@ -1191,7 +1249,20 @@ include
* Requires a MySQL Database. * Requires a MySQL Database.
*/ */
#include #include
#{ {
# type = "file" type = "file"
# name = "chanstats.example.conf" name = "chanstats.example.conf"
#} }
/*
* IRC2SQL Gateway
* This module collects data about users, channels and servers. It doesn't build stats
* itself, however, it gives you the database, it's up to you how you use it.
*
* Requires a MySQL Database and MySQL version 5.5 or higher
*/
#include
{
type = "file"
name = "irc2sql.example.conf"
}
+13 -22
View File
@@ -4,12 +4,12 @@
/* /*
* First, create the service. * First, create the service.
* Note that an easy way to rename this service is to define{} the client name to something else.
*/ */
service service
{ {
/* /*
* The name of the Global client. * The name of the Global client.
* If you change this value, you probably want to change the client directive in the configuration for the global module too.
*/ */
nick = "Global" nick = "Global"
@@ -56,38 +56,30 @@ service
* *
* Provides essential functionality for Global. * Provides essential functionality for Global.
*/ */
module { name = "global" } module
/*
* Configuration for Global provided by gl_main.
*/
global
{ {
name = "global"
/* /*
* The name of the client that should be Global. * The name of the client that should be Global.
*/ */
name = "Global" client = "Global"
/*
* If set, Services will send global messages on starting up and shutting
* down/restarting.
*
* This directive is optional.
*/
#globaloncycle = yes
/* /*
* This is the global message that will be sent when Services are being * This is the global message that will be sent when Services are being
* shutdown/restarted. This directive is only required if you enable * shutdown/restarted.
* globaloncycle above. *
* This directive is optional.
*/ */
globaloncycledown = "Services are restarting, they will be back shortly - please be good while we're gone" #globaloncycledown = "Services are restarting, they will be back shortly - please be good while we're gone"
/* /*
* This is the global message that will be sent when Services (re)join the * This is the global message that will be sent when Services (re)join the
* network. This directive is only required if you enable globaloncycle above. * network.
*
* This directive is optional.
*/ */
globaloncycleup = "Services are now back online - have a nice day" #globaloncycleup = "Services are now back online - have a nice day"
/* /*
* If set, Services will hide the IRC Operator's nick in a global * If set, Services will hide the IRC Operator's nick in a global
@@ -120,5 +112,4 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
* Used for sending a message to every online user. * Used for sending a message to every online user.
*/ */
module { name = "gl_global" } module { name = "gl_global" }
command { service = "OperServ"; name = "GLOBAL"; command = "global/global"; permission = "operserv/global"; }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; } command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
+29 -41
View File
@@ -4,12 +4,12 @@
/* /*
* First, create the service. * First, create the service.
* Note that an easy way to rename this service is to define{} the client name to something else.
*/ */
service service
{ {
/* /*
* The name of the HostServ client. * The name of the HostServ client.
* If you change this value, you probably want to change the client directive in the configuration for the hostserv module too.
*/ */
nick = "HostServ" nick = "HostServ"
@@ -56,45 +56,19 @@ service
* *
* Provides essential functionality for HostServ. * Provides essential functionality for HostServ.
*/ */
module { name = "hostserv" } module
/*
* Configuration for HostServ provided by hs_main.
*/
hostserv
{ {
name = "hostserv"
/* /*
* The name of the client that should be HostServ. * The name of the client that should be HostServ.
*/ */
name = "HostServ" client = "HostServ"
/* /*
* The characters allowed in a vHost. Changing this is not recommended unless * If enabled, vhosts are activated on users immediately when they are set.
* you know for sure your IRCd supports whatever characters you are wanting to use.
* Telling services to set a vHost containing characters your IRCd disallows could
* potentially break the IRCd and/or Services. Note these are 1 byte characters, so
* UTF-8 characters will not work.
*
* It is recommended you DON'T change this.
*/ */
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-" activate_on_set = false
/*
* If set to true, allows vHosts to not contain dots (.).
* Newer IRCds generally do not have a problem with this, but the same warning as
* vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
allow_undotted_vhosts = false
/*
* The characters that are not allowed to be at the very beginning or very ending
* of a vHost. The same warning as vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
disallow_start_or_end = ".-"
} }
/* /*
@@ -129,7 +103,20 @@ command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; pe
* *
* Used for grouping one vHost to many nicks. * Used for grouping one vHost to many nicks.
*/ */
module { name = "hs_group" } module
{
name = "hs_group"
/*
* Upon nickserv/group, this option syncs the nick's main vHost to the grouped nick.
*/
syncongroup = false
/*
* This makes vhosts act as if they are per account.
*/
synconset = false
}
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; } command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
/* /*
@@ -165,17 +152,14 @@ command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
/* /*
* hs_request * hs_request
* *
* Provides the commands hostserv/request, hostserv/active, hostserv/reject, and hostserv/waiting. * Provides the commands hostserv/request, hostserv/activate, hostserv/reject, and hostserv/waiting.
* *
* Used to manage vHosts requested by users. * Used to manage vHosts requested by users.
*/ */
module { name = "hs_request" } module
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
hs_request
{ {
name = "hs_request"
/* /*
* If set, Services will send a memo to the user requesting a vHost when it's been * If set, Services will send a memo to the user requesting a vHost when it's been
* approved or rejected. * approved or rejected.
@@ -187,6 +171,10 @@ hs_request
*/ */
#memooper = yes #memooper = yes
} }
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
/* /*
* hs_set * hs_set
+98
View File
@@ -0,0 +1,98 @@
/*
* Example configuration file for the irc2sql gateway
*
*/
service
{
/*
* The name of the StatServ client.
*/
nick = "StatServ"
/*
* The username of the StatServ client.
*/
user = "StatServ"
/*
* The hostname of the StatServ client.
*/
host = "services.host"
/*
* The realname of the StatServ client.
*/
gecos = "Statistical Service"
/*
* The modes this client should use.
* Do not modify this unless you know what you are doing.
*
* These modes are very IRCd specific. If left commented, sane defaults
* are used based on what protocol module you have loaded.
*
* Note that setting this option incorrectly could potentially BREAK some, if
* not all, usefulness of the client. We will not support you if this client is
* unable to do certain things if this option is enabled.
*/
#modes = "+o"
/*
* An optional comma separated list of channels this service should join. Outside
* of log channels this is not very useful, as the service will just idle in the
* specified channels, and will not accept any types of commands.
*
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
}
module
{
name = "irc2sql"
/*
* The name of the client that should send the CTCP VERSION requests.
* It must already exist or must be defined in the following service block.
*/
client = "StatServ"
/*
* The name of the SQL engine to use.
* This must be MySQL and must match the name in the mysql{} block
*/
engine = "mysql/main"
/*
* An optional prefix to prepended to the name of each created table.
* Do not use the same prefix for other programs.
*/
prefix = "anope_"
/*
* GeoIP - Automatically adds users geoip location to the user table.
* Tables are created by irc2sql, you have to run the
* geoipupdate script after you started Anope to download
* and import the GeoIP database.
*
* The geoip database can be the smaller "country" database or the
* larger "city" database. Comment to disable geoip lookup.
*/
geoip_database = "country"
/*
* Get the CTCP version from users
* The users connecting to the network will receive a CTCP VERSION
* request from the above configured services client
*/
ctcpuser = "yes"
/*
* Send out CTCP VERSION requests to users during burst.
* Disable this if you restart Anope often and don't want to
* annoy your users.
*/
ctcpeob = "yes"
}
+26 -20
View File
@@ -4,12 +4,12 @@
/* /*
* First, create the service. * First, create the service.
* Note that an easy way to rename this service is to define{} the client name to something else.
*/ */
service service
{ {
/* /*
* The name of the MemoServ client. * The name of the MemoServ client.
* If you change this value, you probably want to change the client directive in the configuration for the memoserv module too.
*/ */
nick = "MemoServ" nick = "MemoServ"
@@ -56,18 +56,14 @@ service
* *
* Provides essential functionality for MemoServ. * Provides essential functionality for MemoServ.
*/ */
module { name = "memoserv" } module
/*
* Configuration for MemoServ provided by ms_main.
*/
memoserv
{ {
name = "memoserv"
/* /*
* The name of the client that should be MemoServ. Clients are configured * The name of the client that should be MemoServ. Clients are configured
* with the service blocks. * with the service blocks.
*/ */
name = "MemoServ" client = "MemoServ"
/* /*
* The maximum number of memos a user is allowed to keep by default. Normal users may set the * The maximum number of memos a user is allowed to keep by default. Normal users may set the
@@ -88,16 +84,6 @@ memoserv
* This directive is optional, but recommended. * This directive is optional, but recommended.
*/ */
senddelay = 3s senddelay = 3s
/*
* Allow the use of memo receipts for the following groups:
*
* 1 - Opers Only
* 2 - Everybody
*
* This directive is optional.
*/
#memoreceipt = 1
} }
/* /*
@@ -151,7 +137,17 @@ command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
* *
* Used to ignore memos from specific users. * Used to ignore memos from specific users.
*/ */
module { name = "ms_ignore" } module
{
name = "ms_ignore"
/*
* The maximum number of entries that may be on a memo ignore list.
*
* This directive is optional.
*/
max = 32
}
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; } command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
/* /*
@@ -193,7 +189,17 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
* *
* Requires configuring memoserv:memoreceipt. * Requires configuring memoserv:memoreceipt.
*/ */
#module { name = "ms_rsend" } #module
{
name = "ms_rsend"
/*
* Only allow Services Operators to use ms_rsend.
*
* This directive is optional.
*/
operonly = false
}
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; } #command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
/* /*
+411 -219
View File
@@ -4,6 +4,9 @@
* The following blocks are used to load all non-core modules, including 3rd-party modules. * The following blocks are used to load all non-core modules, including 3rd-party modules.
* Modules can be prevented from loading by commenting out the line, other modules can be added by * Modules can be prevented from loading by commenting out the line, other modules can be added by
* adding a module block. These modules will be loaded prior to Services connecting to your network. * adding a module block. These modules will be loaded prior to Services connecting to your network.
*
* Note that some of these modules are labeled EXTRA, and must be enabled prior to compiling by
* running the 'extras' script on Linux and UNIX.
*/ */
/* /*
@@ -21,9 +24,10 @@ module { name = "help" }
* Adds support for the DNS protocol. By itself this module does nothing useful, * Adds support for the DNS protocol. By itself this module does nothing useful,
* but other modules such as m_dnsbl and os_dns require this. * but other modules such as m_dnsbl and os_dns require this.
*/ */
#module { name = "m_dns" } #module
dns
{ {
name = "m_dns"
/* /*
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file. * The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
* The below should work fine on all unix like systems. Windows users will have to find their nameservers * The below should work fine on all unix like systems. Windows users will have to find their nameservers
@@ -65,6 +69,14 @@ dns
* if you want your records to be updated without much delay. * if you want your records to be updated without much delay.
*/ */
refresh = 3600 refresh = 3600
/* A notify block. There should probably be one per nameserver listed in 'nameservers'.
*/
notify
{
ip = "192.0.2.0"
port = 53
}
} }
/* /*
@@ -74,9 +86,10 @@ dns
* is found on the blacklist they will be immediately banned. This is a crucial module * is found on the blacklist they will be immediately banned. This is a crucial module
* to prevent bot attacks. * to prevent bot attacks.
*/ */
#module { name = "m_dnsbl" } #module
m_dnsbl
{ {
name = "m_dnsbl"
/* /*
* If set, Services will check clients against the DNSBLs when services connect to its uplink. * If set, Services will check clients against the DNSBLs when services connect to its uplink.
* This is not recommended, and on large networks will open a very large amount of DNS queries. * This is not recommended, and on large networks will open a very large amount of DNS queries.
@@ -96,39 +109,73 @@ m_dnsbl
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots. * a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
*/ */
add_to_akill = yes add_to_akill = yes
}
blacklist
{
/* Name of the blacklist. */
name = "rbl.efnetrbl.org"
/* How long to set the ban for. */ blacklist
time = 4h {
/* Name of the blacklist. */
name = "rbl.efnetrbl.org"
/* Reason for akill. /* How long to set the ban for. */
* %n is the nick of the user time = 4h
* %u is the ident/username of the user
* %g is the realname of the user
* %h is the hostname of the user
* %i is the IP of the user
* %r is the reason (configured below). Will be nothing if not configured.
* %N is the network name set in networkinfo:networkname
*/
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
/* Replies to ban and their reason. If this is totally ommited all replies get banned. */ /* Reason for akill.
1 = "Open Proxy" * %n is the nick of the user
/* Don't ban for result 2 or 3 */ * %u is the ident/username of the user
#2 = "spamtrap666" * %g is the realname of the user
#3 = "spamtrap50" * %h is the hostname of the user
4 = "TOR" * %i is the IP of the user
5 = "Drones / Flooding" * %r is the reply reason (configured below). Will be nothing if not configured.
} * %N is the network name set in networkinfo:networkname
blacklist */
{ reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
name = "dnsbl.dronebl.org"
time = 4h /* Replies to ban and their reason. If no relies are configured, all replies get banned. */
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded.do?ip=%i&network=%N" reply
{
code = 1
reason = "Open Proxy"
}
#reply
{
code = 2
reason = "spamtrap666"
}
#reply
{
code = 3
reason = "spamtrap50"
}
reply
{
code = 4
reason = "TOR"
/*
* If set, users identified to services at the time the result comes back
* will not be banned.
*/
#allow_account = yes
}
reply
{
code = 5
reason = "Drones / Flooding"
}
}
#blacklist
{
name = "dnsbl.dronebl.org"
time = 4h
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded?ip=%i&network=%N"
}
/* Exempt localhost from DNSBL checks */
exempt { ip = "127.0.0.1" }
} }
/* /*
@@ -136,9 +183,10 @@ blacklist
* *
* Gives users who are op in the specified help channel usermode +h (helpop). * Gives users who are op in the specified help channel usermode +h (helpop).
*/ */
#module { name = "m_helpchan" } #module
m_helpchan
{ {
name = "m_helpchan"
helpchannel = "#help" helpchannel = "#help"
} }
@@ -150,62 +198,71 @@ m_helpchan
* Note that using this will allow users to get the IP of your services. * Note that using this will allow users to get the IP of your services.
* To prevent this we recommend using a reverse proxy or a tunnel. * To prevent this we recommend using a reverse proxy or a tunnel.
*/ */
#module { name = "m_httpd" } #module
httpd
{ {
/* Name of this service. */ name = "m_httpd"
name = "httpd/main"
/* IP to listen on. */ httpd
ip = "0.0.0.0" {
/* Name of this service. */
name = "httpd/main"
/* Port to listen on. */ /* IP to listen on. */
port = 8080 ip = "0.0.0.0"
/* Time before connections to this server are timed out. */ /* Port to listen on. */
timeout = 30 port = 8080
/* Listen using SSL. Requires m_ssl. */ /* Time before connections to this server are timed out. */
#ssl = yes timeout = 30
/* If you are using a reverse proxy that sends one of the /* Listen using SSL. Requires an SSL module. */
* extforward_headers set below, set this to its IP. #ssl = yes
* This allows services to obtain the real IP of users by
* reading the forwarded-for HTTP header.
*/
#extforward_ip = "192.168.0.255"
/* The header to look for. These probably work as is. */ /* If you are using a reverse proxy that sends one of the
extforward_header = "X-Forwarded-For Forwarded-For" * extforward_headers set below, set this to its IP.
* This allows services to obtain the real IP of users by
* reading the forwarded-for HTTP header.
*/
#extforward_ip = "192.168.0.255"
/* The header to look for. These probably work as is. */
extforward_header = "X-Forwarded-For Forwarded-For"
}
} }
/* /*
* m_ldap * m_ldap [EXTRA]
* *
* This module allows other modules to use LDAP. By itself, this module does nothing useful. * This module allows other modules to use LDAP. By itself, this module does nothing useful.
*/ */
#module { name = "m_ldap" } #module
ldap
{ {
server = "ldap://127.0.0.1" name = "m_ldap"
port = 389
/* ldap
* Admin credentials used for performing searches and adding users. {
*/ server = "ldap://127.0.0.1"
admin_binddn = "cn=Manager,dc=anope,dc=org" port = 389
admin_password = "secret"
/*
* Admin credentials used for performing searches and adding users.
*/
admin_binddn = "cn=Manager,dc=anope,dc=org"
admin_password = "secret"
}
} }
/* /*
* m_ldap_authentication * m_ldap_authentication [EXTRA]
* *
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use * This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
* LDAP to authenticate users. Requires m_ldap. * LDAP to authenticate users. Requires m_ldap.
*/ */
#module { name = "m_ldap_authentication" } #module
m_ldap_authentication
{ {
name = "m_ldap_authentication"
/* /*
* The distinguished name used for searching for users's accounts. * The distinguished name used for searching for users's accounts.
*/ */
@@ -220,7 +277,7 @@ m_ldap_authentication
/* /*
* The object class used by LDAP to store user account information. * The object class used by LDAP to store user account information.
* Used for adding new users to LDAP if disable_ns_register is false. * This is used for adding new users to LDAP if registration is allowed.
*/ */
object_class = "anopeUser" object_class = "anopeUser"
@@ -242,28 +299,32 @@ m_ldap_authentication
password_attribute = "userPassword" password_attribute = "userPassword"
/* /*
* Enable this to have this module disable "/msg NickServ REGISTER". * If set, the reason to give the users who try to register with nickserv,
* including nick registration from grouping.
*
* If not set, then registration is not blocked.
*/ */
disable_ns_register = false #disable_register_reason = "To register on this network visit http://some.misconfigured.site/register"
/* /*
* The reason to give the users who try to "/msg NickServ REGISTER" if * If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
* disable_ns_register is enabled. * If not set, then email changing is not blocked.
*/ */
#disable_reason = "To register on this network, visit http://some.misconfigured.site/register" #disable_email_reason = "To change your email address visit http://some.misconfigured.site"
} }
/* /*
* m_ldap_oper * m_ldap_oper [EXTRA]
* *
* This module dynamically ties users to Anope opertypes when they identify * This module dynamically ties users to Anope opertypes when they identify
* via LDAP group membership. Requires m_ldap. * via LDAP group membership. Requires m_ldap.
* *
* Note that this doesn't give the user privileges on the IRCd, only in Services. * Note that this doesn't give the user privileges on the IRCd, only in Services.
*/ */
#module { name = "m_ldap_oper" } #module
m_ldap_oper
{ {
name = "m_ldap_oper"
/* /*
* An optional binddn to use when searching for groups. * An optional binddn to use when searching for groups.
* %a is replaced with the account name of the user. * %a is replaced with the account name of the user.
@@ -294,20 +355,100 @@ m_ldap_oper
} }
/* /*
* m_mysql * m_mysql [EXTRA]
* *
* This module allows other modules to use MySQL. * This module allows other modules to use MySQL.
*/ */
#module { name = "m_mysql" } #module
mysql
{ {
/* The name of this service. */ name = "m_mysql"
name = "mysql/main"
database = "anope" mysql
server = "127.0.0.1" {
username = "anope" /* The name of this service. */
password = "mypassword" name = "mysql/main"
port = 3306 database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mypassword"
port = 3306
}
}
/*
* m_redis
*
* This module allows other modules to use Redis.
*/
#module
{
name = "m_redis"
/* A redis database */
redis
{
/* The name of this service */
name = "redis/main"
/*
* The redis database to use. New connections default to 0.
*/
db = 0
ip = "127.0.0.1"
port = 6379
}
}
/*
* m_regex_pcre [EXTRA]
*
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
*/
#module { name = "m_regex_pcre" }
/*
* m_regex_posix [EXTRA]
*
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
* This is likely the only regex module you will not need extra libraries for.
*/
#module { name = "m_regex_posix" }
/*
* m_regex_tre [EXTRA]
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
#module { name = "m_regex_tre" }
/*
* m_rewrite
*
* Allows rewriting commands sent to/from clients.
*/
#module { name = "m_rewrite" }
#command
{
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
/* Enable m_rewrite. */
rewrite = true
/* Source message to match. A $ can be used to match anything. */
rewrite_source = "CLEAR $ USERS"
/*
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
* replaced by the number-th word from the source_message, starting from 0.
*/
rewrite_target = "KICK $1 *"
/*
* The command description. This only shows up in HELP's output.
* Comment this option to prevent the command from showing in the
* HELP command.
*/
rewrite_description = "Clears all users from a channel"
} }
/* /*
@@ -323,12 +464,13 @@ mysql
* back to services. If services are able to connect through the proxy to itself * back to services. If services are able to connect through the proxy to itself
* then it knows it is an insecure proxy, and will ban it. * then it knows it is an insecure proxy, and will ban it.
*/ */
#module { name = "m_proxyscan" } #module
m_proxyscan
{ {
name = "m_proxyscan"
/* /*
* The target IP services tells the proxy to connect back to. This must be a publicly * The target IP services tells the proxy to connect back to. This must be a publicly
* avaiable IP that remote proxies can connect to. * available IP that remote proxies can connect to.
*/ */
#target_ip = "127.0.0.1" #target_ip = "127.0.0.1"
@@ -369,41 +511,137 @@ m_proxyscan
* How long before connections should be timed out. * How long before connections should be timed out.
*/ */
timeout = 5 timeout = 5
proxyscan
{
/* The type of proxy to check for. A comma separated list is allowed. */
type = "HTTP"
/* The ports to check. */
port = "80,8080"
/* How long to set the ban for. */
time = 4h
/*
* The reason to ban the user for.
* %h is replaced with the type of proxy found.
* %i is replaced with the IP of proxy found.
* %p is replaced with the port.
*/
reason = "You have an open proxy running on your host (%t:%i:%p)"
}
} }
/* /*
* A proxyscan block (must have m_proxyscan loaded). * m_sasl
* You may have multiple proxyscan blocks. *
* Some IRCds allow "SASL" authentication to let users identify to Services
* during the IRCd user registration process. If this module is loaded, Services will allow
* authenticating users through this mechanism. Supported mechanisms are:
* PLAIN, EXTERNAL.
*/ */
proxyscan #module { name = "m_sasl" }
/*
* m_sasl_dh-aes [EXTRA]
*
* Add the DH-AES mechanism to SASL.
* Requires m_sasl to be loaded.
* Requires openssl.
*/
#module { name = "m_sasl_dh-aes" }
/*
* m_sasl_dh-blowfish [EXTRA]
*
* Add the DH-BLOWFISH mechanism to SASL.
* Requires m_sasl to be loaded.
* Requires openssl.
*/
#module { name = "m_sasl_dh-blowfish" }
/*
* m_ssl_gnutls [EXTRA]
*
* This module provides SSL services to Anope using GnuTLS, for example to
* connect to the uplink server(s) via SSL.
*
* You may only load either m_ssl_gnutls or m_ssl_openssl, bot not both.
*/
#module
{ {
/* The type of proxy to check for. A comma separated list is allowed. */ name = "m_ssl_gnutls"
type = "HTTP"
/* The ports to check. */
port = "80,8080"
/* How long to set the ban for. */
time = 4h
/* /*
* The reason to ban the user for. * An optional certificate and key for m_ssl_gnutls to give to the uplink.
* %h is replaced with the type of proxy found. *
* %i is replaced with the IP of proxy found. * You can generate your own certificate and key pair by using:
* %p is replaced with the port. *
* certtool --generate-privkey --bits 2048 --outfile anope.key
* certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
*
*/ */
reason = "You have an open proxy running on your host (%t:%i:%p)" cert = "data/anope.crt"
key = "data/anope.key"
/*
* Diffie-Hellman parameters to use when acting as a server. This is only
* required for TLS servers that want to use ephemeral DH cipher suites.
*
* This is NOT required for Anope to connect to the uplink server(s) via SSL.
*
* You can generate DH parameters by using:
*
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
*
*/
# dhparams = "data/dhparams.pem"
} }
/* /*
* m_sql_authentication * m_ssl_openssl [EXTRA]
*
* This module provides SSL services to Anope using OpenSSL, for example to
* connect to the uplink server(s) via SSL.
*
* You may only load either m_ssl_openssl or m_ssl_gnutls, bot not both.
*
*/
#module
{
name = "m_ssl_openssl"
/*
* An optional certificate and key for m_ssl_openssl to give to the uplink.
*
* You can generate your own certificate and key pair by using:
*
* openssl genrsa -out anope.key 2048
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095
*/
cert = "data/anope.crt"
key = "data/anope.key"
/*
* As of 2014 SSL 3.0 is considered insecure, but it might be enabled
* on some systems by default for compatibility reasons.
* You can use the following option to enable or disable it explicitly.
* Leaving this option not set defaults to the default system behavior.
*/
#sslv3 = no
}
/*
* m_sql_authentication [EXTRA]
* *
* This module allows authenticating users against an external SQL database using a custom * This module allows authenticating users against an external SQL database using a custom
* query. * query.
*/ */
#module { name = "m_sql_authentication" } #module
m_sql_authentication
{ {
name = "m_sql_authentication"
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */ /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
engine = "mysql/main" engine = "mysql/main"
@@ -433,26 +671,48 @@ m_sql_authentication
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))" query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
/* /*
* Enable this to have this module disable "/msg NickServ REGISTER". * If set, the reason to give the users who try to "/msg NickServ REGISTER".
*/ * If not set, then registration is not blocked.
disable_ns_register = false
/*
* The reason to give the users who try to "/msg NickServ REGISTER" if
* disable_ns_register is enabled.
*/ */
#disable_reason = "To register on this network visit http://some.misconfigured.site/register" #disable_reason = "To register on this network visit http://some.misconfigured.site/register"
/*
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
* If not set, then email changing is not blocked.
*/
#disable_email_reason = "To change your email address visit http://some.misconfigured.site"
} }
/* /*
* m_sql_oper * m_sql_log [EXTRA]
*
* This module adds an additional target option to log{} blocks
* that allows logging Service's logs to SQL. To log to SQL, add
* the SQL service name to log:targets prefixed by sql_log:. For
* example:
*
* log
* {
* targets = "services.log sql_log:mysql/main"
* ...
* }
*
* By default this module logs to the table `logs`, and will create
* it if it doesn't exist. This module does not create any indexes (keys)
* on the table and it is recommended you add them yourself as necessary.
*/
#module { name = "m_sql_log" }
/*
* m_sql_oper [EXTRA]
* *
* This module allows granting users services operator privileges and possibly IRC Operator * This module allows granting users services operator privileges and possibly IRC Operator
* privileges based on an external SQL database using a custom query. * privileges based on an external SQL database using a custom query.
*/ */
#module { name = "m_sql_oper" } #module
m_sql_oper
{ {
name = "m_sql_oper"
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */ /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
engine = "mysql/main" engine = "mysql/main"
@@ -470,90 +730,46 @@ m_sql_oper
} }
/* /*
* m_sqlite * m_sqlite [EXTRA]
* *
* This module allows other modules to use SQLite. * This module allows other modules to use SQLite.
*/ */
#module { name = "m_sqlite" } #module
sqlite
{ {
/* The name of this service. */ name = "m_sqlite"
name = "sqlite/main"
/* The database name, it will be created if it does not exist. */ /* A SQLite database */
database = "anope.db" sqlite
{
/* The name of this service. */
name = "sqlite/main"
/* The database name, it will be created if it does not exist. */
database = "anope.db"
}
} }
/* /*
* m_regex_pcre * webcpanel
* *
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library. * This module creates a web configuration panel that allows users and operators to perform any task
*/ * as they could over IRC. If you are using the default configuration you should be able to access
module { name = "m_regex_pcre" } * this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
/*
* m_regex_posix
* *
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions. * This module requires m_httpd.
* This is likely the only regex module you will not need extra libraries for.
*/ */
#module { name = "m_regex_posix" } #module
/*
* m_regex_tre
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
#module { name = "m_regex_tre" }
/*
* m_rewrite
*
* Allows rewriting commands sent to/from clients.
*/
module { name = "m_rewrite" }
#command
#{
# service = "ChanServ"; name = "CLEAR"; command = "rewrite"
#
# /* Enable m_rewrite. */
# rewrite = true
#
# /* Source message to match. A $ can be used to match anything. */
# rewrite_source = "CLEAR $ USERS"
#
# /*
# * Message to rewrite the source message to. A $ followed by a number, eg $0, gets
# * replaced by the number-th word from the source_message, starting from 0.
# */
# rewrite_target = "KICK $1 *"
#
# /*
# * The command description. This only shows up in HELP's output.
# * Comment this option to prevent the command from showing in the
# * HELP command.
# */
# rewrite_description = "Clears all users from a channel"
#}
/*
* m_ssl
*
* This module uses SSL to connect to the uplink server(s).
*/
#module { name = "m_ssl" }
ssl
{ {
/* name = "webcpanel"
* An optional certificate and key for m_ssl to give to the uplink.
* /* Web server to use. */
* You can generate your own certificate and key pair by using: server = "httpd/main";
*
* openssl genrsa -out anope.key 2048 /* Template to use. */
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095 template = "default";
*/
cert = "data/anope.crt" /* Page title. */
key = "data/anope.key" title = "Anope IRC Services";
} }
/* /*
@@ -562,9 +778,10 @@ ssl
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope. * Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
* By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries. * By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
*/ */
#module { name = "m_xmlrpc" } #module
m_xmlrpc
{ {
name = "m_xmlrpc"
/* Web service to use. Requires m_httpd. */ /* Web service to use. Requires m_httpd. */
server = "httpd/main" server = "httpd/main"
} }
@@ -576,28 +793,3 @@ m_xmlrpc
* Requires m_xmlrpc. * Requires m_xmlrpc.
*/ */
#module { name = "m_xmlrpc_main" } #module { name = "m_xmlrpc_main" }
/*
* webcpanel
*
* This module creates a web configuration panel that allows users and operators to perform any task
* as they could over IRC. If you are using the default configuration you should be able to access
* this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
*
* This module requires m_httpd.
*/
#module { name = "webcpanel" }
webcpanel
{
/* Web server to use. */
server = "httpd/main";
/* Template to use. */
template = "default";
/* Page title. */
title = "Anope IRC Services";
/* Whether or not to use https on redirecting URLs. */
ssl = no
}
+240 -191
View File
@@ -4,12 +4,12 @@
/* /*
* First, create the service. * First, create the service.
* Note that an easy way to rename this service is to define{} the client name to something else.
*/ */
service service
{ {
/* /*
* The name of the NickServ client. * The name of the NickServ client.
* If you change this value, you probably want to change the client directive in the configuration for the nickserv module too.
*/ */
nick = "NickServ" nick = "NickServ"
@@ -56,38 +56,28 @@ service
* *
* Provides essential functionality for NickServ. * Provides essential functionality for NickServ.
*/ */
module { name = "nickserv" } module
/*
* Configuration for NickServ provided by ns_main.
*/
nickserv
{ {
name = "nickserv"
/* /*
* The name of the client that should be NickServ. * The name of the client that should be NickServ.
*/ */
name = "NickServ" client = "NickServ"
/* /*
* Force users to give an e-mail address when they register a nick. * Force users to give an e-mail address when they register a nick.
* *
* This directive is recommended to be enabled, and required if e-mail registration is enabled. * This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
*/ */
forceemail = yes forceemail = yes
/* /*
* Require users who change their email address to confirm they * Require users who change their email address to confirm they
* own it. * own their new email.
*/ */
confirmemailchanges = no confirmemailchanges = no
/*
* Registration confirmation setting. Set to "none" for no registration confirmation,
* "mail" for email confirmation, and "admin" to have services operators manually confirm
* every registration. Set to "disable" to completely disable all registrations.
*/
registration = "none"
/* /*
* A message sent to users on connect if they use an unregistered nick. * A message sent to users on connect if they use an unregistered nick.
* *
@@ -101,40 +91,27 @@ nickserv
* by spaces. * by spaces.
* *
* The options are: * The options are:
* - kill: Kill nick if not identified within 60 seconds * - killprotect: Kill nick if not identified within 60 seconds
* - killquick: Kill nick if not identified within 20 seconds, this one overrides the above * - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the above
* option and the above must be specified with this one * option and the above must be specified with this one
* - secure: Enable nickname security, requiring the nick's password before any operations * - ns_secure: Enable nickname security, requiring the nick's password before any operations
* can be done on it * can be done on it
* - private: Hide the nick from NickServ's LIST command * - ns_private: Hide the nick from NickServ's LIST command
* - hideemail: Hide's the nick's e-mail address from NickServ's INFO command * - hide_email: Hide's the nick's e-mail address from NickServ's INFO command
* - hideusermask: Hide's the nick's last or current user@host from NickServ's INFO command * - hide_mask: Hide's the nick's last or current user@host from NickServ's INFO command
* - hidequit: Hide's the nick's last quit message * - hide_quit: Hide's the nick's last quit message
* - memo_signon: Notify user if they have a new memo when they sign into the nick * - memo_signon: Notify user if they have a new memo when they sign into the nick
* - memo_receive: Notify user if they have a new memo as soon as it's received * - memo_receive: Notify user if they have a new memo as soon as it's received
* - autoop: User will be automatically opped in channels they enter and have access to * - memo_mail: Notify user if they have a new memo by mail
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires * - autoop: User will be automatically opped in channels they enter and have access to
* options:useprivmsg to be enabled as well * - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
* options:useprivmsg to be enabled as well
* - ns_keepmodes: Enables keepmodes, which retains user modes across sessions
* *
* This directive is optional, if left blank, the options will default to secure, memo_signon, and * This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
* memo_receive. If you really want no defaults, use "none" by itself as the option. * memo_receive. If you really want no defaults, use "none" by itself as the option.
*/ */
defaults="secure private hideemail hideusermask memo_signon memo_receive autoop" defaults = "ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
/*
* A list of languages to load on startup that will be available in /nickserv set language.
* Useful if you translate Anope to your language. (Explained further in docs/LANGUAGE).
* Note that english should not be listed here because it is the base language.
*
* Removing .UTF-8 will instead use the default encoding for the language, eg. iso-8859-1 for western European languages.
*/
languages = "ca_ES.UTF-8 de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 hu_HU.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ru_RU.UTF-8 tr_TR.UTF-8"
/*
* Default language that non- and newly-registered nicks will receive messages in.
* Leave empty to default to English.
*/
#defaultlanguage = "es_ES.UTF-8"
/* /*
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This * The minimum length of time between consecutive uses of NickServ's REGISTER command. This
@@ -142,13 +119,6 @@ nickserv
*/ */
regdelay = 30s regdelay = 30s
/*
* The minimum length of time between consecutive uses of NickServ's RESEND command.
*
* This directive is optional, but recommended. If not set, this restriction will be disabled.
*/
resenddelay = 90s
/* /*
* The length of time before a nick's registration expires. * The length of time before a nick's registration expires.
* *
@@ -157,87 +127,13 @@ nickserv
expire = 21d expire = 21d
/* /*
* The length of time before a suspended nick becomes unsuspended. * Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND,
*
* This directive is optional. If not set, the default is never.
*/
#suspendexpire = 90d
/*
* The length of time a user using an unconfirmed account has
* before the account will be released for general use again.
*
* This directive is only required if the e-mail registration option is enabled.
*/
#unconfirmedexpire = 1d
/*
* The maximum number of nicks allowed in a group.
*
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
*/
maxaliases = 16
/*
* The maximum number of entries allowed on a nickname's access list.
*/
accessmax = 32
/*
* The username (and possibly hostname) used for the fake user created when NickServ collides
* a user.
*/
enforceruser = "enforcer"
enforcerhost = "localhost.net"
/*
* The delay before a NickServ collided nick is released.
*/
releasetimeout = 1m
/*
* Allow the use of the IMMED option in the NickServ SET KILL command.
*
* This directive is optional.
*/
#allowkillimmed = yes
/*
* If set, the NickServ GROUP command won't allow any group change. This is recommended for
* better performance and to protect against nick stealing, however users will have less
* flexibility.
*
* This directive is optional, but recommended.
*/
#nogroupchange = yes
/*
* The maximum number of nicks to be returned for a NickServ LIST command.
*/
listmax = 50
/*
* When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
* with this value. The rest will be made up of 6 or 7 digits.
*/
guestnickprefix = "Guest"
/*
* Prevents the use of the ACCESS (excluding the LIST subcommand), DROP, FORBID, SUSPEND,
* GETPASS and SET PASSWORD commands by services operators on other services operators. * GETPASS and SET PASSWORD commands by services operators on other services operators.
* *
* This directive is optional, but recommended. * This directive is optional, but recommended.
*/ */
secureadmins = yes secureadmins = yes
/*
* If set, any user wanting to use the privileges of Services Root, Services Admin, or Services
* Operator must have been logged as an IRC Operator with the /OPER command.
*
* This directive is optional, but recommended.
*/
strictprivileges = yes
/* /*
* If set, Services will set the channel modes a user has access to upon identifying, assuming * If set, Services will set the channel modes a user has access to upon identifying, assuming
* they are not already set. * they are not already set.
@@ -247,17 +143,17 @@ nickserv
modeonid = yes modeonid = yes
/* /*
* If set, Services will add the usermask of registering users to the access list of their * If set, Services will set these user modes on any user who identifies.
* newly created account. If not set, users will always have to identify to NickServ before *
* being recognized, unless they manually add an address to the access list of their account.
* This directive is optional. * This directive is optional.
*/ */
addaccessonreg = yes #modesonid = "+R"
/* /*
* The maximum number of channels a user can have on NickServ's AJOIN command. * If set, Services will not show netsplits in the last quit message field
* of NickServ's INFO command.
*/ */
ajoinmax = 10 hidenetsplitquit = no
/* /*
* If set, is the length of time NickServ's killquick and kill options wait before * If set, is the length of time NickServ's killquick and kill options wait before
@@ -267,32 +163,53 @@ nickserv
kill = 60s kill = 60s
/* /*
* If set, Services will set these user modes on any user who identifies. * If set, forbids the registration of nicks that contain an existing
* nick with Services access. For example, if Tester is a Services Oper,
* you can't register NewTester or Tester123 unless you are an IRC
* Operator.
*
* NOTE: If you enable this, you will have to be logged in as an IRC
* operator in order to register a Services Root nick when setting up
* Anope for the first time.
* *
* This directive is optional. * This directive is optional.
*/ */
#modesonid = "+R" #restrictopernicks = yes
/* /*
* If set, Services will svsnick and svsjoin users who use the recover * The username, and possibly hostname, used for fake users created when Services needs to
* command on an identified user to the nick and channels of the recovered user. * hold a nickname.
*/
enforceruser = "enforcer"
enforcerhost = "services.host"
/*
* The length of time Services hold nicknames.
* *
* This directive is opional. * This directive is optional, but recommended. If not set it defaults to 1 minute.
*/ */
restoreonrecover = yes releasetimeout = 1m
/* /*
* Some IRCds allow "SASL" authentication to let users identify to Services * When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
* during the IRCd user registration process. If set, Services will allow * with this value. The rest will be made up of 6 or 7 digits.
* authenticating users through this mechanism. * Make sure this is a valid nick and Nicklen+7 is not longer than the allowed Nicklen on your ircd.
*
* This directive is optional. If not set it defaults to "Guest"
*/ */
sasl = yes guestnickprefix = "Guest"
/* /*
* If set, Services will not show netsplits in the last quit message field * If set, Services do not allow ownership of nick names, only ownership of accounts.
* of NickServ's INFO command.
*/ */
hidenetsplitquit = no nonicknameownership = no
/*
* The maximum length of passwords
*
* This directive is optional. If not set it defaults to 32.
*/
passlen = 32
} }
/* /*
@@ -314,7 +231,7 @@ nickserv
command_group command_group
{ {
name = "nickserv/admin" name = "nickserv/admin"
description = "Services Operator commands" description = _("Services Operator commands")
} }
/* Give it a help command. */ /* Give it a help command. */
@@ -327,7 +244,24 @@ command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
* *
* Used for configuring what hosts have access to your account. * Used for configuring what hosts have access to your account.
*/ */
module { name = "ns_access" } module
{
name = "ns_access"
/*
* The maximum number of entries allowed on a nickname's access list.
* If not set, the default is 32. This number cannot be set to 0.
*/
accessmax = 32
/*
* If set, Services will add the usermask of registering users to the access list of their
* newly created account. If not set, users will always have to identify to NickServ before
* being recognized, unless they manually add an address to the access list of their account.
* This directive is optional.
*/
addaccessonreg = yes
}
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; } command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
/* /*
@@ -337,7 +271,15 @@ command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
* *
* Used for configuring channels to join once you identify. * Used for configuring channels to join once you identify.
*/ */
module { name = "ns_ajoin" } module
{
name = "ns_ajoin"
/*
* The maximum number of channels a user can have on NickServ's AJOIN command.
*/
ajoinmax = 10
}
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; } command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
/* /*
@@ -357,7 +299,16 @@ command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
* *
* Used for configuring your SSL certificate list, which can be used to automatically identify you. * Used for configuring your SSL certificate list, which can be used to automatically identify you.
*/ */
module { name = "ns_cert" } module
{
name = "ns_cert"
/*
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
*/
max = 5
}
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; } command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
/* /*
@@ -399,7 +350,26 @@ command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"
* *
* Used for controlling nick groups. * Used for controlling nick groups.
*/ */
module { name = "ns_group" } module
{
name = "ns_group"
/*
* The maximum number of nicks allowed in a group.
*
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
*/
maxaliases = 16
/*
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
* prevent users from accidentally dropping their nicks, as it forces users to explicitly
* drop their nicks before adding it to another group.
*
* This directive is optional, but recommended.
*/
nogroupchange = yes
}
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; } command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; } command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; } command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; }
@@ -418,22 +388,40 @@ command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"
/* /*
* ns_info * ns_info
* *
* Provides the command nickserv/info. * Provides the commands:
* nickserv/info. - Used for gathering information about an account.
* nickserv/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info.
* *
* Used for gathering information about an account.
*/ */
module { name = "ns_info" } module { name = "ns_info" }
command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; } command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
/* /*
* ns_list * ns_list
* *
* Provides the command nickserv/list. * Provides the commands:
* nickserv/list - Used for retrieving and searching the registered account list.
* nickserv/set/private, nickserv/saset/private - Used for configuring whether or a users account shows up in nickserv/list.
* *
* Used for retrieving and searching the registered account list.
*/ */
module { name = "ns_list" } module
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; command = "nickserv/admin"; } {
name = "ns_list"
/*
* The maximum number of nicks to be returned for a NickServ LIST command.
*/
listmax = 50
}
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
/* /*
* ns_logout * ns_logout
@@ -452,9 +440,20 @@ command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout"; }
* *
* Used for recovering your nick from services or another user. * Used for recovering your nick from services or another user.
*/ */
module { name = "ns_recover" } module
{
name = "ns_recover"
/*
* If set, Services will svsnick and svsjoin users who use the recover
* command on an identified user to the nick and channels of the recovered user.
*
* This directive is opional.
*/
restoreonrecover = yes
}
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; } command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
# Uncomment below to emulate 1.8's behavior of ghost, recover, and release. # Uncomment below to emulate 1.8's behavior of ghost and release.
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; } #command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; } #command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
@@ -465,7 +464,38 @@ command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover";
* *
* Used for registering accounts. * Used for registering accounts.
*/ */
module { name = "ns_register" } module
{
name = "ns_register"
/*
* Registration confirmation setting. Set to "none" for no registration confirmation,
* "mail" for email confirmation, and "admin" to have services operators manually confirm
* every registration. Set to "disable" to completely disable all registrations.
*/
registration = "none"
/*
* The minimum length of time between consecutive uses of NickServ's RESEND command.
*
* This directive is optional, but recommended. If not set, this restriction will be disabled.
*/
resenddelay = 90s
/*
* Prevents users from registering their nick if they are not connected
* for at least the given number of seconds.
*
* This directive is optional.
*/
#nickregdelay = 30s
/*
* The length of time a user using an unconfirmed account has
* before the account will be released for general use again.
*/
#unconfirmedexpire = 1d
}
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; } command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; } command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; } command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
@@ -488,57 +518,58 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
* nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel. * nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel.
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name. * nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address. * nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels. * nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
* nicksrev/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info for users account.
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection. * nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use. * nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you. * nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
* nickserv/set/password, nickserv/saset/password - Used for changing a users greet password. * nickserv/set/password, nickserv/saset/password - Used for changing a users password.
* nickserv/set/private, nickserv/saset/private - Used for configuring whether or a users account shows up in nickserv/list.
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access. * nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring. * nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
*
* This is a dummy command to provide a help wrapper for the various SET and SASET commands.
*/ */
module { name = "ns_set" } module
{
name = "ns_set"
/*
* Allow the use of the IMMED option in the NickServ SET KILL command.
*
* This directive is optional.
*/
#allowkillimmed = yes
}
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; } command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; } command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; } command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; } command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; } command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; } command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; } command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; } command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; } command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; } command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; group = "nickserv/admin"; }
/* /*
* ns_set_misc * ns_set_misc
@@ -575,7 +606,24 @@ command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
* *
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are preserved. * Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are preserved.
*/ */
module { name = "ns_suspend" } module
{
name = "ns_suspend"
/*
* The length of time before a suspended nick becomes unsuspended.
*
* This directive is optional. If not set, the default is never.
*/
#suspendexpire = 90d
/*
* Settings to show to non-opers in NickServ's INFO output.
* Comment to completely disable showing any information about
* suspended nicknames to non-opers.
*/
show = "suspended, by, reason, on, expires"
}
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; } command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; } command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
@@ -600,13 +648,14 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
* Limits how many times the same email address may be used in Anope * Limits how many times the same email address may be used in Anope
* to register accounts. * to register accounts.
*/ */
module { name = "ns_maxemail" } #module
ns_maxemail
{ {
name = "ns_maxemail"
/* /*
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left * The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
* commented, there will be no limit enforced when registering new accounts or using * commented, there will be no limit enforced when registering new accounts or using
* /msg NickServ SET EMAIL. * /msg NickServ SET EMAIL.
*/ */
#maxemails = 1 maxemails = 1
} }
+140 -116
View File
@@ -4,12 +4,12 @@
/* /*
* First, create the service. * First, create the service.
* Note that an easy way to rename this service is to define{} the client name to something else.
*/ */
service service
{ {
/* /*
* The name of the OperServ client. * The name of the OperServ client.
* If you change this value, you probably want to change the client directive in the configuration for the operserv module too.
*/ */
nick = "OperServ" nick = "OperServ"
@@ -56,25 +56,14 @@ service
* *
* Provides essential functionality for OperServ. * Provides essential functionality for OperServ.
*/ */
module { name = "operserv" } module
/*
* Configuration for OperServ provided by os_main.
*/
operserv
{ {
name = "operserv"
/* /*
* The name of the client that should be OperServ. * The name of the client that should be OperServ.
*/ */
name = "OperServ" client = "OperServ"
/*
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
* them extra privileges such as being a founder on ALL channels.
*
* This directive is optional.
*/
#superadmin = yes
/* /*
* These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs, * These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs,
@@ -98,9 +87,9 @@ operserv
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD. * If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
* This eliminates the need for killing the user after the SNLINE has been added. * This eliminates the need for killing the user after the SNLINE has been added.
* *
*This directive is optional. * This directive is optional.
*/ */
#killonsnline = yes killonsnline = yes
/* /*
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD. * If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
@@ -108,87 +97,7 @@ operserv
* *
* This directive is optional. * This directive is optional.
*/ */
#killonsqline = yes killonsqline = yes
/*
* Enables session limiting. Session limiting prevents users from connecting more than a certain
* number of times from the same host at the same time - thus preventing most types of cloning.
* Once a host reaches it's session limit, all clients attempting to connect from that host will
* be killed. Exceptions to the default session limit can be defined via the exception list. It
* should be noted that session limiting, along with a large exception list, can degrade Services'
* performance.
*
* See the online help for more information about session limiting.
*
* This directive is optional.
*/
limitsessions = yes
/*
* Default session limit per host. Once a host reaches it's session limit, all clients attempting
* to connect from that host will be killed. A value of zero means an unlimited session limit.
*
* This directive is optional.
* If not given and session limiting is enabled, it will default to no limit.
*/
defaultsessionlimit = 3
/*
* The maximum session limit that may be set for a host in an exception.
*
* This directive is only required if session limiting is enabled.
*/
maxsessionlimit = 100
/*
* Sets the default expiry time for session exceptions.
*
* This directive is only required if session limiting is enabled.
*/
exceptionexpiry = 1d
/*
* The message that will be NOTICE'd to a user just before they are removed from the network because
* their host's session limit has been exceeded. It may be used to give a slightly more descriptive
* reason for the impending kill as opposed to simply "Session limit exceeded".
*
* This directive is optional, if not set, nothing will be sent.
*/
sessionlimitexceeded = "The session limit for your IP %s has been exceeded."
/*
* Same as above, but should be used to provide a website address where users can find out more
* about session limits and how to go about applying for an exception.
*
* Note: This directive has been intentionally commented out in an effort to remind you to change
* the URL it contains. It is recommended that you supply an address/URL where people can get help
* regarding session limits.
*
* This directive is optional, if not set, nothing will be sent.
*/
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
/*
* If set and is not 0, this directive tells Services to add an AKILL the number of subsequent kills
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
*
* This directive is optional.
*/
maxsessionkill = 15
/*
* Sets the expiry time for AKILLs set for hosts exceeding the maxsessionkill directive limit.
*
* This directive is optional, if not set, defaults to 30 minutes.
*/
sessionautokillexpiry = 30m
/*
* Sets the CIDR value used to determine which IP addresses represent the same person.
* By default this would limit 3 connections per IPv4 IP and 3 connections per IPv6 IP.
*/
session_ipv4_cidr = 32
session_ipv6_cidr = 128
/* /*
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason. * Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
@@ -204,8 +113,7 @@ operserv
akillids = yes akillids = yes
/* /*
* If set, only IRC Operators will be permitted to use OperServ, regardless of module-based command * If set, only IRC Operators will be permitted to use OperServ, regardless of command access restrictions.
* access restrictions.
* *
* This directive is optional, but recommended. * This directive is optional, but recommended.
*/ */
@@ -254,10 +162,10 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
* Allows you to set services in defcon mode, which can be used to restrict services access * Allows you to set services in defcon mode, which can be used to restrict services access
* during bot attacks. * during bot attacks.
*/ */
#module { name = "os_defcon" } #module
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; }
defcon
{ {
name = "os_defcon"
/* /*
* Default DefCon level (1-5) to use when starting Services up. Level 5 constitutes normal operation * Default DefCon level (1-5) to use when starting Services up. Level 5 constitutes normal operation
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to * while level 1 constitutes the most restrictive operation. If this setting is left out or set to
@@ -338,7 +246,7 @@ defcon
* *
* This directive is required only when globalondefconmore is set. * This directive is required only when globalondefconmore is set.
*/ */
#message = "Put your message to send your users here. Dont forget to uncomment globalondefconmore" #message = "Put your message to send your users here. Don't forget to uncomment globalondefconmore"
/* /*
* Defines the message that will be sent when DefCon is returned to level 5. This directive is optional, * Defines the message that will be sent when DefCon is returned to level 5. This directive is optional,
@@ -352,6 +260,7 @@ defcon
*/ */
#akillreason = "This network is currently not accepting connections, please try again later." #akillreason = "This network is currently not accepting connections, please try again later."
} }
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon"; }
/* /*
* os_dns * os_dns
@@ -384,10 +293,10 @@ defcon
* *
* Finally set a NS record for irc.example.com. to BIND or services. * Finally set a NS record for irc.example.com. to BIND or services.
*/ */
#module { name = "os_dns" } #module
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
os_dns
{ {
name = "os_dns"
/* TTL for records. This should be very low if your records change often. */ /* TTL for records. This should be very low if your records change often. */
ttl = 1m ttl = 1m
@@ -412,6 +321,7 @@ os_dns
*/ */
readd_connected_servers = no readd_connected_servers = no
} }
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
/* /*
* os_config * os_config
@@ -443,6 +353,16 @@ command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; pe
module { name = "os_ignore" } module { name = "os_ignore" }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; } command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
/*
* os_info
*
* Provides the command operserv/info.
*
* Used to add oper only notes to users and channels.
*/
module { name = "os_info" }
command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permission = "operserv/info"; }
/* /*
* os_jupe * os_jupe
* *
@@ -502,15 +422,16 @@ command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
* *
* Used to search services log files. * Used to search services log files.
*/ */
module { name = "os_logsearch" } module
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
logsearch
{ {
name = "os_logsearch"
/* The log file name to search. There should be a log{} block configured to log /* The log file name to search. There should be a log{} block configured to log
* to a file of this name. * to a file of this name.
*/ */
name = "services.log" logname = "services.log"
} }
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
/* /*
* os_mode * os_mode
@@ -553,7 +474,24 @@ command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunloa
* *
* Used to configure news notices shown to users when they connect, and opers when they oper. * Used to configure news notices shown to users when they connect, and opers when they oper.
*/ */
module { name = "os_news" } module
{
name = "os_news"
/*
* The service bot names to use to send news to users on connection
* and to opers when they oper.
*/
announcer = "Global"
oper_announcer = "OperServ"
/*
* The number of LOGON/OPER news items to display when a user logs on.
*
* This directive is optional, if not set it will default to 3.
*/
#newscount = 3
}
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; } command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; } command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; } command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
@@ -604,9 +542,84 @@ command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; pe
* *
* Provides the commands operserv/exception and operserv/session. * Provides the commands operserv/exception and operserv/session.
* *
* This module enables session limiting. Session limiting prevents users from connecting more than a certain
* number of times from the same IP at the same time - thus preventing most types of cloning.
* Once a host reaches it's session limit, all clients attempting to connect from that host will
* be killed. Exceptions to the default session limit can be defined via the exception list.
*
* Used to manage the session limit exception list, and view currently active sessions. * Used to manage the session limit exception list, and view currently active sessions.
*/ */
module { name = "os_session" } module
{
name = "os_session"
/*
* Default session limit per host. Once a host reaches its session limit, all clients attempting
* to connect from that host will be killed.
*
* This directive is required if os_session is loaded.
*/
defaultsessionlimit = 3
/*
* The maximum session limit that may be set for a host in an exception.
*
* This directive is required if os_session is loaded.
*/
maxsessionlimit = 100
/*
* Sets the default expiry time for session exceptions.
*
* This directive is required if os_session is loaded.
*/
exceptionexpiry = 1d
/*
* The message that will be NOTICE'd to a user just before they are removed from the network because
* their host's session limit has been exceeded. It may be used to give a slightly more descriptive
* reason for the impending kill as opposed to simply "Session limit exceeded".
*
* This directive is optional, if not set, nothing will be sent.
*/
sessionlimitexceeded = "The session limit for your IP %IP% has been exceeded."
/*
* Same as above, but should be used to provide a website address where users can find out more
* about session limits and how to go about applying for an exception.
*
* Note: This directive has been intentionally commented out in an effort to remind you to change
* the URL it contains. It is recommended that you supply an address/URL where people can get help
* regarding session limits.
*
* This directive is optional, if not set, nothing will be sent.
*/
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
/*
* If set and is not 0, this directive tells Services to add an AKILL if the number of subsequent kills
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
*
* This directive is optional.
*/
maxsessionkill = 15
/*
* Sets the expiry time for AKILLs set for hosts exceeding the maxsessionkill directive limit.
*
* This directive is optional, if not set, defaults to 30 minutes.
*/
sessionautokillexpiry = 30m
/*
* Sets the CIDR value used to determine which IP addresses represent the same person.
* By default this would limit 3 connections per IPv4 IP and 3 connections per IPv6 IP.
* If you are receiving IPv6 clone attacks it may be useful to set session_ipv6_cidr to
* 64 or 48.
*/
session_ipv4_cidr = 32
session_ipv6_cidr = 128
}
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; } command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; } command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
@@ -617,7 +630,18 @@ command { service = "OperServ"; name = "SESSION"; command = "operserv/session";
* *
* Used to set various settings such as superadmin, debug mode, etc. * Used to set various settings such as superadmin, debug mode, etc.
*/ */
module { name = "os_set" } module
{
name = "os_set"
/*
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
* them extra privileges such as being a founder on ALL channels.
*
* This directive is optional.
*/
#superadmin = yes
}
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; } command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
/* /*
@@ -659,7 +683,7 @@ command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart";
* *
* Provides the operserv/snline and operserv/sqline commands. * Provides the operserv/snline and operserv/sqline commands.
* *
* Used to ban different things such as realnames, nicknames, and IPs. * Used to ban real names, nick names, and possibly channels.
*/ */
module { name = "os_sxline" } module { name = "os_sxline" }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; } command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
+513
View File
@@ -0,0 +1,513 @@
/*
* Example configuration file for Services. After making the appropriate
* changes to this file, place it in the Services conf directory (as
* specified in the "configure" script, default /home/username/services/conf)
* under the name "services.conf".
*
* The format of this file is fairly simple: three types of comments are supported:
* - All text after a '#' on a line is ignored, as in shell scripting
* - All text after '//' on a line is ignored, as in C++
* - A block of text like this one is ignored, as in C
*
* Outside of comments, there are three structures: blocks, keys, and values.
*
* A block is a named container, which contains a number of key to value pairs
* - you may think of this as an array.
*
* A block is created like so:
* foobar
* {
* moo = "cow"
* foo = bar
* }
*
* Note that nameless blocks are allowed and are often used with comments to allow
* easily commenting an entire block, for example:
* #foobar
* {
* moo = "cow"
* foo = bar
* }
* is an entirely commented block.
*
* Keys are case insensitive. Values depend on what key - generally, information is
* given in the key comment. The quoting of values (and most other syntax) is quite
* flexible, however, please do not forget to quote your strings:
*
* "This is a parameter string with spaces in it"
*
* If you need to include a double quote inside a quoted string, precede it
* by a backslash:
*
* "This string has \"double quotes\" in it"
*
* Time parameters can be specified either as an integer representing a
* number of seconds (e.g. "3600" = 1 hour), or as an integer with a unit
* specifier: "s" = seconds, "m" = minutes, "h" = hours, "d" = days.
* Combinations (such as "1h30m") are not permitted. Examples (all of which
* represent the same length of time, one day):
*
* "86400", "86400s", "1440m", "24h", "1d"
*
* In the documentation for each directive, one of the following will be
* included to indicate whether an option is required:
*
* [REQUIRED]
* Indicates a directive which must be given. Without it, Services will
* not start.
*
* [RECOMMENDED]
* Indicates a directive which may be omitted, but omitting it may cause
* undesirable side effects.
*
* [OPTIONAL]
* Indicates a directive which is optional. If not given, the feature
* will typically be disabled. If this is not the case, more
* information will be given in the documentation.
*
* [DISCOURAGED]
* Indicates a directive which may cause undesirable side effects if
* specified.
*
* [DEPRECATED]
* Indicates a directive which will disappear in a future version of
* Services, usually because its functionality has been either
* superseded by that of other directives or incorporated into the main
* program.
*/
/*
* [OPTIONAL] Defines
*
* You can define values to other values, which can be used to easily change
* many values in the configuration. at once.
*/
/*
* The services.host define is used in multiple different locations throughout the
* configuration for services clients hostnames.
*/
define
{
name = "services.host"
value = "services.localhost.net"
}
/*
* [OPTIONAL] Additional Includes
*
* You can include additional configuration files here.
* You may also include executable files, which will be executed and
* the output from it will be included into your configuration.
*/
#include
{
type = "file"
name = "some.conf"
}
#include
{
type = "executable"
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
}
/*
* [REQUIRED] IRCd Config
*
* This section is used to set up Anope to connect to your IRC network.
* This section can be included multiple times, and Anope will attempt to
* connect to each server until it finally connects.
*
* Each uplink IRCd should have a corresponding configuration to allow Services
* to link to it.
*
* An example configuration for InspIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* <link name="services.localhost.net"
* ipaddr="127.0.0.1"
* port="7000"
* sendpass="mypassword"
* recvpass="mypassword">
* <uline server="services.localhost.net" silent="yes">
* <bind address="127.0.0.1" port="7000" type="servers">
*
* An example configuration for UnrealIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* link services.localhost.net
* {
* username *;
* hostname *;
* bind-ip "127.0.0.1";
* port 7000;
* hub *;
* password-connect "mypassword";
* password-receive "mypassword";
* class servers;
* };
* ulines { services.localhost.net; };
* listen 127.0.0.1:7000;
*/
uplink
{
/*
* The IP or hostname of the IRC server you wish to connect Services to.
* Usually, you will want to connect Services over 127.0.0.1 (aka localhost).
*
* NOTE: On some shell providers, this will not be an option.
*/
host = "127.0.0.1"
/*
* Enable if Services should connect using IPv6.
*/
ipv6 = no
/*
* Enable if Services should connect using SSL.
* You must have an SSL module loaded for this to work.
*/
ssl = no
/*
* The port to connect to.
* The IRCd *MUST* be configured to listen on this port, and to accept
* server connections.
*
* Refer to your IRCd documentation for how this is to be done.
*/
port = 7000
/*
* The password to send to the IRC server for authentication.
* This must match the link block on your IRCd.
*
* Refer to your IRCd documentation for more information on link blocks.
*/
password = "mypassword"
}
/*
* [REQUIRED] Server Information
*
* This section contains information about the Services server.
*/
serverinfo
{
/*
* The hostname that Services will be seen as, it must have no conflicts with any
* other server names on the rest of your IRC network. Note that it does not have
* to be an existing hostname, just one that isn't on your network already.
*/
name = "stats.localhost.net"
/*
* The text which should appear as the server's information in /whois and similar
* queries.
*/
description = "Stats for IRC Networks"
/*
* The local address that Services will bind to before connecting to the remote
* server. This may be useful for multihomed hosts. If omitted, Services will let
* the Operating System choose the local address. This directive is optional.
*
* If you don't know what this means or don't need to use it, just leave this
* directive commented out.
*/
#localhost = "nowhere."
/*
* What Server ID to use for this connection?
* Note: This should *ONLY* be used for TS6/P10 IRCds. Refer to your IRCd documentation
* to see if this is needed.
*/
#id = "00A"
/*
* The filename containing the Services process ID. The path is relative to the
* services root directory.
*/
pid = "data/services.pid"
/*
* The filename containing the Message of the Day. The path is relative to the
* services root directory.
*/
motd = "conf/services.motd"
}
/*
* [REQUIRED] Protocol module
*
* This directive tells Anope which IRCd Protocol to speak when connecting.
* You MUST modify this to match the IRCd you run.
*
* Supported:
* - bahamut
* - charybdis
* - hybrid
* - inspircd12
* - inspircd20
* - ngircd
* - plexus
* - ratbox
* - unreal
*/
module
{
name = "inspircd20"
}
/*
* [REQUIRED] Network Information
*
* This section contains information about the IRC network that Services will be
* connecting to.
*/
networkinfo
{
/*
* This is the name of the network that Services will be running on.
*/
networkname = "LocalNet"
/*
* Set this to the maximum allowed nick length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network.
*/
nicklen = 31
/* Set this to the maximum allowed ident length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network.
*/
userlen = 10
/* Set this to the maximum allowed hostname length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Services being disconnected from the network.
*/
hostlen = 64
/* Set this to the maximum allowed channel length on your network.
*/
chanlen = 32
/* The maximum number of list modes settable on a channel (such as b, e, I).
* Comment out or set to 0 to disable.
*/
modelistsize = 100
/*
* The characters allowed in hostnames. This is used for validating hostnames given
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
* recommended unless you know for sure your IRCd supports whatever characters you are
* wanting to use. Telling services to set a vHost containing characters your IRCd
* disallows could potentially break the IRCd and/or Services.
*
* It is recommended you DON'T change this.
*/
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
/*
* If set to true, allows vHosts to not contain dots (.).
* Newer IRCds generally do not have a problem with this, but the same warning as
* vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
allow_undotted_vhosts = false
/*
* The characters that are not allowed to be at the very beginning or very ending
* of a vHost. The same warning as vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
disallow_start_or_end = ".-"
}
/*
* [REQUIRED] Services Options
*
* This section contains various options which determine how Services will operate.
*/
options
{
/*
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
* after starting up. This is useful if Anope has to bind to privileged ports
*/
#user = "anope"
#group = "anope"
/*
* The case mapping used by services. This must be set to a valid locale name
* installed on your machine. Services use this case map to compare, with
* case insensitivity, things such as nick names, channel names, etc.
*
* We provide two special casemaps shipped with Anope, ascii and rfc1459.
*
* This value should be set to what your IRCd uses, which is probably rfc1459,
* however Anope has always used ascii for comparison, so the default is ascii.
*
* Changing this value once set is not recommended.
*/
casemap = "ascii"
/*
* Sets the timeout period for reading from the uplink.
*/
readtimeout = 5s
/*
* Sets the interval between sending warning messages for program errors via
* WALLOPS/GLOBOPS.
*/
warningtimeout = 4h
/*
* If set, Services will only show /stats o to IRC Operators. This directive
* is optional.
*/
#hidestatso = yes
/*
* A space-separated list of ulined servers on your network, it is assumed that
* the servers in this list are allowed to set channel modes and Services will
* not attempt to reverse their mode changes.
*
* WARNING: Do NOT put your normal IRC user servers in this directive.
*
* This directive is optional.
*/
#ulineservers = "services.your.network"
/*
* How long to wait between connection retries with the uplink(s).
*/
retrywait = 60s
}
/*
* [RECOMMENDED] Logging Configuration
*
* This section is used for configuring what is logged and where it is logged to.
* You may have multiple log blocks if you wish. Remember to properly secure any
* channels you choose to have Anope log to!
*/
log
{
/*
* Target(s) to log to, which may be one of the following:
* - a channel name
* - a filename
* - globops
*/
target = "stats.log"
/* Log to both services.log and the channel #services
*
* Note that some older IRCds, such as Ratbox, require services to be in the
* log channel to be able to message it. To do this, configure service:channels to
* join your logging channel.
*/
#target = "stats.log #services"
/*
* The source(s) to only accept log messages from. Leave commented to allow all sources.
* This can be a users name, a channel name, one of our clients (eg, OperServ), or a server name.
*/
#source = ""
/*
* The bot used to log generic messages which have no predefined sender if there
* is a channel in the target directive.
*/
bot = "Global"
/*
* The number of days to keep logfiles, only useful if you are logging to a file.
* Set to 0 to never delete old logfiles.
*
* Note that Anope must run 24 hours a day for this feature to work correctly.
*/
logage = 7
/*
* What types of log messages should be logged by this block. There are nine general categories:
*
* servers - Server actions, linking, squitting, etc.
* channels - Actions in channels such as joins, parts, kicks, etc.
* users - User actions such as connecting, disconnecting, changing name, etc.
* other - All other messages without a category.
* rawio - Logs raw input and output from services
* debug - Debug messages (log files can become VERY large from this).
*
* These options determine what messages from the categories should be logged. Wildcards are accepted, and
* you can also negate values with a ~. For example, "~operserv/akill operserv/*" would log all operserv
* messages except for operserv/akill. Note that processing stops at the first matching option, which
* means "* ~operserv/*" would log everything because * matches everything.
*
* Valid server options are:
* connect, quit, sync, squit
*
* Valid channel options are:
* create, destroy, join, part, kick, leave, mode
*
* Valid user options are:
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper
*
* Rawio and debug are simple yes/no answers, there are no types for them.
*
* Note that modules may add their own values to these options.
*/
servers = "*"
#channels = "~mode *"
users = "connect disconnect nick"
other = "*"
rawio = no
debug = no
}
/*
* [REQUIRED] MySQL Database configuration.
*
* m_mysql
*
* This module allows other modules to use MySQL.
*/
module
{
name = "m_mysql"
mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mypassword"
port = 3306
}
}
/*
* IRC2SQL Gateway
* This module collects data about users, channels and servers. It doesn't build stats
* itself, however, it gives you the database, it's up to you how you use it.
*
* Requires a MySQL Database and MySQL version 5.5 or higher
*/
include
{
type = "file"
name = "irc2sql.example.conf"
}
-3822
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
git log --pretty=format:"Revision %h - %cD - %s" > version.log
+53
View File
@@ -1,3 +1,56 @@
Anope Version 2.0.2
-------------------
Fix keepmodes preventing the first user of a channel from being deopped
Fix SQlines that don't begin with # from matching channels
Made cs_clone behave like the help describes, copying many settings and lists by default
Allow cs_clone to clone levels, too
Update Hybrid protocol module for 8.2
Fix not unescaping all characters sent over XMLRPC
Fix crash when os_mode is used to destroy channels, like when unsetting permanent channel mode from an empty channel
Allow users with topic change privilege to change the topic instead of requiring them to use ChanServ's topic command
Fix negatively locking param modes in default mlock
Change entrymsg to check for the SET privilege, not real founder
Allow configuring characters allowed in nicknames
Fix crash when non users register channels externally (like XMLRPC)
Remove operserv/exception MOVE, it did not function correctly. Instead reorder the list by deleting/adding entries.
Allow flood ttb to be 0.
Enforce mlock when disabling defcon modes
Fix cs_mode not being able to apply mlock on register
Add log message when users send memos
Fix old collide timers from staying around after successful identify. Fixes being able to identify and logout and still being hit by the old timers.
Fix undefined behavior in cs_mode which usually crashes when clearing large list modes
Show all opertypes in operserv/info, even if no opers use them
Anope Version 2.0.1
-------------------
Fix access entries on accounts sometimes not updating when a user's display name changes
Fix ns_group to properly validate the account of the user against the target
Fix os_stats not saving max user count and time when using SQL
Fix nickalias's 'nc' field sometimes not being updated when using SQL
Fix several crashes on Windows related to being unable to load modules
Fix bs_bot change not properly reintroducing bots after changing their ident, host, or realname
Add English language file to allow users to easily modify language strings
Add configuring which mode cs_ban sets, and added a MUTE command to BotServ's fantasy
Allow SVSPART to take an optional reason
Allow cs_list to search channel topics and descriptions
Anope Version 2.0.0
-------------------
Added irc2sql stats module
Anope Version 1.9.9
--------------------
A Added a better webpanel template, removed the old one
A Added SQL logging support
A Added Redis database support
A Added ability to configure what privileges XOP commands give
U Updated Dutch language file, from Robby <robby@chat.be>
U Updated Spanish langauge file, from Isaac Fontal <i_fontal@hotmail.com>
F Fix build on Solaris and OSX
F Fixed setting BotServ's default settings in the config
F Fixed some names of config items, including NickServ's kill protect
Anope Version 1.9.8 Anope Version 1.9.8
-------------------- --------------------
A Ability to configure fantasy commands in the config A Ability to configure fantasy commands in the config
+30
View File
@@ -1,3 +1,33 @@
Anope Version 2.0.2
-------------------
Add an operserv/oper/modify privilege, required to use oper add and oper del
Add a chanserv/access/list privilege, which allow readonly access to ChanServ access and akick lists
Changed m_dnsbl's result configuration to be more extensible
Add 'max' setting to cs_mode
Add 'nickchars' setting to networkinfo
Add 'botserv/fantasy', 'chanserv/access/list', and 'operserv/oper/modify' oper privileges
Fix 'emailchange_message' to include the proper email address
Set a default permission on operserv/defcon
Anope Version 2.0.1
-------------------
Add MUTE command to BotServ fantasy configuration
Document memo_mail option in nickserv.conf
Add 'show' setting to ns_info and cs_info to control which fields are shown to non opers
Anope Version 2.0.0
-------------------
options:passlen, enforceruser, enforcerhost, releasetimeout, and guestnickprefix moved to nickserv's module configuration
options:hideregisteredcommands added
m_ssl renamed to m_ssl_openssl
mail:restrict removed
Anope Version 1.9.9
-------------------
There is not many config changes betewen 1.9.8 and 1.9.9, however many of the
options have been moved around to make more sense, too many to list here,
so get a new config.
Anope Version 1.9.8 Anope Version 1.9.8
------------------- -------------------
networkinfo:chanlen added networkinfo:chanlen added
+14 -21
View File
@@ -9,34 +9,27 @@ Anope Internal Events
Internal Events are setup to give module developers more information Internal Events are setup to give module developers more information
about what the core is doing at different times. This information can about what the core is doing at different times. This information can
be as complex as data we are feeding to the uplink, to simple triggered be as complex as data we are feeding to the uplink, to simple triggered
events such as the databases being saved. events such as the databases being saved.
Additionally there is a module included with the core Additionally there is a module included with the core
which can provide some clue as to how to use the code in your modules. which can provide some clue as to how to use the code in your modules.
The rest of this document assumes that you are used to writing modules. The rest of this document assumes that you are used to writing modules.
2) Using Events 2) Using Events
Anope is told about modules wanting to hook to events by the function Each Event in Anope calls a function.
ModuleManager::Attach(EventName, Module*);, eg: You must override these functions in your main modules class.
ModuleManager::Attach(I_OnJoinChannel, this);
You can also specifcy an array of events:
Implementation i[] = { I_OnJoinChannel, I_OnPartChannel };
ModuleManager::Attach(i, this, 2);
Where 2 is the number of events in the list
You must then overload these functions in your main modules class.
The full list of functions and parameters are in modules.h. In this The full list of functions and parameters are in modules.h. In this
case, you would be overloading OnJoinChannel() and OnPartChannel() like so: case, you would be overriding OnJoinChannel() and OnPartChannel() like so:
void OnJoinChannel(User *u, Channel *c) { } void OnJoinChannel(User *u, Channel *c) anope_override { }
void OnPartChannel(User *u, Channel *c) { } void OnPartChannel(User *u, Channel *c) anope_override { }
Some of these events can be used to prevent or allow things to happen that Some of these event overrides can be used to prevent or allow things to
would normally not be allowed or denied. You can also use ModuleManager happen that would normally not be allowed or denied. You can also use
(not explained here) to set control which order the modules are queried ModuleManager (not explained here) to set control which order the modules
(when multiple modules hook to the same event). are queried (when multiple modules hook to the same event).
The "anope_override" identifier is for compatibility with C++11.
Its usage is highly recommended.
+23 -90
View File
@@ -21,74 +21,51 @@ Note: You should also read the README and FAQ files!
http://www.anope.org/ http://www.anope.org/
Anope can be built one of two ways. The recommended way is to use CMake. Anope requires cmake to build. You can check if CMake is already
You can check if CMake is already installed on your system using the installed on your system using the command:
command:
cmake --version cmake --version
If it's installed, you will get a line that says something similar to If it's installed, you will get a line that says something similar to
"cmake version 2.6-patch 1". If the version is less than 2.4 or you get "cmake version 2.8.12.2". If the version is less than 2.4 or you get
an error saying the command was not found, you will not be able to use an error saying the command was not found, you will not be able to use
CMake unless you install it yourself into your home directory. CMake CMake unless you install it yourself into your home directory. CMake
can be downloaded from: can be downloaded from:
http://www.cmake.org/cmake/resources/software.html http://www.cmake.org/cmake/resources/software.html
If you are unable to install CMake yourself (either due to lack of space
or restrictions by your hosting provider), you still have the alternative
to use the provided configure script. This option is not recommended and
will eventually be phased out, but is provided for compatibility for those
lacking CMake.
Next, unpack the package in your home directory, and go into the created Next, unpack the package in your home directory, and go into the created
directory. directory.
If there are any extra modules you want to enable, such as m_mysql, run
the 'extras' script to enable them. If you do not know you can come back
later and enable them.
Now type ./Config to start the configuration script. It will ask you a Now type ./Config to start the configuration script. It will ask you a
few questions, and figure out how to compile Anope on your system. If few questions, and figure out how to compile Anope on your system. If
you are unsure about the answer to a question, use the default value. you are unsure about the answer to a question, use the default value.
The question to using configure or cmake depends on your decision from
above. If you have CMake and wish to use it, answer with cmake, otherwise
answer with configure.
You can now type make to compile Anope. If there are errors in the Now cd build and type make and make install. This will install
Makefile, *try to use gmake* instead. If it still doesn't work, you (or
the system administrator if it's a shell) must install GNU make. You may
find it at ftp://prep.ai.mit.edu/pub/gnu/.
Now type make install (or gmake install; see above). This will install
all the needed files in the paths you specified with the configure all the needed files in the paths you specified with the configure
script, and setup file permissions. You should ensure that the data script, and setup file permissions. You should ensure that the data
directory is not accessible by other users, as malicious users may directory is not accessible by other users, as malicious users may
cause trouble on your network if passwords are not encrypted, or read cause trouble on your network if passwords are not encrypted, or read
the memos of any user. the memos of any user.
If you see errors during this process, please mail us with the *complete* Now go into the conf directory (by default, ~/services/conf). Copy the example
error output, and don't forget to mention your OS, compiler and C++ library
versions.
Now go into the data directory (by default, ~/services/data). Copy the example
configuration file (example.conf) to services.conf, and open the latter configuration file (example.conf) to services.conf, and open the latter
with your favorite text editor. It contains all the configuration with your favorite text editor. It contains all the configuration
directives Anope will use at startup. Read the instructions contained in directives Anope will use at startup. Read the instructions contained in
the file carefully. Using the default values is NOT a good idea, and will the file carefully. Using the default values is NOT a good idea, and will
most likely not work! most likely not work!
If you need help, you should subscribe to the Anope mailing list and mail If you need help, you should visit http://forum.anope.org/ or #anope on
there to get help from other users. See the README file for more irc.anope.org. Provide *complete* error output, along with other relevant
information. information eg. OS, compiler and C++ library versions.
See the README file for more information.
2) Upgrading Anope 2) Upgrading Anope
If you got a .diff file and want to patch the old Anope sources with it,
do the following:
* Copy the .diff file into the root Anope sources directory.
* Type patch -p1 <file.diff
Note that upgrading anope with a patchfile isn't recommended. You should
download a new, clean source package, as this will give the best results.
To upgrade Anope, just follow the installation instructions described in To upgrade Anope, just follow the installation instructions described in
section 1. There are however a few specific guidelines: section 1. There are however a few specific guidelines:
@@ -99,63 +76,19 @@ Note: You should also read the README and FAQ files!
3) Setting up the IRCd 3) Setting up the IRCd
Services acts as an IRC server with pseudo-clients on it. To link them to Services acts as an IRC server with pseudo-clients on it. To link them to
your network, you'll need to add some lines in the ircd.conf of their hub your network, you'll need to configure your IRCd to allow services to link.
server (as stated in the RemoteServer configuration directive).
For samples below we'll take services.localhost.net as the name of the The configuration varies depending on the IRCd, but you will probably need
Services (as stated in the ServerName configuration directive). Note that a link block (also called connect block, or C line), a U line (also called
this samples are made to be as generic as possible, but there might be a shared block), and be sure that the IRCd is listneing on the given port
small variations, depending on your IRCd. For IRCd-specific help with in the link block.
configuration, read near the end of this section.
First, the C/N lines, that allow Services to link. They also need a Example link configurations can be found in example.conf for some of the
Y:line to work correctly. popular IRCds.
Y:27:180:0:0:4000000
C:127.0.0.1:mypass:services.localhost.net::30
N:127.0.0.1:mypass:services.localhost.net::30
"mypass" is the same password you mentioned in the RemoteServer
configuration directive. 127.0.0.1 is the IP from which Services connect
from (linking in localhost is the most efficient way to run Services).
Then, you have to set-up an U:line, that will allow Services to change
channel modes, topics, and much more without being opped in the channel.
U:services.localhost.net:*:*
NOTE: if you have more than one server in your network, this line MUST
be added on ALL servers, or things won't work correctly.
Finally, you'll need to add an H:line, to make the OperServ JUPE command
work correctly.
H:*::Services.LocalHost.Net
Don't forget to /rehash your IRCd to apply changes. Don't forget to /rehash your IRCd to apply changes.
A new trend in ircd configuration is popping all over the place, good You may also try our interactive link maker, which is located at:
examples are the latest Hybrid, Unreal and Bahamut, which use a more
"readable" form of configuration. For those, use something like:
link services.localhost.net
{
username *;
hostname localhost;
bind-ip *;
port 6667;
hub *;
password-connect "mypass";
password-receive "mypass";
class servers;
};
Note that this block-style configuration files differ heavily, depending
on the IRCd. Consult the interactive link maker (link is below) for more
details on the exact configuration used by your IRCd.
If you're unable to get a link with your IRCd after reading this section,
you might try the interactive link maker, which is located at:
http://anope.org/ilm.php http://anope.org/ilm.php
@@ -183,7 +116,7 @@ Note: You should also read the README and FAQ files!
still running, and restart it if not. still running, and restart it if not.
First rename the example.chk script that is in Anope path (by default, First rename the example.chk script that is in Anope path (by default,
this is ~/services/data) to services.chk and edit it. You'll need to this is ~/services/conf) to services.chk and edit it. You'll need to
modify the CONFIGURATION part of the file. Then ensure that the file is modify the CONFIGURATION part of the file. Then ensure that the file is
marked as executable by typing chmod +x services.chk, and try to launch the marked as executable by typing chmod +x services.chk, and try to launch the
script to see if it works (Anope must not be running when you do this ;)) script to see if it works (Anope must not be running when you do this ;))
@@ -192,7 +125,7 @@ Note: You should also read the README and FAQ files!
This will open the default text editor with the crontab file. Enter the This will open the default text editor with the crontab file. Enter the
following (with correct path): following (with correct path):
*/5 * * * * /home/ircd/services/data/services.chk >/dev/null 2>&1 */5 * * * * /home/ircd/services/conf/services.chk >/dev/null 2>&1
The */5 at the beginning means "check every 5 minutes". You may replace The */5 at the beginning means "check every 5 minutes". You may replace
the 5 with other another number if you want (but less than 60). Consult the 5 with other another number if you want (but less than 60). Consult
+109 -169
View File
@@ -1,209 +1,149 @@
Installation et instructions d'anope Instructions d'installation d'Anope
------------------------------------ -----------------------------------
1) Instalation d'anope 1) Installation d'Anope
2) Mise à jour d'anope 2) Mettre à jour Anope
3) Configuration de l'ircd 3) Configuration de l'IRCd
4) Mise en route de anope 4) Mettre en route Anope
5) Mise en place d'un fichier crontab 5) Mettre en place un crontab
Note: Vous devrez également lire les fichiers README et FAQ ! Note : Vous devrez également lire les fichiers README et FAQ !
1) Installation de anope 1) Installation d'Anope
Note importante: il n'est pas recommandé d'utiliser (et même d'installer) NOTE IMPORTANTE : il est déconseillé d'utiliser (et même d'installer)
Anope en tant que root. Anope en tant que root. Utilisez un utilisateur non
Utilisez un utilisateur non privilégié, privilégié. Celui que vous utilisez pour l'IRCd ou
un utilisateur dédié suffira.
La première chose que vous devez faire est d'obtenir le package Anope
(si ce n'est déjà fait). Vous pouvez le trouver ici :
La première chose que vous devez faire est d'obtenir le package Anope (si ce n'est déjà fait). http://www.anope.org/
Vous pouvez le trouver ici http://www.anope.org/ Anope nécessite cmake pour être compilé. Vous pouvez vérifier si CMake
est déjà installé sur votre système avec la commande :
cmake --version
Si CMake est installé, vous aurez une ligne qui dit quelque chose comme
"cmake version 2.8.12.2". Si la version est inférieure à 2.4 ou si vous
obtenez une erreur disant que la commande n'a pas été trouvée, vous ne
pourrez pas utiliser CMake à moins de l'installer vous-même dans votre
répertoire home. CMake peut être téléchargé ici :
Anope peut être installer de deux façons. http://www.cmake.org/cmake/resources/software.html
1. La méthode recommandée est d'utiliser CMake. Ensuite, décompressez le package dans votre répertoire home, et allez
Vous pouvez vérifier si CMake est déjà installé sur votre système en utilisant la dans le répértoire qui vient d'être créé.
commande: cmake --version ( sur votre vps ou dedier etre loggué en root ) Si il y a des modules facultatifs que vous voulez activer comme m_mysql,
exécuter le script 'extras' pour les activer. Si vous ne savez pas, vous
pouvez les activer plus tard.
Maintenant, tapez ./Config pour lancer le script de configuration. Il
va vous poser quelques questions, et déterminer comment compiler Anope
sur votre système. Si vous ne savez pas comment répondre à une question,
utilisez la valeur par défaut.
Si c'est installé, vous aurez une ligne qui dit quelque chose qui ressemble à Allez dans le dossier build (cd build) et tapez make et make install.
Ceci va installer tous les fichiers nécessaires dans les dossiers que
vous avez indiqués avec le script Config et régler les permissions des
fichiers. Vous devez vous assurer que le répertoire data n'est pas
accessible par les autres utilisateurs, car des utilisateurs
malveillants pourraient causer des problèmes sur votre réseau, si les
mots de passe ne sont pas chiffrés, ou lire les mémos de tous les
utilisateurs.
«version 2.6 cmake-patch 1". Allez maintenant dans le répertoire conf (par défaut, ~/services/conf).
Copiez l'exemple de fichier de configuration (example.conf) en
services.conf et ouvrez ce dernier avec votre éditeur de texte favori.
Il contient toutes les directives de configuration qu'Anope va utiliser
en démarrant. Lisez attentivement les instructions contenues dans le
fichier. L'utilisation des valeurs par défaut n'est pas toujours
recommandée, et Anope ne fonctionnera probablement pas !
Si la version est inférieure à 2,4 ou si vous obtenez une erreur disant que la commande n'a pas été trouvé, Si vous avez besoin d'aide, vous pouvez aller sur le site
vous ne serez pas en mesure d'utiliser CMake, http://forum.anope.org/ ou le canal #anope sur irc.anope.org.
Fournissez *l'essemble* des erreurs qui apparaîssent, en plus de
toutes informations utiles, comme les versions de votre OS, du
compilateur utilisé et de la librairie C++. Lisez le fichier README
pour plus d'informations.
sauf si vous installez vous-même dans votre répertoire home. CMake 2) Mettre à jour Anope
vous pouvez le téléchargé ici > http://www.cmake.org/cmake/resources/software.html
Pour mettre à jour Anope, suivez simplement les instructions
d'installation décrites dans la section 1. Prenez garde cependant :
Si vous n'arrivez pas à installer (soit en raison du manque d'espace * IMPORTANT : Sauvegardez vos anciennes bases de données !
ou de restrictions par votre fournisseur d'hébergement), * Si vous mettez à jour vers une nouvelle version majeure,
vous pouvez encore utiliser le script de configuration fournis. recommencez *toujours* toute votre configuration à partir du
Cette option n'est pas recommandée et finira par être retiré, mais il est fourni pour la compatibilité de ces fichier example.conf.
manque de CMake.
3) Configuration de l'IRCd
Les Services agissent comme un serveur IRC avec des pseudo-clients.
Pour les relier à votre réseau, vous aurez besoin de configurer votre
IRCd pour permettre aux services de se connecter.
Ensuite, décompressez le package dans votre répertoire home, et allez dans le répértoire La configuration dépend de l'IRCd utilisé, mais vous aurez probablement
qui viens d'être crée. besoin d'un bloc link (aussi appelé connect block, ou C:line) et un
U:line (aussi appelé shared block). Assurez-vous que l'IRCd écoute
sur le port donné dans le bloc link.
Maintenant, tapez ./Config pour lancer le script de configuration. Il va vous poser Des exemples de configurations de bloc link peuvent être trouvés dans
quelques questions, et compiler Anope sur votre système. le fichier example.conf pour certains des IRCd les plus populaires.
Si vous ne savez pas repondre à une question, utilisez la valeur par défaut. Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
Vous pouvez également essayer notre créateur de bloc link interactif
Vous pouvez maintenant taper make pour compiler Anope. S'il ya des erreurs dans la situé ici :
Makefile, * essayez d'utiliser * gmake au lieu. Si cela ne fonctionne toujours pas, vous (ou
votre fournisseur ) doit installer GNU make. Vous pouvez
le Trouvez sur ftp://prep.ai.mit.edu/pub/gnu/.
Maintenant, tapez make install (ou gmake install; voir ci-dessus). Cela permet d'installer
tous les fichiers nécessaires dans les chemins que vous avez spécifié dans la configuration
script, et les permissions du fichier de configuration. Vous devez vous assurer que les données
répertoire ne sont pas accessible par d'autres utilisateurs, que des utilisateurs malveillants peuvent
causer des problèmes sur votre réseau, si les mots de passe ne sont pas cryptés, ou de lire
les mémos de tout utilisateur.
Si vous voyez des erreurs lors de ce processus, s'il vous plaît nous envoyer un mail avec le * complet *
sortie d'erreur, et n'oubliez pas de mentionner votre OS, compilateur et bibliothèque C + +
versions.
Maintenant, allez dans le répertoire de données (par défaut, cd ~/services/data). ouvrer exemple.conf
avec votre éditeur de texte favori. Il contient toute la configuration
directives. Anope va l'utiliser au démarrage. Lisez attentivement les instructions contenues dans
le fichier. l'utilisation des valeurs par defauld n'est pas recomment et anope ne risque pas de fonctionner
Si vous avez besoin d'aide, vous devez vous abonner à la mailing list et par courrier Anope
pour se faire aider par d'autres utilisateurs. Voir le fichier README pour plus de
informations.
2) Mise à jour Anope
Si vous avez un fichier .Diff et que vous voulez patcher les ancienne sources Anope avec,
effectuer les opérations suivantes:
* Copiez le fichier .Diff dans le répertoire racine des sources Anope.
* Type de patch-p1 <file.diff
Notez que la mise à jour anope avec un fichier patch n'est pas recommandé.
Vous devez télécharger une nouvelle source propre, car cela vous donnera les meilleurs résultats..
Pour mettre à jour Anope, suivez simplement les instructions d'installation décrites dans
l'article 1. Il y a cependant quelques règles spécifiques:
* IMPORTANT: Sauvegardez vos anciennes bases de données!
* Si vous mettez à jour vers une nouvelle version majeure, toujours redémarrer avec un
fichier de configuration neuve example.conf.
3) Mise en place du IRCd
Ce Services agit comme un serveur IRC avec des pseudo-clients sur elle. Pour les relier à
votre réseau, vous aurez besoin d'ajouter quelques lignes dans le ircd.conf de leur plate-forme
serveur (comme indiqué dans la directive de configuration RemoteServer).
Pour les échantillons ci-dessous, nous allons prendre services.localhost.net que le nom de la
Services (comme indiqué dans la directive de configuration ServerName). Notez que
présente des échantillons sont faites pour être aussi générique que possible, mais il pourrait y avoir
de petites variations, en fonction de votre IRCd. Pour IRCd aide spécifique aux
de configuration, lire près de la fin de cette section.
Tout d'abord, les lignes C / N, qui permettent aux services de crée un lien. Ils ont également besoin d'un
Y: ligne fonctionne correctement.
Y: 27:180:0:0:4000000
C: 127.0.0.1: mypass: services.localhost.net: 30
N: 127.0.0.1: mypass: services.localhost.net: 30
"mot de pass" est le même mot de passe que vous avez mentionné dans le RemoteServer
directive de configuration. 127.0.0.1 est l'adresse IP à partir de laquelle les services se connecterons
à partir de (reliant en localhost est le moyen le plus efficace pour exécuter les services).
Ensuite, vous avez à mettre en place un U:ligne, qui permettra aux services de changer
modes de canal, de sujets, et bien plus encore, sans être op sur le canal.
U: services.localhost.net: *: *
REMARQUE: si vous avez plus d'un serveur dans votre réseau, cette ligne doit
être ajouté sur tous les autres serveurs, où cela ne risque pas de fonctionner correctement.
Enfin, vous aurez besoin d'ajouter un H:ligne, pour permttre la commande OperServ JUPE
de fonctionner correctement.
H:*::Services.LocalHost.Net
Ne pas oublier de /rehash votre IRCd pour appliquer les modifications.
Une nouvelle tendance dans la configuration ircd hybride, Unreal et Bahamut, qui utilisent une approche plus
«Lisibles» sous forme de configuration. Pour ceux, utiliser quelque chose comme:
link services.localhost.net
{
username *;
hostname localhost;
bind-ip *;
port 6667;
hub *;
password-connect "mypass";
password-receive "mypass";
class servers;
};
Notez que ce bloc de fichiers de configuration de style est diffèrent
sur le IRCd. Consultez le fabricant de lien interactif (le lien est ci-dessous) pour plus
détails sur la configuration exacte utilisée par votre IRCd.
Si vous êtes incapable d'obtenir un lien avec votre IRCd après la lecture de cet article,
vous pouvez essayer le fabricant lien interactif, qui est situé au:
http://anope.org/ilm.php http://anope.org/ilm.php
4) A partir Anope 4) Mettre en route Anope
Allez dans le répertoire où les fichiers binaires ont été installés (par défaut, ce n'est Allez dans le répertoire où les fichiers binaires ont été installés
~/ Services/ bin). Tapez. /Services à lancer Anope. (par défaut, ~/services/bin). Tapez ./services pour lancer Anope.
S'il ya des erreurs de syntaxe dans le fichier de configuration, ils seront S'il y a des erreurs de syntaxe dans le fichier de configuration, elles
affiche sur l'écran. Corrigez-les jusqu'à ce qu'il n'y à plus d'erreur. seront affichées à l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait
Un démarrage réussi ne générera pas de message. plus. Un démarrage réussi ne générera pas de message.
Donner aux services au moins une minute pour se connecté à votre réseau, comme certains Donnez aux services au moins une minute pour se connecter à votre
IRCds sur certains OS peut être très lent pour le processus de liaison. Si rien n'arrive après environ une minute, réseau, car certains IRCds sur certains systèmes peuvent être très
il y a probablement un problème de configuration. Essayez lents pour le processus de liaison. Si rien ne se passe après environ
de lancer Anope en mode debug ./services-debug-nofork pour voir toutes les erreurs qu'il une minute, il y a probablement un problème de configuration. Essayez
rencontres, et d'essayer de les corriger. de lancer Anope en mode debug avec ./services -debug -nofork pour voir
toutes les erreurs rencontrées et essayez de les corriger.
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à vous abonner à la Anope Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à
liste de diffusion et de poser là. Voir le fichier README pour plus de détails. vous abonner à la liste de diffusion Anope et d'y poser vos question.
Voir le fichier README pour plus de détails.
5) Mettre en place un crontab 5) Mettre en place un crontab
Une entrée crontab vous permettra de vérifier périodiquement que Anope est Une entrée crontab vous permettra de vérifier périodiquement si Anope
toujours en cours, et redémarrez-le s'il n'est pas. est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
D'abord renommer le script example.chk qui est dans le chemin de Anope (par défaut, D'abord renommez le script example.chk qui est dans les dossiers
cela est ~/services/data) pour services.chk et le modifier. Vous aurez besoin de d'Anope (par défaut, ~/services/conf) en services.chk et modifiez-le.
modifier la partie configuration du fichier. Assurez-vous ensuite que le fichier est Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
marqué comme exécutable en tapant chmod + x services.chk, et essayer de lancer le Assurez-vous ensuite que le fichier est marqué comme exécutable en
script pour voir si cela fonctionne (Anope ne doit pas être en marche lorsque vous faites cela ;)) tapant chmod +x services.chk et essayez de lancer le script pour voir
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
testez cela ;))
Lorsque cela est fait, vous devrez ajouter l'entrée crontab. Type de crontab-e. Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Entrez
Cela va ouvrir l'éditeur de texte par défaut avec le fichier crontab. Entrez le chemin crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
suivant (avec le chemin correct): fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
* / 5 * * * * /home/ircd/services/data/services.chk> /dev/nul 2> & 1 */5 * * * * /home/ircd/services/conf/services.chk > /dev/null 2>&1
Le * / 5 au commencement signifie "vérifier toutes les 5 minutes". Vous pouvez remplacer Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
le 5 avec un autre numéro si vous voulez (mais moins de 60). Consulter remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
pages de manuel de votre système pour plus de détails sur la syntaxe de la crontab Consultez les pages de manuel de votre système pour plus de détails sur
fichier. Intéressant pages de manuel sont crontab (5), crontab (1) et cron (8). la syntaxe du fichier crontab. Les pages de manuel intéressantes sont
crontab(5), crontab(1) et cron(8).
Sauvegarder et quitter, et il est installé. Sauvegardez, quittez, et c'est installé !
-202
View File
@@ -1,202 +0,0 @@
How To Add IRCd Support
-----------------------
1) Files to Edit
2) The Code
3) The IRCDVar struct
4) Modes
5) Functions / Events
6) CAPAB/PROTOCTL
7) IRCDProto Class
1) Files to Edit
When preparing to add supprt to Anope for your IRCd, you need to edit
the following files
A) Make a copy of the .cpp file of the IRCd that matches the IRCd that
you are attempting to add support for best.
B) Add your IRCd into the supported IRCds in example.conf
2) The Code
Here is where the code of the .cpp file comes in. Be prepared to spend at
least an hour, if not longer, going over the code and getting it right;
Especially if you are setting up an ircd that is completely different
than the one you used as a base. This section covers the majority of the
code that is in use.
The first bit of code you will face is the IRCDVar structure, This is one
of two structs which holds your IRCd information; This allows you to quickly
setup your specific ircd.
IRCDVar myIrcd[] = { };
This struct contains your basic IRCd functions. Your base source file has
the list of all available variables; note that you should not swap any
around, or you will break stuff. Here is a brief description of the usage
of each.
1) Name: This member tells Anope about the IRCD's name. It may contain
text about it's name and version. This is used to identify the
build on startup.
2) Pseudo Client Mode: This is the user mode set by Anope on all BotServ
bots. Normally you want this to be a some form of
service or bot flag; you can use + for no mode at
all.
3) Max Channelmode Symbols: This is the total number of possible channel
modes that can appear before a nick. Do
remember to count each possible mode, so +ov
is 2.
4) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
KILL is used. Use 1 for yes, 0 for no.
5) VHOST: Can a user's host be changed on the fly? Enabling this allow
HostServ online. Use 1 for yes, 0 for no.
6) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
0 for no.
7) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
8) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
10) Join to Message: Services must join a channel to send any message to
that channel (cannot override +n). Use 1 for yes,
0 for no.
11) SQline Channels: The IRCd's supports banning channel names via
SQLINES. Use 1 for yes, 0 for no.
12) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
QUIT message for that user? Use 1 for yes, 0 for no.
13) SVSMODE UNBAN: We can use SVSMODE to unban hosts from a channel. Use
1 for yes, 0 for no.
14) Reverse: We can do a reverse check when unbanning. For use with
DreamForge based IRCd's. Use 1 for yes, 0 for no.
15) vIdent: Support for including a user's ident in their vHost. Use
1 for yes, 0 for no.
16) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
a nick enforcer client. Use 1 for yes, 0 for no.
17) TS on MODE: We need to send a timestamp when modes are being changed.
Use 1 for yes, 0 for no.
18) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
0 for no.
19) OMODE: We can use OperServ to give some user a temporary O:LINE.
Use 1 for yes, 0 for no.
20) No Knock Requires +i: Does the No Knock channel mode require invite
only channels? Use 1 for yes, 0 for no.
21) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
1 for yes, 0 for no.
22) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to
do so? Use 1 for yes, 0 for no.
23) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
24) Global TLD Prefix: Prefix used to send global messages, should probably
be "$"
25) Max Modes: The max number of mode changes we can send in one line
3) Modes
Anope is told about modes in the protocol module.
For the most part, the syntax for adding channel and user modes are:
ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, "UMODE_NETADMIN", 'N'));
Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the
mode does. Or:
ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, "CMODE_BLOCKCOLOR", 'c'));
Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what
the mode does
A full list of valid mode names for the second param can be found
in services.h in the enum for ChannelModeName and UserModeName
If necessary, you can add additional modes to this list.
Adding simple modes with parameters is similar, instead adding a
'new ChannelMode', use 'new ChannelModeParam', set the third optional
arg of ChannelModeParam to false if the param should NOT be sent when unsetting
it. Eg:
ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, "CMODE_JOINFLOOD", 'j', true));
Anope will internally track the params, and they can be retrieved through
Channel::GetParam();
If you want to make param validity checking for a mode, you must create a new
class which inherits from ChannelModeParam and overload the IsValid function.
Modes CMODE_OPERONLY, CMODE_ADMINONLY, and CMODE_REGISTERED already exist
internally as classes, to overload the CanSet function to disable non opers
from mlocking (or in CMODE_REGISTERED's case, anyone) from setting them.
This should be added like:
ModeManager::AddChannelMode(new ChannelModeOper('O'));
4) Functions and Events
A brief word about functions and events. All events are captured by creating a Message struct
with the name of the message and the callback function:
Message my_message("MESSAGE", do_my_messsage);
Each message should have a message handler if its important enough to be
processed by services. All event functions should be formed like this:
bool do_my_message(const Anope::string &source, const std::vector<Anope::string> &params)
{
return true;
}
They will receive the source; this can be empty at times depending on the
event. Next, params holds the arguments for the event. Events are likely to
pass to various upper level event handlers; see the previous ircd source for
how they handle these events.
5) CAPAB/PROTOCTL
Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. The protocol module should
handle all of these without the cores knowledge with the exception of the following:
--------------------------------------------------------------------------
Define | Description
----------------|---------------------------------------------------------
CAPAB_NOQUIT | NOQUIT protocol support
CAPAB_TSMODE | Chanmodes are timestamped
CAPAB_UNCONNECT | UNCONNECT protocol support
CAPAB_QS | Quitstorm - same as NOQUIT
You can override the default OnCapab method in IRCdMessage if required.
6) IRCDProto Class
The IRCDProto class is set up like:
class MyIRCdProto : public IRCDProto { } ircdproto;
And told to Anope through the
pmodule_ircd_proto(&ircd_proto);
function.
This is used for sending out specific messages from Anope to your IRCd.
A list of all of the valid function names to overload and their args
are in services.h. If the protocol module you are editing is similar enough
to the IRCd you are adding support for, many of these probably won't need to
be changed.
+10 -3
View File
@@ -8,8 +8,15 @@ Anope Mutli Language Support
1) Building Anope with gettext support 1) Building Anope with gettext support
To build Anope with gettext support, gettext and its development libraries must be installed on the system. To build Anope with gettext support, gettext and its development libraries must be installed on the system.
Anope does not require locales to be installed or enabled on the system, but does require the locales-all
package on Debian and Debian based systems. On Debian install the locales-all package.
On Ubuntu run locale-gen for each language you want to enable.
For example:
locale-gen es_ES.UTF-8
Then execute:
dpkg-reconfigure locales
Building Anope on Windows with gettext support is explained in docs/WIN32.txt Building Anope on Windows with gettext support is explained in docs/WIN32.txt
@@ -31,7 +38,7 @@ Anope Mutli Language Support
3) Using langages with modules 3) Using langages with modules
Module authors can easially add the ability to have their modules translated by adding _() around the strings they Module authors can easily add the ability to have their modules translated by adding _() around the strings they
want translated (messages to the user, etc). want translated (messages to the user, etc).
If you want to translate a module someone has made, first generate a .pot file if there isn't one already using If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
+15 -16
View File
@@ -1,7 +1,7 @@
Anope -- a set of IRC services for IRC networks Anope -- a set of IRC services for IRC networks
----------------------------------------------- -----------------------------------------------
Anope is 2003-2013 Anope Team <team@anope.org>. Anope is 2003-2014 Anope Team <team@anope.org>.
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>. Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>. Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
@@ -107,20 +107,18 @@ Table of Contents
Anope Translations: Anope Translations:
* GeniusDex <geniusdex@anope.org> (nl.l) * Robby <robby@chat.be> (nl_NL)
* Kein <kein-of@yandex.ru> (ru.l) * Kein <kein-of@yandex.ru> (ru_RU)
* Maik Funke <Han@mefalcon.org> (de.l) * Maik Funke <Han@mefalcon.org> (de_DE)
* Gabriel Acevedo H. <drstein@anope.org> (es.l) * Isaac Fontal <i_fontal@hotmail.com> (es_ES)
* Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l) * Janos Kapitany <sarkanyka@cjbchat.hu> (hu_HU)
* Szymon S'wierkosz <szymek@adres.pl> (pl.l) * Szymon S'wierkosz <szymek@adres.pl> (pl_PL)
* Christopher N. <saka@epiknet.org> (fr.l) * Christopher N. <saka@epiknet.org> (fr_FR)
* Yusuf Kurekci <ysfm.20@gmail.com> (tr.l) * Yusuf Kurekci <ysfm.20@gmail.com> (tr_TR)
Anope Web panel: Anope Web panel:
* Thomas Edwards <thomas.edwards@ilkotech.co.uk> * Denis M. (Phr33d0m) <god@politeia.in>
* Luke Thompson <luke.thompson@ilkotech.co.uk>
* Matthew M. <mcm@they-got.us>
2) Presentation 2) Presentation
@@ -171,8 +169,9 @@ Table of Contents
Anope currently works with: Anope currently works with:
* Bahamut 1.4.27 or later (including 1.8) * Bahamut 1.4.27 or later (including 1.8)
* Hybrid 8.0 or later * Charybdis 3.4 or later
* InspIRCd 1.1, 1.2, or 2.0 * Hybrid 8.1 or later
* InspIRCd 1.2 or 2.0
* ngIRCd 19.2 or later * ngIRCd 19.2 or later
* Plexus 3 or later * Plexus 3 or later
* Ratbox 2.0.6 or later * Ratbox 2.0.6 or later
@@ -203,10 +202,10 @@ Table of Contents
--version Display the version of Anope --version Display the version of Anope
--nothird Do not load the non-core modules specified --nothird Do not load the non-core modules specified
--protocoldebug Debug each incoming message after protocol parsing --protocoldebug Debug each incoming message after protocol parsing
--support Used for support, same as -debug -nofork -nothird --support Used for support, same as --debug --nofork --nothird
Upon starting, Anope will parse its command-line parameters then Upon starting, Anope will parse its command-line parameters then
(assuming the -nofork option is not given) detach itself and run in the (assuming the --nofork option is not given) detach itself and run in the
background. If Anope encounters a problem reading the database files or background. If Anope encounters a problem reading the database files or
cannot connect to its uplink server, it will terminate immediately; cannot connect to its uplink server, it will terminate immediately;
otherwise, it will run until the connection is terminated (or a QUIT, otherwise, it will run until the connection is terminated (or a QUIT,
+160
View File
@@ -0,0 +1,160 @@
Starting in Anope 1.9.9, Anope has Redis database support (http://redis.io/).
This document explains the data structure used by Anope, and explains how
keyspace notification works.
This is not a tutorial on how to use Redis, see http://redis.io/documentation
for that.
Table of Contents
-----------------
1) Data structure
2) Keyspace notifications
3) Examples of modifying, deleting, and creating objects
1) Data structure
There are 4 key namespaces in Anope, they are:
id - The keys in id are used to atomically create object ids for new
objects. For example, if I were to create a new BotInfo I would first:
redis 127.0.0.1:6379> INCR id:BotInfo
To get the object ID of the new object.
ids - The keys in ids contain a set of all object ids of the given type.
For example:
redis 127.0.0.1:6379> SMEMBERS ids:BotInfo
Returns "1", "2", "3", "4", "5", "6", "7", "8" because I have 8 bots that
have IDs 1, 2, 3, 4, 5, 6, 7, and 8, respectively.
hash - The keys in hash are the actual objects, stored as hashes. For
example, if I had just looked up all BotInfo ids and wanted to iterate
over all of them, I woulld start by:
redis 127.0.0.1:6379> HGETALL hash:BotInfo:1
Which gets all keys and values from the hash of type BotInfo with id 1.
This may return:
"nick" -> "BotServ"
"user" -> "services"
"host" -> "services.anope.org"
"created" -> "1368704765"
value - The keys in value only exist to aid looking up object IDs. They
are sets of object IDs and are used to map key+value pairs to objects.
For example:
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nick:Adam
Returns a set of object ids of NickAlias objects that have the key
'nick' set to the value 'Adam' in its hash. Clearly this can only
ever contain at most one object, since it is not possible to have
more than one registered nick with the same name, but other keys
will contain more than one, such as:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:email:adam@anope.org
Which would return all accounts with the email "adam@anope.org".
redis 127.0.0.1:6379> SMEMBERS value:ChanAccess:mask:Adam
Which would return all access entries set on the account "Adam".
Behavior similar to SQL's AND, can be achieved using the
SINTER command, which does set intersection on one or more sets.
2) Keyspace notifications
Redis 2.7 (unstable) and 2.8 (stable) and newer support keyspace notifications
(http://redis.io/topics/notifications). This allows Redis to notify Anope of
any external changes to objects in the database. Once notified, Anope will
immediately update the object. Otherwise, Anope keeps all objects in memory
and will not regularly read from the databaes once started.
You can use this to modify objects in Redis and have them immediately reflected
back into Anope. Additionally you can use this feature to run multiple Anope
instances simultaneously from the same database (see also, Redis database
replication).
To use keyspace notifications you MUST execute
redis 127.0.0.1:6379> CONFIG SET notify-keyspace-events KA
OK
or set notify-keyspace-events in redis.conf properly. Anope always executes
CONFIG SET when it first connects.
If you do not enable keyspace events properly Anope will be UNABLE to see any
object modifications you do.
The key space ids and value are managed entirely by Anope, you do
not (and should not) modify them. Once you modify the object (hash), Anope will
update them for you to correctly refelect any changes made to the object.
Finally, always use atomic operations. If you are inserting a new object with
multiple commands, or inserting multiple objects at once, specifically if the
objects depend on each other, you MUST use a transaction.
3) Examples of modifying, deleting, and creating objects
These examples will ONLY work if you meet the criteria in section 2.
If I want to change the email account 'Adam' to 'Adam@anope.org', I would execute the following:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
Which returns a value of "1", which is the object id I want to modify.
Now to change the email:
redis 127.0.0.1:6379> HSET hash:NickCore:1 email Adam@anope.org
You can now see this in NickServ's INFO command:
-NickServ- Email address: Adam@anope.org
If I want to drop the account "Adam", I would execute the following:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
Which returns a value of "1". I would then check:
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nc:Adam
To see what nicknames depend on this account to exist, as I will
have to remove those too. This returns the values "2", and "3".
Finally, I can drop the nick using a transaction via:
redis 127.0.0.1:6379> MULTI
OK
redis 127.0.0.1:6379> DEL hash:NickAlias:2
QUEUED
redis 127.0.0.1:6379> DEL hash:NickAlias:3
QUEUED
redis 127.0.0.1:6379> DEL hash:NickCore:1
QUEUED
redis 127.0.0.1:6379> EXEC
Or alternatively simply:
redis 127.0.0.1:6379> DEL hash:NickAlias:2 hash:NickAlias:3 hash:NickCore:1
If I wanted to create a BotServ bot, I would execute the following:
redis 127.0.0.1:6379> INCR id:BotInfo
Which returns a new object ID for me, in this example it will be "8".
Now I can create the object:
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Services for IRC Networks"
Note if you are using HSET instead of HMSET you will need to use a transaction, as shown in the above example.
If you are watching your services logs you will immediatly see:
USERS: redis!redis@services.anope.org (Services for IRC Networks) connected to the network (services.anope.org)
And the bot redis will be in BotServ's bot list.
Notice how ids:BotInfo and the value keys are updated automatically.
+5 -14
View File
@@ -71,21 +71,12 @@ Anope for Windows
our IRC Support channel for assistance. our IRC Support channel for assistance.
Some Anope modules require third party libraries, such as m_mysql and Some Anope modules require third party libraries, such as m_mysql and
m_ssl. If these libraries are installed in nonstandard locations, cmake the SSL modules. If these libraries are installed in nonstandard
will probably not find them and should be told where they are by passing locations, cmake will probably not find them and should be told where
additional search paths to the last question in Config, such as: they are by passing their location to Config.
-DEXTRA_INCLUDES:STRING=c:/openssl/include;c:/openssl/lib The libraries used to build the 'extra' modules are available at
https://github.com/Adam-/windows-scripts.
Which would have cmake search both C:\openssl\include and
C:\openssl\lib.
Building Anope with gettext requires libintl, libiconv, libgcc and
libmingex. We have precompiled these libraries for you that you may
use if you want. They are avaiable at http://anope.org/downloads/anope-extra.zip
The OpenSSL, MySQL, and OpenLDAP header files and libraries are also included in
this package. Once downloaded and extracted, you should run install.bat
then give Config the path to the new 'installed' directory.
5) You are now ready to compile. If you said you wanted to use NMake in step 4, 5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type: at the prompt type:
+2 -2
View File
@@ -3,8 +3,8 @@ This allows external applications, such as websites, to execute remote procedure
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main: Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
checkAuthetication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password checkAuthentication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
is correct for the account name, useful for making login pages on websites. is correct for the account name, useful for making login pages on websites.
command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command
to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the
+2 -2
View File
@@ -1,7 +1,7 @@
<?php <?php
/* XMLRPC Functions /* XMLRPC Functions
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
*/ */
@@ -74,7 +74,7 @@ class AnopeXMLRPC
*/ */
function DoChannel($Channel) function DoChannel($Channel)
{ {
return $this->RunXMLRPC("channel", NULL); return $this->RunXMLRPC("channel", array($Channel));
} }
/* Like DoChannel(), but different. /* Like DoChannel(), but different.
Executable
+173
View File
@@ -0,0 +1,173 @@
#!/usr/bin/env perl
#
# Script taken from InspIRCd, www.inspircd.org
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
BEGIN { require 5.8.0; }
use strict;
use warnings FATAL => qw(all);
use File::Copy ();
use Cwd;
sub list_extras ();
sub enable_extras (@);
sub disable_extras (@);
# Routine to list out the extra/ modules that have been enabled.
# Note: when getting any filenames out and comparing, it's important to lc it if the
# file system is not case-sensitive (== Epoc, MacOS, OS/2 (incl DOS/DJGPP), VMS, Win32
# (incl NetWare, Symbian)). Cygwin may or may not be case-sensitive, depending on
# configuration, however, File::Spec does not currently tell us (it assumes Unix behavior).
sub list_extras () {
use File::Spec;
# @_ not used
my $srcdir = File::Spec->catdir("modules");
my $abs_srcdir = File::Spec->rel2abs($srcdir);
local $_;
my $dd;
opendir $dd, File::Spec->catdir($abs_srcdir, "extra") or die (File::Spec->catdir($abs_srcdir, "extra") . ": $!\n");
my @extras = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
closedir $dd;
undef $dd;
opendir $dd, $abs_srcdir or die "$abs_srcdir: $!\n";
my @sources = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
closedir $dd;
undef $dd;
my $maxlen = (sort { $b <=> $a } (map {length($_)} (@extras)))[0];
my %extras = ();
EXTRA: for my $extra (@extras) {
next if (File::Spec->curdir() eq $extra || File::Spec->updir() eq $extra);
my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra);
my $abs_source = File::Spec->catfile($abs_srcdir, $extra);
next unless ($extra =~ m/\.(cpp|h)$/ || (-d $abs_extra)); # C++ Source/Header, or directory
if (-l $abs_source) {
# Symlink, is it in the right place?
my $targ = readlink($abs_source);
my $abs_targ = File::Spec->rel2abs($targ, $abs_srcdir);
if ($abs_targ eq $abs_extra) {
$extras{$extra} = "\e[32;1menabled\e[0m";
} else {
$extras{$extra} = sprintf("\e[31;1mwrong symlink target (%s)\e[0m", $abs_targ);
}
} elsif (-e $abs_source) {
my ($devext, $inoext) = stat($abs_extra);
my ($devsrc, $inosrc, undef, $lnksrc) = stat($abs_source);
if ($lnksrc > 1) {
if ($devsrc == $devext && $inosrc == $inoext) {
$extras{$extra} = "\e[32;1menabled\e[0m";
} else {
$extras{$extra} = sprintf("\e[31;1mwrong hardlink target (%d:%d)\e[0m", $devsrc, $inosrc);
}
} else {
open my $extfd, "<", $abs_extra;
open my $srcfd, "<", $abs_source;
local $/ = undef;
if (scalar(<$extfd>) eq scalar(<$srcfd>)) {
$extras{$extra} = "\e[32;1menabled\e[0m";
} else {
$extras{$extra} = sprintf("\e[31;1mout of synch (re-copy)\e[0m");
}
}
} else {
$extras{$extra} = "\e[33;1mdisabled\e[0m";
}
}
for my $extra (sort {$a cmp $b} keys(%extras)) {
my $text = $extras{$extra};
if ($text =~ m/needed by/ && $text !~ m/enabled/) {
printf "\e[31;1;5m%-*s = %s%s\e[0m\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? ")" : "");
} else {
printf "%-*s = %s%s\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? "\e[0m)" : "");
}
}
return keys(%extras) if wantarray; # Can be used by manage_extras.
}
sub enable_extras (@) {
my (@extras) = @_;
for my $extra (@extras) {
my $extrapath = "modules/extra/$extra";
if (!-e $extrapath) {
print STDERR "Cannot enable \e[32;1m$extra\e[0m : No such file or directory in modules/extra\n";
next;
}
my $source = "modules/$extra";
if (-e $source) {
print STDERR "Cannot enable \e[32;1m$extra\e[0m : destination in modules exists (might already be enabled?)\n";
next;
}
print "Enabling $extra ... \n";
symlink "extra/$extra", $source or print STDERR "$source: Cannot link to 'extra/$extra': $!\n";
}
}
sub disable_extras (@)
{
opendir my $dd, "modules/extra/";
my @files = readdir($dd);
closedir $dd;
my (@extras) = @_;
EXTRA: for my $extra (@extras) {
my $extrapath = "modules/extra/$extra";
my $source = "modules/$extra";
if (!-e $extrapath) {
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Is not an extra\n";
next;
}
if ((! -l $source) || readlink($source) ne "extra/$extra") {
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Source is not a link or doesn't refer to the right file. Remove manually if this is in error.\n";
next;
}
# Now remove.
print "Disabling $extra ... \n";
unlink "modules/$extra" or print STDERR "Cannot disable \e[32;1m$extra\e[0m : $!\n";
}
}
my $clearscreen = `clear`;
print $clearscreen;
while (1)
{
list_extras; # print the module list
print "\nPlease enter the name of the module or type 'q' to quit.: ";
my $input = <STDIN>;
chop($input); # remove the trailing \n from the user input
if ($input eq "q") {
if (-e "build/CMakeFiles") {
if (-e "cmake-bin") {
my $cmake_path = `find cmake-bin -name cmake -print0`;
system($cmake_path, "build/.");
} else {
system("cmake", "build/.");
}
print "\nNow cd build, then run make to build Anope.\n\n";
} else {
print "\nBuild directory not found. You should run ./Config now.\n\n"
}
exit 0;
}
print $clearscreen;
if ($input eq "") {
next;
}
if (-e "modules/$input") {
disable_extras($input)
} else {
enable_extras($input)
}
}
+2 -1
View File
@@ -7,7 +7,7 @@ get_target_property(version_BINARY version LOCATION)
# Modify version.h from the above executable, with dependencies to version.cpp # Modify version.h from the above executable, with dependencies to version.cpp
# and all of the source files in the main build # and all of the source files in the main build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
DEPENDS version ${SRC_SRCS} DEPENDS version ${SRC_SRCS}
) )
# Add version to list of files for CPack to ignore # Add version to list of files for CPack to ignore
@@ -15,6 +15,7 @@ get_filename_component(version_BINARY ${version_BINARY} NAME)
add_to_cpack_ignored_files("${version_BINARY}$" TRUE) add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
if(NOT WIN32) if(NOT WIN32)
add_to_cpack_ignored_files("version.h$" TRUE) add_to_cpack_ignored_files("version.h$" TRUE)
add_to_cpack_ignored_files("build.h$" TRUE)
endif(NOT WIN32) endif(NOT WIN32)
set(PCH_SOURCES_GCH "") set(PCH_SOURCES_GCH "")
+23 -6
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -74,12 +74,22 @@ class CoreExport AccessProvider : public Service
/* Represents one entry of an access list on a channel. */ /* Represents one entry of an access list on a channel. */
class CoreExport ChanAccess : public Serializable class CoreExport ChanAccess : public Serializable
{ {
Anope::string mask;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
public: public:
typedef std::multimap<const ChanAccess *, const ChanAccess *> Set;
/* shows the 'path' taken to determine if an access entry matches a user
* .first are access entries checked
* .second are access entries which match
*/
typedef std::pair<Set, Set> Path;
/* The provider that created this access entry */ /* The provider that created this access entry */
AccessProvider *provider; AccessProvider *provider;
/* Channel this access entry is on */ /* Channel this access entry is on */
Serialize::Reference<ChannelInfo> ci; Serialize::Reference<ChannelInfo> ci;
Anope::string mask;
Anope::string creator; Anope::string creator;
time_t last_seen; time_t last_seen;
time_t created; time_t created;
@@ -87,14 +97,19 @@ class CoreExport ChanAccess : public Serializable
ChanAccess(AccessProvider *p); ChanAccess(AccessProvider *p);
virtual ~ChanAccess(); virtual ~ChanAccess();
void SetMask(const Anope::string &mask, ChannelInfo *ci);
const Anope::string &Mask() const;
NickCore *GetAccount() const;
void Serialize(Serialize::Data &data) const anope_override; void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &); static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
/** Check if this access entry matches the given user or account /** Check if this access entry matches the given user or account
* @param u The user * @param u The user
* @param nc The account * @param nc The account
* @param p The path to the access object which matches will be put here
*/ */
virtual bool Matches(const User *u, const NickCore *nc) const; virtual bool Matches(const User *u, const NickCore *nc, Path &p) const;
/** Check if this access entry has the given privilege. /** Check if this access entry has the given privilege.
* @param name The privilege name * @param name The privilege name
@@ -113,8 +128,8 @@ class CoreExport ChanAccess : public Serializable
virtual void AccessUnserialize(const Anope::string &data) = 0; virtual void AccessUnserialize(const Anope::string &data) = 0;
/* Comparison operators to other Access entries */ /* Comparison operators to other Access entries */
bool operator>(const ChanAccess &other) const; virtual bool operator>(const ChanAccess &other) const;
bool operator<(const ChanAccess &other) const; virtual bool operator<(const ChanAccess &other) const;
bool operator>=(const ChanAccess &other) const; bool operator>=(const ChanAccess &other) const;
bool operator<=(const ChanAccess &other) const; bool operator<=(const ChanAccess &other) const;
}; };
@@ -125,8 +140,10 @@ class CoreExport ChanAccess : public Serializable
class CoreExport AccessGroup : public std::vector<ChanAccess *> class CoreExport AccessGroup : public std::vector<ChanAccess *>
{ {
public: public:
/* Channel these access entries are on */ /* Channel these access entries are on */
const ChannelInfo *ci; const ChannelInfo *ci;
/* Path from these entries to other entries that they depend on */
ChanAccess::Path path;
/* Account these entries affect, if any */ /* Account these entries affect, if any */
const NickCore *nc; const NickCore *nc;
/* super_admin always gets all privs. founder is a special case where ci->founder == nc */ /* super_admin always gets all privs. founder is a special case where ci->founder == nc */
+7 -87
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -27,15 +27,6 @@ extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
/* A registered nickname. /* A registered nickname.
* It matters that Base is here before Extensible (it is inherited by Serializable) * It matters that Base is here before Extensible (it is inherited by Serializable)
*
* Possible flags:
* NO_EXPIRE - Nick never expires
* HELD - This nick is being held after a kill by an enforcer client
* or is being SVSHeld.
* COLLIDED - We are taking over this nick, either by SVSNICK or KILL
* and are waiting for the confirmation of either of these actions to
* proceed. This is checked in NickAlias::OnCancel
*
*/ */
class CoreExport NickAlias : public Serializable, public Extensible class CoreExport NickAlias : public Serializable, public Extensible
{ {
@@ -65,18 +56,6 @@ class CoreExport NickAlias : public Serializable, public Extensible
void Serialize(Serialize::Data &data) const anope_override; void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &); static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
/** Release a nick
* See the comment in users.cpp
*/
void Release();
/** This function is called when a user on this nick either disconnects or changes nick.
* Note that the user isnt necessarially identified to this nick
* See the comment in users.cpp
* @param u The user
*/
void OnCancel(User *u);
/** Set a vhost for the user /** Set a vhost for the user
* @param ident The ident * @param ident The ident
* @param host The host * @param host The host
@@ -124,26 +103,6 @@ class CoreExport NickAlias : public Serializable, public Extensible
/* A registered account. Each account must have a NickAlias with the same nick as the /* A registered account. Each account must have a NickAlias with the same nick as the
* account's display. * account's display.
* It matters that Base is here before Extensible (it is inherited by Serializable) * It matters that Base is here before Extensible (it is inherited by Serializable)
*
* Possible flags:
* KILLPROTECT - Kill other users who try to take this nick
* SECURE - Don't recognize unless identified
* MSG - Use PRIVMSG instead of notice
* MEMO_HARDMAX - Don't allow user to change memo limit
* MEMO_SIGNON - Notify of memos at signon and unaway
* MEMO_RECEIEVE - Notify of new memos when sent
* PRIVATE - Don't show in LIST to non-servadmins
* HIDE_EMAIL - Don't show email in INFO
* HIDE_MASK - Don't show last seen address in INFO
* HIDE_QUIT - Don't show last quit message in INFO
* KILL_QUICK - Kill quicker
* KILL_IMMED - Kill immediately
* MEMO_MAIL - User gets email on memo
* HIDE_STATUS - Don't show services access status
* SUSPEND - Nickname is suspended
* AUTOOP - Autoop nickname in channels
* UNCONFIRMED - Account has not had email address confirmed
* STATS - ChanStats is enabled for this user
*/ */
class CoreExport NickCore : public Serializable, public Extensible class CoreExport NickCore : public Serializable, public Extensible
{ {
@@ -155,16 +114,13 @@ class CoreExport NickCore : public Serializable, public Extensible
/* User password in form of hashm:data */ /* User password in form of hashm:data */
Anope::string pass; Anope::string pass;
Anope::string email; Anope::string email;
/* Greet associated with the account, sometimes sent when the user joins a channel */
Anope::string greet;
/* Locale name of the language of the user. Empty means default language */ /* Locale name of the language of the user. Empty means default language */
Anope::string language; Anope::string language;
/* Access list, contains user@host masks of users who get certain privileges based /* Access list, contains user@host masks of users who get certain privileges based
* on if NI_SECURE is set and what (if any) kill protection is enabled. */ * on if NI_SECURE is set and what (if any) kill protection is enabled. */
std::vector<Anope::string> access; std::vector<Anope::string> access;
/* SSL certificate list. Users who have a matching certificate may be automatically logged in */
std::vector<Anope::string> cert;
MemoInfo memos; MemoInfo memos;
std::map<Anope::string, Anope::string> last_modes;
/* Nicknames registered that are grouped to this account. /* Nicknames registered that are grouped to this account.
* for n in aliases, n->nc == this. * for n in aliases, n->nc == this.
@@ -219,6 +175,10 @@ class CoreExport NickCore : public Serializable, public Extensible
*/ */
Anope::string GetAccess(unsigned entry) const; Anope::string GetAccess(unsigned entry) const;
/** Get the number of entries on the access list for this account.
*/
unsigned GetAccessCount() const;
/** Find an entry in the nick's access list /** Find an entry in the nick's access list
* *
* @param entry The nick!ident@host entry to search for * @param entry The nick!ident@host entry to search for
@@ -250,46 +210,6 @@ class CoreExport NickCore : public Serializable, public Extensible
*/ */
bool IsOnAccess(const User *u) const; bool IsOnAccess(const User *u) const;
/** Add an entry to the nick's certificate list
*
* @param entry The fingerprint to add to the cert list
*
* Adds a new entry into the cert list.
*/
void AddCert(const Anope::string &entry);
/** Get an entry from the nick's cert list by index
*
* @param entry Index in the certificaate list vector to retrieve
* @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
*
* Retrieves an entry from the certificate list corresponding to the given index.
*/
Anope::string GetCert(unsigned entry) const;
/** Find an entry in the nick's cert list
*
* @param entry The fingerprint to search for
* @return True if the fingerprint is found in the cert list, false otherwise
*
* Search for an fingerprint within the cert list.
*/
bool FindCert(const Anope::string &entry) const;
/** Erase a fingerprint from the nick's certificate list
*
* @param entry The fingerprint to remove
*
* Removes the specified fingerprint from the cert list.
*/
void EraseCert(const Anope::string &entry);
/** Clears the entire nick's cert list
*
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
*/
void ClearCert();
/** Finds an account /** Finds an account
* @param nick The account name to find * @param nick The account name to find
* @return The account, if it exists * @return The account, if it exists
@@ -302,7 +222,7 @@ class CoreExport NickCore : public Serializable, public Extensible
}; };
/* A request to check if an account/password is valid. These can exist for /* A request to check if an account/password is valid. These can exist for
* extended periods of time due to some authentication modules take. * extended periods due to the time some authentication modules take.
*/ */
class CoreExport IdentifyRequest class CoreExport IdentifyRequest
{ {
+42 -35
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -115,6 +115,7 @@ namespace Anope
* The following functions return the various types of strings. * The following functions return the various types of strings.
*/ */
inline const char *c_str() const { return this->_string.c_str(); } inline const char *c_str() const { return this->_string.c_str(); }
inline const char *data() const { return this->_string.data(); }
inline std::string &str() { return this->_string; } inline std::string &str() { return this->_string; }
inline const std::string &str() const { return this->_string; } inline const std::string &str() const { return this->_string; }
inline ci::string ci_str() const { return ci::string(this->_string.c_str()); } inline ci::string ci_str() const { return ci::string(this->_string.c_str()); }
@@ -159,24 +160,24 @@ namespace Anope
* Trim leading and trailing white spaces from the string. * Trim leading and trailing white spaces from the string.
*/ */
inline string& ltrim() inline string& ltrim(const Anope::string &what = " \t\r\n")
{ {
while (!this->_string.empty() && isspace(this->_string[0])) while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
this->_string.erase(this->_string.begin()); this->_string.erase(this->_string.begin());
return *this; return *this;
} }
inline string& rtrim() inline string& rtrim(const Anope::string &what = " \t\r\n")
{ {
while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1])) while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
this->_string.erase(this->_string.length() - 1); this->_string.erase(this->_string.length() - 1);
return *this; return *this;
} }
inline string& trim() inline string& trim(const Anope::string &what = " \t\r\n")
{ {
this->ltrim(); this->ltrim(what);
this->rtrim(); this->rtrim(what);
return *this; return *this;
} }
@@ -225,7 +226,7 @@ namespace Anope
inline string replace(iterator first, iterator last, const string &_str) { return string(this->_string.replace(first, last, _str._string)); } inline string replace(iterator first, iterator last, const string &_str) { return string(this->_string.replace(first, last, _str._string)); }
inline string replace(iterator first, iterator last, size_type n, char chr) { return string(this->_string.replace(first, last, n, chr)); } inline string replace(iterator first, iterator last, size_type n, char chr) { return string(this->_string.replace(first, last, n, chr)); }
template <class InputIterator> inline string replace(iterator first, iterator last, InputIterator f, InputIterator l) { return string(this->_string.replace(first, last, f, l)); } template <class InputIterator> inline string replace(iterator first, iterator last, InputIterator f, InputIterator l) { return string(this->_string.replace(first, last, f, l)); }
inline string replace_all_cs(const string &_orig, const string &_repl) inline string replace_all_cs(const string &_orig, const string &_repl) const
{ {
Anope::string new_string = *this; Anope::string new_string = *this;
size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length(); size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length();
@@ -236,7 +237,7 @@ namespace Anope
} }
return new_string; return new_string;
} }
inline string replace_all_ci(const string &_orig, const string &_repl) inline string replace_all_ci(const string &_orig, const string &_repl) const
{ {
Anope::string new_string = *this; Anope::string new_string = *this;
size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length(); size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length();
@@ -255,7 +256,7 @@ namespace Anope
{ {
Anope::string new_string = *this; Anope::string new_string = *this;
for (size_type i = 0; i < new_string.length(); ++i) for (size_type i = 0; i < new_string.length(); ++i)
new_string[i] = std::tolower(new_string[i], Anope::casemap); new_string[i] = Anope::tolower(new_string[i]);
return new_string; return new_string;
} }
@@ -266,7 +267,7 @@ namespace Anope
{ {
Anope::string new_string = *this; Anope::string new_string = *this;
for (size_type i = 0; i < new_string.length(); ++i) for (size_type i = 0; i < new_string.length(); ++i)
new_string[i] = std::toupper(new_string[i], Anope::casemap); new_string[i] = Anope::toupper(new_string[i]);
return new_string; return new_string;
} }
@@ -312,7 +313,7 @@ namespace Anope
{ {
inline size_t operator()(const string &s) const inline size_t operator()(const string &s) const
{ {
return std::tr1::hash<std::string>()(s.lower().str()); return TR1NS::hash<std::string>()(s.lower().str());
} }
}; };
@@ -320,7 +321,7 @@ namespace Anope
{ {
inline size_t operator()(const string &s) const inline size_t operator()(const string &s) const
{ {
return std::tr1::hash<std::string>()(s.str()); return TR1NS::hash<std::string>()(s.str());
} }
}; };
@@ -333,7 +334,8 @@ namespace Anope
}; };
template<typename T> class map : public std::map<string, T, ci::less> { }; template<typename T> class map : public std::map<string, T, ci::less> { };
template<typename T> class hash_map : public std::tr1::unordered_map<string, T, hash_ci, compare> { }; template<typename T> class multimap : public std::multimap<string, T, ci::less> { };
template<typename T> class hash_map : public TR1NS::unordered_map<string, T, hash_ci, compare> { };
static const char *const compiled = __TIME__ " " __DATE__; static const char *const compiled = __TIME__ " " __DATE__;
@@ -498,21 +500,21 @@ namespace Anope
/** Retrieves a human readable string representing the time in seconds /** Retrieves a human readable string representing the time in seconds
* @param seconds The time on seconds, eg 60 * @param seconds The time on seconds, eg 60
* @param nc The account to use langauge settings for to translate this string, if applicable * @param nc The account to use language settings for to translate this string, if applicable
* @return A human readable string, eg "1 minute" * @return A human readable string, eg "1 minute"
*/ */
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL); extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL);
/** Generates a human readable string of type "expires in ..." /** Generates a human readable string of type "expires in ..."
* @param expires time in seconds * @param expires time in seconds
* @param nc The account to use langauge settings for to translate this string, if applicable * @param nc The account to use language settings for to translate this string, if applicable
* @return A human readable string, eg "expires in 5 days" * @return A human readable string, eg "expires in 5 days"
*/ */
extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL); extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL);
/** Converts a time in seconds (epoch) to a human readable format. /** Converts a time in seconds (epoch) to a human readable format.
* @param t The time * @param t The time
* @param nc The account to use langauge settings for to translate this string, if applicable * @param nc The account to use language settings for to translate this string, if applicable
* @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)" * @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)"
*/ */
extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false); extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false);
@@ -534,6 +536,11 @@ namespace Anope
* @return the IP if it was found, else the host * @return the IP if it was found, else the host
*/ */
extern Anope::string Resolve(const Anope::string &host, int type); extern Anope::string Resolve(const Anope::string &host, int type);
/** Generate a string of random letters and numbers
* @param len The length of the string returned
*/
extern CoreExport Anope::string Random(size_t len);
} }
/** sepstream allows for splitting token seperated lists. /** sepstream allows for splitting token seperated lists.
@@ -547,19 +554,19 @@ class CoreExport sepstream
/** Original string. /** Original string.
*/ */
Anope::string tokens; Anope::string tokens;
/** Last position of a seperator token
*/
Anope::string::iterator last_starting_position;
/** Current string position
*/
Anope::string::iterator n;
/** Seperator value /** Seperator value
*/ */
char sep; char sep;
/** Current string position
*/
size_t pos;
/** If set then GetToken() can return an empty string
*/
bool allow_empty;
public: public:
/** Create a sepstream and fill it with the provided data /** Create a sepstream and fill it with the provided data
*/ */
sepstream(const Anope::string &source, char seperator); sepstream(const Anope::string &source, char seperator, bool allowempty = false);
/** Fetch the next token from the stream /** Fetch the next token from the stream
* @param token The next token from the stream is placed here * @param token The next token from the stream is placed here
@@ -570,7 +577,7 @@ class CoreExport sepstream
/** Gets token number 'num' from the stream /** Gets token number 'num' from the stream
* @param token The token is placed here * @param token The token is placed here
* @param num The token number to featch * @param num The token number to featch
* @return True if the token was able to be detched * @return True if the token was able to be fetched
*/ */
bool GetToken(Anope::string &token, int num); bool GetToken(Anope::string &token, int num);
@@ -588,7 +595,7 @@ class CoreExport sepstream
/** Gets token number 'num' from the stream and all remaining tokens. /** Gets token number 'num' from the stream and all remaining tokens.
* @param token The token is placed here * @param token The token is placed here
* @param num The token number to featch * @param num The token number to featch
* @return True if the token was able to be detched * @return True if the token was able to be fetched
*/ */
bool GetTokenRemainder(Anope::string &token, int num); bool GetTokenRemainder(Anope::string &token, int num);
@@ -615,7 +622,7 @@ class commasepstream : public sepstream
public: public:
/** Initialize with comma seperator /** Initialize with comma seperator
*/ */
commasepstream(const Anope::string &source) : sepstream(source, ',') { } commasepstream(const Anope::string &source, bool allowempty = false) : sepstream(source, ',', allowempty) { }
}; };
/** A derived form of sepstream, which seperates on spaces /** A derived form of sepstream, which seperates on spaces
@@ -715,8 +722,7 @@ template<typename T> inline void convert(const Anope::string &s, T &x, Anope::st
leftover.clear(); leftover.clear();
std::istringstream i(s.str()); std::istringstream i(s.str());
char c; char c;
bool res = i >> x; if (!(i >> x))
if (!res)
throw ConvertException("Convert fail"); throw ConvertException("Convert fail");
if (failIfLeftoverChars) if (failIfLeftoverChars)
{ {
@@ -757,17 +763,18 @@ template<typename T> inline T convertTo(const Anope::string &s, bool failIfLefto
*/ */
#ifdef DEBUG_BUILD #ifdef DEBUG_BUILD
# include <typeinfo> # include <typeinfo>
#endif
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr) template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
{ {
#ifdef DEBUG_BUILD
T ret = dynamic_cast<T>(ptr); T ret = dynamic_cast<T>(ptr);
if (ptr != NULL && ret == NULL) if (ptr != NULL && ret == NULL)
throw CoreException(Anope::string("anope_dynamic_static_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail"); throw CoreException(Anope::string("anope_dynamic_static_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
return ret; return ret;
#else
return static_cast<T>(ptr);
#endif
} }
#else
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
{
return static_cast<T>(ptr);
}
#endif
#endif // ANOPE_H #endif // ANOPE_H
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* *
* Copyright (C) 2008-2011 Adam <Adam@anope.org> * Copyright (C) 2008-2011 Adam <Adam@anope.org>
* Copyright (C) 2008-2013 Anope Team <team@anope.org> * Copyright (C) 2008-2014 Anope Team <team@anope.org>
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
* *
+7 -6
View File
@@ -1,7 +1,7 @@
/* /*
* *
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org> * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2013 Anope Team <team@anope.org> * Copyright (C) 2008-2014 Anope Team <team@anope.org>
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
* *
@@ -23,6 +23,8 @@ extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */ /* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
class CoreExport BotInfo : public User, public Serializable class CoreExport BotInfo : public User, public Serializable
{ {
/* Channels this bot is assigned to */
Serialize::Checker<std::set<ChannelInfo *> > channels;
public: public:
time_t created; time_t created;
/* Last time this bot said something (via privmsg) */ /* Last time this bot said something (via privmsg) */
@@ -58,15 +60,16 @@ class CoreExport BotInfo : public User, public Serializable
void GenerateUID(); void GenerateUID();
void OnKill();
/** Change the nickname for the bot. /** Change the nickname for the bot.
* @param newnick The nick to change to * @param newnick The nick to change to
*/ */
void SetNewNick(const Anope::string &newnick); void SetNewNick(const Anope::string &newnick);
/** Rejoins all channels that this bot is assigned to. /** Return the channels this bot is assigned to
* Used on /kill, rename, etc.
*/ */
void RejoinAll(); const std::set<ChannelInfo *> &GetChannels() const;
/** Assign this bot to a given channel, removing the existing assigned bot if one exists. /** Assign this bot to a given channel, removing the existing assigned bot if one exists.
* @param u The user assigning the bot, or NULL * @param u The user assigning the bot, or NULL
@@ -130,6 +133,4 @@ class CoreExport BotInfo : public User, public Serializable
static BotInfo* Find(const Anope::string &nick, bool nick_only = false); static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
}; };
extern CoreExport BotInfo *BotServ, *ChanServ, *Global, *HostServ, *MemoServ, *NickServ, *OperServ;
#endif // BOTS_H #endif // BOTS_H
+37 -28
View File
@@ -1,6 +1,6 @@
/* Channel support /* Channel support
* *
* (C) 2008-2013 Anope Team * (C) 2008-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -30,16 +30,6 @@ struct ChanUserContainer : public Extensible
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { } ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
}; };
enum ChannelFlag
{
/* ChanServ is currently holding the channel */
CH_INHABIT,
/* Channel still exists when emptied */
CH_PERSIST,
/* If set the channel is syncing users (channel was just created) and it should not be deleted */
CH_SYNCING
};
class CoreExport Channel : public Base, public Extensible class CoreExport Channel : public Base, public Extensible
{ {
public: public:
@@ -56,10 +46,13 @@ class CoreExport Channel : public Base, public Extensible
Serialize::Reference<ChannelInfo> ci; Serialize::Reference<ChannelInfo> ci;
/* When the channel was created */ /* When the channel was created */
time_t creation_time; time_t creation_time;
std::set<ChannelFlag> flags; /* If the channel has just been created in a netjoin */
bool syncing;
/* Is configured in the conf as a channel bots should be in */
bool botchannel;
/* Users in the channel */ /* Users in the channel */
typedef std::list<ChanUserContainer *> ChanUserList; typedef std::map<User *, ChanUserContainer *> ChanUserList;
ChanUserList users; ChanUserList users;
/* Current topic of the channel */ /* Current topic of the channel */
@@ -80,12 +73,14 @@ class CoreExport Channel : public Base, public Extensible
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */ int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
int16_t bouncy_modes; /* Did we fail to set modes here? */ int16_t bouncy_modes; /* Did we fail to set modes here? */
private:
/** Constructor /** Constructor
* @param name The channel name * @param name The channel name
* @param ts The time the channel was created * @param ts The time the channel was created
*/ */
Channel(const Anope::string &nname, time_t ts = Anope::CurTime); Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
public:
/** Destructor /** Destructor
*/ */
~Channel(); ~Channel();
@@ -103,11 +98,16 @@ class CoreExport Channel : public Base, public Extensible
*/ */
void CheckModes(); void CheckModes();
/** Check if this channel should be deleted
*/
bool CheckDelete();
/** Join a user internally to the channel /** Join a user internally to the channel
* @param u The user * @param u The user
* @param status The status to give the user, if any
* @return The UserContainer for the user * @return The UserContainer for the user
*/ */
ChanUserContainer* JoinUser(User *u); ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
/** Remove a user internally from the channel /** Remove a user internally from the channel
* @param u The user * @param u The user
@@ -118,14 +118,14 @@ class CoreExport Channel : public Base, public Extensible
* @param u The user * @param u The user
* @return A user container if found, else NULL * @return A user container if found, else NULL
*/ */
ChanUserContainer *FindUser(const User *u) const; ChanUserContainer *FindUser(User *u) const;
/** Check if a user has a status on a channel /** Check if a user has a status on a channel
* @param u The user * @param u The user
* @param cms The status mode, or NULL to represent no status * @param cms The status mode, or NULL to represent no status
* @return true or false * @return true or false
*/ */
bool HasUserStatus(const User *u, ChannelModeStatus *cms) const; bool HasUserStatus(User *u, ChannelModeStatus *cms);
/** Check if a user has a status on a channel /** Check if a user has a status on a channel
* Use the overloaded function for ChannelModeStatus* to check for no status * Use the overloaded function for ChannelModeStatus* to check for no status
@@ -133,7 +133,7 @@ class CoreExport Channel : public Base, public Extensible
* @param name The mode name, eg CMODE_OP, CMODE_VOICE * @param name The mode name, eg CMODE_OP, CMODE_VOICE
* @return true or false * @return true or false
*/ */
bool HasUserStatus(const User *u, const Anope::string &name) const; bool HasUserStatus(User *u, const Anope::string &name);
/** See if a channel has a mode /** See if a channel has a mode
* @param name The mode name * @param name The mode name
@@ -225,7 +225,7 @@ class CoreExport Channel : public Base, public Extensible
* @param nick The nick being kicked * @param nick The nick being kicked
* @param reason The reason for the kick * @param reason The reason for the kick
*/ */
void KickInternal(MessageSource &source, const Anope::string &nick, const Anope::string &reason); void KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason);
/** Kick a user from the channel /** Kick a user from the channel
* @param bi The sender, can be NULL for the service bot for this channel * @param bi The sender, can be NULL for the service bot for this channel
@@ -242,9 +242,9 @@ class CoreExport Channel : public Base, public Extensible
/** Get a list of modes on a channel /** Get a list of modes on a channel
* @param name A mode name to get the list of * @param name A mode name to get the list of
* @return a pair of iterators for the beginning and end of the list * @return a vector of the list mode entries
*/ */
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name); std::vector<Anope::string> GetModeList(const Anope::string &name);
/** Get a string of the modes set on this channel /** Get a string of the modes set on this channel
* @param complete Include mode parameters * @param complete Include mode parameters
@@ -258,7 +258,7 @@ class CoreExport Channel : public Base, public Extensible
* @param newtopic The new topic * @param newtopic The new topic
* @param ts The time the new topic is being set * @param ts The time the new topic is being set
*/ */
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime); void ChangeTopicInternal(User *u, const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
/** Update the topic of the channel, and reset it if topiclock etc says to /** Update the topic of the channel, and reset it if topiclock etc says to
* @param user The user setting the topic * @param user The user setting the topic
@@ -267,30 +267,39 @@ class CoreExport Channel : public Base, public Extensible
*/ */
void ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime); void ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
/** Hold the channel open using ChanServ
*/
void Hold();
/** Set the correct modes, or remove the ones granted without permission, /** Set the correct modes, or remove the ones granted without permission,
* for the specified user. * for the specified user.
* @param user The user to give/remove modes to/from * @param user The user to give/remove modes to/from
* @param give_modes if true modes may be given to the user * @param give_modes if true modes may be given to the user
* @param check_noop if true, CI_NOAUTOOP is checked before giving modes
*/ */
void SetCorrectModes(User *u, bool give_mode, bool check_noop); void SetCorrectModes(User *u, bool give_modes);
/** Unbans a user from this channel. /** Unbans a user from this channel.
* @param u The user to unban * @param u The user to unban
* @param mode The mode to unban
* @param full Whether or not to match using the user's real host and IP * @param full Whether or not to match using the user's real host and IP
* @return whether or not a ban was removed * @return whether or not a ban was removed
*/ */
bool Unban(const User *u, bool full = false); bool Unban(User *u, const Anope::string &mode, bool full = false);
/** Check whether a user is permitted to be on this channel
* @param u The user
* @return true if they are allowed, false if they aren't and were kicked
*/
bool CheckKick(User *user);
/** Finds a channel /** Finds a channel
* @param name The channel to find * @param name The channel to find
* @return The channel, if found * @return The channel, if found
*/ */
static Channel* Find(const Anope::string &name); static Channel* Find(const Anope::string &name);
/** Finds or creates a channel
* @param name The channel name
* @param created Set to true if the channel was just created
* @param ts The time the channel was created
*/
static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime);
}; };
#endif // CHANNELS_H #endif // CHANNELS_H
+22 -7
View File
@@ -1,6 +1,6 @@
/* Declarations for command data. /* Declarations for command data.
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -46,7 +46,7 @@ struct CommandInfo
struct CoreExport CommandReply struct CoreExport CommandReply
{ {
virtual ~CommandReply() { } virtual ~CommandReply() { }
virtual void SendMessage(const BotInfo *source, const Anope::string &msg) = 0; virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
}; };
/* The source for a command */ /* The source for a command */
@@ -55,7 +55,7 @@ class CoreExport CommandSource
/* The nick executing the command */ /* The nick executing the command */
Anope::string nick; Anope::string nick;
/* User executing the command, may be NULL */ /* User executing the command, may be NULL */
User *u; Reference<User> u;
public: public:
/* The account executing the command */ /* The account executing the command */
Reference<NickCore> nc; Reference<NickCore> nc;
@@ -126,7 +126,6 @@ class CoreExport Command : public Service
void ClearSyntax(); void ClearSyntax();
void SetSyntax(const Anope::string &s); void SetSyntax(const Anope::string &s);
void SendSyntax(CommandSource &); void SendSyntax(CommandSource &);
void SendSyntax(CommandSource &, const Anope::string &syntax);
void AllowUnregistered(bool b); void AllowUnregistered(bool b);
void RequireUser(bool b); void RequireUser(bool b);
@@ -136,9 +135,10 @@ class CoreExport Command : public Service
bool RequireUser() const; bool RequireUser() const;
/** Get the command description /** Get the command description
* @param source The source wanting the command description
* @return The commands description * @return The commands description
*/ */
const Anope::string &GetDesc() const; virtual const Anope::string GetDesc(CommandSource &source) const;
/** Execute this command. /** Execute this command.
* @param source The source * @param source The source
@@ -163,8 +163,23 @@ class CoreExport Command : public Service
* @param subcommand The subcommand the user tried to use * @param subcommand The subcommand the user tried to use
*/ */
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand); virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
/** Runs a command
* @param source The source of the command
* @param message The full message to run, the command is at the beginning of the message
*/
static void Run(CommandSource &source, const Anope::string &message);
void Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector<Anope::string> &params);
/** Looks up a command name from the service name.
* Note that if the same command exists multiple places this will return the first one encountered
* @param command_service The command service to lookup, eg, nickserv/register
* @param bot If found, is set to the bot the command is on, eg NickServ
* @param name If found, is set to the comand name, eg REGISTER
* @return true if the given command service exists
*/
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
}; };
extern CoreExport void RunCommand(CommandSource &source, const Anope::string &message);
#endif // COMMANDS_H #endif // COMMANDS_H
+118 -747
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -16,319 +16,132 @@
#include "account.h" #include "account.h"
#include "regchannel.h" #include "regchannel.h"
#include "users.h" #include "users.h"
#include "opertype.h"
#include <stack>
/** A configuration key and value pair namespace Configuration
*/
typedef std::pair<Anope::string, Anope::string> KeyVal;
/** A list of related configuration keys and values
*/
typedef std::vector<KeyVal> KeyValList;
/** An entire config file, built up of KeyValLists
*/
typedef std::multimap<Anope::string, KeyValList> ConfigDataHash;
// Required forward definitions
/** Types of data in the core config
*/
enum ConfigDataType
{ {
DT_NOTHING, // No data class CoreExport Block
DT_INTEGER, // Integer
DT_UINTEGER, // Unsigned Integer
DT_LUINTEGER, // Long Unsigned Integer
DT_STRING, // Anope::string
DT_BOOLEAN, // Boolean
DT_HOSTNAME, // Hostname syntax
DT_NOSPACES, // No spaces
DT_IPADDRESS, // IP address (v4, v6)
DT_TIME, // Time value
DT_NORELOAD = 32, // Item can't be reloaded after startup
DT_ALLOW_WILD = 64, // Allow wildcards/CIDR in DT_IPADDRESS
DT_ALLOW_NEWLINE = 128, // New line characters allowed in DT_STRING
DT_ALLOW_EMPTY = 256 // Allow empty value
};
/** Holds a config value, either string, integer or boolean.
* Callback functions receive one or more of these, either on
* their own as a reference, or in a reference to a deque of them.
* The callback function can then alter the values of the ValueItem
* classes to validate the settings.
*/
class CoreExport ValueItem
{
private:
/** Actual data */
Anope::string v;
public:
/** Initialize with nothing */
ValueItem();
/** Initialize with an int */
ValueItem(int);
/** Initialize with a bool */
ValueItem(bool);
/** Initialize with an Anope::string */
ValueItem(const Anope::string &);
/** Initialize with a long */
ValueItem(long);
/** Change value to an Anope::string */
void Set(const Anope::string &);
/** Change value to an int */
void Set(int);
/** Get value as an int */
int GetInteger() const;
/** Get value as a string */
const char *GetString() const;
/** Get value as an Anope::string */
inline const Anope::string &GetValue() const { return v; }
/** Get value as a bool */
bool GetBool() const;
};
/** The base class of the container 'ValueContainer'
* used internally by the core to hold core values.
*/
class ValueContainerBase
{
public:
/** Constructor */
ValueContainerBase() { }
/** Destructor */
virtual ~ValueContainerBase() { }
};
/** ValueContainer is used to contain pointers to different
* core values such as the server name, maximum number of
* clients etc.
* It is specialized to hold a data type, then pointed at
* a value in the ServerConfig class. When the value has been
* read and validated, the Set method is called to write the
* value safely in a type-safe manner.
*/
template<typename T> class ValueContainer : public ValueContainerBase
{
private:
/** Contained item */
T val;
public:
/** Initialize with nothing */
ValueContainer() : ValueContainerBase(), val(NULL) { }
/** Initialize with a value of type T */
ValueContainer(T Val) : ValueContainerBase(), val(Val) { }
/** Initialize with a copy */
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
ValueContainer &operator=(const ValueContainer &Val)
{ {
val = Val.val; friend struct Conf;
return *this;
} public:
/** Change value to type T of size s */ typedef Anope::map<Anope::string> item_map;
void Set(const T newval, size_t s) typedef Anope::multimap<Block> block_map;
private:
Anope::string name;
item_map items;
block_map blocks;
int linenum;
public:
Block(const Anope::string &);
const Anope::string &GetName() const;
int CountBlock(const Anope::string &name);
Block* GetBlock(const Anope::string &name, int num = 0);
template<typename T> inline T Get(const Anope::string &tag)
{
return this->Get<T>(tag, "");
}
/* VS 2008 has an issue with having a default argument here (def = ""), which is why the above
* function exists.
*/
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &value = this->Get<const Anope::string>(tag, def);
if (!value.empty())
try
{
return convertTo<T>(value);
}
catch (const ConvertException &) { }
return T();
}
bool Set(const Anope::string &tag, const Anope::string &value);
const item_map* GetItems() const;
};
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const;
template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const;
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
/** Represents a configuration file
*/
class File
{ {
memcpy(val, newval, s); Anope::string name;
} bool executable;
}; FILE *fp;
public:
File(const Anope::string &, bool);
~File();
const Anope::string &GetName() const;
/** This a specific version of ValueContainer to handle Anope::string specially bool IsOpen() const;
*/ bool Open();
template<> class ValueContainer<Anope::string *> : public ValueContainerBase void Close();
{ bool End() const;
private: Anope::string Read();
/** Contained item */ };
Anope::string *val;
public: struct Uplink;
/** Initialize with nothing */
ValueContainer() : ValueContainerBase(), val(NULL) { } struct CoreExport Conf : Block
/** Initialize with an std::string */
ValueContainer(Anope::string *Val) : ValueContainerBase(), val(Val) { }
/** Initialize with a copy */
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
ValueContainer &operator=(const ValueContainer &Val)
{ {
val = Val.val; /* options:readtimeout */
return *this; time_t ReadTimeout;
} /* options:useprivmsg */
bool UsePrivmsg;
/* If we should default to privmsging clients */
bool DefPrivmsg;
/* Default language */
Anope::string DefLanguage;
/* options:timeoutcheck */
time_t TimeoutCheck;
/* options:usestrictprivmsg */
bool UseStrictPrivmsg;
/* networkinfo:nickchars */
Anope::string NickChars;
/** Change value to given Anope::string */ /* either "/msg " or "/" */
void Set(const Anope::string &newval) Anope::string StrictPrivmsg;
{ /* List of uplink servers to try and connect to */
*val = newval; std::vector<Uplink> Uplinks;
} /* A vector of our logfile options */
/** Change value to given char pointer */ std::vector<LogInfo> LogInfos;
void Set(const char *newval) /* Array of ulined servers */
{ std::vector<Anope::string> Ulines;
*val = newval; /* List of available opertypes */
} std::vector<OperType *> MyOperTypes;
}; /* List of pairs of opers and their opertype from the config */
std::vector<Oper *> Opers;
/* Map of fantasy commands */
CommandInfo::map Fantasy;
/* Command groups */
std::vector<CommandGroup> CommandGroups;
/* List of modules to autoload */
std::vector<Anope::string> ModulesAutoLoad;
/** A specialization of ValueContainer to hold a pointer to a bool /* module configuration blocks */
*/ std::map<Anope::string, Block *> modules;
typedef ValueContainer<bool *> ValueContainerBool; Anope::map<Anope::string> bots;
/** A specialization of ValueContainer to hold a pointer to Conf();
* an unsigned int ~Conf();
*/
typedef ValueContainer<unsigned *> ValueContainerUInt;
/** A specialization of ValueContainer to hold a pointer to void LoadConf(File &file);
* a long unsigned int void Post(Conf *old);
*/
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
/** A specialization of ValueContainer to hold a pointer to Block *GetModule(Module *);
* an int Block *GetModule(const Anope::string &name);
*/
typedef ValueContainer<int *> ValueContainerInt;
/** A specialization of ValueContainer to hold a pointer to BotInfo *GetClient(const Anope::string &name);
* a time_t
*/
typedef ValueContainer<time_t *> ValueContainerTime;
/** A specialization of ValueContainer to hold a pointer to Block *GetCommand(CommandSource &);
* an Anope::string };
*/
typedef ValueContainer<Anope::string *> ValueContainerString;
/** A set of ValueItems used by multi-value validator functions
*/
typedef std::deque<ValueItem> ValueList;
/** A callback for validating a single value
*/
typedef bool (*Validator)(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &);
/** A callback for validating multiple value entries
*/
typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anope::string *, ValueList &, int *);
/** A callback indicating the end of a group of entries
*/
typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &);
/** Represents a configuration file
*/
class ConfigurationFile
{
Anope::string name;
bool executable;
FILE *fp;
public:
ConfigurationFile(const Anope::string &, bool);
~ConfigurationFile();
const Anope::string &GetName() const;
bool IsOpen() const;
bool Open();
void Close();
bool End() const;
Anope::string Read();
};
/** Holds all of the core configuration items
*/
class CoreExport ConfigItems
{
public:
/** Holds a core configuration item and its callbacks
*/
struct Item
{
/** Tag name */
Anope::string tag;
/** Value name */
Anope::string value;
/** Default, if not defined */
Anope::string default_value;
/** Value containers */
ValueContainerBase *val;
/** Data types */
int datatype;
/** Validation function */
Validator validation_function;
} *Values;
/** Holds a core configuration item and its callbacks
* where there may be more than one item
*/
struct MultiItem
{
/** Tag name */
Anope::string tag;
/** One or more items within tag */
Anope::string items[17];
/** One or more defaults for items within tags */
Anope::string items_default[17];
/** One or more data types */
int datatype[17];
/** Initialization function */
MultiNotify init_function;
/** Validation function */
MultiValidator validation_function;
/** Completion function */
MultiNotify finish_function;
} *MultiValues;
ConfigItems(ServerConfig *conf);
~ConfigItems();
};
/** This class holds the bulk of the runtime configuration for Anope.
* It allows for reading new config values, accessing configuration files,
* and storage of the configuration data needed to run Anope.
*/
class CoreExport ServerConfig
{
private:
/** Check that there is only one of each configuration item
*/
bool CheckOnce(const Anope::string &);
public:
/** This holds all the information in the config file,
* it's indexed by tag name to a vector of key/values.
*/
ConfigDataHash config_data;
/** Construct a new ServerConfig
*/
ServerConfig();
/** Read the entire configuration into memory
* and initialize this class. All other methods
* should be used only by the core.
*/
void Read();
/** Load the configuration file into 'this'. With the new config parser everything is parsed into
* tag/key/value at load-time rather than at read-value time.
*/
void LoadConf(ConfigurationFile &file);
// Both these return true if the value existed or false otherwise
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, int, int &);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, int &);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, int);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int);
/** Returns the number of occurences of tag in the config file
*/
int ConfValueEnum(const ConfigDataHash &, const Anope::string &);
/** Returns the numbers of vars inside the index'th 'tag in the config file
*/
int ConfVarEnum(ConfigDataHash &, const Anope::string &, int);
void ValidateHostname(const Anope::string &, const Anope::string &, const Anope::string &) const;
void ValidateIP(const Anope::string &p, const Anope::string &, const Anope::string &, bool) const;
void ValidateNoSpaces(const Anope::string &, const Anope::string &, const Anope::string &) const;
struct Uplink struct Uplink
{ {
@@ -338,350 +151,10 @@ class CoreExport ServerConfig
bool ipv6; bool ipv6;
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { } Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
bool operator==(const Uplink &other) const inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && ipv6 == other.ipv6; }
{
if (this->host != other.host)
return false;
if (this->port != other.port)
return false;
if (this->password != other.password)
return false;
if (this->ipv6 != other.ipv6)
return false;
return true;
}
inline bool operator!=(const Uplink &other) const { return !(*this == other); } inline bool operator!=(const Uplink &other) const { return !(*this == other); }
}; };
}
/** Below here is a list of variables which contain the config files values
*/
/* Host to bind to */
Anope::string LocalHost;
/* List of uplink servers to try and connect to */
std::vector<Uplink *> Uplinks;
/* Our server name */
Anope::string ServerName;
/* Our servers description */
Anope::string ServerDesc;
/* Name of the network were on */
Anope::string NetworkName;
/* The max legnth of nicks */
unsigned NickLen;
/* Max length of idents */
unsigned UserLen;
/* Max lenght of hostnames */
unsigned HostLen;
/* Max length of channel names */
unsigned ChanLen;
/* User and group to run as */
Anope::string User;
Anope::string Group;
/* Casemapping to use */
Anope::string CaseMap;
/* Max length of passwords */
unsigned PassLen;
/* Filename for the PID file */
Anope::string PIDFilename;
/* MOTD filename */
Anope::string MOTDFilename;
Anope::string BotServ;
Anope::string ChanServ;
Anope::string Global;
Anope::string HostServ;
Anope::string NickServ;
Anope::string OperServ;
Anope::string MemoServ;
/* True if its ok to not be able to save backs */
bool NoBackupOkay;
/* Do password checking when new people register */
bool StrictPasswords;
/* How many times you're allowed to give a bad password before being killed */
unsigned BadPassLimit;
/* How long before bad passwords are forgotten */
time_t BadPassTimeout;
/* Delay between automatic database updates */
time_t UpdateTimeout;
/* Delay between checks for expired nicks and channels */
time_t ExpireTimeout;
/* How long to wait for something from the uplink, this is passed to select() */
time_t ReadTimeout;
/* How often to send program errors */
time_t WarningTimeout;
/* How long to process things such as timers to see if there is anything to calll */
time_t TimeoutCheck;
/* Number of days backups are kept */
int KeepBackups;
/* Forbidding requires a reason */
bool ForceForbidReason;
/* Services should use privmsgs instead of notices */
bool UsePrivmsg;
/* Services only respond to full PRIVMSG client@services.server.name messages */
bool UseStrictPrivMsg;
/* This is not a configurable option.
* Config::Config will set it depending on the value of UseStrictPrivMsg */
Anope::string UseStrictPrivMsgString;
/* Number of seconds between consecutive uses of the REGISTER command
* Not to be confused with NSRegDelay */
unsigned NickRegDelay;
/* Max number if news items allowed in the list */
unsigned NewsCount;
/* Default mlock modes */
Anope::string MLock;
/* Unmlockable modes */
Anope::string NoMLock;
/* Modes that are required to be on registered channels */
Anope::string CSRequire;
/* Use server side mlock */
bool UseServerSideMLock;
/* Use server side topic lock */
bool UseServerSideTopicLock;
/* The max length for reasons (cs_kick, cs_ban, etc) */
unsigned CSReasonMax;
/* Default botmodes on channels, defaults to ao */
Anope::string BotModes;
/* How long to wait between connection attempts */
int RetryWait;
/* If services should hide unprivileged commands */
bool HidePrivilegedCommands;
/* If set, nicks cant be owned/everything is entirely account based */
bool NoNicknameOwnership;
/* Regex engine to use */
Anope::string RegexEngine;
/* A vector of our logfile options */
std::vector<LogInfo *> LogInfos;
/* Services can use email */
bool UseMail;
/* Path to the sendmail executable */
Anope::string SendMailPath;
/* Address to send from */
Anope::string SendFrom;
/* Only opers can have services send mail */
bool RestrictMail;
/* Delay between sending mail */
time_t MailDelay;
/* Don't quote the To: address */
bool DontQuoteAddresses;
/* Mail messages to send */
Anope::string MailRegistrationSubject, MailRegistrationMessage;
Anope::string MailResetSubject, MailResetMessage;
Anope::string MailEmailchangeSubject, MailEmailchangeMessage;
Anope::string MailMemoSubject, MailMemoMessage;
/* Prefix of guest nicks when a user gets forced off of a nick */
Anope::string NSGuestNickPrefix;
/* Allow users to set kill immed on */
bool NSAllowKillImmed;
/* Don't allow nicks to use /ns group to regroup nicks */
bool NSNoGroupChange;
/* Default flags for newly registered nicks */
std::set<Anope::string> NSDefFlags;
/* All languages Anope is aware about */
Anope::string Languages;
/* Default language used by services */
Anope::string NSDefLanguage;
/* Users must be connected this long before they can register
* Not to be confused with NickRegDelay */
time_t NSRegDelay;
/* Time before the registering mail will be resent */
time_t NSResendDelay;
/* How long before nicks expire */
time_t NSExpire;
/* How long before suspended nicks expire */
time_t NSSuspendExpire;
/* Time before unconfirmed nicks expire */
time_t NSUnconfirmedExpire;
/* Force email when registering */
bool NSForceEmail;
/* Force users to validate new email addresses */
bool NSConfirmEmailChanges;
/* Max number of nicks in a group */
unsigned NSMaxAliases;
/* Max number of allowed strings on the access list */
unsigned NSAccessMax;
/* Enforcer client user name */
Anope::string NSEnforcerUser;
/* Enforcer client hostname */
Anope::string NSEnforcerHost;
/* How long before recovered nicks are released */
time_t NSReleaseTimeout;
/* Max number of entries that can be returned from the list command */
unsigned NSListMax;
/* Only allow usermode +a etc on real services admins */
bool NSSecureAdmins;
/* Services opers must be /operd on the ircd aswell */
bool NSStrictPrivileges;
/* Type of confirmation to use, or to disable registration completely */
Anope::string NSRegistration;
/* A message sent to unregistered users on connect */
Anope::string NSUnregisteredNotice;
/* Core NickServ modules */
Anope::string NickCoreModules;
/* Set the proper channel modes on users when they identify */
bool NSModeOnID;
/* Add the users hostnask their access list when they register */
bool NSAddAccessOnReg;
/* Maximum number of channels on AJoin */
unsigned AJoinMax;
/* Kill & killquick delays before force changing off users */
time_t NSKillQuick;
time_t NSKill;
/* Modes set on a user when they identify */
Anope::string NSModesOnID;
/* Restore nick/channels on recover */
bool NSRestoreOnRecover;
/* Whether or not to use SASL */
bool NSSASL;
/* If set, hides netsplits in the last_quit field of nicks */
bool NSHideNetSplitQuit;
/* Core ChanServ modules */
Anope::string ChanCoreModules;
/* Default flags for newly registered channels */
std::set<Anope::string> CSDefFlags;
/* Max number of channels a user can own */
unsigned CSMaxReg;
/* Time before a channel expires */
time_t CSExpire;
/* How long before suspended channels expire */
time_t CSSuspendExpire;
/* How long before forbidden channels expire */
time_t CSForbidExpire;
/* Default ban type to use for channels */
int CSDefBantype;
/* Max number of entries allowed on channel access lists */
unsigned CSAccessMax;
/* Max number of entries allowed on autokick lists */
unsigned CSAutokickMax;
/* Default autokick reason */
Anope::string CSAutokickReason;
/* Time ChanServ should stay in the channel to hold it to keep users from getting in */
time_t CSInhabit;
/* Max number of entries allowed to be returned from the LIST command */
unsigned CSListMax;
/* true to make ChanServ oper only */
bool CSOpersOnly;
/* Max number of memos allowed */
unsigned MSMaxMemos;
/* Time you must wait between sending memos */
time_t MSSendDelay;
/* Notify all of the aliases of the core the memo was sent to */
bool MSNotifyAll;
/* Who can use memos reciepts */
unsigned MSMemoReceipt;
/* Valid chars allowed in vhosts */
Anope::string VhostChars;
/* Allow undotted vhosts? */
bool VhostUndotted;
/* Chars disallowed at the beginning or end of vhosts */
Anope::string VhostDisallowBE;
/* Core BotServ modules */
Anope::string BotCoreModules;
/* Default BotServ flags */
std::set<Anope::string> BSDefFlags;
/* How long before botserv forgets a user. This is used for flood kickers etc */
time_t BSKeepData;
/* Min number of users to have in the channel before the service bot joins */
unsigned BSMinUsers;
/* Max number of words allowed on the badwordslist */
unsigned BSBadWordsMax;
/* BotServ bot only joins if it would normally allowed to, abides by bans etc */
bool BSSmartJoin;
/* Dont tell users what badword they used */
bool BSGentleBWReason;
/* Case sensitive badwords matching */
bool BSCaseSensitive;
/* Char to use for the fantasy char, eg ! */
Anope::string BSFantasyCharacter;
/* Only show /stats o to opers */
bool HideStatsO;
/* Send out a global when services shut down or restart */
bool GlobalOnCycle;
/* Don't include the opers name in globals */
bool AnonymousGlobal;
/* Dont allow users to register nicks with oper names in them */
bool RestrictOperNicks;
/* Message to send when shutting down */
Anope::string GlobalOnCycleMessage;
/* Message to send when starting up */
Anope::string GlobalOnCycleUP;
/* Super admin is allowed */
bool SuperAdmin;
/* Default expiry time for akills */
time_t AutokillExpiry;
/* Default expiry time for chan kills */
time_t ChankillExpiry;
/* Default expiry time for SNLine Expire */
time_t SNLineExpiry;
/* Default expiry time for SQLines */
time_t SQLineExpiry;
/* Actually akill the user when the akill is added */
bool AkillOnAdd;
/* Kill users on SNLine */
bool KillonSNline;
/* Kill users on SQline */
bool KillonSQline;
/* Add the akillers nick to the akill reason */
bool AddAkiller;
/* Add akill ids to akill reason */
bool AkillIds;
/* Limit sessions */
bool LimitSessions;
/* The default session limit */
unsigned DefSessionLimit;
/* How long before exceptions expire */
time_t ExceptionExpiry;
/* How many times to kill before adding an KILL */
unsigned MaxSessionKill;
/* Max limit that can be used for exceptions */
unsigned MaxSessionLimit;
/* How long session akills should last */
time_t SessionAutoKillExpiry;
/* Number of bits to use when comparing session IPs */
unsigned SessionIPv4CIDR;
unsigned SessionIPv6CIDR;
/* Reason to use for session kills */
Anope::string SessionLimitExceeded;
/* Optional second reason */
Anope::string SessionLimitDetailsLoc;
/* OperServ requires you to be an operator */
bool OSOpersOnly;
/* List of modules to autoload */
std::list<Anope::string> ModulesAutoLoad;
/* Seed to use for RNG */
unsigned long Seed;
/* Numeric */
Anope::string Numeric;
/* Array of ulined servers */
std::list<Anope::string> Ulines;
/* List of available opertypes */
std::list<OperType *> MyOperTypes;
/* List of pairs of opers and their opertype from the config */
std::vector<Oper *> Opers;
/* Map of fantasy commands */
CommandInfo::map Fantasy;
std::vector<CommandGroup> CommandGroups;
};
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception. /** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or * When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
@@ -705,109 +178,7 @@ class ConfigException : public CoreException
virtual ~ConfigException() throw() { } virtual ~ConfigException() throw() { }
}; };
#define CONF_NO_ERROR 0x000000 extern Configuration::File ServicesConf;
#define CONF_NOT_A_NUMBER 0x000010 extern CoreExport Configuration::Conf *Config;
#define CONF_INT_NEGATIVE 0x000080
#define CONF_VALUE_NOT_FOUND 0x000100
#define CONF_FILE_NOT_FOUND 0x000200
/** Allows reading of values from configuration files
* This class allows a module to read from either the main configuration file (services.conf) or from
* a module-specified configuration file. It may either be instantiated with one parameter or none.
* Constructing the class using one parameter allows you to specify a path to your own configuration
* file, otherwise, inspircd.conf is read.
*/
class CoreExport ConfigReader
{
protected:
/** True if an error occured reading the config file
*/
bool readerror;
/** Error code
*/
long error;
public:
/** Default constructor.
* This constructor initialises the ConfigReader class to read the configuration file(s).
*/
ConfigReader();
/** Overloaded constructor.
* This constructor initialises the ConfigReader class to read a user-specified config file
*/
ConfigReader(const Anope::string &);
/** Default destructor.
* This method destroys the ConfigReader class.
*/
~ConfigReader();
/** Retrieves a value from the config file.
* This method retrieves a value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve.
*/
Anope::string ReadValue(const Anope::string &, const Anope::string &, int, bool = false);
/** Retrieves a value from the config file.
* This method retrieves a value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. If the
* tag is not found the default value is returned instead.
*/
Anope::string ReadValue(const Anope::string &, const Anope::string &, const Anope::string &, int, bool = false);
/** Retrieves a boolean value from the config file.
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
*/
bool ReadFlag(const Anope::string &, const Anope::string &, int);
/** Retrieves a boolean value from the config file.
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
* If the tag is not found, the default value is used instead.
*/
bool ReadFlag(const Anope::string &, const Anope::string &, const Anope::string &, int);
/** Retrieves an integer value from the config file.
* This method retrieves an integer value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
* values in the tag will cause the objects error value to be set, and any call to GetError() will
* return CONF_INVALID_NUMBER to be returned. need_positive is set if the number must be non-negative.
* If a negative number is placed into a tag which is specified positive, 0 will be returned and GetError()
* will return CONF_INT_NEGATIVE. Note that need_positive is not suitable to get an unsigned int - you
* should cast the result to achieve that effect.
*/
int ReadInteger(const Anope::string &, const Anope::string &, int, bool);
/** Retrieves an integer value from the config file.
* This method retrieves an integer value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
* values in the tag will cause the objects error value to be set, and any call to GetError() will
* return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned.
* If a signed number is placed into a tag which is specified unsigned, 0 will be returned and GetError()
* will return CONF_NOT_UNSIGNED. If the tag is not found, the default value is used instead.
*/
int ReadInteger(const Anope::string &, const Anope::string &, const Anope::string &, int, bool);
/** Returns the last error to occur.
* Valid errors can be found by looking in modules.h. Any nonzero value indicates an error condition.
* A call to GetError() resets the error flag back to 0.
*/
long GetError();
/** Counts the number of times a given tag appears in the config file.
* This method counts the number of times a tag appears in a config file, for use where
* there are several tags of the same kind, e.g. with opers and connect types. It can be
* used with the index value of ConfigReader::ReadValue to loop through all copies of a
* multiple instance tag.
*/
int Enumerate(const Anope::string &) const;
/** Returns true if a config file is valid.
* This method is partially implemented and will only return false if the config
* file does not exist or could not be opened.
*/
bool Verify();
/** Returns the number of items within a tag.
* For example if the tag was &lt;test tag="blah" data="foo"&gt; then this
* function would return 2. Spaces and newlines both qualify as valid seperators
* between values.
*/
int EnumerateValues(const Anope::string &, int);
};
extern ConfigurationFile ServicesConf;
extern CoreExport ServerConfig *Config;
#endif // CONFIG_H #endif // CONFIG_H
+5 -5
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -13,25 +13,25 @@
class AccessGroup; class AccessGroup;
class AutoKick; class AutoKick;
namespace Anope { class String; }
class BotInfo; class BotInfo;
class CallBack; class CallBack;
class ChanAccess; class ChanAccess;
class Channel; class Channel;
class ChannelInfo; class ChannelInfo;
class ChannelStatus; class ChannelStatus;
struct ChanUserContainer;
class ClientSocket; class ClientSocket;
class Command; class Command;
class CommandSource; class CommandSource;
namespace Configuration { struct Conf; }
class ConnectionSocket; class ConnectionSocket;
namespace DNS { class Packet; } namespace DNS { struct Query; }
class Entry; class Entry;
class IdentifyRequest; class IdentifyRequest;
class InfoFormatter; class InfoFormatter;
class IRCDProto; class IRCDProto;
class ListenSocket; class ListenSocket;
class Log; class Log;
class LogInfo;
class Memo; class Memo;
class MessageSource; class MessageSource;
class Module; class Module;
@@ -42,7 +42,6 @@ class ReferenceBase;
class Regex; class Regex;
class Serializable; class Serializable;
class Server; class Server;
class ServerConfig;
class Socket; class Socket;
class Thread; class Thread;
class User; class User;
@@ -53,4 +52,5 @@ struct Exception;
struct MemoInfo; struct MemoInfo;
struct ModeLock; struct ModeLock;
struct Oper; struct Oper;
namespace SASL { struct Message; }
+223 -81
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -12,109 +12,251 @@
#include "anope.h" #include "anope.h"
#include "serialize.h" #include "serialize.h"
#include "service.h"
#include "logger.h"
/* All items added to Extensible must inherit from this. class Extensible;
*/
class CoreExport ExtensibleItem class CoreExport ExtensibleBase : public Service
{ {
protected:
std::map<Extensible *, void *> items;
ExtensibleBase(Module *m, const Anope::string &n);
~ExtensibleBase();
public: public:
virtual ~ExtensibleItem() { } virtual void Unset(Extensible *obj) = 0;
virtual const Anope::string *Serialize() { return NULL; } /* called when an object we are keep track of is serializing */
virtual void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &) const { }
virtual void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &) { }
}; };
/** Common class used to Extensible::Extend as it inherits from both ExtensibleItem
* and whatever basic object you're trying to store.
* Eg, obj->Extend(key, new ExtensibleItemClass<Anope::string>(value));
*/
template<typename T> struct CoreExport ExtensibleItemClass : T, ExtensibleItem
{
ExtensibleItemClass(const T& t) : T(t) { }
};
/* Used to attach metadata to this object that is automatically saved
* when the object is saved (assuming the object's Serialize method
* correcly calls Extensible::ExtensibleSerialize).
*/
struct CoreExport ExtensibleMetadata : ExtensibleItemClass<Anope::string>
{
ExtensibleMetadata(const Anope::string &t) : ExtensibleItemClass<Anope::string>(t) { }
const Anope::string *Serialize() anope_override { return this; }
};
/* Used to attach arbitrary objects to this object using unique keys */
class CoreExport Extensible class CoreExport Extensible
{ {
private:
typedef std::map<Anope::string, ExtensibleItem *> extensible_map;
extensible_map *extension_items;
public: public:
/** Default constructor std::set<ExtensibleBase *> extension_items;
*/
Extensible();
/** Destructor, deletes all of the extensible items in this object
* then clears the map
*/
virtual ~Extensible(); virtual ~Extensible();
/** Extend an Extensible class. template<typename T> T* GetExt(const Anope::string &name) const;
* bool HasExt(const Anope::string &name) const;
* @param key The key parameter is an arbitary string which identifies the extension data
* @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
*
* You must provide a key to store the data as via the parameter 'key'.
* The data will be inserted into the map. If the data already exists, it will be overwritten.
*/
void Extend(const Anope::string &key, ExtensibleItem *p = NULL);
void ExtendMetadata(const Anope::string &key, const Anope::string &value = ""); template<typename T> T* Extend(const Anope::string &name, const T &what);
template<typename T> T* Extend(const Anope::string &name);
template<typename T> T* Require(const Anope::string &name);
template<typename T> void Shrink(const Anope::string &name);
/** Shrink an Extensible class. static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
* static void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &data);
* @param key The key parameter is an arbitary string which identifies the extension data };
*
* You must provide a key name. The given key name will be removed from the classes data. If
* you provide a nonexistent key (case is important) then the function will return false.
* @return Returns true on success.
*/
bool Shrink(const Anope::string &key);
/** Get an extension item. template<typename T>
* class BaseExtensibleItem : public ExtensibleBase
* @param key The key parameter is an arbitary string which identifies the extension data {
* @return The item found protected:
*/ virtual T *Create(Extensible *) = 0;
template<typename T> T GetExt(const Anope::string &key) const
public:
BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
~BaseExtensibleItem()
{ {
if (this->extension_items) while (!items.empty())
{ {
extensible_map::const_iterator it = this->extension_items->find(key); std::map<Extensible *, void *>::iterator it = items.begin();
if (it != this->extension_items->end()) Extensible *obj = it->first;
return anope_dynamic_static_cast<T>(it->second); T *value = static_cast<T *>(it->second);
}
obj->extension_items.erase(this);
items.erase(it);
delete value;
}
}
T* Set(Extensible *obj, const T &value)
{
T* t = Set(obj);
if (t)
*t = value;
return t;
}
T* Set(Extensible *obj)
{
T* t = Create(obj);
Unset(obj);
items[obj] = t;
obj->extension_items.insert(this);
return t;
}
void Unset(Extensible *obj) anope_override
{
T *value = Get(obj);
items.erase(obj);
obj->extension_items.erase(this);
delete value;
}
T* Get(const Extensible *obj) const
{
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
if (it != items.end())
return static_cast<T *>(it->second);
return NULL; return NULL;
} }
/** Check if an extension item exists. bool HasExt(const Extensible *obj) const
* {
* @param key The key parameter is an arbitary string which identifies the extension data return items.find(const_cast<Extensible *>(obj)) != items.end();
* @return True if the item was found. }
*/
bool HasExt(const Anope::string &key) const;
/** Get a list of all extension items names. T* Require(Extensible *obj)
* @param list A deque of strings to receive the list {
* @return This function writes a list of all extension items stored T* t = Get(obj);
* in this object by name into the given deque and returns void. if (t)
*/ return t;
void GetExtList(std::deque<Anope::string> &list) const;
void ExtensibleSerialize(Serialize::Data &data) const; return Set(obj);
void ExtensibleUnserialize(Serialize::Data &data); }
}; };
template<typename T>
class ExtensibleItem : public BaseExtensibleItem<T>
{
protected:
T* Create(Extensible *obj) anope_override
{
return new T(obj);
}
public:
ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
};
template<typename T>
class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
{
protected:
T* Create(Extensible *obj) anope_override
{
return new T();
}
public:
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
};
template<>
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
{
protected:
bool* Create(Extensible *) anope_override
{
return NULL;
}
public:
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
};
template<typename T>
class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
{
public:
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
{
T* t = this->Get(e);
data[this->name] << *t;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
{
T t;
if (data[this->name] >> t)
this->Set(e, t);
else
this->Unset(e);
}
};
template<>
class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
{
public:
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { }
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
{
data[this->name] << true;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
{
bool b = false;
data[this->name] >> b;
if (b)
this->Set(e);
else
this->Unset(e);
}
};
template<typename T>
struct ExtensibleRef : ServiceReference<BaseExtensibleItem<T> >
{
ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
};
template<typename T>
T* Extensible::GetExt(const Anope::string &name) const
{
ExtensibleRef<T> ref(name);
if (ref)
return ref->Get(this);
Log(LOG_DEBUG) << "GetExt for nonexistent type " << name << " on " << static_cast<const void *>(this);
return NULL;
}
template<typename T>
T* Extensible::Extend(const Anope::string &name, const T &what)
{
T* t = Extend<T>(name);
if (t)
*t = what;
return t;
}
template<typename T>
T* Extensible::Extend(const Anope::string &name)
{
ExtensibleRef<T> ref(name);
if (ref)
return ref->Set(this);
Log(LOG_DEBUG) << "Extend for nonexistent type " << name << " on " << static_cast<void *>(this);
return NULL;
}
template<typename T>
T* Extensible::Require(const Anope::string &name)
{
if (HasExt(name))
return GetExt<T>(name);
else
return Extend<T>(name);
}
template<typename T>
void Extensible::Shrink(const Anope::string &name)
{
ExtensibleRef<T> ref(name);
if (ref)
ref->Unset(this);
else
Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
}
#endif // EXTENSIBLE_H #endif // EXTENSIBLE_H
+10 -4
View File
@@ -1,7 +1,7 @@
/* /*
* *
* Copyright (C) 2002-2011 InspIRCd Development Team * Copyright (C) 2002-2011 InspIRCd Development Team
* Copyright (C) 2009-2013 Anope Team <team@anope.org> * Copyright (C) 2009-2014 Anope Team <team@anope.org>
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
* *
@@ -13,10 +13,12 @@
#include <string> #include <string>
#include <locale> #include <locale>
#ifndef _WIN32 #if defined _LIBCPP_VERSION || defined _WIN32
#include <tr1/unordered_map>
#else
#include <unordered_map> #include <unordered_map>
#define TR1NS std
#else
#include <tr1/unordered_map>
#define TR1NS std::tr1
#endif #endif
#include "services.h" #include "services.h"
@@ -28,6 +30,10 @@ namespace Anope
/* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */ /* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */
extern std::locale casemap; extern std::locale casemap;
extern void CaseMapRebuild();
extern unsigned char tolower(unsigned char);
extern unsigned char toupper(unsigned char);
/* ASCII case insensitive ctype. */ /* ASCII case insensitive ctype. */
template<typename char_type> template<typename char_type>
class ascii_ctype : public std::ctype<char_type> class ascii_ctype : public std::ctype<char_type>
+12 -26
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2008-2013 Anope Team * (C) 2008-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -55,7 +55,7 @@ namespace Language
extern CoreExport const char *Translate(const NickCore *nc, const char *string); extern CoreExport const char *Translate(const NickCore *nc, const char *string);
/** Translatesa string to the given language. /** Translatesa string to the given language.
* @param lang The language to trnalsate to * @param lang The language to translate to
* @param string The string to translate * @param string The string to translate
* @return The translated string if found, else the original string. * @return The translated string if found, else the original string.
*/ */
@@ -74,7 +74,7 @@ namespace Language
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n" \ #define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n" \
"five characters long, should not be something easily guessed\n" \ "five characters long, should not be something easily guessed\n" \
"(e.g. your real name or your nick), and cannot contain the space or tab characters.") "(e.g. your real name or your nick), and cannot contain the space or tab characters.")
#define PASSWORD_TOO_LONG _("Your password is too long. Please try again with a shorter password.") #define PASSWORD_TOO_LONG _("Your password is too long. It must not exceed %u characters.")
#define NICK_NOT_REGISTERED _("Your nick isn't registered.") #define NICK_NOT_REGISTERED _("Your nick isn't registered.")
#define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.") #define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.")
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.") #define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
@@ -85,12 +85,9 @@ namespace Language
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.") #define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
#define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.") #define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.")
#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.") #define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
#define NO_REASON _("No reason")
#define UNKNOWN _("<unknown>") #define UNKNOWN _("<unknown>")
#define NO_EXPIRE _("does not expire") #define NO_EXPIRE _("does not expire")
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.") #define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
#define UNKNOWN_OPTION _("Unknown option \002%s\002.\n" \
"Type %s%s HELP %s for more information.")
#define NICK_IS_REGISTERED _("This nick is owned by someone else. Please choose another.\n" \ #define NICK_IS_REGISTERED _("This nick is owned by someone else. Please choose another.\n" \
"(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)") "(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)")
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \ #define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
@@ -99,45 +96,34 @@ namespace Language
#define FORCENICKCHANGE_NOW _("This nickname has been registered; you may not use it.") #define FORCENICKCHANGE_NOW _("This nickname has been registered; you may not use it.")
#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.") #define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!") #define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
#define NICK_SET_SYNTAX _("SET \037option\037 \037parameters\037")
#define NICK_SET_DISABLED _("Sorry, nickname option setting is temporarily disabled.")
#define NICK_SET_UNKNOWN_OPTION _("Unknown SET option \002%s%s\002.")
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.") #define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
#define NICK_LIST_SYNTAX _("LIST \037pattern\037") #define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
#define NICK_RECOVERED _("User claiming your nick has been killed.\n" \
"\002%s%s RELEASE %s\002 to get it back before %s timeout.")
#define NICK_REQUESTED _("This nick has already been requested, please check your e-mail address for the pass code")
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry")
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.") #define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
#define CHAN_X_INVALID _("Channel %s is not a valid channel.") #define CHAN_X_INVALID _("Channel %s is not a valid channel.")
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.") #define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
#define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.") #define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.")
#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register") #define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register.")
#define CHAN_SET_DISABLED _("Sorry, channel option setting is temporarily disabled.")
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.") #define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
#define CHAN_SETTING_UNSET _("%s for %s unset.") #define CHAN_SETTING_UNSET _("%s for %s unset.")
#define CHAN_SET_MLOCK_DEPRECATED _("MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead.")
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.") #define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:") #define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except have been removed.") #define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \ #define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
"Type \002%s%s READ %s %d\002 to read it.") "Type \002%s%s READ %s %d\002 to read it.")
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \ #define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
"Type \002%s%s READ %d\002 to read it.") "Type \002%s%s READ %d\002 to read it.")
#define MEMO_HAVE_NO_MEMOS _("You have no memos.") #define MEMO_HAVE_NO_MEMOS _("You have no memos.")
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.") #define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
#define MEMO_SEND_SYNTAX _("SEND {\037nick\037 | \037channel\037} \037memo-text\037")
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.") #define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.") #define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.") #define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.") #define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.") #define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.")
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.") #define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
#define BOT_ASSIGN_READONLY _("Sorry, bot assignment is temporarily disabled.") #define HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
#define HOST_SET_ERROR _("A vhost must be in the format of a valid hostmask.") #define HOST_SET_IDENT_ERROR _("A vHost ident must be in the format of a valid ident.")
#define HOST_SET_IDENT_ERROR _("A vhost ident must be in the format of a valid ident") #define HOST_SET_TOOLONG _("Error! The vHost is too long, please use a hostname shorter than %d characters.")
#define HOST_SET_TOOLONG _("Error! The vhost is too long, please use a host shorter than %d characters.") #define HOST_SET_IDENTTOOLONG _("Error! The vHost ident is too long, please use an ident shorter than %d characters.")
#define HOST_SET_IDENTTOOLONG _("Error! The Ident is too long, please use an ident shorter than %d characters.") #define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vHost assigned to this nick.")
#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vhost assigned to this nick.") #define HOST_NO_VIDENT _("Your IRCd does not support vIdent's, if this is incorrect, please report this as a possible bug")
#define HOST_NO_VIDENT _("Your IRCD does not support vIdent's, if this is incorrect, please report this as a possible bug")
+4 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -67,9 +67,11 @@ class CoreExport ListFormatter
public: public:
typedef std::map<Anope::string, Anope::string> ListEntry; typedef std::map<Anope::string, Anope::string> ListEntry;
private: private:
NickCore *nc;
std::vector<Anope::string> columns; std::vector<Anope::string> columns;
std::vector<ListEntry> entries; std::vector<ListEntry> entries;
public: public:
ListFormatter(NickCore *nc);
ListFormatter &AddColumn(const Anope::string &name); ListFormatter &AddColumn(const Anope::string &name);
void AddEntry(const ListEntry &entry); void AddEntry(const ListEntry &entry);
bool IsEmpty() const; bool IsEmpty() const;
@@ -87,6 +89,7 @@ class CoreExport InfoFormatter
InfoFormatter(NickCore *nc); InfoFormatter(NickCore *nc);
void Process(std::vector<Anope::string> &); void Process(std::vector<Anope::string> &);
Anope::string &operator[](const Anope::string &key); Anope::string &operator[](const Anope::string &key);
void AddOption(const Anope::string &opt);
}; };
#endif // LISTS_H #endif // LISTS_H
+34 -27
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -45,7 +45,8 @@ struct LogFile
std::ofstream stream; std::ofstream stream;
LogFile(const Anope::string &name); LogFile(const Anope::string &name);
Anope::string GetName() const; ~LogFile();
const Anope::string &GetName() const;
}; };
/* Represents a single log message */ /* Represents a single log message */
@@ -53,15 +54,15 @@ class CoreExport Log
{ {
public: public:
/* Bot that should log this message */ /* Bot that should log this message */
const BotInfo *bi; BotInfo *bi;
/* For commands, the user executing the command */
Anope::string nick;
/* For commands, the user executing the command, but might not always exist */ /* For commands, the user executing the command, but might not always exist */
const User *u; User *u;
/* For commands, the account executing teh command, but will not always exist */ /* For commands, the account executing the command, but will not always exist */
const NickCore *nc; NickCore *nc;
/* For commands, the command being executed */ /* For commands, the command being executed */
Command *c; Command *c;
/* For commands, the command source */
CommandSource *source;
/* Used for LOG_CHANNEL */ /* Used for LOG_CHANNEL */
Channel *chan; Channel *chan;
/* For commands, the channel the command was executed on, will not always exist */ /* For commands, the channel the command was executed on, will not always exist */
@@ -72,30 +73,34 @@ class CoreExport Log
Module *m; Module *m;
LogType type; LogType type;
Anope::string category; Anope::string category;
std::list<Anope::string> sources;
std::stringstream buf; std::stringstream buf;
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", const BotInfo *bi = NULL); Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = NULL);
/* LOG_COMMAND/OVERRIDE/ADMIN */ /* LOG_COMMAND/OVERRIDE/ADMIN */
Log(LogType type, CommandSource &source, Command *c, const ChannelInfo *ci = NULL); Log(LogType type, CommandSource &source, Command *c, ChannelInfo *ci = NULL);
/* LOG_CHANNEL */ /* LOG_CHANNEL */
Log(const User *u, Channel *c, const Anope::string &category = ""); Log(User *u, Channel *c, const Anope::string &category = "");
/* LOG_USER */ /* LOG_USER */
explicit Log(const User *u, const Anope::string &category = "", const BotInfo *bi = NULL); Log(User *u, const Anope::string &category = "", BotInfo *bi = NULL);
/* LOG_SERVER */ /* LOG_SERVER */
explicit Log(Server *s, const Anope::string &category = "", const BotInfo *bi = NULL); Log(Server *s, const Anope::string &category = "", BotInfo *bi = NULL);
explicit Log(const BotInfo *b, const Anope::string &category = ""); Log(BotInfo *b, const Anope::string &category = "");
Log(Module *m, const Anope::string &category = ""); Log(Module *m, const Anope::string &category = "", BotInfo *bi = NULL);
~Log(); ~Log();
private:
Anope::string FormatSource() const;
Anope::string FormatCommand() const;
public:
Anope::string BuildPrefix() const; Anope::string BuildPrefix() const;
template<typename T> Log &operator<<(T val) template<typename T> Log &operator<<(T val)
@@ -109,17 +114,19 @@ class CoreExport Log
class CoreExport LogInfo class CoreExport LogInfo
{ {
public: public:
std::list<Anope::string> targets; BotInfo *bot;
std::map<Anope::string, LogFile *> logfiles; std::vector<Anope::string> targets;
std::list<Anope::string> sources; std::vector<LogFile *> logfiles;
int last_day;
std::vector<Anope::string> sources;
int log_age; int log_age;
std::list<Anope::string> admin; std::vector<Anope::string> admin;
std::list<Anope::string> override; std::vector<Anope::string> override;
std::list<Anope::string> commands; std::vector<Anope::string> commands;
std::list<Anope::string> servers; std::vector<Anope::string> servers;
std::list<Anope::string> users; std::vector<Anope::string> users;
std::list<Anope::string> channels; std::vector<Anope::string> channels;
std::list<Anope::string> normal; std::vector<Anope::string> normal;
bool raw_io; bool raw_io;
bool debug; bool debug;
@@ -127,7 +134,7 @@ class CoreExport LogInfo
~LogInfo(); ~LogInfo();
void AddType(std::list<Anope::string> &list, const Anope::string &type); void OpenLogFiles();
bool HasType(LogType ltype, const Anope::string &type) const; bool HasType(LogType ltype, const Anope::string &type) const;
+2 -2
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -20,7 +20,7 @@
namespace Mail namespace Mail
{ {
extern CoreExport bool Send(User *from, NickCore *to, const BotInfo *service, const Anope::string &subject, const Anope::string &message); extern CoreExport bool Send(User *from, NickCore *to, BotInfo *service, const Anope::string &subject, const Anope::string &message);
extern CoreExport bool Send(NickCore *to, const Anope::string &subject, const Anope::string &message); extern CoreExport bool Send(NickCore *to, const Anope::string &subject, const Anope::string &message);
extern CoreExport bool Validate(const Anope::string &email); extern CoreExport bool Validate(const Anope::string &email);
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
+20 -6
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -9,14 +9,14 @@
* Based on the original code of Services by Andy Church. * Based on the original code of Services by Andy Church.
* *
*/ */
#include "protocol.h" #include "protocol.h"
/* Common IRCD messages. /* Common IRCD messages.
* Protocol modules may chose to include some, none, or all of these handlers * Protocol modules may chose to include some, none, or all of these handlers
* as they see fit. * as they see fit.
*/ */
namespace Message namespace Message
{ {
@@ -40,6 +40,13 @@ namespace Message
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override; void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
}; };
struct CoreExport Invite : IRCDMessage
{
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Join : IRCDMessage struct CoreExport Join : IRCDMessage
{ {
@@ -75,7 +82,7 @@ namespace Message
struct CoreExport Mode : IRCDMessage struct CoreExport Mode : IRCDMessage
{ {
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { } Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override; void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
}; };
@@ -87,6 +94,13 @@ namespace Message
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override; void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
}; };
struct CoreExport Notice : IRCDMessage
{
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Part : IRCDMessage struct CoreExport Part : IRCDMessage
{ {
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
@@ -117,7 +131,7 @@ namespace Message
struct CoreExport SQuit : IRCDMessage struct CoreExport SQuit : IRCDMessage
{ {
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override; void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
}; };
+97 -115
View File
@@ -1,7 +1,7 @@
/* Mode support /* Mode support
* *
* Copyright (C) 2008-2011 Adam <Adam@anope.org> * Copyright (C) 2008-2011 Adam <Adam@anope.org>
* Copyright (C) 2008-2013 Anope Team <team@anope.org> * Copyright (C) 2008-2014 Anope Team <team@anope.org>
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
*/ */
@@ -56,6 +56,11 @@ class CoreExport Mode : public Base
*/ */
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type); Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
virtual ~Mode(); virtual ~Mode();
/** Can a user set this mode, used for mlock
* @param u The user
*/
virtual bool CanSet(User *u) const;
}; };
/** This class is a user mode, all user modes use this/inherit from this /** This class is a user mode, all user modes use this/inherit from this
@@ -68,7 +73,6 @@ class CoreExport UserMode : public Mode
* @param mc The mode char * @param mc The mode char
*/ */
UserMode(const Anope::string &name, char mc); UserMode(const Anope::string &name, char mc);
virtual ~UserMode();
}; };
class CoreExport UserModeParam : public UserMode class CoreExport UserModeParam : public UserMode
@@ -84,7 +88,7 @@ class CoreExport UserModeParam : public UserMode
* @param value The param * @param value The param
* @return true or false * @return true or false
*/ */
virtual bool IsValid(const Anope::string &value) const { return true; } virtual bool IsValid(Anope::string &value) const { return true; }
}; };
/** This class is a channel mode, all channel modes use this/inherit from this /** This class is a channel mode, all channel modes use this/inherit from this
@@ -92,20 +96,31 @@ class CoreExport UserModeParam : public UserMode
class CoreExport ChannelMode : public Mode class CoreExport ChannelMode : public Mode
{ {
public: public:
/* channel modes that can posssibly unwrap this mode */
std::vector<ChannelMode *> listeners;
/** constructor /** constructor
* @param name The mode name * @param name The mode name
* @param mc The mode char * @param mc The mode char
*/ */
ChannelMode(const Anope::string &name, char mc); ChannelMode(const Anope::string &name, char mc);
virtual ~ChannelMode();
/** Can a user set this mode, used for mlock bool CanSet(User *u) const anope_override;
* NOTE: User CAN be NULL, this is for checking if it can be locked with defcon
* @param u The user, or NULL virtual void Check() { }
/** 'wrap' this channel mode and param to the underlying mode and param
*/ */
virtual bool CanSet(User *u) const; virtual ChannelMode *Wrap(Anope::string &param);
};
/** 'unwrap' this mode to our internal representation
*/
ChannelMode *Unwrap(Anope::string &param);
/** called when a mode is being unwrapped, and is asking us if we can unwrap it
*/
virtual ChannelMode *Unwrap(ChannelMode *, Anope::string &param);
};
/** This is a mode for lists, eg b/e/I. These modes should inherit from this /** This is a mode for lists, eg b/e/I. These modes should inherit from this
*/ */
@@ -118,15 +133,11 @@ class CoreExport ChannelModeList : public ChannelMode
*/ */
ChannelModeList(const Anope::string &name, char mc); ChannelModeList(const Anope::string &name, char mc);
/** destructor
*/
virtual ~ChannelModeList();
/** Is the mask valid /** Is the mask valid
* @param mask The mask * @param mask The mask
* @return true for yes, false for no * @return true for yes, false for no
*/ */
virtual bool IsValid(const Anope::string &mask) const { return true; } virtual bool IsValid(Anope::string &mask) const;
/** Checks if mask affects user /** Checks if mask affects user
* Should only be used for extbans or other weird ircd-specific things. * Should only be used for extbans or other weird ircd-specific things.
@@ -134,7 +145,7 @@ class CoreExport ChannelModeList : public ChannelMode
* @param e The entry to match against * @param e The entry to match against
* @return true on match * @return true on match
*/ */
virtual bool Matches(const User *u, const Entry *e) { return false; } virtual bool Matches(User *u, const Entry *e) { return false; }
/** Called when a mask is added to a channel /** Called when a mask is added to a channel
* @param chan The channel * @param chan The channel
@@ -161,10 +172,6 @@ class CoreExport ChannelModeParam : public ChannelMode
*/ */
ChannelModeParam(const Anope::string &name, char mc, bool minus_no_arg = false); ChannelModeParam(const Anope::string &name, char mc, bool minus_no_arg = false);
/** destructor
*/
virtual ~ChannelModeParam();
/* Should we send an arg when unsetting this mode? */ /* Should we send an arg when unsetting this mode? */
bool minus_no_arg; bool minus_no_arg;
@@ -172,7 +179,7 @@ class CoreExport ChannelModeParam : public ChannelMode
* @param value The param * @param value The param
* @return true for yes, false for no * @return true for yes, false for no
*/ */
virtual bool IsValid(const Anope::string &value) const { return true; } virtual bool IsValid(Anope::string &value) const { return true; }
}; };
/** This is a mode that is a channel status, eg +v/h/o/a/q. /** This is a mode that is a channel status, eg +v/h/o/a/q.
@@ -181,7 +188,7 @@ class CoreExport ChannelModeStatus : public ChannelMode
{ {
public: public:
/* The symbol, eg @ % + */ /* The symbol, eg @ % + */
char Symbol; char symbol;
/* The "level" of the mode, used to compare with other modes. /* The "level" of the mode, used to compare with other modes.
* Used so we know op > halfop > voice etc. * Used so we know op > halfop > voice etc.
*/ */
@@ -190,25 +197,65 @@ class CoreExport ChannelModeStatus : public ChannelMode
/** constructor /** constructor
* @param name The mode name * @param name The mode name
* @param mc The mode char * @param mc The mode char
* @param mSymbol The symbol for the mode, eg @ % * @param msymbol The symbol for the mode, eg @ %
* @param mlevel A level for the mode, which is usually determined by the PREFIX capab * @param mlevel A level for the mode, which is usually determined by the PREFIX capab
*/ */
ChannelModeStatus(const Anope::string &name, char mc, char mSymbol, short mlevel = 0); ChannelModeStatus(const Anope::string &name, char mc, char msymbol, short mlevel);
};
/** destructor /** A virtual mode. This mode doesn't natively exist on the IRCd (like extbans),
*/ * but we still have a representation for it.
virtual ~ChannelModeStatus(); */
template<typename T>
class CoreExport ChannelModeVirtual : public T
{
Anope::string base;
ChannelMode *basech;
public:
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
~ChannelModeVirtual();
void Check() anope_override;
ChannelMode *Wrap(Anope::string &param) anope_override;
ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) = 0;
}; };
/* The status a user has on a channel (+v, +h, +o) etc */ /* The status a user has on a channel (+v, +h, +o) etc */
class CoreExport ChannelStatus class CoreExport ChannelStatus
{ {
Anope::string modes;
public: public:
std::set<Anope::string> modes; ChannelStatus();
Anope::string BuildCharPrefixList() const; ChannelStatus(const Anope::string &modes);
void AddMode(char c);
void DelMode(char c);
bool HasMode(char c) const;
bool Empty() const;
void Clear();
const Anope::string &Modes() const;
Anope::string BuildModePrefixList() const; Anope::string BuildModePrefixList() const;
}; };
class CoreExport UserModeOperOnly : public UserMode
{
public:
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *u) const anope_override;
};
class CoreExport UserModeNoone : public UserMode
{
public:
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *u) const anope_override;
};
/** Channel mode +k (key) /** Channel mode +k (key)
*/ */
class CoreExport ChannelModeKey : public ChannelModeParam class CoreExport ChannelModeKey : public ChannelModeParam
@@ -216,63 +263,30 @@ class CoreExport ChannelModeKey : public ChannelModeParam
public: public:
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { } ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
bool IsValid(const Anope::string &value) const anope_override; bool IsValid(Anope::string &value) const anope_override;
}; };
/** This class is used for channel mode +A (Admin only) /** This class is used for oper only channel modes
* Only opers can mlock it
*/ */
class CoreExport ChannelModeAdmin : public ChannelMode class CoreExport ChannelModeOperOnly : public ChannelMode
{ {
public: public:
ChannelModeAdmin(char mc) : ChannelMode("ADMINONLY", mc) { } ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
/* Opers only */ /* Opers only */
bool CanSet(User *u) const anope_override; bool CanSet(User *u) const anope_override;
}; };
/** This class is used for channel mode +O (Opers only) /** This class is used for channel modes only servers may set
* Only opers can mlock it
*/ */
class CoreExport ChannelModeOper : public ChannelMode class CoreExport ChannelModeNoone : public ChannelMode
{ {
public: public:
ChannelModeOper(char mc) : ChannelMode("OPERONLY", mc) { } ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
/* Opers only */
bool CanSet(User *u) const anope_override; bool CanSet(User *u) const anope_override;
}; };
/** This class is used for channel mode +r (registered channel)
* No one may mlock r
*/
class CoreExport ChannelModeRegistered : public ChannelMode
{
public:
ChannelModeRegistered(char mc) : ChannelMode("REGISTERED", mc) { }
/* No one mlocks +r */
bool CanSet(User *u) const anope_override;
};
class StackerInfo
{
public:
/* Modes to be added */
std::list<std::pair<Mode *, Anope::string> > AddModes;
/* Modes to be deleted */
std::list<std::pair<Mode *, Anope::string> > DelModes;
/* Bot this is sent from */
const BotInfo *bi;
/** Add a mode to this object
* @param mode The mode
* @param set true if setting, false if unsetting
* @param param The param for the mode
*/
void AddMode(Mode *mode, bool set, const Anope::string &param);
};
/** This is the mode manager /** This is the mode manager
* It contains functions for adding modes to Anope so Anope can track them * It contains functions for adding modes to Anope so Anope can track them
* and do things such as MLOCK. * and do things such as MLOCK.
@@ -281,30 +295,11 @@ class StackerInfo
*/ */
class CoreExport ModeManager class CoreExport ModeManager
{ {
protected:
/* List of pairs of user/channels and their stacker info */
static std::map<User *, StackerInfo *> UserStackerObjects;
static std::map<Channel *, StackerInfo *> ChannelStackerObjects;
/** Build a list of mode strings to send to the IRCd from the mode stacker
* @param info The stacker info for a channel or user
* @return a list of strings
*/
static std::list<Anope::string> BuildModeStrings(StackerInfo *info);
public: public:
/* List of all modes Anope knows about */
static std::vector<ChannelMode *> ChannelModes;
static std::vector<UserMode *> UserModes;
/* Number of generic channel and user modes we are tracking */ /* Number of generic channel and user modes we are tracking */
static unsigned GenericChannelModes; static unsigned GenericChannelModes;
static unsigned GenericUserModes; static unsigned GenericUserModes;
/* Default channel mode lock */
static std::list<std::pair<Anope::string, Anope::string> > ModeLockOn;
static std::list<Anope::string> ModeLockOff;
/* Default modes bots have on channels */
static ChannelStatus DefaultBotModes;
/** Add a user mode to Anope /** Add a user mode to Anope
* @param um A UserMode or UserMode derived class * @param um A UserMode or UserMode derived class
@@ -358,6 +353,11 @@ class CoreExport ModeManager
*/ */
static char GetStatusChar(char symbol); static char GetStatusChar(char symbol);
static const std::vector<ChannelMode *> &GetChannelModes();
static const std::vector<UserMode *> &GetUserModes();
static const std::vector<ChannelModeStatus *> &GetStatusChannelModesByRank();
static void RebuildStatusModes();
/** Add a mode to the stacker to be set on a channel /** Add a mode to the stacker to be set on a channel
* @param bi The client to set the modes from * @param bi The client to set the modes from
* @param c The channel * @param c The channel
@@ -365,7 +365,7 @@ class CoreExport ModeManager
* @param set true for setting, false for removing * @param set true for setting, false for removing
* @param param The param, if there is one * @param param The param, if there is one
*/ */
static void StackerAdd(const BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string &param = ""); static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string &param = "");
/** Add a mode to the stacker to be set on a user /** Add a mode to the stacker to be set on a user
* @param bi The client to set the modes from * @param bi The client to set the modes from
@@ -374,7 +374,7 @@ class CoreExport ModeManager
* @param set true for setting, false for removing * @param set true for setting, false for removing
* @param param The param, if there is one * @param param The param, if there is one
*/ */
static void StackerAdd(const BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string &param = ""); static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string &param = "");
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users /** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
*/ */
@@ -385,25 +385,6 @@ class CoreExport ModeManager
static void StackerDel(User *u); static void StackerDel(User *u);
static void StackerDel(Channel *c); static void StackerDel(Channel *c);
static void StackerDel(Mode *m); static void StackerDel(Mode *m);
/** Updates the default mode locks and default bot modes
* @param config The configuration to read from. This is often called
* during a config reload.
*/
static void UpdateDefaultMLock(ServerConfig *config);
};
/** Entry flags
*/
enum EntryType
{
ENTRYTYPE_CIDR,
ENTRYTYPE_NICK_WILD,
ENTRYTYPE_NICK,
ENTRYTYPE_USER_WILD,
ENTRYTYPE_USER,
ENTRYTYPE_HOST_WILD,
ENTRYTYPE_HOST
}; };
/** Represents a mask set on a channel (b/e/I) /** Represents a mask set on a channel (b/e/I)
@@ -411,29 +392,30 @@ enum EntryType
class CoreExport Entry class CoreExport Entry
{ {
Anope::string name; Anope::string name;
public:
std::set<EntryType> types;
unsigned char cidr_len;
Anope::string mask; Anope::string mask;
Anope::string nick, user, host; public:
unsigned short cidr_len;
Anope::string nick, user, host, real;
/** Constructor /** Constructor
* @param mode What mode this host is for, can be empty for unknown/no mode * @param mode What mode this host is for, can be empty for unknown/no mode
* @param host A full nick!ident@host/cidr mask * @param host A full or poartial nick!ident@host/cidr#real name mask
*/ */
Entry(const Anope::string &mode, const Anope::string &host); Entry(const Anope::string &mode, const Anope::string &host);
/** Get the banned mask for this entry /** Get the banned mask for this entry
* @return The mask * @return The mask
*/ */
const Anope::string GetMask(); const Anope::string GetMask() const;
const Anope::string GetNUHMask() const;
/** Check if this entry matches a user /** Check if this entry matches a user
* @param u The user * @param u The user
* @param full True to match against a users real host and IP * @param full True to match against a users real host and IP
* @return true on match * @return true on match
*/ */
bool Matches(const User *u, bool full = false) const; bool Matches(User *u, bool full = false) const;
}; };
#endif // MODES_H #endif // MODES_H
+5 -5
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -12,7 +12,6 @@
#ifndef MODULE_H #ifndef MODULE_H
#define MODULE_H #define MODULE_H
/* Just include everything for now */
#include "access.h" #include "access.h"
#include "account.h" #include "account.h"
#include "anope.h" #include "anope.h"
@@ -47,8 +46,9 @@
#include "users.h" #include "users.h"
#include "xline.h" #include "xline.h"
#include "global.h" #include "modules/pseudoclients/chanserv.h"
#include "memoserv.h" #include "modules/pseudoclients/global.h"
#include "nickserv.h" #include "modules/pseudoclients/memoserv.h"
#include "modules/pseudoclients/nickserv.h"
#endif // MODULE_H #endif // MODULE_H
+361 -293
View File
File diff suppressed because it is too large Load Diff
+73
View File
@@ -0,0 +1,73 @@
/* BotServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*
*/
/** Flags for badwords
*/
enum BadWordType
{
/* Always kicks if the word is said */
BW_ANY,
/* User must way the entire word */
BW_SINGLE,
/* The word has to start with the badword */
BW_START,
/* The word has to end with the badword */
BW_END
};
/* Structure used to contain bad words. */
struct BadWord
{
Anope::string chan;
Anope::string word;
BadWordType type;
virtual ~BadWord() { }
protected:
BadWord() { }
};
struct BadWords
{
virtual ~BadWords() { }
/** Add a badword to the badword list
* @param word The badword
* @param type The type (SINGLE START END)
* @return The badword
*/
virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
/** Get a badword structure by index
* @param index The index
* @return The badword
*/
virtual BadWord* GetBadWord(unsigned index) const = 0;
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
*/
virtual unsigned GetBadWordCount() const = 0;
/** Remove a badword
* @param index The index of the badword
*/
virtual void EraseBadWord(unsigned index) = 0;
/** Clear all badwords from the channel
*/
virtual void ClearBadWords() = 0;
virtual void Check() = 0;
};
+46
View File
@@ -0,0 +1,46 @@
/* BotServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*
*/
/* Indices for TTB (Times To Ban) */
enum
{
TTB_BOLDS,
TTB_COLORS,
TTB_REVERSES,
TTB_UNDERLINES,
TTB_BADWORDS,
TTB_CAPS,
TTB_FLOOD,
TTB_REPEAT,
TTB_ITALICS,
TTB_AMSGS,
TTB_SIZE
};
struct KickerData
{
bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
int16_t capsmin, capspercent; /* For CAPS kicker */
int16_t floodlines, floodsecs; /* For FLOOD kicker */
int16_t repeattimes; /* For REPEAT kicker */
bool dontkickops, dontkickvoices;
protected:
KickerData() { }
public:
virtual ~KickerData() { }
virtual void Check(ChannelInfo *ci) = 0;
};
+35
View File
@@ -0,0 +1,35 @@
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
struct EntryMsg
{
Anope::string chan;
Anope::string creator;
Anope::string message;
time_t when;
virtual ~EntryMsg() { }
protected:
EntryMsg() { }
};
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
{
protected:
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
public:
virtual ~EntryMessageList()
{
for (unsigned i = (*this)->size(); i > 0; --i)
delete (*this)->at(i - 1);
}
virtual EntryMsg* Create() = 0;
};
+43
View File
@@ -0,0 +1,43 @@
/* ChanServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct LogSetting
{
Anope::string chan;
/* Our service name of the command */
Anope::string service_name;
/* The name of the client the command is on */
Anope::string command_service;
/* Name of the command to the user, can have spaces */
Anope::string command_name;
Anope::string method, extra;
Anope::string creator;
time_t created;
virtual ~LogSetting() { }
protected:
LogSetting() { }
};
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
{
typedef std::vector<LogSetting *>::iterator iterator;
protected:
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
{
}
public:
virtual ~LogSettings() { }
virtual LogSetting *Create() = 0;
};
+90
View File
@@ -0,0 +1,90 @@
/* ChanServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct ModeLock
{
Anope::string ci;
bool set;
Anope::string name;
Anope::string param;
Anope::string setter;
time_t created;
virtual ~ModeLock() { }
protected:
ModeLock() { }
};
struct ModeLocks
{
typedef std::vector<ModeLock *> ModeList;
virtual ~ModeLocks() { }
/** Check if a mode is mlocked
* @param mode The mode
* @param An optional param
* @param status True to check mlock on, false for mlock off
* @return true on success, false on fail
*/
virtual bool HasMLock(ChannelMode *mode, const Anope::string &param, bool status) const = 0;
/** Set a mlock
* @param mode The mode
* @param status True for mlock on, false for mlock off
* @param param An optional param arg for + mlocked modes
* @param setter Who is setting the mlock
* @param created When the mlock was created
* @return true on success, false on failure (module blocking)
*/
virtual bool SetMLock(ChannelMode *mode, bool status, const Anope::string &param = "", Anope::string setter = "", time_t created = Anope::CurTime) = 0;
/** Remove a mlock
* @param mode The mode
* @param status True for mlock on, false for mlock off
* @param param The param of the mode, required if it is a list or status mode
* @return true on success, false on failure
*/
virtual bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string &param = "") = 0;
virtual void RemoveMLock(ModeLock *mlock) = 0;
/** Clear all mlocks on the channel
*/
virtual void ClearMLock() = 0;
/** Get all of the mlocks for this channel
* @return The mlocks
*/
virtual const ModeList &GetMLock() const = 0;
/** Get a list of mode locks on a channel
* @param name The mode name to get a list of
* @return a list of mlocks for the given mode
*/
virtual std::list<ModeLock *> GetModeLockList(const Anope::string &name) = 0;
/** Get details for a specific mlock
* @param mname The mode name
* @param An optional param to match with
* @return The MLock, if any
*/
virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string &param = "") = 0;
/** Get the current mode locks as a string
* @param complete True to show mlock parameters aswell
* @return A string of mode locks, eg: +nrt
*/
virtual Anope::string GetMLockAsString(bool complete) const = 0;
virtual void Check() = 0;
};
+17 -14
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -34,15 +34,18 @@ namespace DNS
/* IPv6 AAAA lookup */ /* IPv6 AAAA lookup */
QUERY_AAAA = 28, QUERY_AAAA = 28,
/* Zone transfer */ /* Zone transfer */
QUERY_AXFR = 252 QUERY_AXFR = 252,
/* A lookup for any record */
QUERY_ANY = 255
}; };
/** Flags that can be AND'd into DNSPacket::flags to receive certain values /** Flags that can be AND'd into DNSPacket::flags to receive certain values
*/ */
enum enum
{ {
QUERYFLAGS_QR = 0x8000, QUERYFLAGS_QR = 0x8000,
QUERYFLAGS_OPCODE = 0x7800, QUERYFLAGS_OPCODE = 0x7800,
QUERYFLAGS_OPCODE_NOTIFY = 0x2000,
QUERYFLAGS_AA = 0x400, QUERYFLAGS_AA = 0x400,
QUERYFLAGS_TC = 0x200, QUERYFLAGS_TC = 0x200,
QUERYFLAGS_RD = 0x100, QUERYFLAGS_RD = 0x100,
@@ -76,9 +79,18 @@ namespace DNS
Question() : type(QUERY_NONE), qclass(0) { } Question() : type(QUERY_NONE), qclass(0) { }
Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { } Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; }
struct hash
{
size_t operator()(const Question &q) const
{
return Anope::hash_ci()(q.name);
}
};
}; };
struct ResourceRecord : public Question struct ResourceRecord : Question
{ {
unsigned int ttl; unsigned int ttl;
Anope::string rdata; Anope::string rdata;
@@ -98,16 +110,6 @@ namespace DNS
Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); } Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); }
}; };
class Packet : public Query
{
public:
static const int POINTER = 0xC0;
static const int LABEL = 0x3F;
static const int HEADER_LENGTH = 12;
virtual ~Packet() { }
};
class ReplySocket; class ReplySocket;
class Request; class Request;
@@ -125,6 +127,7 @@ namespace DNS
virtual bool HandlePacket(ReplySocket *s, const unsigned char *const data, int len, sockaddrs *from) = 0; virtual bool HandlePacket(ReplySocket *s, const unsigned char *const data, int len, sockaddrs *from) = 0;
virtual void UpdateSerial() = 0; virtual void UpdateSerial() = 0;
virtual void Notify(const Anope::string &zone) = 0;
virtual uint32_t GetSerial() const = 0; virtual uint32_t GetSerial() const = 0;
}; };
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -131,11 +131,12 @@ class HTTPProvider : public ListenSocket, public Service
{ {
Anope::string ip; Anope::string ip;
unsigned short port; unsigned short port;
bool ssl;
public: public:
Anope::string ext_ip; Anope::string ext_ip;
std::vector<Anope::string> ext_headers; std::vector<Anope::string> ext_headers;
HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p) : ListenSocket(i, p, i.find(':') != Anope::string::npos), Service(c, "HTTPProvider", n), ip(i), port(p) { } HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, bool s) : ListenSocket(i, p, i.find(':') != Anope::string::npos), Service(c, "HTTPProvider", n), ip(i), port(p), ssl(s) { }
const Anope::string &GetIP() const const Anope::string &GetIP() const
{ {
@@ -147,6 +148,11 @@ class HTTPProvider : public ListenSocket, public Service
return this->port; return this->port;
} }
bool IsSSL() const
{
return this->ssl;
}
virtual bool RegisterPage(HTTPPage *page) = 0; virtual bool RegisterPage(HTTPPage *page) = 0;
virtual void UnregisterPage(HTTPPage *page) = 0; virtual void UnregisterPage(HTTPPage *page) = 0;
virtual HTTPPage* FindPage(const Anope::string &name) = 0; virtual HTTPPage* FindPage(const Anope::string &name) = 0;
+16 -26
View File
@@ -1,8 +1,6 @@
#ifndef ANOPE_LDAP_H #ifndef ANOPE_LDAP_H
#define ANOPE_LDAP_H #define ANOPE_LDAP_H
typedef int LDAPQuery;
class LDAPException : public ModuleException class LDAPException : public ModuleException
{ {
public: public:
@@ -59,28 +57,26 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
} }
}; };
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
struct LDAPResult struct LDAPResult
{ {
std::vector<LDAPAttributes> messages; std::vector<LDAPAttributes> messages;
Anope::string error; Anope::string error;
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
QueryType type; QueryType type;
LDAPQuery id;
LDAPResult() LDAPResult()
{ {
this->type = QUERY_UNKNOWN; this->type = QUERY_UNKNOWN;
this->id = -1;
} }
size_t size() const size_t size() const
@@ -126,48 +122,42 @@ class LDAPProvider : public Service
/** Attempt to bind to the LDAP server as an admin /** Attempt to bind to the LDAP server as an admin
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @return The query ID
*/ */
virtual LDAPQuery BindAsAdmin(LDAPInterface *i) = 0; virtual void BindAsAdmin(LDAPInterface *i) = 0;
/** Bind to LDAP /** Bind to LDAP
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @param who The binddn * @param who The binddn
* @param pass The password * @param pass The password
* @return The query ID
*/ */
virtual LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0; virtual void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
/** Search ldap for the specified filter /** Search ldap for the specified filter
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @param base The base DN to search * @param base The base DN to search
* @param filter The filter to apply * @param filter The filter to apply
* @return The query ID
*/ */
virtual LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0; virtual void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
/** Add an entry to LDAP /** Add an entry to LDAP
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @param dn The dn of the entry to add * @param dn The dn of the entry to add
* @param attributes The attributes * @param attributes The attributes
* @return The query ID
*/ */
virtual LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0; virtual void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
/** Delete an entry from LDAP /** Delete an entry from LDAP
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @param dn The dn of the entry to delete * @param dn The dn of the entry to delete
* @return The query ID
*/ */
virtual LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) = 0; virtual void Del(LDAPInterface *i, const Anope::string &dn) = 0;
/** Modify an existing entry in LDAP /** Modify an existing entry in LDAP
* @param i The LDAPInterface the result is sent to * @param i The LDAPInterface the result is sent to
* @param base The base DN to modify * @param base The base DN to modify
* @param attributes The attributes to modify * @param attributes The attributes to modify
* @return The query ID
*/ */
virtual LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0; virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
}; };
#endif // ANOPE_LDAP_H #endif // ANOPE_LDAP_H
+71
View File
@@ -0,0 +1,71 @@
/* NickServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct NSCertList
{
protected:
NSCertList() { }
public:
virtual ~NSCertList() { }
/** Add an entry to the nick's certificate list
*
* @param entry The fingerprint to add to the cert list
*
* Adds a new entry into the cert list.
*/
virtual void AddCert(const Anope::string &entry) = 0;
/** Get an entry from the nick's cert list by index
*
* @param entry Index in the certificaate list vector to retrieve
* @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
*
* Retrieves an entry from the certificate list corresponding to the given index.
*/
virtual Anope::string GetCert(unsigned entry) const = 0;
virtual unsigned GetCertCount() const = 0;
/** Find an entry in the nick's cert list
*
* @param entry The fingerprint to search for
* @return True if the fingerprint is found in the cert list, false otherwise
*
* Search for an fingerprint within the cert list.
*/
virtual bool FindCert(const Anope::string &entry) const = 0;
/** Erase a fingerprint from the nick's certificate list
*
* @param entry The fingerprint to remove
*
* Removes the specified fingerprint from the cert list.
*/
virtual void EraseCert(const Anope::string &entry) = 0;
/** Clears the entire nick's cert list
*
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
*/
virtual void ClearCert() = 0;
virtual void Check() = 0;
};
class CertService : public Service
{
public:
CertService(Module *c) : Service(c, "CertService", "certs") { }
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
};
+46
View File
@@ -0,0 +1,46 @@
#ifndef OS_FORBID_H
#define OS_FORBID_H
enum ForbidType
{
FT_NICK = 1,
FT_CHAN,
FT_EMAIL,
FT_REGISTER,
FT_SIZE
};
struct ForbidData
{
Anope::string mask;
Anope::string creator;
Anope::string reason;
time_t created;
time_t expires;
ForbidType type;
virtual ~ForbidData() { }
protected:
ForbidData() : created(0), expires(0) { }
};
class ForbidService : public Service
{
public:
ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { }
virtual void AddForbid(ForbidData *d) = 0;
virtual void RemoveForbid(ForbidData *d) = 0;
virtual ForbidData* CreateForbid() = 0;
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
virtual std::vector<ForbidData *> GetForbids() = 0;
};
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
#endif
+45
View File
@@ -0,0 +1,45 @@
/* OperServ ignore interface
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct IgnoreData
{
Anope::string mask;
Anope::string creator;
Anope::string reason;
time_t time; /* When do we stop ignoring them? */
virtual ~IgnoreData() { }
protected:
IgnoreData() : time(0) { }
};
class IgnoreService : public Service
{
protected:
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
public:
virtual void AddIgnore(IgnoreData *) = 0;
virtual void DelIgnore(IgnoreData *) = 0;
virtual void ClearIgnores() = 0;
virtual IgnoreData *Create() = 0;
virtual IgnoreData *Find(const Anope::string &mask) = 0;
virtual std::vector<IgnoreData *> &GetIgnores() = 0;
};
static ServiceReference<IgnoreService> ignore_service("IgnoreService", "ignore");
+45
View File
@@ -0,0 +1,45 @@
#ifndef OS_NEWS
#define OS_NEWS
enum NewsType
{
NEWS_LOGON,
NEWS_RANDOM,
NEWS_OPER
};
struct NewsMessages
{
NewsType type;
Anope::string name;
const char *msgs[10];
};
struct NewsItem : Serializable
{
NewsType type;
Anope::string text;
Anope::string who;
time_t time;
NewsItem() : Serializable("NewsItem") { }
};
class NewsService : public Service
{
public:
NewsService(Module *m) : Service(m, "NewsService", "news") { }
virtual NewsItem *CreateNewsItem() = 0;
virtual void AddNewsItem(NewsItem *n) = 0;
virtual void DelNewsItem(NewsItem *n) = 0;
virtual std::vector<NewsItem *> &GetNewsList(NewsType t) = 0;
};
static ServiceReference<NewsService> news_service("NewsService", "news");
#endif // OS_NEWS
@@ -7,7 +7,7 @@ struct Session
unsigned count; /* Number of clients with this host */ unsigned count; /* Number of clients with this host */
unsigned hits; /* Number of subsequent kills for a host */ unsigned hits; /* Number of subsequent kills for a host */
Session(const Anope::string &ip, int len) : addr(ip, len), count(1), hits(0) { } Session(const sockaddrs &ip, int len) : addr(ip, len), count(1), hits(0) { }
}; };
struct Exception : Serializable struct Exception : Serializable
@@ -27,11 +27,13 @@ struct Exception : Serializable
class SessionService : public Service class SessionService : public Service
{ {
public: public:
typedef std::tr1::unordered_map<cidr, Session *, cidr::hash> SessionMap; typedef TR1NS::unordered_map<cidr, Session *, cidr::hash> SessionMap;
typedef std::vector<Exception *> ExceptionVector; typedef std::vector<Exception *> ExceptionVector;
SessionService(Module *m) : Service(m, "SessionService", "session") { } SessionService(Module *m) : Service(m, "SessionService", "session") { }
virtual Exception *CreateException() = 0;
virtual void AddException(Exception *e) = 0; virtual void AddException(Exception *e) = 0;
virtual void DelException(Exception *e) = 0; virtual void DelException(Exception *e) = 0;
@@ -42,11 +44,7 @@ class SessionService : public Service
virtual ExceptionVector &GetExceptions() = 0; virtual ExceptionVector &GetExceptions() = 0;
virtual void AddSession(Session *s) = 0; virtual Session *FindSession(const Anope::string &ip) = 0;
virtual void DelSession(Session *s) = 0;
virtual Session *FindSession(const Anope::string &mask) = 0;
virtual SessionMap &GetSessions() = 0; virtual SessionMap &GetSessions() = 0;
}; };
+18
View File
@@ -0,0 +1,18 @@
#ifndef CHANSERV_H
#define CHANSERV_H
class ChanServService : public Service
{
public:
ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ")
{
}
/* Have ChanServ hold the channel, that is, join and set +nsti and wait
* for a few minutes so no one can join or rejoin.
*/
virtual void Hold(Channel *c) = 0;
};
#endif // CHANSERV_H
@@ -4,14 +4,16 @@
class GlobalService : public Service class GlobalService : public Service
{ {
public: public:
GlobalService(Module *m) : Service(m, "GlobalService", "Global") { } GlobalService(Module *m) : Service(m, "GlobalService", "Global")
{
}
/** Send out a global message to all users /** Send out a global message to all users
* @param sender Our client which should send the global * @param sender Our client which should send the global
* @param source The sender of the global * @param source The sender of the global
* @param message The message * @param message The message
*/ */
virtual void SendGlobal(const BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0; virtual void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
}; };
#endif // GLOBAL_H #endif // GLOBAL_H
@@ -12,7 +12,9 @@ class MemoServService : public Service
MEMO_TARGET_FULL MEMO_TARGET_FULL
}; };
MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ") { } MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ")
{
}
/** Sends a memo. /** Sends a memo.
* @param source The source of the memo, can be anythin. * @param source The source of the memo, can be anythin.
@@ -4,10 +4,13 @@
class NickServService : public Service class NickServService : public Service
{ {
public: public:
NickServService(Module *m) : Service(m, "NickServService", "NickServ") { } NickServService(Module *m) : Service(m, "NickServService", "NickServ")
{
}
virtual void Validate(User *u) = 0; virtual void Validate(User *u) = 0;
virtual void Login(User *u, NickAlias *na) = 0; virtual void Collide(User *u, NickAlias *na) = 0;
virtual void Release(NickAlias *na) = 0;
}; };
#endif // NICKSERV_H #endif // NICKSERV_H
+74
View File
@@ -0,0 +1,74 @@
/*
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
namespace Redis
{
struct Reply
{
enum Type
{
NOT_PARSED,
NOT_OK,
OK,
INT,
BULK,
MULTI_BULK
}
type;
Reply() { Clear(); }
~Reply() { Clear(); }
void Clear()
{
type = NOT_PARSED;
i = 0;
bulk.clear();
multi_bulk_size = 0;
for (unsigned j = 0; j < multi_bulk.size(); ++j)
delete multi_bulk[j];
multi_bulk.clear();
}
int64_t i;
Anope::string bulk;
int multi_bulk_size;
std::deque<Reply *> multi_bulk;
};
class Interface
{
public:
Module *owner;
Interface(Module *m) : owner(m) { }
virtual ~Interface() { }
virtual void OnResult(const Reply &r) = 0;
virtual void OnError(const Anope::string &error) { Log(owner) << error; }
};
class Provider : public Service
{
public:
Provider(Module *c, const Anope::string &n) : Service(c, "Redis::Provider", n) { }
virtual void SendCommand(Interface *i, const std::vector<Anope::string> &cmds) = 0;
virtual void SendCommand(Interface *i, const Anope::string &str) = 0;
virtual bool BlockAndProcess() = 0;
virtual void Subscribe(Interface *i, const Anope::string &pattern) = 0;
virtual void Unsubscribe(const Anope::string &pattern) = 0;
virtual void StartTransaction() = 0;
virtual void CommitTransaction() = 0;
};
}
+123
View File
@@ -0,0 +1,123 @@
/*
*
* (C) 2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
namespace SASL
{
struct Message
{
Anope::string source;
Anope::string target;
Anope::string type;
Anope::string data;
Anope::string ext;
};
class Mechanism;
struct Session;
class Service : public ::Service
{
public:
Service(Module *o) : ::Service(o, "SASL::Service", "sasl") { }
virtual void ProcessMessage(const Message &) = 0;
virtual Anope::string GetAgent() = 0;
virtual Session* GetSession(const Anope::string &uid) = 0;
virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0;
virtual void Succeed(Session *, NickCore *) = 0;
virtual void Fail(Session *) = 0;
virtual void SendMechs(Session *) = 0;
virtual void DeleteSessions(Mechanism *, bool = false) = 0;
virtual void RemoveSession(Session *) = 0;
};
static ServiceReference<SASL::Service> sasl("SASL::Service", "sasl");
struct Session
{
time_t created;
Anope::string uid;
Reference<Mechanism> mech;
Session(Mechanism *m, const Anope::string &u) : created(Anope::CurTime), uid(u), mech(m) { }
virtual ~Session()
{
if (sasl)
sasl->RemoveSession(this);
}
};
/* PLAIN, EXTERNAL, etc */
class Mechanism : public ::Service
{
public:
Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { }
virtual Session* CreateSession(const Anope::string &uid) { return new Session(this, uid); }
virtual void ProcessMessage(Session *session, const Message &) = 0;
virtual ~Mechanism()
{
if (sasl)
sasl->DeleteSessions(this, true);
}
};
class IdentifyRequest : public ::IdentifyRequest
{
Anope::string uid;
public:
IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : ::IdentifyRequest(m, acc, pass), uid(id) { }
void OnSuccess() anope_override
{
if (!sasl)
return;
NickAlias *na = NickAlias::Find(GetAccount());
if (!na || na->nc->HasExt("NS_SUSPENDED"))
return OnFail();
Session *s = sasl->GetSession(uid);
if (s)
{
Log(Config->GetClient("NickServ")) << "A user identified to account " << this->GetAccount() << " using SASL";
sasl->Succeed(s, na->nc);
delete s;
}
}
void OnFail() anope_override
{
if (!sasl)
return;
Session *s = sasl->GetSession(uid);
if (s)
{
sasl->Fail(s);
delete s;
}
Anope::string accountstatus;
NickAlias *na = NickAlias::Find(GetAccount());
if (!na)
accountstatus = "nonexistent ";
else if (na->nc->HasExt("NS_SUSPENDED"))
accountstatus = "suspended ";
Log(Config->GetClient("NickServ")) << "A user failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
}
};
}
+17
View File
@@ -0,0 +1,17 @@
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
struct MiscData
{
Anope::string object;
Anope::string name;
Anope::string data;
MiscData() { }
virtual ~MiscData() { }
};
@@ -1,5 +1,5 @@
/* /*
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
+18
View File
@@ -0,0 +1,18 @@
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct SuspendInfo
{
Anope::string what, by, reason;
time_t when, expires;
SuspendInfo() { }
virtual ~SuspendInfo() { }
};
+4 -5
View File
@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org> * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2013 Anope Team <team@anope.org> * Copyright (C) 2008-2014 Anope Team <team@anope.org>
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
* *
@@ -25,15 +25,14 @@ struct CoreExport Oper
bool require_oper; bool require_oper;
Anope::string password; Anope::string password;
Anope::string certfp; Anope::string certfp;
/* True if this operator is set in the config */
bool config;
/* Hosts allowed to use this operator block */ /* Hosts allowed to use this operator block */
std::vector<Anope::string> hosts; std::vector<Anope::string> hosts;
Anope::string vhost; Anope::string vhost;
Oper(const Anope::string &n, OperType *o) : name(n), ot(o), require_oper(false), config(false) { } Oper(const Anope::string &n, OperType *o);
virtual ~Oper();
virtual ~Oper() { } static std::vector<Oper *> opers;
/** Find an oper block by name /** Find an oper block by name
* @param name The name * @param name The name
+67 -45
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -27,20 +27,22 @@ class CoreExport IRCDProto : public Service
public: public:
virtual ~IRCDProto(); virtual ~IRCDProto();
virtual void SendSVSKillInternal(const BotInfo *, User *, const Anope::string &); virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &);
virtual void SendModeInternal(const BotInfo *, const Channel *, const Anope::string &); virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &);
virtual void SendModeInternal(const BotInfo *, const User *, const Anope::string &) = 0; virtual void SendModeInternal(const MessageSource &, User *, const Anope::string &);
virtual void SendKickInternal(const BotInfo *, const Channel *, const User *, const Anope::string &); virtual void SendKickInternal(const MessageSource &, const Channel *, User *, const Anope::string &);
virtual void SendMessageInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf); virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg);
virtual void SendNoticeInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &msg); virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
virtual void SendPrivmsgInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf); virtual void SendQuitInternal(User *, const Anope::string &buf);
virtual void SendQuitInternal(const User *u, const Anope::string &buf); virtual void SendPartInternal(User *, const Channel *chan, const Anope::string &buf);
virtual void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf); virtual void SendGlobopsInternal(const MessageSource &, const Anope::string &buf);
virtual void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf); virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
virtual void SendCTCPInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf); virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
const Anope::string &GetProtocolName(); const Anope::string &GetProtocolName();
virtual void Parse(const Anope::string &, Anope::string &, Anope::string &, std::vector<Anope::string> &);
virtual Anope::string Format(const Anope::string &source, const Anope::string &message);
/* Modes used by default by our clients */ /* Modes used by default by our clients */
Anope::string DefaultPseudoclientModes; Anope::string DefaultPseudoclientModes;
/* Can we force change a users's nick? */ /* Can we force change a users's nick? */
@@ -65,8 +67,16 @@ class CoreExport IRCDProto : public Service
bool CanCertFP; bool CanCertFP;
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */ /* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
bool RequiresID; bool RequiresID;
/* If this IRCd has unique ids, whether the IDs and nicknames are ambiguous */
bool AmbiguousID;
/* The maximum number of modes we are allowed to set with one MODE command */ /* The maximum number of modes we are allowed to set with one MODE command */
unsigned MaxModes; unsigned MaxModes;
/* The maximum number of bytes a line may have */
unsigned MaxLine;
/* Retrieves the next free UID or SID */
virtual Anope::string UID_Retrieve();
virtual Anope::string SID_Retrieve();
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users /** Sets the server in NOOP mode. If NOOP mode is enabled, no users
* will be able to oper on the server. * will be able to oper on the server.
@@ -79,7 +89,7 @@ class CoreExport IRCDProto : public Service
* @param bi The bot to set the topic from * @param bi The bot to set the topic from
* @param c The channel to set the topic on. The topic being set is Channel::topic * @param c The channel to set the topic on. The topic being set is Channel::topic
*/ */
virtual void SendTopic(BotInfo *, Channel *); virtual void SendTopic(const MessageSource &, Channel *);
/** Sets a vhost on a user. /** Sets a vhost on a user.
* @param u The user * @param u The user
@@ -110,34 +120,34 @@ class CoreExport IRCDProto : public Service
virtual void SendSQLine(User *, const XLine *x) { } virtual void SendSQLine(User *, const XLine *x) { }
virtual void SendSQLineDel(const XLine *x) { } virtual void SendSQLineDel(const XLine *x) { }
virtual void SendKill(const MessageSource &source, const Anope::string &target, const Anope::string &reason);
/** Kills a user /** Kills a user
* @param source The client used to kill the user, if any * @param source Who is doing the kill
* @param user The user to be killed * @param user The user to be killed
* @param fmt Kill reason * @param fmt Kill reason
*/ */
virtual void SendSVSKill(const BotInfo *source, User *user, const char *fmt, ...); virtual void SendSVSKill(const MessageSource &source, User *user, const char *fmt, ...);
virtual void SendMode(const BotInfo *bi, const Channel *dest, const char *fmt, ...); virtual void SendMode(const MessageSource &source, const Channel *dest, const char *fmt, ...);
virtual void SendMode(const BotInfo *bi, const User *u, const char *fmt, ...); virtual void SendMode(const MessageSource &source, User *u, const char *fmt, ...);
/** Introduces a client to the rest of the network /** Introduces a client to the rest of the network
* @param u The client to introduce * @param u The client to introduce
*/ */
virtual void SendClientIntroduction(const User *u) = 0; virtual void SendClientIntroduction(User *u) = 0;
virtual void SendKick(const BotInfo *bi, const Channel *chan, const User *user, const char *fmt, ...); virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const char *fmt, ...);
/* Sends a message using SendPrivmsg or SendNotice, depending on the default message method. */ virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
virtual void SendMessage(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
virtual void SendNotice(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); virtual void SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
virtual void SendPrivmsg(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...); virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
virtual void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg) = 0; virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
virtual void SendGlobalPrivmsg(const BotInfo *bi, const Server *desc, const Anope::string &msg) = 0; virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
virtual void SendQuit(const User *u, const char *fmt, ...); virtual void SendQuit(User *u, const char *fmt, ...);
virtual void SendPing(const Anope::string &servname, const Anope::string &who); virtual void SendPing(const Anope::string &servname, const Anope::string &who);
virtual void SendPong(const Anope::string &servname, const Anope::string &who); virtual void SendPong(const Anope::string &servname, const Anope::string &who);
@@ -148,8 +158,8 @@ class CoreExport IRCDProto : public Service
* be set on the user. This may include the modes in the join, but will usually place them on the mode * be set on the user. This may include the modes in the join, but will usually place them on the mode
* stacker to be set "soon". * stacker to be set "soon".
*/ */
virtual void SendJoin(const User *u, Channel *c, const ChannelStatus *status) = 0; virtual void SendJoin(User *u, Channel *c, const ChannelStatus *status) = 0;
virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...); virtual void SendPart(User *u, const Channel *chan, const char *fmt, ...);
/** Force joins a user that isn't ours to a channel. /** Force joins a user that isn't ours to a channel.
* @param bi The source of the message * @param bi The source of the message
@@ -157,30 +167,30 @@ class CoreExport IRCDProto : public Service
* @param chan The channel to join the user to * @param chan The channel to join the user to
* @param param Channel key? * @param param Channel key?
*/ */
virtual void SendSVSJoin(const BotInfo *bi, const User *u, const Anope::string &chan, const Anope::string &param) { } virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) { }
/** Force parts a user that isn't ours from a channel. /** Force parts a user that isn't ours from a channel.
* @param bi The source of the message * @param source The source of the message
* @param u The user to part * @param u The user to part
* @param chan The channel to part the user from * @param chan The channel to part the user from
* @param param part reason, some IRCds don't support this * @param param part reason, some IRCds don't support this
*/ */
virtual void SendSVSPart(const BotInfo *bi, const User *u, const Anope::string &chan, const Anope::string &param) { } virtual void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) { }
virtual void SendInvite(const BotInfo *bi, const Channel *c, const User *u); virtual void SendInvite(const MessageSource &source, const Channel *c, User *u);
virtual void SendGlobops(const BotInfo *source, const char *fmt, ...); virtual void SendGlobops(const MessageSource &source, const char *fmt, ...);
/** Sets oper flags on a user, currently only supported by Unreal /** Sets oper flags on a user, currently only supported by Unreal
*/ */
virtual void SendSVSO(const BotInfo *, const Anope::string &, const Anope::string &) { } virtual void SendSVSO(BotInfo *, const Anope::string &, const Anope::string &) { }
/** Sends a nick change of one of our clients. /** Sends a nick change of one of our clients.
*/ */
virtual void SendNickChange(const User *u, const Anope::string &newnick); virtual void SendNickChange(User *u, const Anope::string &newnick);
/** Forces a nick change of a user that isn't ours (SVSNICK) /** Forces a nick change of a user that isn't ours (SVSNICK)
*/ */
virtual void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when); virtual void SendForceNickChange(User *u, const Anope::string &newnick, time_t when);
/** Used to introduce ourselves to our uplink. Usually will SendServer(Me) and any other /** Used to introduce ourselves to our uplink. Usually will SendServer(Me) and any other
* initial handshake requirements. * initial handshake requirements.
@@ -193,10 +203,10 @@ class CoreExport IRCDProto : public Service
virtual void SendBOB() { } virtual void SendBOB() { }
virtual void SendEOB() { } virtual void SendEOB() { }
virtual void SendSVSHold(const Anope::string &) { } virtual void SendSVSHold(const Anope::string &, time_t) { }
virtual void SendSVSHoldDel(const Anope::string &) { } virtual void SendSVSHoldDel(const Anope::string &) { }
virtual void SendSWhois(const BotInfo *bi, const Anope::string &, const Anope::string &) { } virtual void SendSWhois(const MessageSource &, const Anope::string &, const Anope::string &) { }
/** Introduces a server to the uplink /** Introduces a server to the uplink
*/ */
@@ -205,7 +215,7 @@ class CoreExport IRCDProto : public Service
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...); virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...);
virtual void SendLogin(User *u) = 0; virtual void SendLogin(User *u, NickAlias *na) = 0;
virtual void SendLogout(User *u) = 0; virtual void SendLogout(User *u) = 0;
/** Send a channel creation message to the uplink. /** Send a channel creation message to the uplink.
@@ -218,10 +228,21 @@ class CoreExport IRCDProto : public Service
*/ */
virtual void SendOper(User *u); virtual void SendOper(User *u);
virtual void SendSASLMessage(const SASL::Message &) { }
virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) { }
virtual bool IsNickValid(const Anope::string &); virtual bool IsNickValid(const Anope::string &);
virtual bool IsChannelValid(const Anope::string &); virtual bool IsChannelValid(const Anope::string &);
virtual bool IsIdentValid(const Anope::string &); virtual bool IsIdentValid(const Anope::string &);
virtual bool IsHostValid(const Anope::string &); virtual bool IsHostValid(const Anope::string &);
virtual bool IsExtbanValid(const Anope::string &) { return false; }
/** Retrieve the maximum number of list modes settable on this channel
* Defaults to Config->ListSize
*/
virtual unsigned GetMaxListFor(Channel *c);
virtual Anope::string NormalizeMask(const Anope::string &mask);
}; };
class CoreExport MessageSource class CoreExport MessageSource
@@ -234,10 +255,11 @@ class CoreExport MessageSource
MessageSource(const Anope::string &); MessageSource(const Anope::string &);
MessageSource(User *u); MessageSource(User *u);
MessageSource(Server *s); MessageSource(Server *s);
const Anope::string GetName(); const Anope::string &GetName() const;
const Anope::string &GetSource(); const Anope::string &GetSource() const;
User *GetUser(); User *GetUser() const;
Server *GetServer(); BotInfo *GetBot() const;
Server *GetServer() const;
}; };
enum IRCDMessageFlag enum IRCDMessageFlag
+22 -223
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2008-2013 Anope Team * (C) 2008-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -22,49 +22,6 @@ typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList; extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
/* Indices for TTB (Times To Ban) */
enum
{
TTB_BOLDS,
TTB_COLORS,
TTB_REVERSES,
TTB_UNDERLINES,
TTB_BADWORDS,
TTB_CAPS,
TTB_FLOOD,
TTB_REPEAT,
TTB_ITALICS,
TTB_AMSGS,
TTB_SIZE
};
/** Flags for badwords
*/
enum BadWordType
{
/* Always kicks if the word is said */
BW_ANY,
/* User must way the entire word */
BW_SINGLE,
/* The word has to start with the badword */
BW_START,
/* The word has to end with the badword */
BW_END
};
/* Structure used to contain bad words. */
struct CoreExport BadWord : Serializable
{
Serialize::Reference<ChannelInfo> ci;
Anope::string word;
BadWordType type;
BadWord();
~BadWord();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
};
/* AutoKick data. */ /* AutoKick data. */
class CoreExport AutoKick : public Serializable class CoreExport AutoKick : public Serializable
{ {
@@ -86,93 +43,22 @@ class CoreExport AutoKick : public Serializable
static Serializable* Unserialize(Serializable *obj, Serialize::Data &); static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
}; };
struct CoreExport ModeLock : Serializable
{
public:
Serialize::Reference<ChannelInfo> ci;
bool set;
Anope::string name;
Anope::string param;
Anope::string setter;
time_t created;
ModeLock(ChannelInfo *ch, bool s, const Anope::string &n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime);
~ModeLock();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
};
struct CoreExport LogSetting : Serializable
{
Serialize::Reference<ChannelInfo> ci;
/* Our service name of the command */
Anope::string service_name;
/* The name of the client the command is on */
Anope::string command_service;
/* Name of the command to the user, can have spaces */
Anope::string command_name;
Anope::string method, extra;
Anope::string creator;
time_t created;
LogSetting() : Serializable("LogSetting") { }
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
};
/* It matters that Base is here before Extensible (it is inherited by Serializable) /* It matters that Base is here before Extensible (it is inherited by Serializable)
*
* Possible flags:
* TOPICLOCK - Topic can only be changed by TOPIC SET
* RESTRICTED - Only users on the access list may join
* PEACE - Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels
* SECURE - Don't allow any privileges
* NO_EXPIRE - Channel does not expire
* MEMO_HARDMAX - Channel memo limit may not be changed
* SECUREFOUNDER - Stricter control of channel founder status
* SIGNKICK - Sign kicks with the user who did the kick
* SIGNKICK_LEVEL - Sign kicks if level is < than the one defined by the SIGNKICK level
* SUSPENDED - Channel is suepended
* PERSIST - Channel still exists when empited (perm channel mode or leaving a botserv bot).
* STATS - Chanstats are enabled
* NOAUTOOP - If set users are not auto given any status on join
*
* BotServ flags:
* BS_DONTKICKOPS - BotServ won't kick ops
* BS_DONTKICKVOICES - BotServ won't kick voices
* BS_FANTASY - BotServ bot accepts fantasy commands
* BS_GREET - BotServ should show greets
* BS_NOBOT - BotServ bots are not allowed to be in this channel
* BS_KICK_BOLDS - BotServ kicks for bolds
* BS_KICK_COLORS - BotServ kicks for colors
* BS_KICK_REVERSES - BotServ kicks for reverses
* BS_KICK_UNDERLINES - BotServ kicks for underlines
* BS_KICK_BADWORD - BotServ kicks for badwords
* BS_KICK_CAPS - BotServ kicks for caps
* BS_KICK_FLOOD - BotServ kicks for flood
* BS_KICK_REPEAT - BotServ kicks for repeating
* BS_KICK_ITALICS - BotServ kicks for italics
* BS_KICK_AMSGS - BotServ kicks for amsgs
*/ */
class CoreExport ChannelInfo : public Serializable, public Extensible class CoreExport ChannelInfo : public Serializable, public Extensible
{ {
/* channels who reference this one */
Anope::map<int> references;
private: private:
Serialize::Reference<NickCore> founder; /* Channel founder */ Serialize::Reference<NickCore> founder; /* Channel founder */
Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */ Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */ Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */
Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */ Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
Serialize::Checker<std::vector<BadWord *> > badwords; /* List of badwords */ Anope::map<int16_t> levels;
std::map<Anope::string, int16_t> levels;
public: public:
friend class ChanAccess; friend class ChanAccess;
friend class AutoKick; friend class AutoKick;
friend struct BadWord;
typedef std::multimap<Anope::string, ModeLock *> ModeList;
Serialize::Checker<ModeList> mode_locks;
Serialize::Checker<std::vector<LogSetting *> > log_settings;
Anope::string name; /* Channel name */ Anope::string name; /* Channel name */
Anope::string desc; Anope::string desc;
@@ -184,6 +70,8 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
Anope::string last_topic_setter; /* Setter */ Anope::string last_topic_setter; /* Setter */
time_t last_topic_time; /* Time */ time_t last_topic_time; /* Time */
Channel::ModeList last_modes; /* The last modes set on this channel */
int16_t bantype; int16_t bantype;
MemoInfo memos; MemoInfo memos;
@@ -192,11 +80,8 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
/* For BotServ */ /* For BotServ */
Serialize::Reference<BotInfo> bi; /* Bot used on this channel */ Serialize::Reference<BotInfo> bi; /* Bot used on this channel */
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
int16_t capsmin, capspercent; /* For CAPS kicker */ time_t banexpire; /* Time bans expire in */
int16_t floodlines, floodsecs; /* For FLOOD kicker */
int16_t repeattimes; /* For REPEAT kicker */
/** Constructor /** Constructor
* @param chname The channel name * @param chname The channel name
@@ -204,7 +89,7 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
ChannelInfo(const Anope::string &chname); ChannelInfo(const Anope::string &chname);
/** Copy constructor /** Copy constructor
* @param ci The ChannelInfo to copy settings to * @param ci The ChannelInfo to copy settings from
*/ */
ChannelInfo(const ChannelInfo &ci); ChannelInfo(const ChannelInfo &ci);
@@ -256,13 +141,18 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
*/ */
unsigned GetAccessCount() const; unsigned GetAccessCount() const;
/** Get the number of access entries for this channel,
* including those that are on other channels.
*/
unsigned GetDeepAccessCount() const;
/** Erase an entry from the channel access list /** Erase an entry from the channel access list
* *
* @param index The index in the access list vector * @param index The index in the access list vector
* *
* Clears the memory used by the given access entry and removes it from the vector. * @return The erased entry
*/ */
void EraseAccess(unsigned index); ChanAccess *EraseAccess(unsigned index);
/** Clear the entire channel access list /** Clear the entire channel access list
* *
@@ -308,105 +198,10 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
*/ */
void ClearAkick(); void ClearAkick();
/** Add a badword to the badword list /** Get the level entries for the channel.
* @param word The badword * @return The levels for the channel.
* @param type The type (SINGLE START END)
* @return The badword
*/ */
BadWord* AddBadWord(const Anope::string &word, BadWordType type); const Anope::map<int16_t> &GetLevelEntries();
/** Get a badword structure by index
* @param index The index
* @return The badword
*/
BadWord* GetBadWord(unsigned index) const;
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
*/
unsigned GetBadWordCount() const;
/** Remove a badword
* @param index The index of the badword
*/
void EraseBadWord(unsigned index);
/** Clear all badwords from the channel
*/
void ClearBadWords();
/** Check if a mode is mlocked
* @param mode The mode
* @param An optional param
* @param status True to check mlock on, false for mlock off
* @return true on success, false on fail
*/
bool HasMLock(ChannelMode *mode, const Anope::string &param, bool status) const;
/** Set a mlock
* @param mode The mode
* @param status True for mlock on, false for mlock off
* @param param An optional param arg for + mlocked modes
* @param setter Who is setting the mlock
* @param created When the mlock was created
* @return true on success, false on failure (module blocking)
*/
bool SetMLock(ChannelMode *mode, bool status, const Anope::string &param = "", Anope::string setter = "", time_t created = Anope::CurTime);
/** Remove a mlock
* @param mode The mode
* @param status True for mlock on, false for mlock off
* @param param The param of the mode, required if it is a list or status mode
* @return true on success, false on failure
*/
bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string &param = "");
void RemoveMLock(ModeLock *mlock);
/** Clear all mlocks on the channel
*/
void ClearMLock();
/** Get all of the mlocks for this channel
* @return The mlocks
*/
const ModeList &GetMLock() const;
/** Get a list of modes on a channel
* @param Name The mode name to get a list of
* @return a pair of iterators for the beginning and end of the list
*/
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name);
/** Get details for a specific mlock
* @param mname The mode name
* @param An optional param to match with
* @return The MLock, if any
*/
const ModeLock *GetMLock(const Anope::string &mname, const Anope::string &param = "");
/** Get the current mode locks as a string
* @param complete True to show mlock parameters aswell
* @return A string of mode locks, eg: +nrt
*/
Anope::string GetMLockAsString(bool complete) const;
/** Check whether a user is permitted to be on this channel
* @param u The user
* @return true if they are allowed, false if they aren't and were kicked
*/
bool CheckKick(User *user);
/** Check the channel topic
* If topic lock is enabled will change the topic back, else it records
* the new topic in the ChannelInfo
*/
void CheckTopic();
/** Restore the channel topic, used on channel creation when not syncing with the uplink
* and after uplink sync
*/
void RestoreTopic();
/** Get the level for a privilege /** Get the level for a privilege
* @param priv The privilege name * @param priv The privilege name
@@ -442,6 +237,10 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
* @return the ChannelInfo associated with the channel * @return the ChannelInfo associated with the channel
*/ */
static ChannelInfo* Find(const Anope::string &name); static ChannelInfo* Find(const Anope::string &name);
void AddChannelReference(const Anope::string &what);
void RemoveChannelReference(const Anope::string &what);
void GetChannelReferences(std::deque<Anope::string> &chans);
}; };
/** Is the user the real founder? /** Is the user the real founder?
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
+9 -6
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -60,9 +60,9 @@ class CoreExport Serializable : public virtual Base
* constructed before other objects are if it isn't. * constructed before other objects are if it isn't.
*/ */
static std::list<Serializable *> *SerializableItems; static std::list<Serializable *> *SerializableItems;
friend class Serialize::Type;
/* The type of item this object is */ /* The type of item this object is */
Serialize::Type *s_type; Serialize::Type *s_type;
private:
/* Iterator into serializable_items */ /* Iterator into serializable_items */
std::list<Serializable *>::iterator s_iter; std::list<Serializable *>::iterator s_iter;
/* The hash of the last serialized form of this object commited to the database */ /* The hash of the last serialized form of this object commited to the database */
@@ -80,7 +80,10 @@ class CoreExport Serializable : public virtual Base
virtual ~Serializable(); virtual ~Serializable();
/* Unique ID (per type, not globally) for this object */ /* Unique ID (per type, not globally) for this object */
unsigned int id; uint64_t id;
/* Only used by redis, to ignore updates */
unsigned short redis_ignore;
/** Marks the object as potentially being updated "soon". /** Marks the object as potentially being updated "soon".
*/ */
@@ -106,7 +109,7 @@ class CoreExport Serializable : public virtual Base
* of class that inherits from Serialiable. Used for unserializing objects * of class that inherits from Serialiable. Used for unserializing objects
* of this type, as it requires a function pointer to a static member function. * of this type, as it requires a function pointer to a static member function.
*/ */
class CoreExport Serialize::Type class CoreExport Serialize::Type : public Base
{ {
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &); typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
@@ -129,7 +132,7 @@ class CoreExport Serialize::Type
public: public:
/* Map of Serializable::id to Serializable objects */ /* Map of Serializable::id to Serializable objects */
std::map<unsigned int, Serializable *> objects; std::map<uint64_t, Serializable *> objects;
/** Creates a new serializable type /** Creates a new serializable type
* @param n Type name * @param n Type name
@@ -185,7 +188,7 @@ class Serialize::Checker
{ {
Anope::string name; Anope::string name;
T obj; T obj;
mutable Serialize::Type *type; mutable ::Reference<Serialize::Type> type;
inline void Check() const inline void Check() const
{ {
+19 -9
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -23,16 +23,16 @@ extern CoreExport Server *Me;
namespace Servers namespace Servers
{ {
/* Retrieves the next free TS6 UID or SID */
extern CoreExport const Anope::string TS6_UID_Retrieve();
extern CoreExport const Anope::string TS6_SID_Retrieve();
/* Gets our uplink. Note we don't actually have an "uplink", this is just /* Gets our uplink. Note we don't actually have an "uplink", this is just
* the only server whose uplink *is* Me that is not a juped server. * the only server whose uplink *is* Me that is not a juped server.
* @return Our uplink, or NULL if not uplinked to anything * @return Our uplink, or NULL if not uplinked to anything
*/ */
extern CoreExport Server* GetUplink(); extern CoreExport Server* GetUplink();
/* Server maps by name and id */
extern CoreExport Anope::map<Server *> ByName;
extern CoreExport Anope::map<Server *> ByID;
/* CAPAB/PROTOCTL given by the uplink */ /* CAPAB/PROTOCTL given by the uplink */
extern CoreExport std::set<Anope::string> Capab; extern CoreExport std::set<Anope::string> Capab;
} }
@@ -58,7 +58,8 @@ class CoreExport Server : public Extensible
bool syncing; bool syncing;
/* The server is juped */ /* The server is juped */
bool juped; bool juped;
/* The server is about to quit */
bool quitting;
/* Reason this server was quit */ /* Reason this server was quit */
Anope::string quit_reason; Anope::string quit_reason;
@@ -117,6 +118,10 @@ class CoreExport Server : public Extensible
*/ */
const Anope::string &GetSID() const; const Anope::string &GetSID() const;
/** Retrieves the reason this server is quitting
*/
const Anope::string &GetQuitReason() const;
/** Get the list of links this server has, or NULL if it has none /** Get the list of links this server has, or NULL if it has none
* @return A list of servers * @return A list of servers
*/ */
@@ -161,18 +166,23 @@ class CoreExport Server : public Extensible
*/ */
bool IsJuped() const; bool IsJuped() const;
/** Check if the server is quitting
* @return true if this server is quitting.
*/
bool IsQuitting() const;
/** Send a message to alll users on this server /** Send a message to alll users on this server
* @param source The source of the message * @param source The source of the message
* @param message The message * @param message The message
*/ */
void Notice(const BotInfo *source, const Anope::string &message); void Notice(BotInfo *source, const Anope::string &message);
/** Find a server /** Find a server
* @param name The name or SID/numeric * @param name The name or SID/numeric
* @param s The server list to search for this server on, defaults to our Uplink * @param name_only set to true to only look up by name, not SID
* @return The server * @return The server
*/ */
static Server *Find(const Anope::string &name, Server *s = NULL); static Server *Find(const Anope::string &name, bool name_only = false);
}; };
#endif // SERVERS_H #endif // SERVERS_H
+4 -4
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -15,12 +15,12 @@
#include "services.h" #include "services.h"
#include "anope.h" #include "anope.h"
#include "modules.h" #include "base.h"
/** Anything that inherits from this class can be referred to /** Anything that inherits from this class can be referred to
* using ServiceReference. Any interfaces provided by modules, * using ServiceReference. Any interfaces provided by modules,
* such as commands, use this. This is also used for modules * such as commands, use this. This is also used for modules
* that publish a service (m_ssl, etc). * that publish a service (m_ssl_openssl, etc).
*/ */
class CoreExport Service : public virtual Base class CoreExport Service : public virtual Base
{ {
@@ -148,7 +148,7 @@ class ServiceReference : public Reference<T>
* creates its own service type (that other modules must include the header file * creates its own service type (that other modules must include the header file
* for), as the core is not compiled with it so there is no RTTI for it. * for), as the core is not compiled with it so there is no RTTI for it.
*/ */
this->ref = static_cast<T *>(Service::FindService(this->type, this->name)); this->ref = static_cast<T *>(::Service::FindService(this->type, this->name));
if (this->ref) if (this->ref)
this->ref->AddReference(this); this->ref->AddReference(this);
} }
+2 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -43,6 +43,7 @@
#include <bitset> #include <bitset>
#include <set> #include <set>
#include <algorithm> #include <algorithm>
#include <iterator>
#include "defs.h" #include "defs.h"
+6 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -41,6 +41,11 @@ class CoreExport SocketEngine
/** Read from sockets and do things /** Read from sockets and do things
*/ */
static void Process(); static void Process();
static int GetLastError();
static void SetLastError(int);
static bool IgnoreErrno();
}; };
#endif // SOCKETENGINE_H #endif // SOCKETENGINE_H
+10 -9
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -54,9 +54,12 @@ union CoreExport sockaddrs
*/ */
Anope::string addr() const; Anope::string addr() const;
/* Is this address ipv6? */
bool ipv6() const;
/** Check if this sockaddr has data in it /** Check if this sockaddr has data in it
*/ */
bool operator()() const; bool valid() const;
/** Compares with sockaddr with another. Compares address type, port, and address /** Compares with sockaddr with another. Compares address type, port, and address
* @return true if they are the same * @return true if they are the same
@@ -85,12 +88,14 @@ class CoreExport cidr
{ {
sockaddrs addr; sockaddrs addr;
Anope::string cidr_ip; Anope::string cidr_ip;
unsigned char cidr_len; unsigned short cidr_len;
public: public:
cidr(const Anope::string &ip); cidr(const Anope::string &ip);
cidr(const Anope::string &ip, unsigned char len); cidr(const Anope::string &ip, unsigned char len);
cidr(const sockaddrs &ip, unsigned char len);
Anope::string mask() const; Anope::string mask() const;
bool match(sockaddrs &other); bool match(const sockaddrs &other);
bool valid() const;
bool operator<(const cidr &other) const; bool operator<(const cidr &other) const;
bool operator==(const cidr &other) const; bool operator==(const cidr &other) const;
@@ -341,7 +346,7 @@ class CoreExport BinarySocket : public virtual Socket
/** Write data to the socket /** Write data to the socket
* @param buffer The data to write * @param buffer The data to write
* @param l The length of the data * @param l The length of the data; if 0 then this function returns without doing anything
*/ */
virtual void Write(const char *buffer, size_t l); virtual void Write(const char *buffer, size_t l);
void Write(const char *message, ...); void Write(const char *message, ...);
@@ -385,10 +390,6 @@ class CoreExport ConnectionSocket : public virtual Socket
/* Sockaddrs for connection ip/port */ /* Sockaddrs for connection ip/port */
sockaddrs conaddr; sockaddrs conaddr;
/** Constructor
*/
ConnectionSocket();
/** Connect the socket /** Connect the socket
* @param TargetHost The target host to connect to * @param TargetHost The target host to connect to
* @param Port The target port to connect to * @param Port The target port to connect to
+1 -1
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
+21 -4
View File
@@ -1,6 +1,6 @@
/* Timer include stuff. /* Timer include stuff.
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -18,6 +18,10 @@
class CoreExport Timer class CoreExport Timer
{ {
private: private:
/** The owner of the timer, if any
*/
Module *owner;
/** The time this was created /** The time this was created
*/ */
time_t settime; time_t settime;
@@ -42,6 +46,14 @@ class CoreExport Timer
*/ */
Timer(long time_from_now, time_t now = Anope::CurTime, bool repeating = false); Timer(long time_from_now, time_t now = Anope::CurTime, bool repeating = false);
/** Constructor, initializes the triggering time
* @param creator The creator of the timer
* @param time_from_now The number of seconds from now to trigger the timer
* @param now The time now
* @param repeating Repeat this timer every time_from_now if this is true
*/
Timer(Module *creator, long time_from_now, time_t now = Anope::CurTime, bool repeating = false);
/** Destructor, removes the timer from the list /** Destructor, removes the timer from the list
*/ */
virtual ~Timer(); virtual ~Timer();
@@ -76,6 +88,11 @@ class CoreExport Timer
*/ */
time_t GetSetTime() const; time_t GetSetTime() const;
/** Returns the owner of this timer, if any
* @return The owner of the timer
*/
Module *GetOwner() const;
/** Called when the timer ticks /** Called when the timer ticks
* This should be overridden with something useful * This should be overridden with something useful
*/ */
@@ -90,7 +107,7 @@ class CoreExport TimerManager
{ {
/** A list of timers /** A list of timers
*/ */
static std::vector<Timer *> Timers; static std::multimap<time_t, Timer *> Timers;
public: public:
/** Add a timer to the list /** Add a timer to the list
* @param t A Timer derived class to add * @param t A Timer derived class to add
@@ -107,9 +124,9 @@ class CoreExport TimerManager
*/ */
static void TickTimers(time_t ctime = Anope::CurTime); static void TickTimers(time_t ctime = Anope::CurTime);
/** Compares two timers /** Deletes all timers owned by the given module
*/ */
static bool TimerComparison(Timer *one, Timer *two); static void DeleteTimersFor(Module *m);
}; };
#endif // TIMERS_H #endif // TIMERS_H
+5 -7
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -14,6 +14,7 @@
#define UPLINK_H #define UPLINK_H
#include "sockets.h" #include "sockets.h"
#include "protocol.h"
namespace Uplink namespace Uplink
{ {
@@ -24,6 +25,7 @@ namespace Uplink
class UplinkSocket : public ConnectionSocket, public BufferedSocket class UplinkSocket : public ConnectionSocket, public BufferedSocket
{ {
public: public:
bool error;
UplinkSocket(); UplinkSocket();
~UplinkSocket(); ~UplinkSocket();
bool ProcessRead() anope_override; bool ProcessRead() anope_override;
@@ -33,16 +35,12 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket
/* A message sent over the uplink socket */ /* A message sent over the uplink socket */
class CoreExport Message class CoreExport Message
{ {
private: MessageSource source;
/* The source of the message, can be a server (Me), or any user (one of our bots) */
const Server *server;
const User *user;
std::stringstream buffer; std::stringstream buffer;
public: public:
Message(); Message();
explicit Message(const Server *); Message(const MessageSource &);
explicit Message(const User *);
~Message(); ~Message();
template<typename T> Message &operator<<(const T &val) template<typename T> Message &operator<<(const T &val)
{ {
+43 -34
View File
@@ -1,7 +1,7 @@
/* /*
* *
* (C) 2008-2011 Robin Burchell <w00t@inspircd.org> * (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -20,6 +20,7 @@
#include "serialize.h" #include "serialize.h"
#include "commands.h" #include "commands.h"
#include "account.h" #include "account.h"
#include "sockets.h"
typedef Anope::hash_map<User *> user_map; typedef Anope::hash_map<User *> user_map;
@@ -36,6 +37,9 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
bool quit; bool quit;
/* Users that are in the process of quitting */ /* Users that are in the process of quitting */
static std::list<User *> quitting_users; static std::list<User *> quitting_users;
public:
typedef std::map<Anope::string, Anope::string> ModeList;
protected: protected:
Anope::string vident; Anope::string vident;
Anope::string ident; Anope::string ident;
@@ -43,7 +47,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* If the user is on the access list of the nick theyre on */ /* If the user is on the access list of the nick theyre on */
bool on_access; bool on_access;
/* Map of user modes and the params this user has (if any) */ /* Map of user modes and the params this user has (if any) */
std::map<Anope::string, Anope::string> modes; ModeList modes;
/* NickCore account the user is currently loggged in as, if they are logged in */ /* NickCore account the user is currently loggged in as, if they are logged in */
Serialize::Reference<NickCore> nc; Serialize::Reference<NickCore> nc;
@@ -68,7 +72,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* SSL Fingerprint */ /* SSL Fingerprint */
Anope::string fingerprint; Anope::string fingerprint;
/* User's IP */ /* User's IP */
Anope::string ip; sockaddrs ip;
/* Server user is connected to */ /* Server user is connected to */
Server *server; Server *server;
/* When the user signed on. Set on connect and never modified. */ /* When the user signed on. Set on connect and never modified. */
@@ -79,7 +83,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
bool super_admin; bool super_admin;
/* Channels the user is in */ /* Channels the user is in */
typedef std::list<ChanUserContainer *> ChanUserList; typedef std::map<Channel *, ChanUserContainer *> ChanUserList;
ChanUserList chans; ChanUserList chans;
/* Last time this user sent a memo command used */ /* Last time this user sent a memo command used */
@@ -89,6 +93,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* Last time this user sent an email */ /* Last time this user sent an email */
time_t lastmail; time_t lastmail;
protected:
/** Create a new user object, initialising necessary fields and /** Create a new user object, initialising necessary fields and
* adds it to the hash * adds it to the hash
* *
@@ -99,18 +104,20 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
* @param sip The ip of the user * @param sip The ip of the user
* @param sserver The server of the user * @param sserver The server of the user
* @param srealname The realname/gecos of teh user * @param srealname The realname/gecos of teh user
* @param ssignon User's timestamp * @param ts User's timestamp
* @param smodes User's modes * @param smodes User's modes
* @param suid The unique identifier of the user. * @param suid The unique identifier of the user.
* @param nc The account the user is identified as, if any
*/ */
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid = ""); User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
protected:
/** Destroy a user. /** Destroy a user.
*/ */
virtual ~User(); virtual ~User();
public: public:
static User* OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
/** Update the nickname of a user record accordingly, should be /** Update the nickname of a user record accordingly, should be
* called from ircd protocol. * called from ircd protocol.
* @param newnick The new username * @param newnick The new username
@@ -184,24 +191,19 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
* @param fmt Format of the Message * @param fmt Format of the Message
* @param ... any number of parameters * @param ... any number of parameters
*/ */
void SendMessage(const BotInfo *source, const char *fmt, ...); void SendMessage(BotInfo *source, const char *fmt, ...);
void SendMessage(const BotInfo *source, const Anope::string &msg) anope_override; void SendMessage(BotInfo *source, const Anope::string &msg) anope_override;
/** Collide a nick /** Identify the user to a nick.
* See the comment in users.cpp
* @param na The nick
*/
void Collide(NickAlias *na);
/** Identify the user to the Nick
* updates last_seen, logs the user in, * updates last_seen, logs the user in,
* send messages, checks for mails, set vhost and more * send messages, checks for mails, set vhost and more
* @param the NickAlias * @param na the nick to identify to, should be the same as
* the user's current nick
*/ */
void Identify(NickAlias *na); void Identify(NickAlias *na);
/** Login the user to a NickCore /** Login the user to an account
* @param core The account the user is useing * @param core The account
*/ */
void Login(NickCore *core); void Login(NickCore *core);
@@ -212,7 +214,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/** Get the account the user is logged in using /** Get the account the user is logged in using
* @return The account or NULL * @return The account or NULL
*/ */
virtual NickCore *Account() const; NickCore *Account() const;
/** Check if the user is identified for their nick /** Check if the user is identified for their nick
* @param check_nick True to check if the user is identified to the nickname they are on too * @param check_nick True to check if the user is identified to the nickname they are on too
@@ -221,10 +223,10 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
bool IsIdentified(bool check_nick = false) const; bool IsIdentified(bool check_nick = false) const;
/** Check if the user is recognized for their nick (on the nicks access list) /** Check if the user is recognized for their nick (on the nicks access list)
* @param check_nick Only returns true if the user has secure off * @param check_secure Only returns true if the user has secure off
* @return true or false * @return true or false
*/ */
bool IsRecognized(bool check_nick = true) const; bool IsRecognized(bool check_secure = true) const;
/** Check if the user is a services oper /** Check if the user is a services oper
* @return true if they are an oper * @return true if they are an oper
@@ -254,82 +256,89 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
bool HasMode(const Anope::string &name) const; bool HasMode(const Anope::string &name) const;
/** Set a mode internally on the user, the IRCd is not informed /** Set a mode internally on the user, the IRCd is not informed
* @param setter who/what is setting the mode
* @param um The user mode * @param um The user mode
* @param Param The param, if there is one * @param Param The param, if there is one
*/ */
void SetModeInternal(UserMode *um, const Anope::string &param = ""); void SetModeInternal(const MessageSource &setter, UserMode *um, const Anope::string &param = "");
/** Remove a mode internally on the user, the IRCd is not informed /** Remove a mode internally on the user, the IRCd is not informed
* @param setter who/what is setting the mode
* @param um The user mode * @param um The user mode
*/ */
void RemoveModeInternal(UserMode *um); void RemoveModeInternal(const MessageSource &setter, UserMode *um);
/** Set a mode on the user /** Set a mode on the user
* @param bi The client setting the mode * @param bi The client setting the mode
* @param um The user mode * @param um The user mode
* @param Param Optional param for the mode * @param Param Optional param for the mode
*/ */
void SetMode(const BotInfo *bi, UserMode *um, const Anope::string &param = ""); void SetMode(BotInfo *bi, UserMode *um, const Anope::string &param = "");
/** Set a mode on the user /** Set a mode on the user
* @param bi The client setting the mode * @param bi The client setting the mode
* @param name The mode name * @param name The mode name
* @param Param Optional param for the mode * @param Param Optional param for the mode
*/ */
void SetMode(const BotInfo *bi, const Anope::string &name, const Anope::string &param = ""); void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string &param = "");
/** Remove a mode on the user /** Remove a mode on the user
* @param bi The client setting the mode * @param bi The client setting the mode
* @param um The user mode * @param um The user mode
* @param param Optional param for the mode
*/ */
void RemoveMode(const BotInfo *bi, UserMode *um); void RemoveMode(BotInfo *bi, UserMode *um, const Anope::string &param = "");
/** Remove a mode from the user /** Remove a mode from the user
* @param bi The client setting the mode * @param bi The client setting the mode
* @param name The mode name * @param name The mode name
* @param param Optional param for the mode
*/ */
void RemoveMode(const BotInfo *bi, const Anope::string &name); void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string &param = "");
/** Set a string of modes on a user /** Set a string of modes on a user
* @param bi The client setting the modes * @param bi The client setting the modes
* @param umodes The modes * @param umodes The modes
*/ */
void SetModes(const BotInfo *bi, const char *umodes, ...); void SetModes(BotInfo *bi, const char *umodes, ...);
/** Set a string of modes on a user internally /** Set a string of modes on a user internally
* @param setter who/what is setting the mode
* @param umodes The modes * @param umodes The modes
*/ */
void SetModesInternal(const char *umodes, ...); void SetModesInternal(const MessageSource &source, const char *umodes, ...);
/** Get modes set for this user. /** Get modes set for this user.
* @return A string of modes set on the user * @return A string of modes set on the user
*/ */
Anope::string GetModes() const; Anope::string GetModes() const;
const ModeList &GetModeList() const;
/** Find the channel container for Channel c that the user is on /** Find the channel container for Channel c that the user is on
* This is preferred over using FindUser in Channel, as there are usually more users in a channel * This is preferred over using FindUser in Channel, as there are usually more users in a channel
* than channels a user is in * than channels a user is in
* @param c The channel * @param c The channel
* @return The channel container, or NULL * @return The channel container, or NULL
*/ */
ChanUserContainer *FindChannel(const Channel *c) const; ChanUserContainer *FindChannel(Channel *c) const;
/** Check if the user is protected from kicks and negative mode changes /** Check if the user is protected from kicks and negative mode changes
* @return true or false * @return true or false
*/ */
bool IsProtected() const; bool IsProtected();
/** Kill a user /** Kill a user
* @param source The user/server doing the kill * @param source The user/server doing the kill
* @param reason The reason for the kill * @param reason The reason for the kill
*/ */
void Kill(const Anope::string &source, const Anope::string &reason); void Kill(const MessageSource &source, const Anope::string &reason);
/** Process a kill for a user /** Process a kill for a user
* @param source The user/server doing the kill * @param source The user/server doing the kill
* @param reason The reason for the kill * @param reason The reason for the kill
*/ */
void KillInternal(const Anope::string &source, const Anope::string &reason); void KillInternal(const MessageSource &source, const Anope::string &reason);
/** Processes a quit for the user, and marks them as quit /** Processes a quit for the user, and marks them as quit
* @param reason The reason for the quit * @param reason The reason for the quit
+88 -36
View File
@@ -1,6 +1,6 @@
/* Build bumper /* Build bumper
* *
* (C) 2003-2013 Anope Team * (C) 2003-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -13,7 +13,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <list> #include <map>
static std::string get_git_hash(const std::string &git_dir) static std::string get_git_hash(const std::string &git_dir)
{ {
@@ -45,29 +45,16 @@ static std::string get_git_hash(const std::string &git_dir)
return "g" + filebuf.substr(0, 7); return "g" + filebuf.substr(0, 7);
} }
int main(int argc, char *argv[]) static bool read_version_sh(const std::string &version_sh, std::map<std::string, std::string> &versions)
{ {
if (argc < 3) std::fstream fd(version_sh.c_str(), std::ios::in);
{
std::cerr << "Syntax: " << argv[0] << " <base> <version.h>" << std::endl;
return 1;
}
std::string version_sh = std::string(argv[1]) + "/src/version.sh";
std::string git_dir = std::string(argv[1]) + "/.git";
std::fstream fd;
fd.clear();
fd.open(version_sh.c_str(), std::ios::in);
if (!fd.is_open()) if (!fd.is_open())
{ {
std::cerr << "Error: Unable to open src/version.sh for reading: " << version_sh << std::endl; std::cerr << "Error: Unable to open src/version.sh for reading: " << version_sh << std::endl;
return 1; return false;
} }
std::string filebuf; std::string filebuf;
std::list<std::pair<std::string, std::string> > versions;
while (getline(fd, filebuf)) while (getline(fd, filebuf))
{ {
if (!filebuf.find("VERSION_")) if (!filebuf.find("VERSION_"))
@@ -75,24 +62,25 @@ int main(int argc, char *argv[])
size_t eq = filebuf.find('='); size_t eq = filebuf.find('=');
std::string type = filebuf.substr(0, eq); std::string type = filebuf.substr(0, eq);
std::string value = filebuf.substr(eq + 2, filebuf.length() - eq - 3); std::string value = filebuf.substr(eq + 1);
versions.push_back(std::make_pair(type, value));
versions[type] = value;
} }
} }
fd.close(); fd.close();
std::string git_version = get_git_hash(git_dir); return true;
if (!git_version.empty()) }
versions.push_back(std::make_pair("VERSION_GIT", git_version));
fd.clear(); static bool write_build_h(const std::string &buildh, const std::string &git_version)
fd.open(argv[2], std::ios::in); {
std::fstream fd(buildh.c_str(), std::ios::in);
std::string build = "#define BUILD 1"; std::string build = "#define BUILD 1";
if (fd.is_open()) if (fd.is_open())
{ {
while (getline(fd, filebuf)) for (std::string filebuf; getline(fd, filebuf);)
{ {
if (!filebuf.find("#define BUILD")) if (!filebuf.find("#define BUILD"))
{ {
@@ -110,27 +98,91 @@ int main(int argc, char *argv[])
} }
fd.clear(); fd.clear();
fd.open(argv[2], std::ios::out); fd.open(buildh.c_str(), std::ios::out);
if (!fd.is_open()) if (!fd.is_open())
{ {
std::cerr << "Error: Unable to include/version.h for writing: " << argv[2] << std::endl; std::cerr << "Error: Unable to open build.h for writing: " << buildh << std::endl;
return 1; return false;
} }
fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl; fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl;
fd << build << std::endl;
if (!git_version.empty())
fd << "#define VERSION_GIT \"" << git_version << "\"" << std::endl;
fd.close();
for (std::list<std::pair<std::string, std::string> >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it) return true;
}
static void read_version_h(const std::string &versionh, std::map<std::string, std::string> &versions)
{
std::fstream fd(versionh.c_str(), std::ios::in);
if (!fd.is_open())
return;
for (std::string filebuf; getline(fd, filebuf);)
{ {
if (it->first == "VERSION_EXTRA" || it->first == "VERSION_GIT") if (!filebuf.find("#define VERSION_"))
fd << "#define " << it->first << " \"" << it->second << "\"" << std::endl; {
else size_t space = filebuf.substr(8).find(' ');
fd << "#define " << it->first << " " << it->second << std::endl;
std::string name = filebuf.substr(8).substr(0, space),
version = filebuf.substr(8).substr(space + 1);
versions[name] = version;
}
} }
fd << build << std::endl; fd.close();
}
static bool write_version_h(const std::string &versionh, const std::map<std::string, std::string> &versions)
{
std::fstream fd(versionh.c_str(), std::ios::out);
if (!fd.is_open())
return false;
for (std::map<std::string, std::string>::const_iterator it = versions.begin(); it != versions.end(); ++it)
{
fd << "#define " << it->first << " " << it->second << std::endl;
}
fd.close(); fd.close();
return true;
}
int main(int argc, char *argv[])
{
if (argc < 4)
{
std::cerr << "Syntax: " << argv[0] << " <base> <version.h> <build.h>" << std::endl;
return 1;
}
std::string version_sh = std::string(argv[1]) + "/src/version.sh";
std::string git_dir = std::string(argv[1]) + "/.git";
std::string versionh = argv[2];
std::string buildh = argv[3];
std::map<std::string, std::string> versions, old_versions;
if (!read_version_sh(version_sh, versions))
return -1;
std::string git_version = get_git_hash(git_dir);
if (!write_build_h(buildh, git_version))
return -1;
read_version_h(versionh, old_versions);
if (versions == old_versions)
return 0;
if (!write_version_h(versionh, versions))
return -1;
return 0; return 0;
} }
+9 -6
View File
@@ -1,6 +1,6 @@
/* /*
* *
* (C) 2008-2013 Anope Team * (C) 2008-2014 Anope Team
* Contact us at team@anope.org * Contact us at team@anope.org
* *
* Please read COPYING and README for further details. * Please read COPYING and README for further details.
@@ -12,12 +12,15 @@
#include "serialize.h" #include "serialize.h"
#include "service.h" #include "service.h"
#include "sockets.h"
/* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */ /* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */
class CoreExport XLine : public Serializable class CoreExport XLine : public Serializable
{ {
void InitRegex(); void Init();
Anope::string nick, user, host, real;
public: public:
cidr *c;
Anope::string mask; Anope::string mask;
Regex *regex; Regex *regex;
Anope::string by; Anope::string by;
@@ -32,10 +35,10 @@ class CoreExport XLine : public Serializable
XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason, const Anope::string &uid = ""); XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason, const Anope::string &uid = "");
~XLine(); ~XLine();
Anope::string GetNick() const; const Anope::string &GetNick() const;
Anope::string GetUser() const; const Anope::string &GetUser() const;
Anope::string GetHost() const; const Anope::string &GetHost() const;
Anope::string GetReal() const; const Anope::string &GetReal() const;
Anope::string GetReason() const; Anope::string GetReason() const;
+3239 -2952
View File
File diff suppressed because it is too large Load Diff
+3459 -3122
View File
File diff suppressed because it is too large Load Diff
+3282 -2981
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More