1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 18:34:49 +02:00

Compare commits

...

1334 Commits

Author SHA1 Message Date
Sadie Powell 507eefc820 Release 2.1.4. 2024-04-01 11:24:48 +01:00
Sadie Powell 72af764861 Fix some typos in the changelog. 2024-03-31 15:21:18 +01:00
Sadie Powell 1b631e96bd Add a default value for sendmailpath. 2024-03-31 15:17:03 +01:00
Sadie Powell 3b4a4da52d Update the changelogs. 2024-03-29 14:24:17 +00:00
Sadie Powell 2e59aac025 Fix the default value of accessmax in cs_access. 2024-03-29 14:21:51 +00:00
Sadie Powell 3de6da80c6 Alias ACCESS to ALIST now the former is unused. 2024-03-27 23:32:16 +00:00
Sadie Powell 2829c83118 Add more nick options to webcpanel's nickserv/info page. 2024-03-26 14:27:52 +00:00
Sadie Powell f58012ea0e Remove some leftover references to nickserv/access. 2024-03-26 13:40:53 +00:00
Sadie Powell f8605ec188 Allow specifying the webcpanel template directory directly.
There's no need to hardcode a base path here.
2024-03-26 12:59:03 +00:00
Sadie Powell 5a12beff15 Fix some spelling issues in the webcpanel that were missed earlier. 2024-03-26 12:33:59 +00:00
Sadie Powell 6b1f8de885 Use consistent headers and footers on all webcpanel templates. 2024-03-26 11:52:04 +00:00
Sadie Powell 33be5de66e Flatten the webcpanel hierarchy slightly. 2024-03-26 11:22:43 +00:00
Sadie Powell 4399eeaa58 Add the --nopid option to disable writing a pidfile.
This is useful for init scripts that don't fork.
2024-03-20 21:34:28 +00:00
Sadie Powell 38cfb0603a Fix deleting pidfiles. 2024-03-20 21:34:18 +00:00
Sadie Powell 1a3844e74e Fix the Windows build. 2024-03-19 15:58:41 +00:00
Sadie Powell bfed2e1bf5 Use paths relative to data/conf in the config file.
This was done in some places already but not consistently.

Closes #349.
2024-03-19 15:51:55 +00:00
Sadie Powell e488f294a1 Put the webcpanel directory in the data directory not a subdir. 2024-03-19 15:19:15 +00:00
Sadie Powell fde3438ef2 Allow using absolute paths in more places. 2024-03-19 15:11:40 +00:00
Sadie Powell 1575dea5b9 Redocument deprecated encryption modules. 2024-03-19 12:40:01 +00:00
Sadie Powell a1972ba9b6 Prevent using enc_posix as a primary encryption module. 2024-03-19 11:54:39 +00:00
Sadie Powell 5a72d8783e Add verify-only support for POSIX crypt() hashes from Atheme. 2024-03-18 22:17:14 +00:00
Sadie Powell e6770bc2fd Fix an off by one error in enc_sha2. 2024-03-18 22:04:57 +00:00
Sadie Powell 413fed474e Fix unnecessary uses of std::string. 2024-03-18 12:47:43 +00:00
Sadie Powell 60083834f8 Improve sending email.
- Use consistent line endings as expected by the email spec.
- Don't require admins to escape . at the start of lines.
- Log the reason why sending email fails.
2024-03-18 12:34:34 +00:00
Sadie Powell 9ac4da0489 Fix not storing the start time after calling UpdateTime. 2024-03-18 11:45:33 +00:00
Sadie Powell cb3848b7db Use clock_gettime if it is available. 2024-03-18 11:27:10 +00:00
Sadie Powell 753119c4a1 Use consistent casing when referring to vhosts and vidents. 2024-03-15 12:42:13 +00:00
Sadie Powell d996c3aa8f Fix a format-extra-args warning on some versions on GCC. 2024-03-15 12:22:22 +00:00
dependabot[bot] ac6e8c617d Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-15 12:19:07 +00:00
Sadie Powell 3b09f4aa54 Merge branch '2.0' into 2.1. 2024-03-15 12:17:49 +00:00
Sadie Powell 10f4724b6b Dependabot requires that the target-branch is a string. 2024-03-15 12:17:15 +00:00
Sadie Powell ad86535024 Consistently use READ_ONLY_MODE everywhere. 2024-03-15 12:09:58 +00:00
Sadie Powell 628f4d2a7e Merge branch '2.0' into 2.1. 2024-03-15 11:58:09 +00:00
Sadie Powell 8d5be77c93 Send dependabot pull requests to the 2.1 branch. 2024-03-15 11:56:56 +00:00
Sadie Powell 13a556df89 Initialize timer members with constructor initialization. 2024-03-14 23:19:32 +00:00
Sadie Powell 4e9d183523 Restore some functionality that was removed in an earlier commit. 2024-03-14 23:10:53 +00:00
Sadie Powell 074dfb63a7 Fix a warning when building with Clang. 2024-03-14 21:37:18 +00:00
Sadie Powell beaf09de7b Rework sending global notices.
Admins can now queue multiple messages and send them when they are
ready. This is fully compatible with the previous global behaviour.

Admins can now also send messages to individual servers. This is
useful for informing users of maintenance due to downtime.
2024-03-14 21:35:17 +00:00
Sadie Powell c8d8978cd0 Require that at least one encryption module is loaded. 2024-03-12 21:57:38 +00:00
Sadie Powell 11edba04fe Add command handlers for encap commands on InspIRCd. 2024-03-12 21:57:06 +00:00
Sadie Powell 22ba54b00d Show the full command in CONFIRM_DROP. 2024-03-12 19:24:31 +00:00
Sadie Powell 6fd7ca39e2 Fix the reason when kicking users from suspended channels.
Closes #372.
2024-03-12 17:00:42 +00:00
Sadie Powell b8cd00b412 Merge branch '2.0' into 2.1. 2024-03-12 16:50:30 +00:00
Sadie Powell f4bd43e898 Add a workaround for users matching expired sqlines.
I'll fix this properly in 2.1 because I don't want to make big
changes to 2.0.

Closes #384.
2024-03-12 16:47:57 +00:00
Sadie Powell 7d7664444a Fix expiring forbids. 2024-03-12 16:26:33 +00:00
Sadie Powell 1a8bbd6004 Respect --noexpire in cs_suspend and ns_suspend. 2024-03-12 14:43:12 +00:00
Sadie Powell e725c880a9 Fix expiring channel suspensions.
Closes #386.
2024-03-12 14:12:37 +00:00
Sadie Powell f5abcd1c4c Fix expiring nick suspensions.
Closes #376.
2024-03-12 14:02:16 +00:00
Sadie Powell 1986aa6581 Fix duplicate messages when synconset/syncongroup is set.
Closes #366.
2024-03-12 13:26:25 +00:00
Sadie Powell b52e1b2b02 Implement support for challenge authentication on InspIRCd. 2024-03-12 13:19:20 +00:00
Sadie Powell 54719fbfc6 Allow protocol modules to declare that they have no line/mode limit.
InspIRCd allows us to send infinite length lines and mode changes
and will restack before sending to users.
2024-03-12 12:39:33 +00:00
Sadie Powell 06add0e5fc Simplify limit extraction code. 2024-03-12 12:24:02 +00:00
Sadie Powell 63d682314b Merge branch '2.0' into 2.1. 2024-03-12 11:53:14 +00:00
Sadie Powell 1a6060ac5b Fix sending SVSTOPIC when topiclock is loaded on InspIRCd. 2024-03-12 11:46:41 +00:00
Sadie Powell a302f8f1be Refactor sending vhosts in the InspIRCd protocol module. 2024-03-12 11:43:21 +00:00
Sadie Powell 04e1a4f5c8 Add a protocol module function for extracting timestamps. 2024-03-12 11:02:08 +00:00
Sadie Powell 1538909ac0 Add ProtocolException and use it to send fatal errors. 2024-03-12 00:17:49 +00:00
Sadie Powell a15f165a1d Fix an inverted condition in enc_bcrypt. 2024-03-12 00:17:49 +00:00
Sadie Powell 77435dd0d9 Merge branch '2.0' into 2.1. 2024-03-11 22:43:29 +00:00
Sadie Powell 6f57907416 Fix the TIME message on InspIRCd. 2024-03-11 22:38:15 +00:00
Sadie Powell 7c1cfd2849 Fix comparing passwords in enc_sha256. 2024-03-11 21:07:39 +00:00
Sadie Powell 259b10b83a Fix some InspIRCd 1206 protocol compatibility issues. 2024-03-11 20:27:30 +00:00
Sadie Powell 02355546ff Reject registrations and password changes if password encryption fails. 2024-03-11 19:39:47 +00:00
Sadie Powell 6ad3430ac4 Clean up some dead code in ns_register. 2024-03-11 19:30:57 +00:00
Sadie Powell 29e7674e56 Replace convertTo/stringify with non-throwing alternatives.
Having these throw is terrible for ergonomics and there are loads
of places where the exception was either silently ignored or not
handled at all. Having a function which returns an optional and
another that returns a default works a lot better imo.
2024-03-11 19:17:29 +00:00
Bram Matthys b09632d1c3 Fix OS SQLINE expiry with UnrealIRCd 2024-03-11 18:30:55 +00:00
Sadie Powell e2df7d4d01 Ensure that verify-only encryption modules can never encrypt passwords.
If another module was loaded first and then later unloaded it was
possible for a deprecated module to encrypt passwords.
2024-03-10 20:46:03 +00:00
Sadie Powell 9a984a8148 Implement verify-only support for raw SHA-2 passwords. 2024-03-10 20:46:03 +00:00
Sadie Powell fb9c8950ed Refactor the enc_bcrypt module and expose an encryption provider. 2024-03-10 20:46:03 +00:00
Sadie Powell a849a81ac3 Refactor the enc_old module. 2024-03-10 20:28:00 +00:00
Sadie Powell f919bb0748 Add self-tests to the encryption providers. 2024-03-10 20:20:24 +00:00
Sadie Powell 3b85a8071f Add some missing documentation comments. 2024-03-10 15:58:58 +00:00
Sadie Powell 9a8cac060d Add support for encrypting passwords with the Argon2 algorithm.
Closes #369.
2024-03-10 15:09:38 +00:00
Sadie Powell 0353338436 Replace the custom SHA-2 implementation in enc_sha256. 2024-03-10 12:27:49 +00:00
Sadie Powell defb8348a7 Move the HMAC function to the encryption header.
This will be useful for doing challenge authentication on InspIRCd.
2024-03-09 22:51:23 +00:00
Sadie Powell 1b86665d81 Add a stats category for password encryption algorithms. 2024-03-09 22:22:56 +00:00
Sadie Powell 2f52fa723c Redocument the encryption module config. 2024-03-09 22:22:56 +00:00
Sadie Powell 6e0f0b8896 Add the enc_sha2 module which hashes passwords with HMAC-SHA-2.
Using HMAC instead of changing the IV is a lot safer.
2024-03-09 22:22:56 +00:00
Sadie Powell 2c5b2c649e Convert enc_md5 to use a vendored MD5 library. 2024-03-09 22:22:56 +00:00
Sadie Powell a6bc4cab9d Misc improvements to the encryption API. 2024-03-09 22:22:56 +00:00
Sadie Powell ef37daf44a Clean up the services.h includes. 2024-03-09 22:22:56 +00:00
Sadie Powell 39d288f99f Rename hash_map to unordered_map to match the underlying container. 2024-03-09 22:22:56 +00:00
Sadie Powell 9ead3f15c3 Save the last email time for accounts. 2024-03-09 22:22:55 +00:00
Sadie Powell 272104af95 Modernize the initialisation of NickAlias and NickCore. 2024-03-09 22:22:55 +00:00
Bram Matthys 51e95d72e3 Enable message-tags support for UnrealIRCd 2024-03-09 14:53:38 +00:00
Sadie Powell 12486f6cee Tweak the config default limits slightly. 2024-03-09 11:43:38 +00:00
Sadie Powell 891375baca Use a separate CAPAB handler on InspIRCd to avoid pollution. 2024-03-08 19:05:12 +00:00
Sadie Powell 41a295202e Only enable InspIRCd parser logging when using --protocoldebug. 2024-03-08 18:17:17 +00:00
Sadie Powell 722c5b7d61 Implement support for the InspIRCd 1206 protocol. 2024-03-08 17:12:44 +00:00
Sadie Powell 52216b56a1 Merge branch '2.0' into 2.1. 2024-03-08 17:05:49 +00:00
Sadie Powell cd614831de Fix feature detection on InspIRCd. 2024-03-08 16:49:55 +00:00
Sadie Powell 1d0a836a2e Improve protocol debug messages. 2024-03-08 12:24:44 +00:00
Sadie Powell 46b7064834 Keep the InspIRCd protocol version around for later use. 2024-03-08 11:07:30 +00:00
Sadie Powell bb8df01e25 Move some modules which can be built by default out of extra. 2024-03-07 23:18:08 +00:00
Sadie Powell 16700b0e30 Remove a guarantee that may not necessarily be correct. 2024-03-07 23:09:25 +00:00
Sadie Powell 4e04a11995 Consistently use email instead of e-mail. 2024-03-07 22:52:41 +00:00
Sadie Powell 76e5480be9 Update the changelogs. 2024-03-07 22:52:41 +00:00
Sadie Powell 464e6b8010 Use the C++11 random number generator instead of rand().
This is safer, faster, and doesn't require seeding.
2024-03-07 22:52:41 +00:00
Sadie Powell 3272c1bbc6 Require new accounts to have email addresses. 2024-03-07 22:25:32 +00:00
Sadie Powell 307ffea951 Update the English translation for the previous commit.
y
2024-03-07 21:19:47 +00:00
Sadie Powell bb94f286f5 Also use drop confirmation codes for nicknames. 2024-03-07 21:18:06 +00:00
Sadie Powell 86e3556438 Fix some misc bugs in the InspIRCd protocol module.
Closes #373.
2024-03-07 20:55:22 +00:00
Sadie Powell 12214bee72 Add the initial version of the Atheme database importer. 2024-03-07 18:50:36 +00:00
Sadie Powell 08a35231ef Merge branch '2.0' into 2.1. 2024-03-04 12:10:22 +00:00
Sadie Powell 9649dc78a1 When using ldap/sql auth prevent displays expiring before their group.
This prevents zombie accounts from being left around that can't be
authenticated to.

Closes #355.
2024-03-04 12:08:28 +00:00
Sadie Powell 9970b4e37b Bump for 2.1.4-git. 2024-03-04 11:09:51 +00:00
Sadie Powell a5a615d5c7 Release 2.1.3. 2024-03-04 11:09:51 +00:00
Sadie Powell ce97fdd1c6 Update the changelogs. 2024-03-04 11:09:51 +00:00
Sadie Powell 1a8ae513b4 Add NickAlias::GetVhostMask for getting the vident@vhost. 2024-03-04 11:09:50 +00:00
Sadie Powell d15ac93a8f Clean up some more CMake flags. 2024-02-29 23:50:10 +00:00
Sadie Powell 4e0f94bcce Fix some oversights from previous commits. 2024-02-29 23:18:46 +00:00
Sadie Powell 1c1645096f If a user runs an invalid command try to suggest a valid one. 2024-02-29 21:56:14 +00:00
Sadie Powell e0ac5509b4 Consolidate some header files. 2024-02-29 19:32:44 +00:00
Sadie Powell 190c37a68b Rework some platform compatibility code. 2024-02-29 19:11:37 +00:00
Sadie Powell a67bef2dee Update the changelogs. 2024-02-29 17:15:15 +00:00
Sadie Powell 893bbf9251 Fix some oversights. 2024-02-29 17:15:15 +00:00
Sadie Powell 5441093211 Merge branch '2.0' into 2.1. 2024-02-29 16:32:14 +00:00
Sadie Powell ee7455daa8 Fix a copy/paste error in webcpanel. 2024-02-29 16:27:24 +00:00
Sadie Powell 579af3c442 Rip out ns_access and related code.
This is wildly insecure and has been disabled by default for at
least a decade.
2024-02-29 16:14:15 +00:00
Sadie Powell 25bdcfcbc4 Add names for the numerics used by the core. 2024-02-29 13:07:14 +00:00
Sadie Powell 26919f41d2 If a PRIVMSG or NOTICE is empty then send a single space instead.
Currently a bunch of code does source.Reply(" ") to ensure that an
empty line gets rendered but this is a much better way to handle
this problem.

The code that does this already will be updated in a future commit
to avoid breaking translations in progress.
2024-02-29 12:31:19 +00:00
Sadie Powell 5f735b2570 Fix matching extbans on InspIRCd and implement missing matchers. 2024-02-27 20:33:43 +00:00
Sadie Powell 9c80f9e34e Replace OnChannelUnban with an IRCDProto function.
This was added for (and is only used for) for unbanning users on
UnrealIRCd which is an IRCd protocol function so it should be in
IRCDProto.
2024-02-27 13:40:47 +00:00
Sadie Powell b5b3c74477 Make functions that don't use this static. 2024-02-27 10:48:55 +00:00
Sadie Powell 73d4ac6de0 Remove redundant uses of const. 2024-02-27 10:34:27 +00:00
Sadie Powell 7640fad30c Simplify several boolean expressions. 2024-02-27 10:19:44 +00:00
Sadie Powell 9f6d378755 Fix write_pidfile on Windows.
Microsoft's documentation lies again.
2024-02-27 10:19:36 +00:00
Sadie Powell 642e68f53a Fix sending numerics on InspIRCd. 2024-02-26 23:57:55 +00:00
Sadie Powell eb658f87a3 Use fstream for accessing files where possible. 2024-02-26 23:57:55 +00:00
Sadie Powell 1e87849e5c Rework IRCDMessage/IRCDMessageFlag. 2024-02-26 23:56:07 +00:00
Sadie Powell 5fa4acb195 Refactor User::IsServicesOper. 2024-02-26 22:00:21 +00:00
Sadie Powell 79f215606d Allow using more than one fingerprint in an oper block.
Closes #362.
2024-02-26 21:55:59 +00:00
Sadie Powell 2fd4b45f81 Deduplicate InspIRCd CAPAB parsing. 2024-02-26 19:26:21 +00:00
Sadie Powell d3b4a4bd05 Update translator names. 2024-02-26 18:56:11 +00:00
Sadie Powell d914febbec Fix a typo in UnrealIRCd's SendGlobops. 2024-02-26 17:23:15 +00:00
Sadie Powell 2962a0be8c Fix bs_kick not using the correct kick message for automatic kicks.
Closes #354.
2024-02-26 16:45:28 +00:00
Sadie Powell 6be4df3b39 Remove several string format IRCDProto function overloads. 2024-02-26 16:45:28 +00:00
Sadie Powell 4789751e50 Fix a missing override keyword. 2024-02-26 16:45:28 +00:00
Sadie Powell 57674f5869 Replace IRCDProto::CanSendTags with IsTagValid.
Not every IRC server accepts arbitrary tags so this is a better
way to handle tag filtering.
2024-02-26 15:50:35 +00:00
Sadie Powell c6cb4ba159 Fix some coding style issues. 2024-02-26 15:34:17 +00:00
Sadie Powell e341cac8d6 Implement support for the IRCv3 +draft/channel-context tag.
Closes #358.
2024-02-26 15:34:17 +00:00
Sadie Powell 83dd96b9f2 Extract should privmsg logic to its own function. 2024-02-26 14:41:50 +00:00
Sadie Powell cabaa079df Kill checks for obsolete versions of Windows.
Because of the required system functionality Anope will not build
or run on these systems anyway.
2024-02-25 23:56:46 +00:00
Sadie Powell 273e7f249c Remove duplicate suffix from socketengine file names. 2024-02-25 23:54:12 +00:00
Sadie Powell 8c9ca23900 Remove a function which exists for compat with old versions of VS. 2024-02-25 23:49:07 +00:00
Sadie Powell 8e3da86283 Remove a reference to 1.8. 2024-02-25 23:42:14 +00:00
Sadie Powell 97b65b2255 Use unique_ptr for managing std::thread ownership. 2024-02-25 21:54:40 +00:00
Sadie Powell b26f198489 Fix formatting messages on ngircd. 2024-02-22 19:54:09 +00:00
Sadie Powell a99a00d7c5 Fix sending the ngircd PASS handler. 2024-02-22 19:07:11 +00:00
Sadie Powell 283137841f Refactor the InspIRCd module static variables and method. 2024-02-22 17:47:14 +00:00
Sadie Powell 3290ebd36a GetMaxListFor: use size_t and add a default like the other fields. 2024-02-22 17:25:47 +00:00
Sadie Powell c4e9c0bf85 If the IRCd sends a field limit then use it over that of the config. 2024-02-22 17:05:30 +00:00
Sadie Powell 84ad85ee85 Fix a bug in the unrealircd protocol module. 2024-02-22 15:58:23 +00:00
Sadie Powell 9789c3bd8c Deduplicate User::SendMessage. 2024-02-22 14:14:23 +00:00
Sadie Powell a75afb597b Add the IRCv3 reply tag to messages sent as responses to a user. 2024-02-22 13:23:18 +00:00
Sadie Powell f93d9e7698 Store the source message identifier in CommandSource. 2024-02-22 13:19:36 +00:00
Sadie Powell 7423fa9998 Route message tags into more message functions. 2024-02-22 13:03:53 +00:00
Sadie Powell 7cba665270 Fix some oversights in commit 82fa7e1467. 2024-02-22 11:18:05 +00:00
Sadie Powell 9502567453 Fix the NickServ help message showing a wrong min password length.
Closes #357.
2024-02-22 11:01:41 +00:00
Sadie Powell 14472c5a95 Increase minpasslen and maxpasslen slightly. 2024-02-22 10:46:30 +00:00
Sadie Powell d4f4bcf23c Remove UplinkSocket::Message now nothing uses it. 2024-02-22 00:14:08 +00:00
Sadie Powell 82fa7e1467 Convert protocol modules over to Uplink::Send. 2024-02-22 00:14:08 +00:00
Sadie Powell aefbb4fbda Rework SendModeInternal to be usable with Uplink::Send. 2024-02-22 00:14:08 +00:00
Sadie Powell 9b77fdf5b6 Rework SendNumericInternal to be usable with Uplink::Send. 2024-02-22 00:14:08 +00:00
Sadie Powell 7a6979c814 Convert most core protocol handlers to use Uplink::Send. 2024-02-22 00:14:08 +00:00
Sadie Powell c4ab550ec7 Add Uplink::Send, rework message formatting.
This is the new way of sending messages to the uplink inspired by
the work done in the old git master. This will allow us to do new
things involving tags in the future.
2024-02-22 00:14:08 +00:00
Sadie Powell 3ecf6b495b Document IRCDProto::Parse. 2024-02-22 00:14:08 +00:00
Sadie Powell 8475697e3b Inline, constify, and document GetProtocolName. 2024-02-22 00:14:08 +00:00
Sadie Powell 85687781d1 Include tags in OnMessage. 2024-02-22 00:14:08 +00:00
TehPeGaSuS ccfaca32a2 Fix a typo in cs_drop. 2024-02-21 23:09:09 +00:00
Sadie Powell 07373c8cf2 Move IRCDProto member initializers to the header. 2024-02-21 13:55:48 +00:00
Sadie Powell 89594d4557 Add a method to the ns_cert API for replacing a certificate.
This will be used for upgrading certificate fingerprints when the
InspIRCd 1206 protocol support is added.
2024-02-21 13:30:16 +00:00
Sadie Powell b478a1cb53 Make ModuleManager::SetPriority more readable. 2024-02-20 18:38:52 +00:00
Sadie Powell 1fb77e414d Increase the size of the random codes in ns_register and ns_set. 2024-02-19 22:31:07 +00:00
Sadie Powell 22fe5bb724 Require users to use a confirmation code when dropping channels. 2024-02-19 22:20:36 +00:00
Robert Scheck 909b9b2679 Remove a leftover use of the m_ module prefix. 2024-02-17 21:34:03 +00:00
Sadie Powell 49ea709027 Merge branch '2.0' into 2.1. 2024-02-17 20:50:31 +00:00
Sadie Powell 4ea2bc5e46 Mark as 2.0.16-git. 2024-02-17 20:08:10 +00:00
Sadie Powell eabc8b641e Release 2.0.15. 2024-02-17 20:07:09 +00:00
Sadie Powell 2f1ed186d1 Update the change log. 2024-02-17 20:06:08 +00:00
Sadie Powell 4cc68397dc Update the copyright headers for 2024. 2024-02-17 19:58:17 +00:00
Sadie Powell 2b7872139c Prevent resetting the password of suspended accounts.
Closes #351.
2024-02-17 19:52:39 +00:00
TehPeGaSuS e47ad6ed3f Fix some typos in the config change log. 2024-02-17 18:59:17 +00:00
Sadie Powell f3b14694c6 Bump for 2.1.3-git. 2024-02-17 18:15:38 +00:00
Sadie Powell e9424b529c Release 2.1.2. 2024-02-17 18:14:10 +00:00
Sadie Powell a60c796cf6 Update the config changelog. 2024-02-17 18:13:30 +00:00
Sadie Powell fcf16ab20a Merge branch '2.0' into 2.1. 2024-02-11 21:35:31 +00:00
Sadie Powell 8e3be20387 Update the Windows dependencies. 2024-02-11 21:34:00 +00:00
Sadie Powell 689dd44d3b Add a GitHub security policy. 2024-02-11 21:32:23 +00:00
Sadie Powell a25d0aa60e Update the changelog. 2024-02-11 21:14:59 +00:00
Sadie Powell c50d1dc2b5 Remove some outdated development docs. 2024-02-11 21:08:17 +00:00
Sadie Powell 274bb19d03 Switch Thread to use the C++11 equivalent, remove win32/pthread. 2024-02-11 20:35:21 +00:00
Sadie Powell 2c5b84bd1d Replace Condition and Mutex with the C++11 standard equivalents. 2024-02-11 19:53:05 +00:00
Sadie Powell 5c50bcb9c7 Remove the time_t parameter from Tick and TickTimers.
Most uses of Tick do not use the parameter and even when it is used
it is always the same as CurTime.
2024-02-11 18:18:18 +00:00
Sadie Powell cef56abea4 Consistently use time_t for the timer duration. 2024-02-11 18:10:38 +00:00
Sadie Powell 30b9f12711 Remove the now parameter from the Timer class.
This was never actually changed from the default.
2024-02-11 17:56:35 +00:00
Sadie Powell c9e0245f23 Revert "Document ns_no_expire nick default".
This reverts commit 9c9df2ad1f.

Closes #350.
2024-02-11 16:22:01 +00:00
Robby 5337326cc9 Update the dutch language file. 2024-01-31 06:17:01 +01:00
Robby 73d8c85879 Update the dutch language file. 2024-01-31 06:17:00 +01:00
Robby 6237245ab7 Remove an extraneous space in cs_xop, part 2. 2024-01-31 03:20:35 +01:00
Robby 7ae20c2a6d Remove an extraneous space in cs_xop. 2024-01-31 03:08:54 +01:00
Robby ae1829e5a8 Fix a typo in the PASSWORD_TOO_SHORT text string. 2024-01-30 19:15:19 +01:00
Sadie Powell 026661c9a2 Fix irc2sql and webcpanel not being put into the modules folder. 2024-01-30 14:53:08 +00:00
Sadie Powell ec7223ace2 Convert map/multimap/hash_map to an alias template. 2024-01-30 14:29:17 +00:00
Sadie Powell 1f31621bbf Remove various references to old versions. 2024-01-30 14:01:07 +00:00
Sadie Powell dfd41b9b94 Fix Clang and GCC disagreeing about whether a move is needed. 2024-01-24 16:12:29 +00:00
Sadie Powell fdd4aade3b Add a CI workflow for Alpine. 2024-01-24 15:14:21 +00:00
Sadie Powell 0a53f4c26e Merge branch '2.0' into 2.1. 2024-01-24 14:48:53 +00:00
Sadie Powell d6a826a09c Backport CI changes from the 2.1 branch. 2024-01-24 14:45:57 +00:00
Sadie Powell 484160eb4e Shuffle modules around a bit. 2024-01-24 12:34:34 +00:00
Sadie Powell 7ac1fe5847 Rename several modules to remove the m_ prefix. 2024-01-24 12:22:51 +00:00
Sadie Powell 72acef4e15 Mark types that have no inheritors as final. 2024-01-23 16:53:06 +00:00
Sadie Powell a6a0f6c447 Improve the layout of types that inherit from another type. 2024-01-23 15:28:23 +00:00
Sadie Powell 398d674cf4 Fix some CoreExport types that should be DllExport. 2024-01-23 14:06:46 +00:00
Sadie Powell 1467de1c7e Mark all exception types as CoreExport.
From the GCC docs:

>Exception catching of a user defined type in a binary other than
>the one which threw the exception requires a typeinfo lookup.

Closes #335.
2024-01-22 20:06:57 +00:00
Sadie Powell c5023fdfa0 Update the Turkish translation for the changes in 2.1 git.
Co-authored-by: CaPa CuL <capacul@gmail.com>
2024-01-22 19:52:06 +00:00
Sadie Powell 97782248af Merge branch '2.0' into 2.1. 2024-01-22 18:35:12 +00:00
Sadie Powell 016761776b Add a new Turkish translation contributed by CaPa CuL.
Co-authored-by: CaPa CuL <capacul@gmail.com>
2024-01-22 16:29:20 +00:00
Victor Coss c2450eabab Fix typo 2024-01-22 00:38:23 +00:00
Sadie Powell d6ced86021 Fix some module names that were missed in commit 4056af00e3. 2024-01-11 17:13:14 +00:00
Sadie Powell 0d8d1675f7 Fix an oversight in build_subdir. 2024-01-10 17:49:02 +00:00
Sadie Powell 4056af00e3 Parse InspIRCd module names in a way which is 1206 compatible. 2024-01-10 17:47:27 +00:00
Sadie Powell 99b4305573 Add a wrapper for std::string::compare to Anope::string. 2024-01-10 17:07:17 +00:00
Sadie Powell 113301dbba Update the changelogs. 2024-01-09 21:25:44 +00:00
Sadie Powell 349ae043b6 Always build the stats modules.
These have no external dependencies so it makes no sense to not
always build them.
2024-01-09 21:25:44 +00:00
Sadie Powell 710e7dd3a2 Bump the minimum OpenSSL version to 1.1. 2024-01-09 21:25:44 +00:00
Sadie Powell 1e9c6d7931 Always disable SSLv3 support, allow disabling TLSv1.[012]. 2024-01-09 21:25:44 +00:00
Sadie Powell 5772b924cc Drop support for ancient versions of GnuTLS. 2024-01-09 21:25:44 +00:00
Sadie Powell fce5f4cc0f Update the default SSL filenames to use the Certbot names. 2024-01-09 21:25:44 +00:00
Sadie Powell fa7ad6b3df Use native file extensions on macOS and Windows. 2024-01-09 14:35:49 +00:00
Sadie Powell fc2df00cfc Put modules into their own folder on Windows. 2024-01-09 13:57:32 +00:00
Sadie Powell f92c5471c2 Add a string overload of Channel::Kick. 2024-01-08 14:37:50 +00:00
Sadie Powell 0439e3b21b Add a string overload of User::SetModes. 2024-01-08 14:14:57 +00:00
Sadie Powell 5b23fae8bf Add a string overload of Channel::SetModes. 2024-01-08 14:14:37 +00:00
Sadie Powell aac4b0f0a3 Bump the up to date languages for the recent format changes. 2024-01-08 13:47:39 +00:00
Sadie Powell f083795c79 Fix various format string issues. 2024-01-08 13:11:50 +00:00
Sadie Powell 5db79c1e24 Add a non-formatting overload of User::SetModesInternal. 2024-01-08 13:11:50 +00:00
Sadie Powell a4dddfd5f1 Mark format strings with the GNU printf attribute. 2024-01-08 13:11:50 +00:00
Valentin Lorentz 7ddc865cde fr_FR: Generalize gender-neutral grammar
'(e)' and 'le/la' were used in a few places, I generalized them to all
strings referring to people.

I also made role names gender-neutral using contraction (eg. "fondateur"
-> "fondateurice"), and adapted specifiers accordingly.
2024-01-06 23:22:10 +00:00
Sadie Powell 688ecf1c1d Fix an oversight in the mysql module. 2024-01-06 23:19:18 +00:00
Sadie Powell c0453cfec1 Fix a sign conversion issue in the mysql module. 2024-01-06 13:39:03 +00:00
Sadie Powell a9ab0c72a6 Use auto in places where the type is unambiguous. 2024-01-06 13:23:37 +00:00
Robert Scheck de918ef9cf Add missing whitespace in multi-line comment 2024-01-06 12:41:31 +00:00
Sadie Powell 0ee9874112 Update translations for the recent services case fix. 2024-01-05 21:44:08 +00:00
Val Lorentz 388858aee6 Fix inconsistent capitalization of 'services'. 2024-01-05 21:34:26 +00:00
Sadie Powell f22703df59 Fix a translation string and enable translations on CI. 2024-01-05 21:28:54 +00:00
Val Lorentz 4715b76dbe fr_FR: msgmerge + update fuzzy strings. 2024-01-05 21:21:43 +00:00
Sadie Powell 50bd385ccf Add an alias for chanserv/status for the name used by Atheme.
Closes #336.
2024-01-05 21:21:17 +00:00
Sadie Powell e738da9b11 Merge branch '2.0' into 2.1. 2024-01-05 19:52:56 +00:00
Val Lorentz 6e6e053384 fr_FR: Update fuzzy strings 2024-01-05 19:49:56 +00:00
Valentin Lorentz 5edf19d230 fr_FR: Fix trailing spaces 2024-01-05 19:00:19 +00:00
Sadie Powell 4573e1925d Use normal exit codes when exiting the process. 2024-01-05 12:00:28 +00:00
Sadie Powell a40f8e0b9d Update the copyright headers for 2024. 2024-01-04 22:25:48 +00:00
Sadie Powell 9db49ec790 Bump for 2.1.2-git. 2024-01-04 17:55:44 +00:00
Sadie Powell e8cd2909a5 Release 2.1.1. 2024-01-04 17:54:06 +00:00
Sadie Powell e7a57aa754 Update the changelog. 2024-01-04 17:53:05 +00:00
Sadie Powell 1c30f69bd0 Fix a typo in GetCommandLineArgument. 2024-01-04 17:52:30 +00:00
Sadie Powell eb2aaf22ed Fix a copy/paste error in the default channel settings. 2024-01-01 17:32:37 +00:00
k4be 36c43683e5 Remove unused strings from pl_PL 2023-12-27 15:06:30 +00:00
k4be 0b63a4244d Update pl_PL translation for 2.1 2023-12-27 15:06:30 +00:00
Sadie Powell 4a62259695 Move privilege descriptions to the example configs. 2023-12-22 15:58:28 +00:00
Sadie Powell 87e3d5a045 Remove an extraneous space in cs_xop. 2023-12-21 01:27:34 +00:00
Dragone2 2b8384bb39 Updates Italian translations for Anope 2.1 2023-12-21 00:47:47 +00:00
Sadie Powell 6d981960da Merge branch '2.0' into 2.1. 2023-12-20 00:07:51 +00:00
Sadie Powell aca9d30064 Tweak the issue templates slightly. 2023-12-19 21:21:39 +00:00
Sadie Powell b84b1d8166 Misc grammar fixes. 2023-12-17 19:32:45 +00:00
Sadie Powell 6acbd326f3 Add the regex_stdlib regular expression engine.
Unlike other regular expression engines this is available on all
systems.
2023-12-17 15:00:26 +00:00
Sadie Powell cb533b63ac Merge branch '2.0' into 2.1. 2023-12-17 14:33:44 +00:00
Sadie Powell 6538641e87 Remove some unnecessary spaces that break editor indentation. 2023-12-17 13:59:49 +00:00
Sadie Powell eb0e5c89b2 Remove the m_regex_pcre module.
Users should migrate to m_regex_pcre2 instead.
2023-12-17 13:46:34 +00:00
Mingjie Shen 8e2fa4acdb messages: fix incorrect format specifier
Calling a printf-like function with the wrong type of arguments causes
unpredictable behavior.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-12-08 17:16:53 +00:00
Sadie Powell 84c2f8d3fc Skip checking for chgrp/chmod on Windows. 2023-12-07 15:59:19 +00:00
Dragone2 8d99b3e2d7 Clean-ups old strings 2023-12-05 16:52:02 +00:00
Dragone2 b3ec2a5463 Adds new Italian translations 2023-12-05 16:52:02 +00:00
Sadie Powell 4c67f4393f Update the en_US translation. 2023-12-04 18:49:57 +00:00
Sadie Powell 4e9a2df827 Add the UNBANME privilege to allow users to unban themselves.
This is separate from the existing UNBAN privilege which applies
to all users.

Closes #331.
2023-11-30 14:38:20 +00:00
Sadie Powell 2d2d1972e9 Fix some modules that weren't converted to the new socket ctor.
Closes #330.
2023-11-26 13:26:38 +00:00
PeGaSuS cc9e2c1260 Fix missing end of comment 2023-11-24 21:04:05 +00:00
Sadie Powell 2b21264fb0 Bump for 2.1.1-git. 2023-11-24 13:37:11 +00:00
Sadie Powell 3f61b52db3 Release 2.1.0. 2023-11-24 13:33:10 +00:00
Sadie Powell f5fa4ff0e9 Remove the 1.9 and 2.0 changes from the change log. 2023-11-24 13:29:15 +00:00
Sadie Powell 251551c8c3 Update the change logs. 2023-11-24 13:29:11 +00:00
Sadie Powell e2d546ad46 Add a note about how to send emails on Windows. 2023-11-24 13:24:42 +00:00
Sadie Powell 949176c3e0 Merge branch '2.0' into 2.1. 2023-11-24 13:04:00 +00:00
Sadie Powell 3371941be5 Allow users to opt-out of being added to channel access lists. 2023-11-23 15:10:03 +00:00
Sadie Powell 70d72b62df Avoid needing to cast CurrentUplink by changing it to a size_t. 2023-11-16 21:49:48 +00:00
Sadie Powell c3e95d8e2e Fix chanserv/suspend info not being visible to regular users.
Closes #325.
2023-11-16 19:54:23 +00:00
Sadie Powell 46209895e3 Merge branch '2.0' into 2.1. 2023-11-16 19:34:37 +00:00
Sadie Powell ba163027bd Make the SASL PLAIN implementation more robust.
- Reject auth attempts that try to authenticate using an alternate
  authorization identity.

- Reject auth attempts that contain extraneous null bytes in the
  string as required by the SASL PLAIN RFC.

- General code quality cleanup.
2023-11-16 18:14:15 +00:00
Sadie Powell b28180d680 Implement support for the ANONYMOUS SASL mechanism. 2023-11-14 15:02:04 +00:00
Sadie Powell 0f1f0c5a22 Deduplicate account sending code in the inspircd module. 2023-11-14 13:53:45 +00:00
Sadie Powell 6e16e71fda Remove the two day X-line cap. 2023-11-03 11:01:01 +00:00
Sadie Powell 1eba69d035 Fix a missing override keyword. 2023-10-24 18:10:32 +01:00
Sadie Powell eb409fc6eb When changing the nick of a user on inspircd3 send the expected ts.
This should prevent users being renicked if they changed their nick
between services sending the renick and the IRCd receiving it.
2023-10-24 18:00:34 +01:00
Sadie Powell 97fa6d84bc Fix confirming an unconfirmed operator's account. 2023-10-22 23:31:48 +01:00
Sadie Powell 02940e4ea8 Fix a misleading temporary variable in ns_register. 2023-10-20 18:10:29 +01:00
Sadie Powell 38d5b93e4a Add support for server-initiated logins and logouts on UnrealIRCd. 2023-10-19 23:22:31 +01:00
Sadie Powell 78398a4481 Add support for server-initiated logouts on InspIRCd. 2023-10-19 22:52:05 +01:00
Sadie Powell 69a0f3bec2 Fix removing entries by an alias in chanserv/access and chanserv/xop. 2023-10-12 19:09:44 +01:00
Sadie Powell 0f32d2e553 Use a more human readable datetime format. 2023-10-12 14:41:07 +01:00
Sadie Powell 8e1c7e1e44 Merge branch '2.0' into 2.1. 2023-10-11 15:51:52 +01:00
Sadie Powell a3241065c5 Start migrating to range-based for loops. 2023-10-11 15:51:52 +01:00
Dragone2 6119586920 Small fixes and improvements to Italian translation. 2023-10-04 17:14:39 +01:00
dependabot[bot] 32cf99fdb5 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:20:09 +01:00
Sadie Powell dc371aad6d Re-add the GHOST and REGAIN commands for compatibility.
These are hidden so they won't be shown in the help.
2023-09-26 12:39:30 +01:00
Sadie Powell ca2209aaed Show the SQL service name in the db_sql error message.
This should help users diagnose issues easier.
2023-09-05 00:21:31 +01:00
Sadie Powell 0a3ddef315 Replace Twitter with Mastodon in the ns_set_misc example config.
Closes #320.
2023-08-31 07:19:00 +01:00
Sadie Powell adf820c08a Merge branch 2.0 into 2.1. 2023-08-06 13:36:27 +01:00
Sadie Powell 0715db7182 Mark as 2.0.15-git. 2023-08-06 13:00:09 +01:00
Sadie Powell 8bf14ad5ea Release 2.0.14. 2023-08-06 12:58:38 +01:00
Sadie Powell c9f21f4ef6 Update the changelogs. 2023-08-06 12:57:26 +01:00
Sadie Powell 1b2eb9b9c8 Fix the pull request template to be more relevant to Anope. 2023-07-30 12:41:21 +01:00
Sadie Powell 1343be58d7 Add some templates for people filing issues on GitHub. 2023-07-30 12:15:20 +01:00
Sadie Powell 377ba87d52 Remove broken support for MinGW.
This apparently doesn't work and is pointless given we have native
Windows builds now anyway.
2023-07-29 10:01:18 +01:00
Sadie Powell 97f6aadd5b Fix paging the Config header on some util-linux revisions.
We use an environment variable here as passing -e directly may
result in an error on older `more` releases.
2023-07-28 23:56:09 +01:00
Sadie Powell 2dafc85af4 Remove references to the ilm which never got updated from 1.8. 2023-07-16 18:25:21 +01:00
Sadie Powell 7f8a0c9d33 Allow Anope to look up multiple DNS results.
For fixing bug 1756.
2023-07-11 16:11:57 +01:00
Sadie Powell cc23f6dc01 Fix sending log messages from a renamed pseudoclient.
If a command is named e.g. nickserv/wibble it previously tried to
look up the nickserv service and if this service didn't exist then
it would fall back to sending from the first available service. This
caused problems if the NickServ service had been renamed to something
else.

Reported by @AndrioCelos on IRC.
2023-07-11 15:13:17 +01:00
Sadie Powell aa619f1eeb Merge branch '2.0' into 2.1. 2023-07-11 12:28:54 +01:00
Sadie Powell b7458c5da1 Allow access list entries to have a description.
This is useful when adding glob matches to the access list as a
reminder of who they actually match.

Resolves https://bugs.anope.org/view.php?id=1613
2023-07-11 12:19:47 +01:00
PeGaSuS e717ac0a89 Clarify that operserv/sqline can also match channel names. 2023-07-09 23:44:02 +01:00
Sadie Powell 34ab54522e Fix not serialising dontkickops/dontkickvoices properly. 2023-07-09 23:09:11 +01:00
Sadie Powell 47bbc9b3fb Enable CanSQLineChannel in unreal4.
Ref: https://www.unrealircd.org/docs/Server_protocol:SQLINE_command
2023-07-09 22:32:43 +01:00
Sadie Powell 68b51c7481 Fix not getting memo notifications when using SASL. 2023-07-09 22:32:43 +01:00
Sadie Powell 37b60f8d9d Update links to the bugtracker. 2023-07-09 20:06:32 +01:00
Sadie Powell 14204353ac Allow customising the email content type.
This will allow people to send emails using HTML or non UTF-8 text.
2023-07-09 14:39:51 +01:00
Sadie Powell 098f19c005 Fix a crash when a module tries to get another module's config. 2023-07-06 10:53:25 +01:00
PeGaSuS 4e1f5cce80 Tell users that they must identify to their account before using CONFIRM.
This only happens when a nickname is registered via webcpanel and said nickname is online.
2023-07-05 17:09:47 +01:00
Sadie Powell 4a6f4bc92f Pull in the upstream changes from InspIRCd's vendoring tool. 2023-06-20 01:06:35 +01:00
Sadie Powell da2ac3e8a2 Fix detection of the nopartmsg module in the InspIRCd proto modules. 2023-06-20 01:00:37 +01:00
Sadie Powell 7c7158cf24 Terminate lines with CR+LF instead of just LF when sending an email.
From https://www.rfc-editor.org/rfc/rfc5321#section-2.3.1:

> Lines consist of zero or more data characters terminated by the
> sequence ASCII character "CR" (hex value 0D) followed immediately by
> ASCII character "LF" (hex value 0A).
2023-06-06 16:48:47 +01:00
Sadie Powell 1c30205af5 Also build the Windows dependencies in the CI. 2023-06-03 22:02:49 +01:00
Sadie Powell 9d0a6ddc67 Merge branch '2.0' into 2.1. 2023-06-03 21:51:07 +01:00
Adam fbf3b34474 add gettext to conan deps 2023-06-02 23:01:27 -04:00
Adam ce42810265 m_ldap: use Wldap on windows 2023-06-02 21:31:12 -04:00
Adam 07babdbd77 use Conan for extra's dependencies on Windows
conan install src\win32\conanfile.txt --build=missing
cmake -B build .
cmake --build build --config Release --target PACKAGE
2023-06-02 19:08:55 -04:00
Sadie Powell fe3926f572 Mark as 2.0.14-git. 2023-06-01 23:12:08 +01:00
Sadie Powell 03eead042c Release 2.0.13. 2023-06-01 23:12:07 +01:00
Sadie Powell b1fff640dd Update the changelogs. 2023-05-30 16:07:54 +01:00
Dragone2 f251ca6373 Small fixes to the Italian translation. 2023-05-29 21:33:59 +01:00
Adam 24a2c51003 CMakeLists.txt: remove -fno-delete-null-pointer-checks 2023-05-28 21:26:03 -04:00
Adam 66f37139cb regchannels: remove dependency on no-delete-null-pointer-checks 2023-05-28 21:26:03 -04:00
Adam 0646547c9e config: remove dependency on no-delete-null-pointer-checks 2023-05-28 21:25:59 -04:00
Sadie Powell 41206b991e Fix not being able to log into oper accounts when DNS fails. 2023-05-11 13:05:39 +01:00
Sadie Powell b7abfe5eca Avoid returning null when a config tag does not exist.
This invokes undefined behaviour on modern compilers.
2023-05-04 19:21:02 +01:00
Hendrik Jäger 23e7f5bd33 update: german translation 2023-04-21 22:30:18 +01:00
Dragone2 df9dfeae95 Update the Italian translation.
Ref: #309
2023-04-04 16:59:59 +01:00
Sadie Powell 29db25dac7 Fix missing override keywords. 2023-03-13 13:52:56 +00:00
Sadie Powell d210cd2695 Modernize finding system tools and remove checks for unused tools. 2023-03-13 13:52:56 +00:00
Sadie Powell fc8e6ee338 Document the protocol module changes from a while ago. 2023-03-13 01:44:37 +00:00
henk84 e68a41a91e Make language/update.sh safer, faster, cleaner.
Ref: #308

Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2023-03-06 12:01:46 +00:00
henk84 26f846e112 Document how to update a translation.
Ref: #307

Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2023-02-26 23:09:30 +00:00
henk84 f1fbe9e629 Update some german translations.
Ref: #306

Co-authored-by: Hendrik Jäger <gitcommit@henk.geekmail.org>
2023-02-26 23:05:28 +00:00
Sadie Powell ebe3fd7e57 Merge branch '2.0' into 2.1. 2023-02-19 11:21:58 +00:00
Sadie Powell 1c9b34190e Update the en_US translation. 2023-02-19 11:14:37 +00:00
Sadie Powell a5d4aa5821 Remove line numbers from the translation files.
The translations are updated so infrequently that these always
change a bunch and it makes reading the diffs really hard.
2023-02-19 11:12:37 +00:00
Hendrik Jäger 9b583961b0 Update german translation 2023-02-18 21:48:53 +00:00
Bram Matthys fef0cc1c29 unreal4: set vhost/vident during SASL 2023-02-09 16:05:50 +00:00
Sadie Powell f0ad0b4f0a Raise the default session limit from 3 to 5. 2023-02-06 17:12:35 +00:00
Sadie Powell dc1d9c837b Fix crashing when encountering an unterminated commented block. 2023-02-06 17:10:29 +00:00
Sadie Powell 885462d98e Merge branch '2.0' into 2.1. 2022-12-31 22:11:19 +00:00
Sadie Powell 33a337dfc0 Update the copyright headers for 2023. 2022-12-31 22:08:50 +00:00
Sadie Powell b64dc09bd2 Fix marking services pseudoclients as an oper on InspIRCd.
The bot user needs to be marked as introduced in order to send an
oper type.
2022-12-31 21:55:05 +00:00
Sadie Powell 6395107be6 Fix getting the port on non-UNIX socket listeners. 2022-12-27 10:21:40 +00:00
Sadie Powell 24b881c427 Update MODULE_INIT for modern MSVC+ versions. 2022-12-23 15:09:12 +00:00
Sadie Powell 28be881886 Backport anopesmtp removal from the master branch. 2022-12-23 14:21:34 +00:00
Sadie Powell 5bc560a743 Remove some unnecessary dependencies on the Linux CI. 2022-12-23 14:10:33 +00:00
Sadie Powell fee60c8e06 The fantasy:name field is allowed to contain spaces. 2022-12-18 10:36:59 +00:00
Sadie Powell 3f867c1e11 Show the invalid config value in the rejection message. 2022-12-18 10:35:11 +00:00
Sadie Powell b235da2e9c Merge branch '2.0' into 2.1. 2022-12-17 16:18:09 +00:00
Sadie Powell 3f3062a077 Use <filesystem> instead of opendir/readdir/closedir. 2022-12-17 16:03:28 +00:00
dependabot[bot] 2f46739931 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-17 15:59:28 +00:00
Sadie Powell 6eec018c34 Allow Dependabot to keep our GitHub CI up to date. 2022-12-17 15:57:37 +00:00
Sadie Powell 8a8fb7725b Use the native versions of inet_ntop/inet_pton on Windows. 2022-12-17 12:40:58 +00:00
Sadie Powell f6e5e6a2b4 Add sockaddrs::str to stringify a sockaddrs properly.
Also clean up the socket code slightly.
2022-12-17 12:39:48 +00:00
Sadie Powell dfdcd3021a Add support for linking over UNIX sockets. 2022-12-17 11:50:38 +00:00
Sadie Powell 5fa3d8f929 Use emplace() instead of insert(std::make_pair()). 2022-12-09 16:50:29 +00:00
Sadie Powell e78db21180 Mark as 2.0.13-git. 2022-12-09 08:33:02 +00:00
Sadie Powell d4d2a4b4ce Release 2.0.12. 2022-12-09 08:30:43 +00:00
Sadie Powell e33b8d5f43 Update the changelogs. 2022-12-09 08:28:57 +00:00
PeGaSuS c2b154e1b1 Document cs_no_expire (#301). 2022-12-08 07:16:04 +00:00
Sadie Powell 1a2da82106 Merge branch '2.0' into 2.1. 2022-12-07 15:59:46 +00:00
Sadie Powell 4a2861ba3d Add a module that provides regex/pcre using PCRE2. 2022-12-07 15:43:39 +00:00
Sadie Powell 9d92de1157 Import InspIRCd's vendoring tool and use it to vendor crypt_blowfish. 2022-10-22 20:08:30 +01:00
miwob 211bd80061 Update ircd-hybrid protocol module
* Add METADATA command handler which currently only allows to modify a client's certificate fingerprint
* Minor reformatting and style inconsistency fixes
2022-09-29 13:05:05 +01:00
Austin Ellis 32679a107a Add the ability to confirm accounts via webcpanel after logging in. 2022-09-22 17:38:07 +01:00
Sadie Powell 1664689eb7 Merge branch '2.0' into 2.1. 2022-09-15 18:46:51 +01:00
miwob bc101d10de Update hybrid protocol module to improve compatibility with the latest ircd-hybrid release.
* Remove support for deprecated channel mode `u`
* Add support for channel mode `N`
* Fixed the `UID` message handler requiring the correct amount of arguments
* Fixed the `SID` message handler requiring the correct amount of arguments
* Fixed the `SJOIN` message handler requiring the correct amount of arguments
* Minor documentation updates and style corrections
* Remove pointless return statement in the `JOIN` message handler
* Add support for the owner and admin channel prefix modes
* Add support for `MLOCK`
* Fixed SendChannel() so modes are prefixed with a `+`
* Change SendJoin() to actually use the mode stacker
* Add support for channel mode `Q`
* Add support for channel mode `Z`
* Add support for user mode `B` and `Z`
* Actually user mode `g` is not oper only. For some reason this mode got set to oper only in anope/anope@1e625b6
* Work properly with extended bans, e.g. don't normalize masks starting with a `$`
2022-09-15 14:13:24 +01:00
Sadie Powell 901a456132 Fix allowing spaces in some config fields that shouldn't contain them. 2022-09-12 17:56:45 +01:00
Sadie Powell 0c61915e31 Bahamut now has support for halfops. 2022-09-12 17:56:45 +01:00
Dragone2 d5e85c7f25 Fixe a typo in the Italian translation.
Ref: #298
2022-08-10 19:40:42 +01:00
Michael Stapelberg a5425e3bf3 database: write to temporary file and rename.
This decreases the likelihood of ending up with a zero-byte (or missing)
anope.db.

Co-authored-by: Michael Stapelberg <michael@robustirc.net>
2022-07-27 17:40:49 +01:00
Sadie Powell b96519d85c Build the installer package on Windows CI. 2022-05-01 10:28:18 +01:00
Sadie Powell ac98ed615b Merge branch '2.0' into 2.1. 2022-04-22 10:34:04 +01:00
Sadie Powell 2062eb23f0 Release 2.0.11. 2022-04-22 10:17:19 +01:00
Sadie Powell af4d7d21ba Update the changelogs. 2022-04-21 17:48:54 +01:00
Sadie Powell c2ba553483 Remove unnecessary ProcessModes call in unreal4.
This was made obsolete by the previous commit.
2022-04-11 15:34:37 +01:00
Sadie Powell f2bcf449cd Use windows-2019 for Windows builds. 2022-03-01 05:21:28 +00:00
Sadie Powell 09c587bed0 Remove TR1 compatibility layer.
This isn't necessary now we use C++17.
2022-03-01 05:09:29 +00:00
Sadie Powell a8724b5f03 Use noexcept instead of an empty exception specifier. 2022-03-01 05:06:19 +00:00
PeGaSuS 8dd1fb8ac2 Fix unsetting vhosts on unreal4 (#289). 2022-02-13 14:30:09 +00:00
Sadie Powell b7e85f5161 Default synconset and syncongroup to on. 2022-02-05 23:11:39 +00:00
Sadie Powell 773ed39d5d Merge branch '2.0' into 2.1. 2022-02-05 23:10:42 +00:00
Sadie Powell b5fe380011 Include the required modules in the example InspIRCd config. 2022-01-29 13:33:19 +00:00
Sadie Powell af7bf785f9 Fix a grammar error in nickserv.example.conf. 2022-01-29 13:31:04 +00:00
Sadie Powell 15d51ff033 Document the sysconf header file. 2022-01-13 13:46:29 +00:00
Sadie Powell 83bf5ba255 Remove checks for obsolete Windows SDK versions.
We can't build against these anyway now as they're too old.
2022-01-13 03:22:12 +00:00
Sadie Powell 2881ba112b Clean up the predefined variables on Windows.
- Use _MSC_VER for detecting MSVC instead of a custom define.
- Remove MINGW as you can use __MINGW32__ to detect this.
- Stop defining _WIN32 as this will always be defined on Windows.
2022-01-13 02:35:23 +00:00
Sadie Powell 1ee81580c6 Add support for Windows CI. 2022-01-13 01:59:13 +00:00
Sadie Powell 4f421db5a9 Fix checking whether localisation is enabled. 2022-01-13 01:59:13 +00:00
Sadie Powell 091c0eea28 Rip out check_functions().
This isn't actually used anywhere and just slows down the build.
2022-01-13 01:42:46 +00:00
Sadie Powell eaaabd8de0 Rip out calculate_depends().
This code is incredibly error prone and it just duplicates behaviour
that CMake already implements with depend.make files.
2022-01-13 01:42:38 +00:00
Sadie Powell 40ce51a1a9 Include cstring instead of string.h in services.h 2022-01-13 01:13:46 +00:00
Sadie Powell 23ac008cc1 Remove NO_CLIENT_LONG_LONG from the mysql module.
This is not necessary now we use C++17.
2022-01-13 01:12:05 +00:00
Sadie Powell 6486956401 Fix some methods that should have been marked as CoreExport. 2022-01-13 00:34:51 +00:00
Sadie Powell 33b42ce86e Use the default CMake modules for finding gettext instead of our own. 2022-01-12 23:05:25 +00:00
Sadie Powell a631028660 Merge branch '2.0' into 2.1. 2022-01-12 22:08:35 +00:00
Sadie Powell 04257b9d6a Replace ICQ in the ns_set_misc examples with something not dead. 2022-01-10 16:45:25 +00:00
Sadie Powell acb6c55529 Add all extra modules to the gitignore to avoid adding their symlinks. 2022-01-10 16:20:56 +00:00
Sadie Powell 0e6f8488d3 Avoid duplicate checks in irc2sql. 2022-01-10 16:20:56 +00:00
Filippo Cortigiani 56687c27cb Fix ns_resetpass not returning a response for XMLRPC (#243)
Co-authored-by: filippo nicola cortigiani <simos@H7-25.fritz.box>
2022-01-10 16:12:33 +00:00
k4bek4be 9b0c7929d9 Multiple updates for unreal4 protocol (#285)
* Parse PROTOCTL PREFIX and PROTOCTL USERMODES
* Add several previously unhandled modes
* Fix incorrect SJOIN prefix handling
* Enable message tags sending from ircd
* Add timedban matcher
* Add operclass matcher
* Store all client and channel moddata.
* Call unreal's internal unban on /cs unban
* Check for ~a:0 ban
* Add country ban matcher
* Use +B umode for services bots
2022-01-10 15:50:17 +00:00
k4bek4be d895a3aa01 Use utf-8 encoding for outgoing email (#286) 2022-01-09 19:01:45 +00:00
k4be d4632e5286 Add a "Network Service" (RPL_WHOISOPERATOR) line to WHOIS replies 2022-01-09 18:39:09 +00:00
Michael Wobst c38106211c Adjust IsIdentValid test to comply with upcoming ircd-hybrid release (#272).
hybrid.cpp: adjust IsIdentValid test to comply with upcoming ircd-hybrid where
user names may only consist of [A-Za-z0-9._-] and may not begin with '.', '-',
or '_'.

As a side effect this fixes an issue where currently it is possible to introduce
bots whose user name starts with (non-alnum) characters considered invalid for
ircd-hybrid leading to a services shutdown due to a nick introduction/kill loop.
2022-01-09 15:25:09 +00:00
Sadie Powell b8bcad048e Update the copyright headers for 2022. 2022-01-06 23:15:44 +00:00
Sadie Powell 4e5fc9797c Speed up CI by building with Ninja instead of Make. 2022-01-04 18:48:22 +00:00
Sadie Powell 9befb13ea4 Remove various entries from sysconf which are never actually used. 2022-01-04 15:05:33 +00:00
Sadie Powell 8eb6a4da71 Update more IRCServices references to reflect the current project.
- If referring to the specific piece of software use "Anope".
- If referring to services in general use "services".
2022-01-04 14:11:07 +00:00
Sadie Powell ec7dfb3675 Use C++11 header names instead of their deprecated equivalents. 2022-01-04 12:36:35 +00:00
Sadie Powell 106750db77 Replace all uses of push_back with emplace_back. 2022-01-04 12:28:55 +00:00
Sadie Powell 7d1047490e Consistently use #pragma once across all header files.
This replaces a mixture of no include guards, ANOPE_FOO_H, and FOO_H.
2022-01-04 12:10:32 +00:00
Sadie Powell c9f93eeaed Merge branch '2.0' into 2.1. 2022-01-04 00:39:34 +00:00
Sadie Powell db6b2225b1 Use GNU visibility attributes when on non-Windows.
This reduces binary sizes by several megabytes on my system.
2022-01-04 00:39:05 +00:00
Sadie Powell c6c9d9591c Remove some obsolete header and function checks. 2022-01-04 00:39:05 +00:00
Sadie Powell c1f6a79c72 Export a compilation database for debug builds. 2022-01-04 00:39:05 +00:00
Sadie Powell eb81f22a5b Modernize CXXFLAGS on Unix and enable -Werror on CI.
Also clear up warnings that this exposed.
2022-01-04 00:39:05 +00:00
Sadie Powell a31a7f5a6c Use C++11 default initializers and destructors where possible. 2022-01-04 00:17:19 +00:00
Sadie Powell 7531e90499 Use C++11 style class/struct initialisation. 2022-01-04 00:17:13 +00:00
k4be a93a7c87b6 Update pl_PL translation 2022-01-03 19:53:08 +00:00
Sadie Powell ba2c82e2f5 Fix some minor issues discovered whilst working on 2.1. 2022-01-03 19:37:33 +00:00
Sadie Powell dfcc025a19 Remove MARK_DEPRECATED as there's an attribute for this now. 2022-01-03 19:02:44 +00:00
Sadie Powell a5f7aac295 Replace anope_{final,override} with their C++11 equivalent. 2022-01-03 19:02:44 +00:00
Sadie Powell d76d747196 Require C++17 to build Anope. 2022-01-03 19:02:44 +00:00
Sadie Powell aee1e53cb3 Remove support for precompiled headers.
This might have been useful two decades ago but on recent hardware
this just makes builds take longer than without them.
2022-01-03 16:27:15 +00:00
Sadie Powell fd1ca96e2c Merge branch '2.0' into 2.1. 2022-01-03 15:50:22 +00:00
Sadie Powell 2c18601d8f Fix linking against libraries by their alternate name. 2021-12-28 21:18:22 +00:00
Sadie Powell a1a1b3ad01 Add a build time check that OpenLDAP is reentrant. 2021-12-28 19:20:23 +00:00
Robert Scheck 7a28d81b44 Reflect OpenLDAP 2.5 upstream change from libldap_r to libldap
Starting with OpenLDAP 2.5 upstream decided to merge the non-threaded
libldap_r library into the threaded libldap library. And starting with
OpenLDAP 2.6 common Linux distributions such as Fedora do not ship the
compatibility symbolic link anymore (which leads to a build failure),
thus the linking tests for libldap_r and uses alternatively libldap.

See also:
 - https://lists.openldap.org/hyperkitty/list/openldap-announce@openldap.org/thread/BH3VDPG6IYYF5L5U6LZGHHKMJY5HFA3L/
 - https://bugzilla.redhat.com/show_bug.cgi?id=2032707
2021-12-28 19:20:03 +00:00
Sadie Powell 69dbcba069 Allow specifying multiple dependency libraries like foo|bar. 2021-12-28 18:53:24 +00:00
Hendrik Jäger 66bf55fb7f Fix missing spaces in de_DE 2021-12-23 22:10:27 +00:00
Sadie Powell 002186c016 Document log files having their creation date appended. 2021-12-23 22:08:36 +00:00
Sadie Powell 6a7488edc1 Remove double escaping in CMake regex matching.
This is not needed now we use regex matching directly instead of
via the CMake 2.4 function wrapper.

Fixes building extra modules.
2021-12-14 11:11:22 +00:00
Sadie Powell 4af8dfa549 Update the min version of CMake mentioned in the Config script. 2021-12-14 10:10:03 +00:00
Sadie Powell 4efc2c219b Send mode changes from ChanServ if the channel is not registered.
Avoids calling WhoSends() on a null pointer.
2021-12-03 07:11:37 +00:00
Sadie Powell 84ec0903ee Fix checking if this is null in regchannel.
I can't see any places this might be called on a null pointer.
2021-12-02 10:23:05 +00:00
Sadie Powell 754c82d047 Remove undefined behaviour around checking if this is null. 2021-11-30 11:04:19 +00:00
Sadie Powell 17fa704278 CMake warnings CMP0003 and CMP0007 are not necessary. 2021-11-30 10:11:17 +00:00
Sadie Powell b9ccd4bb0b Fix cmake deprecation warning CMP0026. 2021-11-30 10:03:10 +00:00
Sadie Powell 595bc09ec1 Merge branch '2.0' into 2.1. 2021-11-30 09:50:33 +00:00
Sadie Powell 64f65b035e Fix some message params being sent as <middle> instead of <trailing>. 2021-11-20 19:54:56 +00:00
Sadie Powell b6f1c86f65 Use example.com instead of localhost.net in the example configs. 2021-11-14 20:45:17 +00:00
Sadie Powell a736b54ef1 Use the server name as the enforcer hostname if not otherwise set. 2021-11-14 20:45:01 +00:00
Austin Ellis 8b8bc97194 Fix the grammar of the globaloncycledown message (#279).
The previous default example (which is in use on many Anope networks) refers to Services in 2nd person, then 1st person - in the same sentence.
2021-11-14 00:42:09 +00:00
Sadie Powell 27cff11e31 Increase the default channel expiry to 30 days. 2021-10-17 19:46:29 +01:00
Sadie Powell b7da27ad3a Increase the default nickname expiry to 90 days. 2021-10-17 19:44:05 +01:00
Sadie Powell aa0adcf99b Show the protocol module name when connecting to the uplink. 2021-10-06 20:58:57 +01:00
Sadie Powell 079fb1b66f Mark as 2.0.11-git. 2021-08-29 20:02:49 +01:00
Sadie Powell 1cab1d32c2 Send the oper mode for services pseudoclients on InspIRCd. 2021-08-29 18:37:12 +01:00
Sadie Powell e5075d2dc2 Merge branch '2.0' into 2.1 2021-08-28 19:53:17 +01:00
Matthew Beeching 98fdce2e1d Update Jobe's email address in the readme. 2021-08-25 20:33:11 +01:00
Adam d8d1c1d18c cmake: update NSIS template for NSIS 3
Newer cmake versions require NSIS 3, which already defines a RemoveSection macro causing cpack to fail
2021-08-09 17:17:25 -04:00
Sadie Powell 48ec53242e Release 2.0.10. 2021-08-09 15:54:25 +01:00
Sadie Powell e7e8447fa3 Deduplicate code for checking if a user is securely connected. 2021-08-01 19:23:48 +01:00
Sadie Powell 561b205c4a Merge branch '2.0' into 2.1. 2021-08-01 18:53:24 +01:00
Adam 91321bdf68 webcpanel: fix command source ip to use extforward ip 2021-07-24 12:09:12 -04:00
Sadie Powell 33590aa59b Overwritten has two t's in it. 2021-06-17 18:41:23 +01:00
Josh Soref fd88b756fc Fix various spelling issues (#274).
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>.
2021-06-17 15:02:30 +01:00
Sadie Powell 8d1bc95faf Use the InspIRCd-sent maxlist size instead of networkinfo:modelistsize. 2021-06-04 02:19:54 +01:00
Sadie Powell e67c2d5632 Add support for per-mode list limits. 2021-06-04 02:12:09 +01:00
Sadie Powell 376053e0ac Allow protocol modules to declare that the IRCd supports tags.
This is not being used currently but will be soon.
2021-06-01 00:21:41 +01:00
Sadie Powell cadc6f48e6 Remove nickserv:strictpasswords as it is now obsolete. 2021-05-31 21:44:10 +01:00
Sadie Powell b6665d5eb9 Add the nickserv:minpasslen option. 2021-05-31 21:16:06 +01:00
Sadie Powell 95955ae069 Rename nickserv:passlen to nickserv:maxpasslen. 2021-05-31 21:00:43 +01:00
Sadie Powell df4313f5bb Merge branch '2.0' into 2.1. 2021-05-31 20:57:48 +01:00
Sadie Powell 3728a0bda1 Fix some misleading indentation in ns_register. 2021-05-31 20:53:29 +01:00
Sadie Powell d2da73cf68 Add the -devel switch to Config.
This makes the script use defaults that make development easier.
2021-05-26 04:13:42 +01:00
Sadie Powell 100b24074d Improve the message for NICK_IDENTIFY_REQUIRED. 2021-05-23 19:51:40 +01:00
Sadie Powell a040f17787 Use InnoDB instead of the deprecated MyISAM engine.
Ref: https://www.percona.com/blog/2016/10/11/mysql-8-0-end-myisam/
2021-04-27 23:21:07 +01:00
Sadie Powell 6274bd0b34 Use utf8mb4 instead of utf8 in chanstats and irc2sql.
The utf8 charset, confusingly, is an alias for utf8mb3 which is not
a real UTF-8 encoding as it can only store three byte characters.

The real UTF-8 charset is utf8mb4.
2021-04-27 23:18:04 +01:00
Sadie Powell 095a25d473 Add the anope_override keyword to methods that lack it. 2021-04-27 21:41:19 +01:00
Sadie Powell 53cd3f47b5 Use elseif in CMake where possible. 2021-04-27 19:20:39 +01:00
Sadie Powell c21f6eb5a3 Rip out compatibility code for now-unsupported CMake versions. 2021-04-27 19:20:36 +01:00
Sadie Powell e2aeab970b Remove the repeated conditions in cmake endif/else statements. 2021-04-27 17:49:21 +01:00
Sadie Powell ef4fd869ae Bump minimum CMake version to 3.8.
This is the minimum version that supports CMAKE_CXX_STANDARD=17.
2021-04-27 17:48:28 +01:00
Sadie Powell dfc8bd4aa2 Switch SendSVSLogin to take a NickAlias. 2021-04-27 17:31:14 +01:00
Sadie Powell fd774bd52a Remove unnecessary space. 2021-04-21 14:09:07 +01:00
Sadie Powell 16fac79b78 The last parameter of Solanum ECHO is a <trailing>. 2021-04-21 14:06:49 +01:00
Sadie Powell 622a8ea7e9 Implement support for the Solanum ECHO server capability.
https://github.com/solanum-ircd/solanum/commit/4cac091255d972b0131ffbf0cd278f984bd892d4
2021-04-21 14:05:35 +01:00
Sadie Powell c00ecc5e02 Process writes to the uplink socket before quitting in all cases.
This allows any error that might have been sent to the IRCd to
actually be sent.
2021-04-16 22:46:11 +01:00
Sadie Powell cdd9b6f11b Default to the inspircd3 protocol module instead of inspircd20. 2021-04-16 22:18:56 +01:00
Sadie Powell faee68e85f Don't enforce casemapping when using the 1202 InspIRCd protocol.
This allows older servers which use a module that provides custom
casemapping (e.g. the ascii module) to link.
2021-04-16 22:17:47 +01:00
Sadie Powell 683f42eeef Use UTC in anopesmtp to fix a C++98 compat warning. 2021-04-08 13:47:13 +01:00
Sadie Powell f83558f10b Log when freopen and chown fail. 2021-04-08 13:47:13 +01:00
Sadie Powell 0a518f4bbd Fix the syntax of Solanum identified messages. 2021-03-30 13:56:20 +01:00
PeGaSuS 9483da3239 Added Account to show the main nick of a grouped nick(s).
#270
2021-02-19 01:42:13 +00:00
Matt Schatz c67911bfcc bots: Fix dtor channel iterator being invalidated.
The call to UnAssign() erases the channel from the set which
invalidates the iterator in this loop. Handle this in the same
manner as the NickCore dtor.
2021-02-19 01:37:08 +00:00
Sadie Powell 3f6e694e50 Send the appropriate messages for Solanum's IDENTIFIED feature. 2021-02-19 01:08:08 +00:00
Sadie Powell c2646d67bb Replace the Charybdis protocol module with Solanum (its successor). 2021-02-19 00:33:27 +00:00
Sadie Powell c68b81eac8 Merge branch '2.0' into 2.1. 2021-02-18 23:59:28 +00:00
Adam 4d271e0210 cs_access: require accounts to be confirmed for level 0 access 2021-01-31 12:05:25 -05:00
Robby c5a4e8337c Update copyright to 2021.
This was done with:
find docs/ include/ language/ modules/ src/ *.* Config -exec sed -i 's/-20.. Anope Team/-2021 Anope Team/i' {} \;
2021-01-07 03:31:08 +01:00
PeGaSuS 7e08e7cb6c Set killprotect as a default option in nickserv.example.conf. 2021-01-07 03:24:17 +01:00
Michael Hazell 4031dc7321 inspircd3: Enable support for channel SQLines (#268) 2021-01-01 19:03:23 +00:00
Robby d1e4943800 Add kill_immed as an available option to nickserv.example.conf. 2020-11-20 17:00:00 +01:00
Sadie Powell 74f18d7b1d Only grant an account an identifier when the identifier is needed. 2020-11-19 14:12:18 +00:00
Sadie Powell 3856538e48 Bump for 2.0.10-git. 2020-10-22 12:10:08 +01:00
Sadie Powell 236affa2a4 Release 2.0.9. 2020-10-22 12:08:50 +01:00
Sadie Powell f8d8104d82 Update the changelog. 2020-10-22 12:07:56 +01:00
Sadie Powell a3c7f716bd Fix the query used by IRC2SQL for updating server information. 2020-10-21 16:26:08 +01:00
Sadie Powell b2b53a1e01 Fix account identifiers conflicting with SQL row identifiers. 2020-10-21 12:20:26 +01:00
Sadie Powell 95f4e29edd Unset the account id before the account name on InspIRCd.
This avoids the id being shown on the logout event.
2020-10-12 17:47:41 +01:00
Sadie Powell cdf147f351 Fix not sending an account id to InspIRCd on SASL.
Also, send the account id first so it shows on the ACCOUNT message.
2020-10-12 17:30:05 +01:00
Sadie Powell 8b2c1548ab Merge tag '2.0.8' into 2.1. 2020-10-07 14:42:33 +01:00
Sadie Powell 2cf507ed66 Bump for 2.0.9-git. 2020-10-07 13:15:31 +01:00
Sadie Powell 46e1395e62 Release 2.0.8. 2020-10-07 13:15:31 +01:00
Sadie Powell 6117299ecd Update the changelog. 2020-10-07 13:15:31 +01:00
Sadie Powell f8777097d1 Fix last case check for le64toh. 2020-10-07 13:15:31 +01:00
TheMythPT a79046e025 Update nickserv.example.conf
This breaks the `killprotect' functionality, because a user is expected to turn into guest after the specified amount of time.
Also new users that register their nicknames will wonder why they can't join a +R channel but they didn't change their nick to Guest*
2020-10-06 15:20:56 +01:00
Sadie Powell d0e8392445 Fix the global/global command showing the wrong origin nick. 2020-10-06 15:13:14 +01:00
Sadie Powell af8056d2dd Simplify the definition of _le64toh in the siphash implementation. 2020-10-06 14:52:55 +01:00
Sadie Powell 4ba871c631 Remove use of the deprecated register keyword.
Fixes a build error on C++17 compilers.
2020-10-02 16:53:13 +01:00
miwob da08dd6d0e Minor spelling fix in operserv.example.conf. it's vs its 2020-10-02 16:52:38 +01:00
miwob 1ac3b38fa8 Update/modernize ircd-hybrid protocol module to stay link compatible with next ircd-hybrid release 2020-10-02 14:53:08 +01:00
Sadie Powell c29b72fcdc Add C++98 and C++14 build matrixes to the Linux CI. 2020-10-02 14:27:04 +01:00
Sadie Powell a3673a5a2d Update the changelogs. 2020-10-01 10:26:20 +01:00
Sadie Powell 5dd5fa4644 Rename unreal4 to unrealircd and inspircd3 to inspircd. 2020-09-28 15:33:16 +01:00
Sadie Powell 9d6dd4af11 Remove the non-tagged version of IRCDMessage::Run. 2020-09-28 15:28:27 +01:00
Sadie Powell f430522b41 Rename things from services to anope. 2020-09-28 15:28:27 +01:00
Sadie Powell 907aa60380 All modern platforms support stdint so remove pstdint. 2020-09-28 15:28:26 +01:00
Sadie Powell c7e26c5f67 Remove nickserv/getpass and Anope::Decrypt.
There is no point having these now plain text passwords are deprecated.
2020-09-28 15:28:26 +01:00
Sadie Powell 8e0e1806a4 Require a secure password hashing algorithm for new accounts.
Insecure algorithms can still be used for existing accounts.
2020-09-28 15:28:26 +01:00
Sadie Powell 7f39fb14f2 Remove operserv/oline and CanSVSO/SendSVSO in IRCDProto.
Now UnrealIRCd 3.2.x support has been removed nothing uses this.
2020-09-28 15:28:26 +01:00
Sadie Powell fb86705d3f Drop support for InspIRCd 1.2, InspIRCd 2.0, and UnrealIRCd 3.2.
None of these are supported by upstream anymore.
2020-09-28 15:28:26 +01:00
Sadie Powell f4fa5b3733 Bump for 2.1.0-git. 2020-09-28 15:28:26 +01:00
Sam James (sam_c) 9701cbcd08 Fix musl build (gettext internals)
__USE_GNU_GETTEXT is exposed by musl because they provide
a GNU gettext-compatible interface. This doesn't mean they
provide all the internals that glibc does.

Check for __GLIBC__ if using internal _nl_msg_cat_cntr.

Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
2020-09-28 13:11:24 +01:00
Sadie Powell 1af02bf2a9 Switch from Travis CI to GitHub Actions.
Closes #153.
2020-09-28 12:47:52 +01:00
Michael bf725aa8dc HostServ: Remove vhost when a nick is dropped 2020-09-28 12:15:48 +01:00
Sadie Powell 52914216f0 Clarify that unreal4 also works for UnrealIRCd 5. 2020-09-14 16:49:25 +01:00
Sadie Powell 8180dd414e Implement support for immutable account identifiers. 2020-09-10 15:15:34 +01:00
miwob ff28985384 Fix -Wclass-memaccess warning:
/anope/src/misc.cpp: In function ‘Anope::string Anope::Resolve(const Anope::string&, int)’:
/anope/src/misc.cpp:742:60: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘union sockaddrs’ from an array of ‘struct sockaddr’ [-Wclass-memaccess]
   memcpy(&addr, addrresult->ai_addr, addrresult->ai_addrlen);
                                                            ^
In file included from /anope/include/users.h:21,
                 from /anope/include/bots.h:12,
                 from /anope/include/regchannel.h:18,
                 from /anope/include/config.h:16,
                 from /anope/src/misc.cpp:16:
/anope/include/sockets.h:27:18: note: ‘union sockaddrs’ declared here
 union CoreExport sockaddrs
                  ^~~~~~~~~
2020-09-10 13:22:42 +01:00
miwob 584a209b28 ircd-hybrid protocol module: add support for channel mode 'K' (no knock) 2020-08-01 13:39:35 +01:00
Matt Schatz c327d1aeef Improve wording of the resetpass:confirm log message. 2020-04-06 09:49:46 +01:00
Matt Schatz 0d0763f72f Fix the handling of topic messages with InspIRCd v3. 2020-03-26 08:24:39 +00:00
Robby 4d101569f8 Update the mailmap. 2020-01-24 11:13:26 +01:00
Robby 8866612160 Update my mailmap entries. 2020-01-24 10:05:39 +01:00
Robby d69b14e54c Fix a typo in the mailmap. 2020-01-24 09:50:29 +01:00
Sadie Powell 505eed9eef InspIRCd: send an oper type of "service" instead of "services".
This fixes a grammar issue with RPL_WHOISOPERATOR where users would
see "ChanServ is a services on NetworkName".
2020-01-21 18:27:29 +00:00
Sadie Powell b188a1c0cd Update my name and email address. 2020-01-20 20:48:22 +00:00
Robby 2c1f8260fd ms_info: Fix a typo in the INFO output when a nickname has been given.
Update the dutch language file.
2020-01-07 04:37:19 +01:00
Robby d319fc6eb5 m_chanstats: Make ChanServ's HELP SET CHANSTATS translatable too. (#253)
Also refresh the language files while at it.
2020-01-07 02:45:30 +01:00
Dragone2 83eea99317 Update for Italian translation (#253). 2020-01-06 16:37:16 +01:00
Dragone2 55a23c7253 Update for Italian translation (#250). 2020-01-04 16:54:44 +01:00
Robby c8699c6726 Update copyright to 2020.
This was done with:
find docs/ include/ language/ modules/ src/ *.* Config -exec sed -i 's/-20.. Anope Team/-2020 Anope Team/i' {} \;
2020-01-04 15:51:20 +01:00
Matt Schatz 95c8478ec5 Fix the handling of kick messages with InspIRCd v3. 2020-01-04 12:40:20 +01:00
Peter Powell cba1313a40 Revert "Fix the length limit for InspIRCd v3 S2S messages."
This is causing build errors for some people and i'm unsure why.

This reverts commit a4ab6876c3.
2019-12-15 12:40:31 +00:00
Peter Powell 96ea61d8b8 Add the <limits> include to the inspircd3 module. 2019-12-15 01:50:31 +00:00
Peter Powell 523f89f45f Enable C++11 features on non-GCC C++11 compilers. 2019-12-14 19:16:44 +00:00
Peter Powell 6617d29b52 Fix a bunch of broken indentation. 2019-12-14 18:38:13 +00:00
Peter Powell a4ab6876c3 Fix the length limit for InspIRCd v3 S2S messages. 2019-12-14 18:06:53 +00:00
Peter Powell ff0109d6ba inspircd3: Refer to modules using without a prefix/suffix. 2019-12-14 17:53:42 +00:00
Matt Schatz 059c78aee3 Fix retrieval of TopicLock status in IRCDMessageMetadata. 2019-11-27 18:21:01 +00:00
Matt Schatz f75c5011e2 Update IRCDMessageMetadata for channel metadata.
- InspIRCd 3 now includes the channel TS in any channel metadata.
This pushes the type and value by one.
- Update the messages sent from this function accordingly.
- Fix retrieval of TopicLock status.
2019-11-27 18:21:01 +00:00
Peter Powell 2832c736dd Fix parsing InspIRCd v3 IJOIN messages.
Thanks to @H7-25 and @genius3000 for reporting this.
2019-11-17 10:23:06 +00:00
Matt Schatz f34ba4b1f0 Add the SSL ExtensibleItem for Users.
Copied this directly from inspircd12.cpp, which
inspircd20.cpp inherited from.
2019-11-12 13:06:32 +00:00
Adam 91dde90ad2 Merge pull request #246 from genius3000/2.0+unconfimed_info
Fix NickServ INFO and GLIST showing an incorrect unconfirmed expiry.
2019-11-11 21:20:55 -05:00
Matt Schatz 661b320d23 Look up unconfirmedexpire from the correct module.
- NickServ INFO and GLIST were looking in the wrong module.
2019-11-11 19:15:54 -07:00
Adam ae7706ae55 Bump for 2.0.8-git 2019-11-02 20:59:02 -04:00
Adam 1dee851207 Release 2.0.7 2019-11-02 20:44:48 -04:00
Adam 9c91d386e4 docs: update Changes 2019-11-02 20:43:18 -04:00
Adam 3e4d87051b inspircd3: remove CoreExport from IRCDMessageKick 2019-11-02 20:24:21 -04:00
Robby 26975fc011 Rename a few instances of 'services' to 'stats' in stats.standalone.example.conf and irc2sql.example.conf. 2019-11-03 00:50:37 +01:00
Adam c15dc49994 ns_recover: add privilege for admins to recover other users 2019-10-14 13:13:08 -04:00
Peter Powell 14ee76a0ad Fix various typos. 2019-09-23 14:48:49 +01:00
Peter Powell 4465c67790 Update the supported InspIRCd versions in the README. 2019-09-23 13:23:02 +01:00
Peter Powell 20e0fa33fc Sort message handlers alphabetically. 2019-09-23 13:23:02 +01:00
Peter Powell 7e76daf39f Add the InspIRCd v3 module to the example configs. 2019-09-23 13:23:02 +01:00
Peter Powell 2ee63f0f68 Handle/send 1205-style PING/PONG messages. 2019-09-23 13:23:02 +01:00
Peter Powell c35029fa2f Parse 1205-style mode lists for CAPAB CHANMODES/USERMODES. 2019-09-23 13:23:02 +01:00
Peter Powell bae8987ec1 Add a handler for the IJOIN command. 2019-09-23 13:23:02 +01:00
Peter Powell 470d4d1a97 Update for the 1205 channel METADATA syntax. 2019-09-23 13:23:02 +01:00
Peter Powell 78bac905c2 Update for the 1205 FJOIN syntax. 2019-09-23 13:23:02 +01:00
Peter Powell d88d8e940e Update for the 1205 KICK syntax. 2019-09-23 13:23:02 +01:00
Peter Powell b2c3775b58 Update for the 1205 INVITE syntax. 2019-09-23 13:23:02 +01:00
Peter Powell b311248bed Update for the 1205 SERVER syntax. 2019-09-23 13:23:02 +01:00
Peter Powell f7f45b4e2b Update for the 1205 FTOPIC syntax. 2019-09-23 13:23:02 +01:00
Peter Powell 3cad3514f1 Remove the TOPIC command handler.
This legacy compat command was removed in the 1205 protocol.
2019-09-23 13:23:02 +01:00
Peter Powell 1020ca47bd Remove the JOIN command handler.
This legacy compat command was removed in the 1205 protocol.
2019-09-23 13:23:02 +01:00
Peter Powell 48dbb70ecc Use the SINFO command instead of the old VERSION command. 2019-09-23 13:23:02 +01:00
Peter Powell ae16206f0c Use NUM instead of PUSH for sending numerics to clients. 2019-09-23 13:23:02 +01:00
Peter Powell 7045f206af Require the 1205 (3.0+) server protocol. 2019-09-23 13:23:02 +01:00
Peter Powell 67bd3e44c0 Remove the dependency on the inspircd12 module. 2019-09-23 13:23:02 +01:00
Peter Powell 264981fb1b Mark inspircd3 as being the InspIRCd 3 module. 2019-09-23 13:23:02 +01:00
Peter Powell 47d471c53d Make a copy of the InspIRCd v2 module for v3. 2019-09-23 13:23:02 +01:00
Peter Powell e43bc49ba7 Update the core message parser to allow parsing IRCv3 message tags. 2019-09-23 13:20:07 +01:00
Robby d9de4ddd82 Insert a new line between the subject and message body when sending mail.
Required for RFC 2822 compliancy.

Reported by jrmu via IRC.
2019-08-24 07:37:35 +02:00
Adam 8f7f4b1593 Merge pull request #244 from clem16/2.0
Fixed stupid simple typos.
2019-08-18 20:37:00 -04:00
Clem Morton fc64c0c6dd Fixed stupid simple typos.
Fixed stupid simple type, changed "bot not both" to "but not both"
2019-08-18 16:46:50 -06:00
Robby 03d065e952 Add hide_status as an available option to nickserv.example.conf.
Also improve the hide_* descriptions slightly.
2019-08-04 23:32:52 +02:00
Peter Powell 77a52eec7c Fix the version binary colliding with the C++20 <version> header. 2019-07-05 12:17:37 +01:00
Robby 523a586176 Fix globops logging if there is no predefined sender. 2019-05-10 05:50:18 +02:00
Robby af32a14fc1 Config files: Fix some typos, bring stats.standalone.example.conf up to par with example.conf, etc. 2019-04-05 03:11:39 +02:00
Romain Rivière 5c8548040a Log channel memo deletions 2019-03-30 22:17:00 -04:00
Adam 6a42c1a4f3 Merge pull request #240 from SaberUK/2.0+bot
Mark pseudoclients as bots on InspIRCd if the bot mode exists.
2019-03-30 22:10:44 -04:00
Peter Powell 0defcda8d0 Reset the default modes on CAPAB START. 2019-03-30 20:09:34 +00:00
Peter Powell f6ee88c42a Mark pseudoclients as bots on InspIRCd if the bot mode exists. 2019-03-30 12:11:31 +00:00
Robby 34f65e3266 Update enc_bcrypt with upstream crypt_blowfish 1.3 changes.
Also reverted the URLs in the header to the original ones provided by upstream.
2019-03-14 16:53:52 +01:00
Robby 02ac3a403c Fix the ChanServ SET SUCCESSOR syntax to show that a nickname is optional. 2019-03-06 03:34:25 +01:00
Adam e1e840a87d Merge pull request #239 from SaberUK/2.0+set
Fix missing braces in cs_set.
2019-03-05 08:10:04 -05:00
Peter Powell eb66f9eda0 Fix missing braces in cs_set. 2019-03-05 11:29:45 +00:00
Robby a4c37a373a Update the dutch language file. 2019-02-28 04:44:37 +01:00
Robby bca9b4ce83 Regenerate the language files. 2019-02-28 03:05:07 +01:00
Robby a2446b8d4b Merge pull request #224 from genius3000/2.0+deoper_superadmin
Ensure SuperAdmin isn't left on when de-opering
2019-02-14 04:41:27 +01:00
Robby e567cfda36 Improve the help text for ChanServ SET SUCCESSOR. 2019-02-14 02:41:57 +01:00
Adam 961a9bc506 Merge pull request #221 from SaberUK/2.0+uplink
Make it more clear where the uplink config goes.
2019-02-09 17:37:41 -05:00
Bram Matthys da6e2730c2 Allow post-handshake SASL in UnrealIRCd 4.2.2 and up.
This updates the unreal4 protocol module to work with both pseudo-id's
and real UID's. Something that will also be necessary once UnrealIRCd
gets rid of pseudo-id's altogether.
2019-02-09 17:10:23 -05:00
Robby 2b8072bf80 Remove a few more unnecessary fuzzies in the language files. 2019-01-24 18:04:23 +01:00
Robby 49cea76841 Remove an unnecessary fuzzy in the french language file. 2019-01-24 17:30:17 +01:00
Robby e1c8aa0dbc Update the language files.
- Regenerated the language files.
- Made some corrections to the french language file.
2019-01-24 15:36:50 +01:00
Adam 2546e865e2 Merge pull request #233 from genius3000/2.0+typofix
Fix typo in CS enforce help reply.
2019-01-21 19:14:10 -05:00
Matt Schatz d6af21e0d9 cs_enforce: fix typo in help. 2019-01-20 21:25:07 -07:00
Dragone2 18522f7fc8 Fixed some misspellings in Italian Translation 2019-01-03 21:46:52 -05:00
Adam 4c167bed69 Merge pull request #223 from SimosNap/webcpanel
Fixed NickServ set access from webcpanel
2019-01-03 21:34:00 -05:00
devel 32a21679fb Fixed NickServ set access from webcpanel 2019-01-03 21:33:02 -05:00
Adam a5eaf6fc49 Merge pull request #225 from genius3000/2.0+away_msg
Handle S2S AWAY messages with a timestamp
2019-01-03 21:30:44 -05:00
k4bek4be 9d7245bded Polish translation reworked and completed. 2019-01-03 21:20:34 -05:00
Adam 02fb4b67cf Merge pull request #228 from SaberUK/2.0+casemap
Send the casemap as part of CAPAB CAPABILITIES on InspIRCd.
2019-01-03 21:10:31 -05:00
linuxdaemon cf44418e10 Allow multiple IP addresses in extforward_ip separated by spaces 2019-01-03 21:07:01 -05:00
Robby 6fbb7cffe9 Update copyright to 2019.
This was done with:
find docs/ include/ language/ modules/ src/ *.* Config -exec sed -i 's/-20.. Anope Team/-2019 Anope Team/i' {} \;
2019-01-01 17:43:35 +01:00
Robby b279863acb Update most URLs to use HTTPS if available, and fix some dead ones too. 2018-11-10 15:15:05 +01:00
BoGu5 9e7dadb967 docs/FAQ: Fixed 1.9 to 2.0 in 2.0 branch 2018-11-10 13:07:35 +01:00
Robby 9069bf4e2f Merge branch 'TheMythPT-patch-2' into 2.0
Update chanstats.example.conf

Missing permissions that otherwise allow any registered user to turn on/off chanstats option to any other user
2018-10-28 16:42:17 +01:00
Vitor e85b0a5f68 Update chanstats.example.conf
Missing permissions that otherwise allow any registered user to turn on/off chanstats option to any other user
2018-10-28 16:35:47 +01:00
Peter Powell 195eff9c04 Send the casemap as part of CAPAB CAPABILITIES on InspIRCd.
This is technically part of the 1205 protocol but it is entirely
backwards compatible so older versions will not be negatively
affected by this.
2018-10-27 19:11:38 +01:00
Robby 42aa330db3 ns_set: Log email address change requests when confirmemailchanges = yes 2018-09-11 01:21:19 +02:00
Matt Schatz 1e9d959857 Handle S2S AWAY messages with a timestamp
InspIRCd 2.0 sends a timestamp in its S2S AWAY message since
https://github.com/inspircd/inspircd/commit/b1002b7df55f1aec5bfce48ecd07d6d326174c95
Syntax of `AWAY <timestamp> :<away msg>`
Catch this message and remove the timestamp parameter before
sending it to the core AWAY handler.
2018-07-20 09:39:47 -06:00
Matt Schatz 38721993f1 Ensure SuperAdmin isn't left on when de-opering 2018-07-14 17:38:37 -06:00
Peter Powell 1b782235c4 Make it more clear where the uplink config goes. 2018-06-19 11:15:13 +01:00
Adam 368300d319 Merge pull request #222 from bonnedav/patch-2
Unreal4 does not allow SWHOIS to come from a user source.
2018-06-12 12:36:19 -04:00
Adam 94e10d52fb anopesmtp: fix previous commit 2018-06-12 10:46:55 -04:00
Adam d25c8c169e Merge pull request #203 from MrGadget1024/patch-1
Fix mail sending for reliability.
2018-06-12 10:39:17 -04:00
Vitor 67b7fed9ed example.conf: update example link block for Unreal 4 2018-06-12 10:36:39 -04:00
Dragone2 e32a8dbbe5 Update Italian translation 2018-06-12 10:29:34 -04:00
Dragone2 281edf8475 cs_seen: fix for translations being ignored
These strings: " but %s mysteriously dematerialized.", ". %s is still online." and ", but %s mysteriously dematerialized." weren't translated by the method Anope::printf().
2018-06-12 10:22:20 -04:00
Adam ce7c266651 Merge pull request #214 from genius3000/2.0+fix_insp20_proto
Fix for bug 1712
2018-06-12 10:16:45 -04:00
Adam c1166e3618 Merge pull request #216 from SaberUK/2.0+oline
Disable the os_oline module by default.
2018-06-12 10:08:16 -04:00
Adam 8294c94b95 Merge pull request #217 from genius3000/2.0+ns_set_message
Show NickServ SET MESSAGE in help when 'useprivmsg' is enabled
2018-06-12 10:07:55 -04:00
Adam 6f09b703dd Merge pull request #218 from miwob/modernize
Update ircd-hybrid protocol module to support latest version of ircd-…
2018-06-12 10:01:27 -04:00
miwob 466e5be741 Update ircd-hybrid protocol module to support latest version of ircd-hybrid better 2018-06-12 08:40:57 -04:00
Adam 32076c099c Merge pull request #219 from genius3000/2.0+set_help_hide
Check for 'hide' flag in commands in (bs,cs,ns)_set HELP
2018-06-12 08:39:24 -04:00
Adam 216b96aa57 Merge pull request #220 from genius3000/2.0+ns_ungroup_log
Log NickServ ungroup
2018-06-12 08:16:35 -04:00
bonnedav 6d592e2a0f Unreal4 does not allow SWHOIS to come from a user source. 2018-06-12 00:00:00 -06:00
Matt Schatz feb5a4d935 Log NickServ ungroup 2018-05-08 16:24:02 -06:00
Robby e03ae0cd85 Update copyright to 2018.
This was done with:
find docs/ include/ language/ modules/ src/ *.* Config -exec sed -i 's/-20.. Anope Team/-2018 Anope Team/i' {} \;
2018-04-25 19:22:13 +02:00
Robby 901fc3e40f Document that negating is possible for commands and privs in opertype blocks. 2018-04-25 18:59:09 +02:00
Robby 5683f45925 Clarify available tokens for the email templates. 2018-04-25 16:32:12 +02:00
Robby bafc17472e Add 'n' email token for use in the emailchange template, this token gets replaced with the display nickname. 2018-04-25 16:15:16 +02:00
genius3000 7638c7a884 Check for 'hide' flag in commands in (bs,cs,ns)_set HELP
This code is duplicated from help.cpp to (bs,cs,ns)_set.cpp for listing
the available SET commands. The check for the 'hide' flag was missed
and this incorrectly listed commands that were configured as hidden.
2018-04-02 04:02:23 -06:00
Adam d25722ddd0 m_httpd: make http headers case insensitive 2018-03-26 20:21:06 -04:00
genius3000 750d1009ec Show NickServ SET MESSAGE in help when 'useprivmsg' is enabled 2018-03-10 15:22:02 -07:00
Peter Powell b8e7960ff6 Disable the os_oline module by default.
This only works on UnrealIRCd 3.2 (which has been EOL for over a
year now) and regularly confuses users who think that "your IRCd
does not support OMODE" is an error they need to fix.
2018-03-03 14:26:33 +00:00
genius3000 ff878bbda8 Allow empty values in InspIRCd 2.0 mode strings within CAPABILITIES
Skipping over empty values in the commasepstream can put the mode adding
logic out of order (eg. ignoring the first two tokens when they are the
needed tokens). Most modes are already added by being explicitly checked
for, but the "unknown" or "extra" modes are added here.
2018-02-13 20:35:37 -07:00
Adam 1baf774647 ns_group: send login on successful group too 2018-02-10 08:36:12 -05:00
Adam 772410d974 Merge pull request #211 from Dragone2/patch-5
Update for Italian translation
2018-02-02 22:48:00 -05:00
Adam 7ceb4426c7 m_dns: fix notify socket always being ipv6 2018-02-02 22:39:46 -05:00
Dragone2 10c7a9ff94 Update for Italian translation
Update for the old Italian translation of Anope, with new translated strings, correction of grammatical errors and other minor changes.
2018-02-03 00:19:21 +01:00
Adam b3c4b28a67 Merge pull request #197 from genius3000/2.0+fix_insp_rlines
2.0: Fix sending incorrect RLines to InspIRCd
2018-01-12 12:09:50 -05:00
nekoswag 0da4150283 Update chanserv.example.conf (#206) 2017-12-30 15:32:22 -05:00
Chris Langsenkamp 5920f1b59c Fix mail sending for reliability.
After sending the "\r\n.\r\n" after the mail payload, smtp_send_email was not waiting for the mail server to complete post-processing and respond with "250", but was sending "QUIT\r\n" immediately and dropping the connection.  Mail server may kill the transaction if it can't send the "250" (socket closed).  The changes proposed completes the mail transaction by reading for the 250 and in smtp_disconnect steps through a proper quit sequence by waiting for the 221 server response.

I discovered this by including the --debug option in services.conf sendmailpath, which invoked logging in smtp_send and that slowed it down enough for the mail server to return the 250 and complete the transaction.
2017-12-11 12:41:31 -05:00
Adam 68fcb1af93 Bump for 2.0.7-git 2017-12-11 11:47:06 -05:00
Adam 0574de2d22 Anope 2.0.6 Release 2017-12-11 11:46:10 -05:00
Adam c9c53dbe61 Add README.md, for github 2017-11-19 17:28:05 -05:00
Adam a084245822 README: remove some outdated links 2017-11-19 17:28:05 -05:00
Robby 77e3f062da Update the dutch language file. 2017-11-17 23:56:15 +01:00
genius3000 0e14adcb0f Fix sending incorrect RLines to InspIRCd
Currently a Regex AKILL is sent with a malformed mask to InspIRCd as an RLine.
InspIRCd expects a mask of 'n!u@h\sr', so we need to remove the enclosing
slashes (/.../), change the '#' separator to '\s', and change any literal
spaces to '\s' and then it creates a proper RLine.
2017-10-14 08:36:35 -06:00
Adam 8bb3067e42 Update Changes and Changes.conf 2017-10-12 19:58:02 -04:00
Adam 0c469abe4a Call OnDelChan prior to unsetting extensibles
cs_set uses this to set -P on permanent channels if they are persistent.

Also move similar event in nickcore/nickalias destruction
2017-10-12 19:37:06 -04:00
Adam d63e32a579 No longer try to create persistent channels on the fly
Change initial channel creation to on post init so it will be part of
the burst.
2017-10-12 19:30:48 -04:00
Adam f13c450b93 Add post init event 2017-10-12 19:28:34 -04:00
Adam e95c07291a unreal4: send sjoin with empty users in SendChannel 2017-10-12 19:28:12 -04:00
Adam 2963fc0a1d unreal4: send modes in sjoin 2017-10-12 19:27:51 -04:00
Adam 5d309d46e1 plexus: fix overriding SendSVSLogin 2017-10-10 21:19:23 -04:00
Adam 2e7fcd3098 Merge pull request #199 from syzop/2.0+unrealsaslmechs
Advertise SASL mechanisms to UnrealIRCd servers.
2017-10-09 11:29:55 -04:00
Adam 884759aed4 Merge pull request #200 from syzop/2.0+saslbydefault
Load sasl module by default.
2017-10-09 11:23:09 -04:00
Bram Matthys 2ec65023a6 Load sasl module by default. 2017-10-09 10:31:21 +02:00
Bram Matthys 0093f3fa44 Advertise SASL mechanisms to UnrealIRCd servers. 2017-10-09 10:22:50 +02:00
Adam 2ad76278dd Use full path to file for conf.cpp file could not be opened error message 2017-08-05 18:31:57 -04:00
Tim Gunter 23e59d9f2c Allow calls to XMLRPC to impersonate supplied user, if online 2017-07-28 09:08:40 -04:00
Adam 3cb9e0b97c m_xmlrpc: fix incorrect string find usage 2017-07-24 20:30:34 -04:00
Adam 0b7b6d9d6d ns_group: don't require a user to group 2017-07-24 10:04:07 -04:00
Adam 56e6efbe8f Default require_oper to true. Fixes os_oper unserializer because it doesn't set it. 2017-07-02 18:03:36 -04:00
Adam feed624cdc webcpanel: rate limit login attempts 2017-06-05 18:44:48 -04:00
Adam 1a6f42b994 webcpanel: escape values in template_fileserver
Remove other escapes to prevent double escape.

Not all replaced values were escaped, such as replies from commands.
2017-06-05 10:11:22 -04:00
Adam 04f49225c9 httputils: escape ampersand too 2017-06-05 10:10:58 -04:00
Adam b18d1a69b6 Merge pull request #174 from Techman-/2.0+inspsasl
InspIRCd: Send CHGIDENT/CHGHOST on SVSLOGIN
2017-05-27 12:29:12 -04:00
Adam 0ace685597 Merge pull request #188 from key2peace/2.0
IPv6 support for m_dnsbl and sockaddrs::reverse()
2017-05-27 09:58:34 -04:00
Alexander Maassen bfcfd0b727 Moved m_dns's reverse ip method to sockaddrs::reverse().
Updated m_dnsbl to support ipv6.
2017-05-27 09:56:18 -04:00
Adam 087f1cb359 m_dnsbl: fix exempts, allow cidrs, default exempt 127.0.0.0/8 2017-05-17 08:51:57 -04:00
Adam 010d20198e m_regex_posix: use REG_ICASE 2017-03-30 19:10:31 -04:00
Adam 953e804231 example.conf: disable regexengine directive by default 2017-03-30 17:02:36 -04:00
Adam c656fe0694 regchannel: fix compile warning from previous commit 2017-03-27 22:25:49 -04:00
Adam fb3ec7a897 cs_akick: don't show channel doesn't exist message in enforce from adding akicks 2017-03-27 21:41:35 -04:00
Adam 274658f955 Fix autokick destructor to properly remove channel references from accounts 2017-03-27 21:14:32 -04:00
Adam 7621306f4b example.conf: update to reflect deprecated status of older encryption modules 2017-03-26 18:34:03 -04:00
Adam b804867105 Remove weird warning in nickserv help which for some reason assumes admins' abuse policies 2017-03-23 20:05:09 -04:00
Adam f8f1550c31 Merge pull request #187 from miwob/new-mode
Add channel mode 'u', and 'L' to hybrid protocol module; Remove usele…
2017-03-19 18:56:06 -04:00
Adam 0fcc66711b m_sasl: pass module to logger 2017-03-19 18:55:32 -04:00
Adam 8d9574e306 readme: change minimum supported hybrid version to 8.2 2017-03-19 18:55:19 -04:00
miwob 6cb17c734c Add channel mode 'u', and 'L' to hybrid protocol module; Remove useless CAPABs that are mandatory for some years now. 2017-03-19 12:02:22 +01:00
Adam 3545e8e383 Fix ns_keep_modes default option in nickserv.conf 2017-03-18 15:30:17 -04:00
Adam 3c18e02b0b logger.cpp: fix variable shadow warning 2017-03-16 21:37:34 -04:00
Adam b831cd8a36 Include ip for web clients in command log messages for source 2017-03-16 20:23:57 -04:00
Adam 516ab164f6 redis: check for socket errors when loading database on startup 2017-03-16 20:13:56 -04:00
Adam b2d028533d cs_xop: fix showing alternative access methods in help 2017-03-15 21:44:05 -04:00
Adam a88d9cb1f0 modes.cpp: correct usage of format string passed to SendMode 2017-03-08 19:58:25 -05:00
Adam b57ef5d2c7 db_redis: don't crash if destroying an object with no type 2017-03-08 16:23:30 -05:00
Adam 1a96390826 unreal4: set +xt on chghost as unreal does 2017-03-01 17:44:05 -05:00
Adam 60339edf40 cs_set: don't lower ts from own clients joining 2017-02-21 14:44:33 -05:00
Adam 6990c692d6 Unwrap list modes too in cs_mode, and fix clear on virtual modes to show an error 2017-02-21 12:36:59 -05:00
Adam 98e62b4032 Fix logging in cs_mode set 2017-02-21 12:35:51 -05:00
Adam a1d7d42d6a Unwrap mode changes in RemoveMode before checking if it is set, fixes os_mode not being able to remove extbans etc 2017-02-21 12:35:20 -05:00
Adam 3f7c0829ef os_forbid: match forbids exact on add/del 2017-02-21 09:59:10 -05:00
Adam 46d8af781d Verify configured servername and uplink password are valid 2017-02-21 08:19:03 -05:00
Adam 67b7c8bd7d os_logsearch: fix quick match 2017-02-12 16:46:13 -05:00
Adam 21486e2c81 Merge pull request #185 from fallen/2.0
Update French language file
2017-02-06 14:20:40 -05:00
Adam 29ac40b584 ns_set_misc/cs_set_misc: send syntax help too 2017-02-06 14:06:55 -05:00
Adam dde444ed0e protocol/inspircd12: set +x on /hs off 2017-02-06 13:15:01 -05:00
Adam 9b6c209c80 bs_badwords: allow opers with botserv/administration to list/clear badwords too 2017-02-04 20:21:40 -05:00
Yann Sionneau 3c7d67c8cd Update French language file
- translate "nick" to "pseudo"
- remove "XOP" arg from set secureops
2017-02-04 23:47:05 +01:00
Adam c730291762 logger: some log events rely on empty sources 2017-01-23 08:03:51 -05:00
Adam c593661f40 Anope 2.0.6-git 2017-01-22 17:04:20 -05:00
Adam a9bf251886 Anope 2.0.5 Release 2017-01-22 16:09:36 -05:00
Adam beac29b1d0 m_sasl: don't allow logging into unconfirmed accounts 2017-01-22 16:00:06 -05:00
Adam 35d6437d45 Remove old language strings from lang files 2017-01-20 09:45:25 -05:00
Robby 76ce8ece1a Cleanup some excess whitespaces and tabs, and fix a few typos along the way. 2017-01-17 05:03:25 +01:00
Adam 464093d36e Regenerate language files 2017-01-16 18:59:30 -05:00
Adam 71bb3fefcc Update Changes 2017-01-16 18:58:30 -05:00
Adam 1f6f9f5dbb Revert "Remove efnetrbl from example dnsbl configuration" 2017-01-16 18:45:08 -05:00
Adam 34bf21f7d1 Correct a couple expiry time checks from DoTime() 2017-01-16 18:42:29 -05:00
Adam 847dfd9523 Merge pull request #182 from genius3000/2.0+protocol_match_name
protocol/inspircd: Match servername as well on ENCAP
2017-01-16 18:33:09 -05:00
Adam a96e40e249 Merge pull request #183 from SaberUK/2.0+cmake
Don't give misleading instructions when running CMake fails.
2017-01-16 18:32:34 -05:00
Robby 8656b65e39 Update copyright to 2017.
This was done with:
find docs/ include/ language/ modules/ src/ *.* Config -exec sed -i 's/-20.. Anope Team/-2017 Anope Team/i' {} \;

Added missing copyright headers to files that didn't have it yet.
2017-01-16 03:13:25 +01:00
Robby 39422beaef Update the dutch language file. 2017-01-14 02:57:44 +01:00
Peter Powell 6d29538346 Don't give misleading instructions when running CMake fails. 2017-01-13 22:02:00 +00:00
Adam bdf4650ff8 m_dnsbl: widen allowed reply range to 127.0.0.0/8 2017-01-12 13:26:29 -05:00
Adam 074bde5ccc db_sql: run table creation queries during import synchronously too 2017-01-11 20:44:55 -05:00
Adam a4f7d847ab unreal4: use SENDUMODE instead of GLOBOPS 2017-01-11 20:42:20 -05:00
Adam 5beb338247 Remove efnetrbl from example dnsbl configuration 2017-01-08 15:48:54 -05:00
Adam 7b1154de69 ns_register: notify users of unconfirmed accounts on register when there is no user too 2017-01-08 13:08:04 -05:00
Adam 46aeb8b70b os_list: show number of channels listed, too 2017-01-07 18:09:14 -05:00
Adam fe6271dffb ngircd: move metadata non-exietent user log message to debug 2017-01-07 18:04:07 -05:00
Adam 7cede5bb60 os_list: also allow patterns in nick!user@host#realname form 2017-01-07 18:03:53 -05:00
Adam 2b7f0084b7 Move log messages for status mode change for unknown user to debug 2016-12-22 20:59:04 -05:00
Adam ec7ce09ef4 Make User::Mask behave more like 1.8 2016-12-22 20:52:43 -05:00
Adam 574c8dfbc7 Fix previous commit, deleting sessions removes it from the map which invalidates the reference 2016-12-21 10:35:57 -05:00
Adam 4381031994 m_sasl: log hostname/ip, if provided 2016-12-19 19:03:10 -05:00
Adam b3010c3c6b logger: log source nick if there is no user or account 2016-12-15 08:24:40 -05:00
Adam d092f5e7c8 Fix detecting if chghost/chgident is loaded on inspircd and don't send them unless they are 2016-12-11 09:43:22 -05:00
Adam 358f46b8ae Fix setting kill quick in webcpanel 2016-12-11 09:34:37 -05:00
Adam e5125c2c84 Allow nonconfirmed opers to confirm accounts 2016-12-11 09:24:52 -05:00
Adam 65db59b3ec Remove unnecessary functions from ngircd that duplicate the default behavior, fix a few typos in comments 2016-12-10 23:28:50 -05:00
Adam 95cd7a6aee inspircd12: fix mode handler to handle opers changing other users umodes correctly 2016-12-01 19:10:46 -05:00
Adam 12515fd2c1 cs_access: fix typo 2016-12-01 19:08:39 -05:00
Adam 437a6dbb29 os_logsearch: optimize non wildcard searches, allow regex 2016-11-22 19:44:25 -05:00
Adam d96ca9b824 os_logsearch: add a hard max limit and make the limiter smarter 2016-11-22 19:35:11 -05:00
genius3000 aefde6e44d protocol/inspircd: Match servername as well on ENCAP 2016-11-22 02:26:41 -07:00
Adam 23a0628fba db_old: convert languages to UTF-8 encoded version 2016-11-11 13:30:22 -05:00
Adam ef9c69f99d Don't apply secureops to users with chanserv/administration privilege, not protected 2016-11-05 12:06:26 -04:00
Adam 8be331618c ns_group: allow userless execution 2016-11-05 11:07:02 -04:00
Adam a5fdf7c546 irc2sql: fix changing status modes to update ison modes 2016-11-05 10:36:28 -04:00
Adam dba19d839a cs_access: fix negative access to apply to the -1/0 special casing 2016-11-05 10:35:47 -04:00
Adam 7453c71c00 irc2sql: fix crash on shutdown with no sql 2016-11-05 10:34:25 -04:00
Adam f09ea316dd irc2sql: update max topic len to 512 2016-11-05 10:34:09 -04:00
Adam ac0f3c5ccf m_mysql: null empty columns instead of setting to '' 2016-11-04 22:56:15 -04:00
Adam 76ea111980 irc2sql: fix a couple SQL errors 2016-11-04 22:07:00 -04:00
Adam 9f9183afc4 help: always use command name from config, which may be a different case 2016-11-03 23:23:57 -04:00
Adam ef32505633 dns: set error to REFUSED when there are no answers 2016-11-03 23:15:07 -04:00
Adam 304494322f Don't apply secureops to protected users 2016-11-03 23:08:49 -04:00
Adam 9e510cd0d9 Fix userless /ns set email, #1689 2016-11-03 23:04:22 -04:00
Adam 0f49d1051a Don't try to include files with empty paths 2016-11-03 22:58:50 -04:00
Adam 4b97a9b13f Fix crash loading enc_old prior to the proto mods 2016-11-03 22:54:35 -04:00
Adam 07f72a3122 os_list: fix regex matching 2016-10-25 14:35:36 -04:00
Adam f4543edfe2 plexus: add noop and sasl support 2016-10-16 18:52:40 -04:00
Adam 095751363d db_sql: don't update objects pending creation as it duplicates it 2016-10-16 18:51:58 -04:00
Adam 1b67b97e93 ns_maxemail: equals_ci for comparing emails 2016-10-06 14:59:22 -04:00
Adam d4bf0957d1 inspircd20: specifially add channel modes official-join and operprefix as status modes, sometimes they are sent in CAPAB without a status prefix which causes them to be added as parameter modes 2016-10-04 21:45:45 -04:00
Adam 99acdcf168 cs_mode: check chanserv privilege too for status modes on set 2016-10-04 21:28:43 -04:00
Adam e95950ee26 cs_mode: make override logging of mode set more reliable 2016-10-04 21:13:43 -04:00
Adam fc0171fb40 memoserv: always use display for memo source 2016-09-30 21:03:35 -04:00
Adam 1c82697ccb Revert "Always use display for memo source"
This reverts commit d8a945b1a6.
2016-09-30 20:52:38 -04:00
AlphaTech f3bb46a9f5 MemoServ - Read All 2016-09-25 17:27:30 -04:00
Michael Hazell 3b62c8f3e2 InspIRCd: Send CHGIDENT/CHGHOST on SVSLOGIN 2016-09-25 14:50:03 -04:00
Adam 4d054aa2b2 Merge pull request #173 from genius3000/2.0-remove-expiretimeout-cs_seen
Thanks
2016-09-25 14:38:16 -04:00
Adam 3a8ff5d456 Merge pull request #177 from attilamolnar/2.0+sqliteleak
m_sqlite: Fix possible memory leak when opening a database fails
2016-09-25 14:37:01 -04:00
Adam 0b783b66a4 Merge pull request #178 from Techman-/2.0+resv
Thanks
2016-09-25 14:36:46 -04:00
Adam 0c7050c506 Merge pull request #175 from genius3000/2.0-email-date_header
Added a Date field to the Header
2016-09-25 14:35:43 -04:00
Adam d02b3c1c45 Merge pull request #176 from Alef-Burzmali/2.0+update-fr2
Thanks
2016-09-25 14:33:49 -04:00
Adam d8a945b1a6 Always use display for memo source 2016-09-14 17:24:06 -04:00
Adam b50fbec705 cs_seen: allow unregistered users to use 2016-09-13 12:36:48 -04:00
Adam d488efdcfe ms_cancel: cleanup, consider accounts by equiality instead of sender name to account name 2016-09-06 14:46:19 -04:00
Adam 13c5eec00a m_ssl_openssl: allow certificate chain files to be used 2016-09-05 10:41:52 -04:00
Michael Hazell 39eb9f8cfc ratbox: fix RESVs
Also, enable channel support because it wasn't specified already and point charybdis to these methods instead.
2016-09-04 04:05:11 -04:00
Thomas Fargeix 83c2f8e970 Update French language file. 2016-08-19 21:33:57 +02:00
genius3000 e23cf0c221 Added a Date field to the Header 2016-08-17 10:22:44 -06:00
Attila Molnar de174149f7 m_sqlite: Fix possible memory leak when opening a database fails 2016-08-17 14:09:05 +02:00
genius3000 663e79e4d3 Remove 'expiretimeout' from chanserv.example.conf
As seen within this commit: https://github.com/anope/anope/commit/22658d63bdb1e52a66f4514af45fa55ca5891345
'expiretimeout' is no longer set within cs_seen and I can't see it used elsewhere to be needed in the config.
2016-08-08 23:39:19 -06:00
Adam 2a5e7827bd Merge pull request #172 from bonnedav/patch-1
Thanks
2016-08-08 09:34:14 -04:00
bonnedav 9c0b843665 Remove unused commands from oper config. 2016-08-08 02:41:42 -06:00
Adam 8fdfa6e094 Fix #1684 more, can have non-user sources for encap sasl 2016-07-25 22:27:30 -04:00
Adam dad4be050b cs_xop: remove unused code 2016-07-25 19:35:19 -04:00
Adam 937b0e7185 db_old: fix warnings 2016-07-25 19:34:59 -04:00
Adam db4f38bcf5 Bump for 2.0.5-git 2016-07-23 17:37:05 -04:00
Adam c2e09fdaea Anope 2.0.4 Release 2016-07-23 16:26:14 -04:00
Adam 01768bc73e Update Changes.conf 2016-07-23 16:25:37 -04:00
Adam c18eedec18 ns_set: clear last modes before unserializing them 2016-07-23 16:20:54 -04:00
Adam 0e0615c6fe Note Windows installer fixes in changelog 2016-07-23 16:17:33 -04:00
Adam 5bd3fde79b cs_set: clear last modes before unserializing them 2016-07-23 16:17:21 -04:00
Adam 647f8cd4e6 Add/fix various checks on source user existing in the protocol modules 2016-07-23 15:47:33 -04:00
Adam b2e25db159 Merge pull request #171 from Techman-/2.0+charybdis-resv-fixes
charybdis.cpp: Properly support RESVs
2016-07-23 15:38:26 -04:00
Adam 9f9371531d Fix making directories from the Windows installer 2016-07-23 15:22:54 -04:00
Michael Hazell b578ed2544 charybdis.cpp: Properly support RESVs
Properly support RESV and UNRESV in Charybdis, and improve RESV setting for pseudoclients when bursting.
2016-07-21 23:27:20 -04:00
Adam 0a7f167060 m_dns: accept unpacking the root domain, and don't consider exceptions from nameserver/additional record unpacking as fatal to query parsing 2016-07-19 21:17:58 -04:00
Adam d427772bd3 os_defcon: find module by name, it might not be loaded yet 2016-07-10 20:51:03 -04:00
Robby b2d670298b Update the dutch language file. 2016-07-07 16:07:24 +02:00
Adam 6b646fa1f8 Update Changes 2016-07-03 13:57:11 -04:00
Adam 72269c44e5 Merge pull request #170 from Zoddo/charybdis/join0
Thanks
2016-07-03 13:47:49 -04:00
Adam 3b2366e4ba Merge pull request #169 from SaberUK/2.0+which
Use "cmake --version" instead of "which cmake" to detect CMake.
2016-07-03 13:46:41 -04:00
Adam 257a8a9a24 ns_maxemail: optionally remove gmail aliases 2016-07-03 13:42:18 -04:00
Adam 7a1d2e11dd chankill: don't add duplicate akills 2016-07-03 13:31:12 -04:00
Adam 8dc687b657 #1682: store aftype with masks and include cidrs in GetNUHMask 2016-07-03 13:29:27 -04:00
Adam 18fc113984 #1681 update last realname always on signon 2016-07-03 13:06:06 -04:00
Adam 20c1a5d638 #1680: fix Anope::Duration with one year durations 2016-07-03 12:42:16 -04:00
Adam 8000ae0c0f #1677 apply sqlines even if the ircd doesn't on non opers 2016-07-03 12:36:34 -04:00
Adam 284d95bfe2 #1675: fix saset display to update the account name on the correct clients 2016-07-03 12:27:01 -04:00
Adam c7d5ee4bec Fix /ns confirm to set +r/accounts when appropriate 2016-07-03 12:17:44 -04:00
Adam 4c4cc0ded7 Fix xmlrpc notice call to return something to prevent m_xmlrpc from thinking it is a http 404 2016-07-03 12:08:21 -04:00
Adam 83f89bfece Clarify botserv repeat kicker message and allow setting repeat times to 1 2016-06-25 13:04:32 -04:00
Adam 7cf4245359 Enable -fno-delete-null-pointer-checks on GCC 6 2016-06-22 20:20:28 -04:00
Zoddo 9284441491 Handle /join 0 for ratbox & charybdis 2016-06-02 12:23:26 +02:00
Peter Powell 7592a6981b Use "cmake --version" instead of "which cmake" to detect CMake. 2016-05-21 17:54:33 +01:00
Adam 56b158ea43 Fix handling nick introduction collisions on unreal4 2016-05-20 21:18:34 -04:00
Adam 0143dafe51 Merge pull request #165 from sketchni/patch-1
Add the notice method to XMLRPC.
2016-04-22 10:17:41 -05:00
Adam a2dbcc620e Merge pull request #166 from jmdh/2.0-reproducible
Optionally strip variable build date from compiled program
2016-04-22 10:17:11 -05:00
Adam 9b5fdea8f2 Fix randomnews to work when there are more than newscount random news 2016-04-22 11:15:42 -04:00
Dominic Hargreaves fab07d6b75 Optionally strip variable build date from compiled program
To aid build reproducibility, don't include the build date/time if
-DREPRODUCIBLE_BUILD is defined.

Based on the patch provided by Alexis Bienvenüe in the Debian report.

Bug-Debian: https://bugs.debian.org/820152
Patch-Name: reproducible_datetime.diff
2016-04-21 23:08:12 +01:00
Sketch 1d198da436 Add the notice method to XMLRPC. 2016-04-20 15:41:23 +01:00
Adam 8b6e17fe7e Change access check in cs_updown to not allow actions on users with equal access 2016-04-16 18:14:23 -04:00
Adam 86484b6c2b Merge pull request #164 from SaberUK/2.0+extras
Remove references to cmake-bin which was removed ages ago.
2016-04-16 16:59:21 -05:00
Adam c14ae99d32 Merge pull request #163 from Zoddo/fix_sasl_reauth
Send new account name to the IRCd on SASL reauth
2016-04-16 16:59:00 -05:00
Adam cb0cda2f8d Missed channel deletion in ~ChannelInfo 2016-04-16 18:00:47 -04:00
Peter Powell 2af363755a Remove references to cmake-bin which was removed ages ago. 2016-04-16 13:05:44 +01:00
Zoddo 753b8dc989 Send new account name to the IRCd on SASL reauth 2016-04-15 10:49:30 +02:00
Adam d2ea1e7917 Merge pull request #160 from Zoddo/charybdis/fix_euid
Fix host on charybdis if there is no vhost
2016-04-14 19:18:14 -05:00
Adam a8f66578b1 Merge pull request #161 from Zoddo/charybdis/vhost_svslogin
Send vident/vhost in SVSLOGIN with SASL
2016-04-14 19:17:39 -05:00
Adam ca39aeb554 Merge pull request #162 from SaberUK/2.0+sasl
Remove support for DH-AES and DH-BLOWFISH.
2016-04-14 19:16:56 -05:00
Adam a941f9bde0 Remove memos from memoinfo more reliably 2016-04-14 20:15:53 -04:00
Peter Powell f4f6787c9c Remove support for DH-AES and DH-BLOWFISH.
These SASL mechanisms are considered insecure and should not be
used anymore.
2016-04-13 20:26:50 +01:00
Zoddo 82816cb206 Send vident/vhost in SVSLOGIN with SASL
Only charybdis seems to support that for the moment.
2016-04-10 18:24:25 +02:00
Zoddo 58f0c8c612 Fix host on charybdis if there is no vhost 2016-04-10 17:53:53 +02:00
Adam 21e1913c0f Fix subtle typo in command initializer list 2016-04-05 16:01:16 -04:00
Adam 79e7c3f98a Also defer channel deletion when processing sjoins 2016-03-19 16:21:40 -04:00
Adam 72127e1b00 Merge pull request #159 from Diftraku/2.0
proto/charybdis: Add support for MECHLIST
2016-03-17 17:15:56 -05:00
Toni Kaija ed47588087 proto/charybdis: Add support for MECHLIST 2016-03-17 15:13:11 +02:00
Adam 448967cefc Merge pull request #156 from SaberUK/2.0+sasl-mechlist
Implement support for SASL 3.2 mechanism lists.
2016-03-15 17:41:48 -05:00
Adam 979027138b Merge pull request #155 from SaberUK/2.0+sasl-reauth
Fix logging into accounts with SASL on servers that support reauth.
2016-03-15 17:40:26 -05:00
Robby 176e0e4f37 Update the dutch language file. 2016-03-09 22:42:45 +01:00
Adam b431d4dccf cs_clone: don't clone registered time 2016-03-08 19:49:30 -05:00
Adam 1b12b80b48 language: incrementing _nl_msg_cat_cntr is still required on some systems apparently (freebsd 10?). I don't know why. 2016-03-08 19:47:06 -05:00
Peter Powell 52fdc45597 Implement support for SASL 3.2 mechanism lists. 2016-02-28 16:36:43 +00:00
Peter Powell 91762524e2 Fix logging into accounts with SASL on servers that support reauth. 2016-02-28 13:22:19 +00:00
Adam 413b38b1c1 Fail sasl external auth immediately if cert is empty 2016-02-13 18:25:04 -05:00
Adam ecdccd6ad6 And use account here, user might be null 2016-02-13 18:19:47 -05:00
Adam e0fd118b3e Fix access path changes in ns_alist from earlier 2016-02-13 18:11:03 -05:00
Adam c10d7bdada Update chanserv secure help to reflect more accurately what it does 2016-02-13 14:41:23 -05:00
Adam 4e2ca31cf5 Rewrite access path system to be simplier and use recursion
Show where access is "from" in chanserv/status
2016-02-13 14:16:29 -05:00
Adam addd2a1987 Correct umode +I change in Changelog, is for unreal 2016-02-11 08:36:12 -05:00
Adam 4071487f80 Merge pull request #154 from SaberUK/2.0+inspfix
Fix a low risk privilege escalation exploit on InspIRCd with m_autoop.
2016-02-11 07:03:55 -06:00
Peter Powell 9c17c2d818 Fix a privilege escalation exploit on InspIRCd with m_autoop. 2016-02-10 08:56:23 +00:00
Adam dd9fcca45d Anope 2.0.4-git 2016-01-30 18:50:28 -05:00
Adam d9c0a13caf Anope 2.0.3 Release 2016-01-30 17:27:31 -05:00
Robby 5daa84c7f9 Update the dutch language file. 2016-01-30 23:26:32 +01:00
Adam b12669487f Allow /ms read to get a comma separated list of memo numbers as help describes. Show message if no memos could be displayed. 2016-01-30 16:54:20 -05:00
Robby 0e9a1e87d0 The default xop access for PROTECTME should really be SOP, not AOP. 2016-01-29 19:42:10 +01:00
Robby f118960a25 Update copyright to 2016. This was done with:
find include/ src/ lang/ docs/ modules/ *.* Config -exec sed -i 's/-20.. Anope Team/-2014 Anope Team/i' {} \;

Added missing copyright headers to files that didn't have it yet.
Fixed some whitespace and blank lines along the way.
2016-01-28 20:24:49 +01:00
Adam 5d6a71b6d2 Regenerate language files 2016-01-28 08:15:38 -05:00
Adam 23fab4ad06 Revert "Regenerate language files"
This reverts commit e955db6e85.
2016-01-28 08:15:24 -05:00
Adam 825dc5be46 Revert "Updated and fixed the Greek language."
This reverts commit f451c6cbac.
2016-01-28 08:14:58 -05:00
Robby b6fb6410c0 Update the dutch language file. 2016-01-27 19:14:12 +01:00
Robby 45dfea5ad9 Document m_xmlrpc_main opers 2016-01-27 18:04:55 +01:00
Adam d0a5316c67 Remove default session exception expiry time 2016-01-25 11:51:31 -05:00
Adam 382ab84938 Merge pull request #150 from westor7/patch-1
Updated and fixed the Greek language.
2016-01-25 10:31:47 -06:00
westor f451c6cbac Updated and fixed the Greek language.
Updated and fixed all the non-fuzzy languages items, previously all of them was incorrect.
Added new credits.
2016-01-24 17:20:00 +02:00
Adam 9645f53dc8 Update m_ssl_gnutls Windows library version to libgnutls-30 2016-01-23 22:25:19 -05:00
Adam 41802c28c6 Fix m_sql_oper to compile from the cleanup of the other day 2016-01-23 20:45:10 -05:00
Adam 97a13081e9 Fix typo in changes 2016-01-23 20:44:50 -05:00
Adam 38fcf15d62 Put maxlogins logic a few other important places 2016-01-23 10:53:32 -05:00
Adam 75dd784538 Fix hybrid to compile 2016-01-23 10:53:22 -05:00
Adam e955db6e85 Regenerate language files 2016-01-23 10:37:23 -05:00
Adam a434651e75 Update Changelogs 2016-01-23 10:36:04 -05:00
Adam 7d674726c2 Merge pull request #145 from miwob/style+copyright
Style+copyright
2016-01-23 09:19:08 -06:00
Adam be50211ae6 Merge pull request #149 from miwob/SendSQLine
Update SendSQLine() in hybrid's protocol module to use non-capsulatet…
2016-01-23 09:18:41 -06:00
Adam faa8f57bb2 Merge pull request #148 from SaberUK/2.0+18mod
Error out if any 1.8 modules are in the the module directory.
2016-01-23 09:18:32 -06:00
Adam 8cf21191fb Merge pull request #147 from miwob/temporary_xline
Update SendSGLine() in hybrid's protocol module to add support for te…
2016-01-23 09:18:12 -06:00
Adam ae847bcaf0 Merge pull request #144 from miwob/chankill_example
example.conf: announce operserv/chankill as well
2016-01-23 09:17:56 -06:00
Adam c4bbef0af8 Merge pull request #143 from staticfox/grammar
hs_group: Fix grammar
2016-01-23 09:17:44 -06:00
Adam 7953274a88 Re-lookup access in webcpanel after deleting access as the old group might be invalid 2016-01-23 10:15:01 -05:00
Adam d8eb3d4937 Apply regex sqlines on connect too 2016-01-23 08:58:08 -05:00
Adam f91f375b70 Show akill/xline ids in view 2016-01-22 10:29:44 -05:00
Adam eac25d016a Include memo mail information in ms_info 2016-01-22 10:13:05 -05:00
miwob 2356a1caab Update SendSQLine() in hybrid's protocol module to use non-capsulatet RESV message 2016-01-20 19:18:52 +01:00
Adam 164b349ef9 Fix various inconsistencies/crashes related to having multiple opers configured for the same user through combinations of os_oper/config/m_sql_oper 2016-01-19 16:25:02 -05:00
Peter Powell 2e370f6ed5 Error out if any 1.8 modules are in the the module directory. 2016-01-19 21:07:34 +00:00
miwob 9d30e1d63f Update SendSGLine() in hybrid's protocol module to add support for temporary x-lines 2016-01-19 20:07:45 +01:00
Adam 4771af1cb8 Couple user find by nick fixes 2016-01-19 08:30:35 -05:00
Adam 9c9df2ad1f Document ns_no_expire nick default 2016-01-19 08:30:06 -05:00
miwob 7f418a58da hybrid.cpp: clean up style to match with other code; update copyright header 2016-01-13 16:23:22 +01:00
miwob 510045858f example.conf: announce operserv/chankill as well 2016-01-12 20:00:08 +01:00
Matt Ullman d270910ace hs_group: Fix grammar 2016-01-12 09:31:58 -05:00
Adam 10aeba2da2 Merge pull request #142 from Zoddo/unreal4/uid
[Unreal4] Use UID/SID instead of nick/servername when possible
2016-01-03 11:36:03 -06:00
Zoddo 4e675c50e5 [Unreal4] Use UID/SID instead of nick/servername when possible 2016-01-03 16:31:45 +01:00
Adam 0a37576270 Actually there is no account here 2016-01-02 17:19:08 -05:00
Adam 8f6f2a2c47 Add sasl log category for auth log messages 2016-01-02 17:15:26 -05:00
Adam 36a465473e Add IRCDMESSAGE_SOFT_LIMIT to MD handler 2016-01-02 16:38:25 -05:00
Adam 23a0ecd0c4 unreal4: add md handler, certfp support 2015-12-30 16:11:41 -05:00
Adam 601af1b0eb Unreal 4 changes 2015-12-30 12:42:12 -05:00
Adam fb2aae1b17 Copy unreal -> unreal4 2015-12-30 12:42:03 -05:00
Adam ac984af11a Move CanAdd() check to after mask sanitization as it will remove other entries that are considered "covered by" the new mask 2015-12-29 14:04:45 -05:00
Adam d6cbd64621 Remove run-cc leftover 2015-12-29 14:04:04 -05:00
Adam e6bdc5dddd Merge pull request #141 from miwob/2.0+cmode_T_nonotice
Add support for channel mode +T to the ircd-hybrid protocol module
2015-12-29 12:57:09 -06:00
Adam ba805e30b8 Include gecos in GetNUHMask 2015-12-29 13:53:44 -05:00
Adam 6e48b1d56f Fix saset language reply 2015-12-28 17:45:44 -05:00
Michael Wobst cd6401f628 Add support for channel mode +T to the ircd-hybrid protocol module 2015-12-26 13:29:18 +01:00
Adam a25f94456d Fix race with recovering and svsnicing nicknames. Wait for first svsnick to go through before issuing the second. Fixes users sometimes svsnick colliding when recovering nicknames. 2015-12-19 13:38:47 -05:00
Adam b5228282e1 Merge commit '593ec34' into 2.0 2015-12-13 19:59:29 -05:00
Matt Ullman 593ec34ff7 os_akill: Sanity check AKILLing before modifing the akill list 2015-12-13 19:58:40 -05:00
Adam 7ce0eb219b Fixup ecdd046c80 to compile 2015-12-13 19:52:50 -05:00
miwob 99282e65a6 hybrid.cpp:SendClientIntroduction(): use a valid IP address format. In the future ircd-hybrid will reject UID messages with invalid IP addresses 2015-12-13 19:48:22 -05:00
Adam d07e60b3da Merge pull request #136 from miwob/add+CanSQLineChannel
hybrid.cpp: add missing CanSQLineChannel = true; to the protocol options
2015-12-13 18:46:14 -06:00
Adam 3da2cdb496 Only special case level -1 to everyone and not everything <0 2015-12-13 19:43:21 -05:00
Adam ecdd046c80 Add some replacement tokens for akick reason and welcome notice 2015-12-13 19:37:24 -05:00
Adam 98b35dfab2 Document m_xmlrpc_main notice 2015-12-13 19:28:31 -05:00
Adam 56abaf8498 Add notice method to m_xmlrpc_main 2015-12-13 19:27:15 -05:00
Adam 5394f5433a Fix SendNumericInternal on inspircd sending to the user's uid if dest is a uid 2015-12-13 19:21:53 -05:00
Adam c414433fae Allow wildcard searching emails 2015-12-13 19:19:00 -05:00
Adam 16d08e57df Fall back to account vhost in hs on/off 2015-12-13 19:14:44 -05:00
Adam 252a65af7e Update LOG dir in anoperc 2015-12-08 14:06:08 -05:00
Adam d40edcae69 null xline manager when removing so removexline doesn't get called 2015-11-05 20:50:10 -05:00
Adam 4c1cc0e05d Cleanup after xlines if directly removed 2015-11-04 20:51:02 -05:00
Adam 80c332bc41 Fix logonnews to prioritize the newest entries if it can't show them all 2015-11-04 20:05:01 -05:00
miwob 5a25a3807b hybrid.cpp: add missing CanSQLineChannel = true; to the protocol options 2015-10-24 12:45:19 +02:00
Robby 27a2645ed3 Fix chanserv botmodes. 2015-09-25 02:40:28 +02:00
Adam 830361e97d Check privilege name is valid in SetLevel 2015-09-24 17:22:44 -04:00
Adam 93a92bb73b Clear regex xlines on unload, which happens on shutdown, even though they are perm modules 2015-09-23 14:55:28 -04:00
Robby b9dc44ae9a Update the dutch language file. 2015-09-18 06:04:42 +02:00
Robby f52bbe22af Update my email address. 2015-09-18 05:38:44 +02:00
Robby 96d7797134 Bold code 2 -> 002. 2015-09-18 05:25:20 +02:00
Robby 9810da9829 Fix some sentences to be more correct. 2015-09-18 04:53:49 +02:00
Adam 5692abb316 Don't prevent channel destruction because persist is set. Perm mode/a bot should be assigned anyway which will prevent it. Fixes deleting bots out of perm channels causing desyncs 2015-09-17 20:35:46 -04:00
Adam 2e65bd4012 Channel::DeleteUser delets the container 2015-09-17 12:31:02 -04:00
Adam 1ac4a1d9a5 Defer channel deletion until after i/o. There are some edge cases with events kicking users mid-event that can delete them. 2015-09-17 10:07:30 -04:00
Adam 8d13a355cd Remove associated oper blocks in os_oper when accounts are deleted 2015-09-14 13:43:14 -04:00
Adam 8c4eec2b6e Update topic lock help to reflect how it works 2015-09-14 12:39:59 -04:00
Adam 776207ba67 Don't allow suspended users to login to webcpanel 2015-09-14 12:35:26 -04:00
Adam 2f5e880e57 Don't update channel last used time from ns alist access check 2015-09-14 12:24:13 -04:00
Adam 94f781726e Don't assign bots when persist is set if we aren't synced sinec we might not know of all modes 2015-09-11 14:54:48 -04:00
Adam 054c227df0 Merge pull request #120 from Alef-Burzmali/2.0+nobackupok
Fix db_flatfile to read the "nobackokay" setting
2015-09-06 16:12:22 -04:00
Adam 907e192aab Merge pull request #126 from SaberUK/2.0+typos
Fix a ton of typos.
2015-09-06 16:11:50 -04:00
Adam d6d0c883b0 Merge pull request #128 from SaberUK/2.0+destdir
Fix support for passing relative install paths to CMake.
2015-09-06 16:09:29 -04:00
Adam 7f4327e8ba Merge pull request #129 from AlphaT3ch/placeholder
Placeholder left in French Translation
2015-09-06 16:08:17 -04:00
Adam 132932ffaf Merge pull request #134 from retsofaj/2.0
Have CMake first check for libraries in any additional locations
2015-09-06 16:03:58 -04:00
Adam c007b829f7 Don't unset modes which have no privilege associated with them 2015-09-06 16:01:43 -04:00
Robby 3b647b0740 When toggling NOEXPIRE for a nickname, show the actual nickname in addition to the account name. 2015-09-02 20:36:24 +02:00
Adam 7a21648683 Only remove collide timers if the account matches on id 2015-08-20 15:04:03 -04:00
Jason Foster 389c1dbd92 Have CMake check for libraries first in any additional locations and second in the standard locations.
This allows (e.g.) using the Homebrew-installed OpenSSL instead of the system version.
2015-08-12 20:26:02 -04:00
Adam d95189a4d8 Fix webcpanel/memoserv/memos with a nonexistent channel 2015-07-31 18:26:49 -04:00
Adam e65a22ae9d Fix use after free from unloading modules which are the last one holding onto an IdentifyRequest 2015-07-31 17:07:30 -04:00
Adam 4e8cc4f786 Make secureops help less weird 2015-07-30 19:47:00 -04:00
Adam dfc18db1dd Remove unused variables from m_ldap 2015-07-23 08:25:28 -04:00
Adam 63dbd7fbf0 Set LDAP_OPT_PROTOCOL_VERSION 3 etc on reconnect, too 2015-07-23 08:23:48 -04:00
AlphaTech c1cdefe1a7 Placeholder left in French Translation 2015-07-16 15:21:13 -04:00
Peter Powell cd9a2af65d Fix support for passing relative install paths to CMake. 2015-07-15 00:28:59 +01:00
Adam 7fe0543bc6 Also UnsetExtensibles on botinfo 2015-07-14 18:52:23 -04:00
Peter Powell 2a6ad3d9fc Refuse to configure with old compilers that can't build Anope. 2015-07-13 19:26:02 -04:00
Adam 38cbff4156 Fix cmake for 2.4 once again 2015-07-13 19:25:37 -04:00
Adam a86162f287 Fix incorrect iteration when destructing modelockimpls 2015-07-13 18:02:44 -04:00
Adam ceddb8370c Unset extensibles on larger objects when they destruct
Some complex extensibles require the full object to still be alive in
their destructors to keep proper bookkeeping
2015-07-13 17:59:14 -04:00
Thomas Fargeix 040b06ad56 Fix db_flatfile to read "nobackupokay" 2015-07-11 10:27:27 +02:00
Peter Powell 1666b1a8d8 Fix a ton of typos. 2015-07-08 11:06:02 +01:00
Adam 4362f53cc3 Fix unused variable warning in cs_clone 2015-07-01 20:16:59 -04:00
Dominic Hargreaves cc616a7146 Allow PROGRAM_NAME to be set during configuration 2015-07-01 20:10:15 -04:00
Dominic Hargreaves 0f01c04b02 Allow disabling installation of extra tools (with DISABLE_TOOLS) 2015-07-01 20:09:46 -04:00
Dominic Hargreaves 4cbdf9a73b Support DESTDIR
If DESTDIR is set it should be prepended to CMAKE_INSTALL_PREFIX. See
<http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_INSTALL_PREFIX.html>
2015-07-01 20:08:51 -04:00
Adam fce257dc43 Merge pull request #121 from SaberUK/2.0+cmake-improvements
Various improvements to the build system.
2015-07-01 20:00:59 -04:00
Adam ad7601b0cc Merge pull request #119 from Jyzee/irc2sql-away
irc2sql: handle away messages.
2015-07-01 19:51:29 -04:00
Adam 5be9de5d12 Merge pull request #123 from Alef-Burzmali/2.0+cs-levels
Allow opers with chanserv/access/list to view the levels list
2015-07-01 19:50:26 -04:00
Adam 02ed9a9725 #1649 don't update keepmodes during inhbait 2015-06-29 19:35:57 -04:00
Adam 074f163750 #1643 Umode +I is oper only on Unreal 2015-06-29 13:57:32 -04:00
Adam de023bab0a Don't allow registering service nicks 2015-06-29 13:47:50 -04:00
Adam 510a746f8d Add ns_identify:maxlogins to limit the max number of concurrent logins per account 2015-06-29 09:37:09 -04:00
Adam 8eb46772e6 Don't allow loading hostserv mods if there can be no hostserv 2015-06-29 08:58:31 -04:00
Adam d563aa0da8 Check name validity after unpackname() to check for bad names in questins and ptr/cname rdata 2015-06-29 08:48:08 -04:00
Adam 3e3312db25 Don't allow adding or changing bots to collide with users 2015-06-29 08:42:29 -04:00
Adam bb5c4906cc Also clear vhost on hs_off so the proto mods don't have to 2015-06-21 10:42:49 -04:00
Adam 444976e64f Update host on hs off too
Protocol modules which don't trigger this by causing a mode change
currently desync
2015-06-20 17:33:13 -04:00
Thomas Fargeix 57b614ae59 Allow opers with chanserv/access/list to view the levels list 2015-06-14 19:33:45 +02:00
Peter Powell 2f9eabdb72 Remove support for run-cc.
This tool is not useful anymore. It just slows the build down.
2015-05-17 21:27:09 +01:00
Jyzee a458f7c840 irc2sql: handle away messages. 2015-04-30 19:29:44 +02:00
Adam 65bf84cfb5 When introducing opered clients on inspircd send a fake opertype 2015-04-28 15:23:31 -04:00
Adam 5efaa5b206 Merge pull request #117 from aFreshMelon/fix-xmlrpc-php
Fix xmlrpc php
2015-04-04 09:50:57 -04:00
Sebastian 41f4c7dab6 A variety of small improvements to xmlrpc.php
Pretty simple stuff.

* Better method names
* Better DocBlocks
* Lowercase variables
2015-04-04 09:43:51 +02:00
Peter Powell 0f1936f63d Fix matching the Apple Clang variant on CMake 3.0+ 2015-04-04 03:28:46 +01:00
Peter Powell 5baa6247a9 Don't overwrite CMAKE_INSTALL_PREFIX if it has already been set. 2015-04-02 01:43:05 +01:00
Peter Powell 82f5d1d61d Remove an old Autotools limitation.
This is not needed anymore as support for Autotools was removed.
2015-04-02 01:38:31 +01:00
Sebastian dd8dd3b4a0 Make xmlrpc.php comply with PSR-2 coding standard 2015-04-01 23:28:41 +02:00
Sebastian a718223585 Remove workaround that is no longer needed
This workaround was required previously but breaks the code with the corrections to the XML-RPC response.
2015-04-01 23:27:44 +02:00
Robby- abc4851287 Update the dutch language file. 2015-03-23 02:39:18 +01:00
Adam 3d1255dbe9 Anope 2.0.3-git 2015-03-22 21:22:49 -04:00
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
489 changed files with 52781 additions and 67640 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
___
/ _ \ http://www.anope.org
/ _ \ https://www.anope.org/
| /_\ | _ __ _ _ _ _ ___
| _ || '_ \/ _ \/ _ \ / _ \
| | | || | | |_| |_| | __/
@@ -7,12 +7,13 @@
| |
|_| IRC Services
CURVER
This program will help you to compile your Services, and ask you
This program will help you to compile your services, and ask you
questions regarding the compile-time settings of it during the
process. For more options type SOURCE_DIR/Config --help
Anope is a set of Services for IRC networks that allows users to
Anope is a set of services for IRC networks that allows users to
manage their nicks and channels in a secure and efficient way,
and administrators to manage their network with powerful tools.
For all your Anope needs please visit our portal at www.anope.org
For all your Anope needs please visit our portal at
https://www.anope.org/
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Report a non-security issue with Anope.
---
<!--
Please fill in the template below. It will help us process your bug report a lot faster. If you have multiple bugs to report then please open one issue for each bug.
-->
**Description**
**Steps to reproduce the issue:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information you deem important (e.g. issue happens only occasionally):**
**Output of `services --version`:**
+15
View File
@@ -0,0 +1,15 @@
---
name: Feature request
about: Request that a new feature is added to Anope.
---
<!--
Please fill in the template below. It will help us process your feature request a lot faster. If you have multiple features to request then please open one issue for each feature.
-->
**Description**
**Why this would be useful**
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
+26
View File
@@ -0,0 +1,26 @@
<!--
Please fill in the template below. It will help us process your pull request a lot faster.
-->
## Summary
<!--
Briefly describe what this pull request changes.
-->
## Rationale
<!--
Describe why you have made this change.
-->
## Testing Environment
<!--
Describe the environment in which you have tested this change:
-->
I have tested this pull request on:
**Operating system name and version:** <!-- e.g. Linux 3.11 -->
**Compiler name and version:** <!-- e.g. GCC 4.2.0 -->
+19
View File
@@ -0,0 +1,19 @@
# Security Policy
## Supported Versions
Currently the 2.0 (stable) branch is actively receiving security fixes.
The 2.1 (development) branch is still early in development and currently only receives security fixes when they are synced from the 2.0 branch.
Version | Supported
------- | ---------
2.1.x | :warning:
2.0.x | :white_check_mark:
1.8.x | :x:
## Reporting a Vulnerability
Please do not report security vulnerabilities on GitHub. Instead, email the details to team@anope.org or get the attention of a developer in our development IRC channel at irc.anope.org #anope-devel and PM them the details.
We will triage your issue as soon as possible and try to release a fixed version within a week of receiving your report.
+7
View File
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
target-branch: "2.1"
+59
View File
@@ -0,0 +1,59 @@
name: Alpine CI
on:
pull_request:
push:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip alpine ci]')"
container: alpine:edge
runs-on: ubuntu-latest
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: -Werror
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
apk update
apk add \
argon2-dev \
clang \
cmake \
g++ \
gettext \
git \
gnutls-dev \
mariadb-dev \
openldap-dev \
openssl-dev \
pcre2-dev \
samurai \
sqlite-dev \
tre-dev
- name: Enable extras
run: |
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
do
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
done
- name: Run CMake
run: |
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=$(readlink -f ../run) ..
- name: Build Anope
run: |
ninja -C build install
strategy:
fail-fast: false
matrix:
compiler:
- clang++
- g++
+54
View File
@@ -0,0 +1,54 @@
name: Ubuntu CI
on:
- pull_request
- push
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ubuntu ci]')"
runs-on: ubuntu-20.04
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: -Werror
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update --assume-yes
sudo apt-get install --assume-yes --no-install-recommends \
clang \
g++ \
gettext \
git \
libargon2-dev \
libgnutls28-dev \
libldap2-dev \
libmysqlclient-dev \
libpcre2-dev \
libsqlite3-dev \
libssl-dev \
libtre-dev \
ninja-build
- name: Enable extras
run: |
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
do
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
done
- name: Run CMake
run: |
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=${{ github.workspace }}/run ..
- name: Build Anope
run: |
ninja -C ${{ github.workspace }}/build install
strategy:
fail-fast: false
matrix:
compiler:
- clang++
- g++
+35
View File
@@ -0,0 +1,35 @@
name: Windows CI
on:
pull_request:
push:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.3
- name: Setup Conan
uses: turtlebrowser/get-conan@v1.2
with:
version: 1.59.0
- name: Install libraries
run: |
conan install ${{ github.workspace }}\src\win32 --build=missing
- name: Run CMake
run: |
mkdir ${{ github.workspace }}\build
cd ${{ github.workspace }}\build
cmake -A "x64" -G "Visual Studio 16 2019" ..
- name: Build Anope
working-directory: ${{ github.workspace }}\build
run: |
msbuild PACKAGE.vcxproj /M:3 /P:Configuration=Release /P:Platform=x64 /VERBOSITY:MINIMAL
+14 -1
View File
@@ -1,3 +1,16 @@
build/
config.cache
include/sysconf.h
build/
modules/enc_argon2.cpp
modules/enc_posix.cpp
modules/ldap.cpp
modules/mysql.cpp
modules/regex_pcre2.cpp
modules/regex_posix.cpp
modules/regex_tre.cpp
modules/sqlite.cpp
modules/ssl_gnutls.cpp
modules/ssl_openssl.cpp
modules/stats
run/
*.mo
+15 -2
View File
@@ -1,3 +1,4 @@
(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Adam <adam@anope.org> <adam-@5417fbe8-f217-4b02-8779-1006273d7864>
Adam <adam@anope.org> <adam@adam-laptop.(none)>
Adam <adam@anope.org> <Adam@anope.org>
@@ -5,9 +6,11 @@ Adam <adam@anope.org> <Adam@drink-coca-cola.info>
Adam <adam@anope.org> <Adam@sigterm.info>
Adam Kramer <ribosome@anope.org> <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Alvaro Toledo <atoledo@keldon.org> <atoledo atoledo@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Attila Molnar <attilamolnar@hush.com>
Björn Stiddien <keeper@anope.org> <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Charles Kingsley <chaz@anope.org>
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
Cronus <cronus@nite-serv.com>
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
@@ -15,6 +18,7 @@ Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b0
Fabio Scotoni <cculex@gmail.com>
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Harakiri <harakiri@overstack.fr>
Jan Milants <viper@anope.org>
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
@@ -23,15 +27,24 @@ Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-10062
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
Lee Holmes <lethality@anope.org>
Lee Holmes <lethality@anope.org> <lee@lethality.me.uk>
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Matt Schatz <genius3000@g3k.solutions>
Matt Ullman <matt@airraidsirens.com> <blindsight@gamesurge.net>
Michael Hazell <michaelhazell@hotmail.com> <Techman-@users.noreply.github.com>
Michael Wobst <wobst.michael@web.de>
Michael Wobst <wobst.michael@web.de> <michael@static.163.129.251.148.clients.your-server.de>
Michael Wobst <wobst.michael@web.de> <michael@wobst.at>
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Robby <robby@chat.be>
Robby <robby@chatbelgie.be> <robby@anope.org>
Robby <robby@chatbelgie.be> <robby@chat.be>
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
Sadie Powell <sadie@witchery.services> Peter Powell <petpow@saberuk.com>
Sebastian Barfurth <github@afreshmelon.com>
Sebastian V. <hal9000@denorastats.org>
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
+136 -271
View File
@@ -1,72 +1,10 @@
# This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions)
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
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(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
message(FATAL_ERROR "You can not use CMake to build Anope from the root of it's source tree! Remove the CMakeCache.txt file from this directory, then create a separate directory (either below this directory or elsewhere), and then re-run CMake from there.")
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
# This usage of CMake requires at least version 3.8
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
# Set the project as C++ primarily, but have C enabled for the checks required later
project(Anope CXX)
enable_language(C)
# Detect the version of CMake for the later conditional checks
execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
if(HAS_PATCH)
string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
else(HAS_PATCH)
string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}")
if(HAS_DOT)
string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
else(HAS_DOT)
string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
if(MINOR_VERSION STREQUAL "4-1\n")
set(PATCH_VERSION 1)
else(MINOR_VERSION STREQUAL "4-1\n")
set(PATCH_VERSION 0)
endif(MINOR_VERSION STREQUAL "4-1\n")
set(MINOR_VERSION 4)
endif(HAS_DOT)
endif(HAS_PATCH)
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
if(MINOR_VERSION GREATER 5)
set(CMAKE26_OR_BETTER TRUE)
set(CMAKE248_OR_BETTER TRUE)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(MINOR_VERSION GREATER 5)
set(CMAKE26_OR_BETTER FALSE)
# Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is non-existant in earlier versions
if(PATCH_VERSION GREATER 7)
set(CMAKE248_OR_BETTER TRUE)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 7)
set(CMAKE248_OR_BETTER FALSE)
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are non-existant in earlier versions
if(PATCH_VERSION GREATER 3)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 3)
set(CMAKE244_OR_BETTER FALSE)
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
if(PATCH_VERSION GREATER 1)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 1)
set(CMAKE242_OR_BETTER FALSE)
endif(PATCH_VERSION GREATER 1)
endif(PATCH_VERSION GREATER 3)
endif(PATCH_VERSION GREATER 7)
endif(MINOR_VERSION GREATER 5)
# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake)
@@ -79,8 +17,16 @@ set(ENV{LC_ALL} C)
set(DEFAULT_LIBRARY_DIRS)
set(DEFAULT_INCLUDE_DIRS)
# We require C++17 to build
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Put modules in their own folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# 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}" MATCHES "Clang$")
# 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)
# Find only the part after "libraries: "
@@ -88,9 +34,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
if(NOT MINGW)
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
else(NOT MINGW)
else()
set(LIBRARIES "${LINE}")
endif(NOT MINGW)
endif()
# Iterate through the libraries
foreach(LIBRARY ${LIBRARIES})
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
@@ -98,13 +44,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(NOT FIRST_CHAR STREQUAL "=")
# If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY})
endif(NOT FIRST_CHAR STREQUAL "=")
endforeach(LIBRARY)
list(APPEND DEFAULT_LIBRARY_DIRS ${LIBRARY})
endif()
endforeach()
# Remove duplicate entries from the list
if(DEFAULT_LIBRARY_DIRS)
remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
endif(DEFAULT_LIBRARY_DIRS)
list(REMOVE_DUPLICATES DEFAULT_LIBRARY_DIRS)
endif()
# Create a temporary file to test for the default include directories
FILE(WRITE empty.cpp "")
# Next, we look for the compiler's default include directories
@@ -121,11 +67,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# If the line has the following on it, the next lines will contain directory names
if(LINE STREQUAL "#include <...> search starts here:")
set(IN_SEARCH TRUE)
else(LINE STREQUAL "#include <...> search starts here:")
else()
# If the line has the following on it, we hit the end of the list
if(LINE STREQUAL "End of search list.")
set(IN_SEARCH FALSE)
else(LINE STREQUAL "End of search list.")
else()
# If we are within the block between the above two lines...
if(IN_SEARCH)
# Get everything but the first character of the line
@@ -137,47 +83,16 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Convert the path to an absolute one, just in case it wasn't
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
# Add that directory to the list of default include directories
append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE})
endif(IN_SEARCH)
endif(LINE STREQUAL "End of search list.")
endif(LINE STREQUAL "#include <...> search starts here:")
endforeach(LINE)
list(APPEND DEFAULT_INCLUDE_DIRS ${INCLUDE})
endif()
endif()
endif()
endforeach()
# Remove duplicate entries from the list
if(DEFAULT_INCLUDE_DIRS)
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
endif(DEFAULT_INCLUDE_DIRS)
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(MSVC)
# If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path
# Look for the 2008 SDK under HKLM first
get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
if(WSDK2008_PATH STREQUAL "/registry")
# If not found, look for the 2003 SDK under HKLM
get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
if(WSDK2003_PATH STREQUAL "/registry")
# If not found, look for the 2008 SDK under HKCU
get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
if(WSDK2008_PATH STREQUAL "/registry")
# 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)
if(WSDK2003_PATH STREQUAL "/registry")
# The SDK was never found, set the path to nothing
set(WSDK_PATH "")
else(WSDK2003_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2003_PATH}")
endif(WSDK2003_PATH STREQUAL "/registry")
else(WSDK2008_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2008_PATH}")
endif(WSDK2008_PATH STREQUAL "/registry")
else(WSDK2003_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2003_PATH}")
endif(WSDK2003_PATH STREQUAL "/registry")
else(WSDK2008_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2008_PATH}")
endif(WSDK2008_PATH STREQUAL "/registry")
endif(MSVC)
list(REMOVE_DUPLICATES DEFAULT_INCLUDE_DIRS)
endif()
endif()
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
@@ -186,57 +101,67 @@ endif(MSVC)
if(NOT MSVC)
if(CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
else(CMAKE_BUILD_TYPE)
else()
set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif(CMAKE_BUILD_TYPE)
endif(NOT MSVC)
endif()
endif()
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
if(MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif(MINGW)
endif()
# Include the checking functions used later in this CMakeLists.txt
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckTypeSize)
include(CheckLibraryExists)
if(CMAKE244_OR_BETTER)
include(CheckCXXCompilerFlag)
else(CMAKE244_OR_BETTER)
include(TestCXXAcceptsFlag)
endif(CMAKE244_OR_BETTER)
include(CheckCXXCompilerFlag)
# If extra include directories were specified, tell cmake about them.
if(EXTRA_INCLUDE)
include_directories(${EXTRA_INCLUDE})
endif(EXTRA_INCLUDE)
endif()
# If extra library directories were specified, tell cmake about them.
if(EXTRA_LIBS)
link_directories(${EXTRA_LIBS})
endif(EXTRA_LIBS)
endif()
# setup conan
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
endif()
# Find gettext
find_package(Gettext)
# Add an optional variable for using run-cc.pl for building, Perl will be checked later regardless of this setting
option(USE_RUN_CC_PL "Use run-cc.pl for building" OFF)
option(USE_PCH "Use precompiled headers" OFF)
find_package(Intl)
if(GETTEXT_FOUND AND Intl_FOUND)
set(HAVE_LOCALIZATION ON)
include_directories(${Intl_INCLUDE_DIRS})
else()
message("Unable to find gettext and libintl; disabling localization")
set(HAVE_LOCALIZATION OFF)
endif()
# Use the following directories as includes
# Note that it is important the binary include directory comes before the
# source include directory so the precompiled headers work correctly.
include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/language ${Anope_SOURCE_DIR}/modules/pseudoclients)
include_directories(
${Anope_BINARY_DIR}/include
${Anope_SOURCE_DIR}/include
${Anope_SOURCE_DIR}/vendor
)
# Pass on REPRODUCIBLE_BUILD
if(REPRODUCIBLE_BUILD)
add_definitions(-DREPRODUCIBLE_BUILD)
endif()
# If using Windows, always add the _WIN32 define
if(WIN32)
add_definitions(-D_WIN32)
# And include the windows specific folder for our anope_windows.h
# If using Windows, include the windows specific folder for anope_windows.h
include_directories(${Anope_SOURCE_DIR}/src/win32)
endif(WIN32)
endif()
# If using Visual Studio, set the C++ flags accordingly
if(MSVC)
@@ -245,106 +170,61 @@ if(MSVC)
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4267 /wd4275 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# Otherwise, we're not using Visual Studio
else(MSVC)
else()
# Set the compile flags to have all warnings on (including shadowed variables)
set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
# If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler)
if(UNIX)
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# If we aren't on a *nix system, we are using MinGW
else(UNIX)
# Also, if we are building under MinGW, add another define for MinGW
if(MINGW)
add_definitions(-DMINGW)
endif(MINGW)
endif(UNIX)
endif(MSVC)
set(CXXFLAGS "${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -Wpedantic -Wno-format-nonliteral -Wno-format-zero-length -Wno-unused-parameter ${CMAKE_CXX_FLAGS}")
endif()
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
if(CMAKE_DL_LIBS)
append_to_list(LINK_LIBS ${CMAKE_DL_LIBS})
endif(CMAKE_DL_LIBS)
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
endif()
# Find the linker flags required for using threads.
find_package("Threads" REQUIRED)
if(CMAKE_THREAD_LIBS_INIT)
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
endif()
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
if(MINGW)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
endif(MINGW)
endif()
# Under Windows, we set the executable name for Anope to be anope
if(WIN32)
if(NOT PROGRAM_NAME)
set(PROGRAM_NAME anope)
# Under *nix, we set the executable name for Anope to be services
else(WIN32)
set(PROGRAM_NAME services)
endif(WIN32)
endif()
# If we are not using Visual Studio, we'll run the following checks
if(NOT MSVC)
# Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works
if(CMAKE244_OR_BETTER)
# If using CMake 2.4.4 or better, we can use check_cxx_compiler_flag
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
else(CMAKE244_OR_BETTER)
# If using CMake 2.4.3 or older, we will use check_cxx_accepts_flags instead
check_cxx_accepts_flag(-pipe HAVE_PIPE_FLAG)
endif(CMAKE244_OR_BETTER)
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
# If the flag was accepted, add it to the list of flags
if(HAVE_PIPE_FLAG)
set(CXXFLAGS "${CXXFLAGS} -pipe")
endif(HAVE_PIPE_FLAG)
# The following are additional library checks, they are not required for Windows
if(NOT WIN32)
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
if(HAVE_SOCKET_LIB)
append_to_list(LINK_LIBS socket)
endif(HAVE_SOCKET_LIB)
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
if(HAVE_NSL_LIB)
append_to_list(LINK_LIBS nsl)
endif(HAVE_NSL_LIB)
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
if(HAVE_PTHREAD)
if(NOT APPLE)
set(LDFLAGS "${LDFLAGS} -pthread")
endif(NOT APPLE)
else(HAVE_PTHREAD)
message(FATAL_ERROR "The pthread library is required to build Anope")
endif(HAVE_PTHREAD)
endif(NOT WIN32)
endif(NOT MSVC)
endif()
endif()
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
if(NOT DEFUMASK)
if(RUNGROUP)
set(DEFUMASK "007")
else(RUNGROUP)
else()
set(DEFUMASK "077")
endif(RUNGROUP)
endif(NOT DEFUMASK)
endif()
endif()
# Set the DEBUG_BUILD for sysconf.h
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(DEBUG_BUILD TRUE)
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
endif()
# Check for the existance of the following include files
check_include_file(cstdint HAVE_CSTDINT)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(strings.h HAVE_STRINGS_H)
# Check for the existance of the following functions
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(stricmp HAVE_STRICMP)
# Check for the existence of the following functions
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
check_function_exists(umask HAVE_UMASK)
check_function_exists(epoll_wait HAVE_EPOLL)
check_function_exists(poll HAVE_POLL)
@@ -352,73 +232,62 @@ check_function_exists(kqueue HAVE_KQUEUE)
# Strip the leading and trailing spaces from the compile flags
if(CXXFLAGS)
strip_string(${CXXFLAGS} CXXFLAGS)
endif(CXXFLAGS)
string(STRIP ${CXXFLAGS} CXXFLAGS)
endif()
# Strip the leading and trailing spaces from the linker flags
if(LDFLAGS)
strip_string(${LDFLAGS} LDFLAGS)
endif(LDFLAGS)
string(STRIP ${LDFLAGS} LDFLAGS)
endif()
# Search for the following programs
find_program(GREP grep)
find_program(SH sh)
find_program(CHGRP chgrp)
find_program(CHMOD chmod)
find_program(PERL perl)
if(NOT WIN32 AND RUNGROUP)
find_program(CHGRP "chgrp" REQUIRED)
find_program(CHMOD "chmod" REQUIRED)
endif()
# If perl is included on the system and the user wants to use run-cc.pl, change the commands for compiling and linking
if(PERL AND USE_RUN_CC_PL)
set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_COMPILE_OBJECT}")
set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_LINK_EXECUTABLE}")
set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_CREATE_SHARED_MODULE}")
endif(PERL AND USE_RUN_CC_PL)
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the anope directory under the user's home directory
if(INSTDIR)
set(CMAKE_INSTALL_PREFIX "${INSTDIR}")
else(INSTDIR)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
endif(INSTDIR)
elseif(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/anope")
endif()
# Set default paths for various directories if not already defined
if(NOT BIN_DIR)
set(BIN_DIR "bin")
endif(NOT BIN_DIR)
endif()
if(NOT DB_DIR)
set(DB_DIR "data")
endif(NOT DB_DIR)
endif()
if(NOT DOC_DIR)
set(DOC_DIR "doc")
endif(NOT DOC_DIR)
endif()
if(NOT CONF_DIR)
set(CONF_DIR "conf")
endif(NOT CONF_DIR)
endif()
if(NOT LIB_DIR)
set(LIB_DIR "lib")
endif(NOT LIB_DIR)
endif()
if(NOT LOCALE_DIR)
set(LOCALE_DIR "locale")
endif(NOT LOCALE_DIR)
endif()
if(NOT LOGS_DIR)
set(LOGS_DIR "logs")
endif(NOT LOGS_DIR)
endif()
# Version number processing
# Find all lines in src/version.sh that start with VERSION_
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
file(STRINGS ${Anope_SOURCE_DIR}/src/version.sh VERSIONS REGEX "^VERSION_")
# Iterate through the strings found
foreach(VERSION_STR ${VERSIONS})
# Get the length of the string
string(LENGTH ${VERSION_STR} VERSION_LEN)
# 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)
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 16")
# Extract the type from the string
string(SUBSTRING ${VERSION_STR} 8 5 VERSION_TYPE)
# Extract the actual value from the string
string(SUBSTRING ${VERSION_STR} 15 ${VERSION_NUM_LEN} VERSION)
# Set the version type to the value extract from above
set(VERSION_${VERSION_TYPE} ${VERSION})
endforeach(VERSION_STR ${VERSIONS})
string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
list(LENGTH VERSION_OUT VERSION_LEN)
list(GET VERSION_OUT 0 VERSION_TYPE)
if(${VERSION_LEN} GREATER 1)
list(GET VERSION_OUT 1 VERSION_DATA)
set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
endif()
endforeach()
# Default build version to 0
set(VERSION_BUILD 0)
@@ -426,7 +295,7 @@ set(VERSION_BUILD 0)
# Only change the build number if version.h exists
if(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
# Attempt to read the build number from include/version.h
read_from_file(${Anope_SOURCE_DIR}/include/version.h "^#define VERSION_BUILD" VERSIONS)
file(STRINGS ${Anope_SOURCE_DIR}/src/version.sh VERSIONS REGEX "^#define VERSION_BUILD")
foreach(VERSION_STR ${VERSIONS})
# Get the length of the string
string(LENGTH ${VERSION_STR} VERSION_LEN)
@@ -436,8 +305,8 @@ if(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
string(SUBSTRING ${VERSION_STR} 22 ${VERSION_NUM_LEN} VERSION)
# Set VERSION_BUILD correctly
set(VERSION_BUILD ${VERSION})
endforeach(VERSION_STR ${VERSIONS})
endif(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
endforeach()
endif()
# Set the version variables based on what was found above
set(VERSION_COMMA "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_BUILD}")
@@ -450,7 +319,7 @@ set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}")
if(WIN32)
# Generate the win32.rc file using the above variables
configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc)
endif(WIN32)
endif()
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
add_to_cpack_ignored_files(".git\;config.cache\;CMakeFiles\;sysconf.h$\;build" TRUE)
@@ -465,8 +334,8 @@ if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# If using Visual Studio, add these files as well
if(MSVC)
add_to_cpack_ignored_files(".vcproj$\;.sln$\;.ncb$\;.suo$\;.dir$\;.ilk$\;.exp$\;.pdb$\;.lib$\;/debug$;/release$;/relwithdebinfo$;/minsizerel$" TRUE)
endif(MSVC)
endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
endif()
endif()
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(data)
@@ -477,33 +346,29 @@ add_subdirectory(modules)
add_subdirectory(include)
# Get the filename of the Anope binary, to use later
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>")
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# 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}/${LOGS_DIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
if(WIN32)
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
endif(WIN32)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
endif()
# 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)
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 ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
endif(NOT WIN32 AND RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")")
endif()
# On Windows platforms, install extra files
if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
DESTINATION ${BIN_DIR}
)
endif()
# 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)
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
# Only process the CPack section if we have CPack
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
@@ -533,19 +398,19 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
"bin\\\\anope.bat\\\" \\\"-debug -nofork" "Anope IRC Services (Debug and Window Logging)"
"bin\\\\anope.bat\\\" \\\"-nofork" "Anope IRC Services (Window Logging)"
"bin\\\\anope.bat\\\" \\\"-nothird" "Anope IRC Services (No Third Party Modules)"
"http://www.anope.org/" "Anope Web Site"
"https://www.anope.org/" "Anope Web Site"
)
# The following doesn't work, but a bug report has been filed about it
#set(CPACK_CREATE_DESKTOP_LINK_${SERVICES_BINARY} TRUE)
set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico")
set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico")
set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org/")
set(CPACK_NSIS_URL_INFO_ABOUT "https://www.anope.org/")
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
endif(WIN32)
endif()
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
set(CPACK_MONOLITHIC_INSTALL TRUE)
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
endif()
+23 -122
View File
@@ -1,8 +1,8 @@
#!/bin/sh
#
# Configuration script for Services.
# Configuration script for Anope.
#
# Anope (c) 2003-2014 Anope Team
# Anope (C) 2003-2024 Anope Team
# Contact us at team@anope.org
#
# This program is free but copyrighted software; see the file COPYING for
@@ -62,18 +62,6 @@ Run_Build_System () {
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
else
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
fi
if [ "$USE_PCH" = "yes" ] ; then
PCH="-DUSE_PCH:BOOLEAN=ON"
else
PCH="-DUSE_PCH:BOOLEAN=OFF"
fi
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
fi
@@ -82,12 +70,6 @@ Run_Build_System () {
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
fi
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
if [ "$SOURCE_DIR" = "." ] ; then
pwdsave=`pwd`
test -d build || mkdir build
@@ -97,9 +79,13 @@ Run_Build_System () {
REAL_SOURCE_DIR="$SOURCE_DIR"
fi
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
if [ $? -ne 0 ]; then
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
exit 1
fi
echo ""
if [ "$SOURCE_DIR" = "." ] ; then
@@ -127,12 +113,10 @@ export ECHO2 ECHO2SUF
# Init values
###########################################################################
INSTDIR=$HOME/services
INSTDIR=$HOME/anope
RUNGROUP=
UMASK=
DEBUG="no"
USE_RUN_CC_PL="no"
USE_PCH="no"
EXTRA_INCLUDE_DIRS=
EXTRA_LIB_DIRS=
EXTRA_CONFIG_ARGS=
@@ -152,6 +136,9 @@ while [ $# -ge 1 ] ; do
echo "-nointro Skip intro (disclaimer, etc)"
echo "-quick Skip questions, go straight to cmake"
exit 0
elif [ $1 = "-devel" ] ; then
DEBUG="yes"
INSTDIR="$PWD/run"
elif [ $1 = "-nocache" ] ; then
IGNORE_CACHE="1"
elif [ $1 = "-nointro" ] ; then
@@ -173,67 +160,26 @@ done
# Check for CMake and (optionally) install it
###########################################################################
which cmake > /dev/null
cmake --version 2>&1 > /dev/null
if [ $? -ne 0 ] ; then
clear
if exists "cmake-bin" ; then :
else
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org"
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"
echo "Anope requires CMake 3.8 or newer, which can be downloaded at https://cmake.org/ or through your system's package manager."
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
exit 0
fi
###########################################################################
if [ ! "$NO_INTRO" ] ; then
case `uname -s` in
MINGW*)
PAGER=less
;;
*)
PAGER=more
clear
;;
esac
export MORE='-e'
. $SOURCE_DIR/src/version.sh
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | more
echo ""
else
echo ""
fi
echo "Beginning Services configuration."
echo "Beginning Anope configuration."
echo ""
###########################################################################
@@ -272,7 +218,7 @@ while [ $ok -eq 0 ] ; do
fi
fi
elif exists "$INPUT/include/services.h" ; then
echo "You cannot use the Services source directory as a target directory."
echo "You cannot use the Anope source directory as a target directory."
else
ok=1
fi
@@ -284,11 +230,11 @@ echo ""
OLD_RUNGROUP="$RUNGROUP"
if [ "$RUNGROUP" ] ; then
echo "Which group should all Services data files be owned by? (If Services"
echo "Which group should all Anope data files be owned by? (If Anope"
echo "should not force files to be owned by a particular group, type \"none\""
echo "(without the quotes) and press Return.)"
else
echo "Which group should all Services data files be owned by? (If Services"
echo "Which group should all Anope data files be owned by? (If Anope"
echo "should not force files to be owned by a particular group, just press"
echo "Return.)"
fi
@@ -354,49 +300,6 @@ echo ""
####
TEMP_YN="n"
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
TEMP_YN="y"
fi
echo "You can optionally have the build run through run-cc.pl, which will"
echo "cause warnings and errors (if any) to be colored yellow and red,"
echo "respectively. This relies on Perl being installed, so if you say yes"
echo "to this without Perl, the option will be ignored."
echo "NOTE: If you are using MinGW, it is NOT recommended to say yes to"
echo "this, it may fail."
echo "Would you like to utilize run-cc.pl?"
echo2 "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
USE_RUN_CC_PL="yes"
else
USE_RUN_CC_PL="no"
fi
fi
echo ""
####
TEMP_YN="n"
if [ "$USE_PCH" = "yes" ] ; then
TEMP_YN="y"
fi
echo "Do you want to build using precompiled headers? This can speed up"
echo "the build, but uses more disk space."
echo2 "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
USE_PCH="yes"
else
USE_PCH="no"
fi
fi
echo ""
####
echo "Are there any extra include directories you wish to use?"
echo "You may only need to do this if CMake is unable to locate"
echo "missing dependencies without hints."
@@ -434,7 +337,7 @@ echo ""
####
echo "Are there any extra arguments you wish to pass to CMake?"
echo "If you need no extra arugments to CMake, enter NONE in all caps."
echo "If you need no extra arguments to CMake, enter NONE in all caps."
echo2 "[$EXTRA_CONFIG_ARGS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
@@ -459,8 +362,6 @@ INSTDIR="$INSTDIR"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
DEBUG="$DEBUG"
USE_RUN_CC_PL="$USE_RUN_CC_PL"
USE_PCH="$USE_PCH"
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
BIN
View File
Binary file not shown.
+46
View File
@@ -0,0 +1,46 @@
## About
Anope is an open source set of IRC services. It is highly modular, with a vast number of configurable parameters, and is the most used IRC services package. There are also many modules on the [modsite](https://modules.anope.org) to add additional features. It runs on Linux, BSD, and Windows, and supports many modern IRCds, including InspIRCd, UnrealIRCd, and ircd-hybrid. For more details, credits, command line options, and contact information see [docs/README](https://github.com/anope/anope/blob/2.0/docs/README).
* [Website](https://anope.org)
* [GitHub](https://github.com/anope)
* IRC \#anope on irc.anope.org
## Installation
### Linux/BSD
Download the latest release off of the [releases page](https://github.com/anope/anope/releases).
```
$ ./Config
$ cd build
$ make
$ make install
```
Now change to the directory where you installed Anope to, e.g. `$ cd ~/anope/`
### Windows
Download the latest release off of the [releases page](https://github.com/anope/anope/releases) and run the installer.
## Configuration
Copy conf/anope.example.conf to conf/anope.conf
```
$ cp conf/anope.example.conf conf/anope.conf
```
Edit anope.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the anope.example.conf documentation. The [Anope wiki](https://wiki.anope.org) is also a good source of information. Our support channel is located at #anope on [irc.anope.org](irc://irc.anope.org/#anope).
Note that the example configuration file includes other example configuration files. If you want to modify the other example configuration files, copy them (e.g. `modules.example.conf` to `modules.conf`) and modify the `include` directive in `anope.conf` to include the new file.
## Running
Run `$ ./bin/anope` to start Anope. If asked to provide logs for support, use the `--support` flag, e.g.: `$ ./bin/anope --support`
## Installing extra modules
Extra modules, which are usually modules which require extra libraries to use, such as m\_mysql, can be enabled with the `./extras` command from the source directory. Then re-run `Config`, `make` and `make install` again. Third party modules can be installed by placing them into the `modules/third` directory.
+47 -483
View File
@@ -1,421 +1,3 @@
###############################################################################
# strip_string(<input string> <output string>)
#
# A macro to handle stripping the leading and trailing spaces from a string,
# uses string(STRIP) if using CMake 2.6.x or better, otherwise uses
# string(REGEX REPLACE).
###############################################################################
macro(strip_string INPUT_STRING OUTPUT_STRING)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRIP sub-command of string()
string(STRIP ${INPUT_STRING} ${OUTPUT_STRING})
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we will have to use the REGEX REPLACE sub-command of string() instead
# First check if the input string is empty or not
if (${INPUT_STRING} STREQUAL "")
set(${OUTPUT_STRING} "")
else(${INPUT_STRING} STREQUAL "")
# Determine if the string is entirely empty or not
string(REGEX MATCH "^[ \t]*$" EMPTY_STRING "${INPUT_STRING}")
if(EMPTY_STRING)
set(${OUTPUT_STRING} "")
else(EMPTY_STRING)
# We detect if there is any leading whitespace and remove any if there is
string(SUBSTRING "${INPUT_STRING}" 0 1 FIRST_CHAR)
if(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
string(REGEX REPLACE "^[ \t]+" "" TEMP_STRING "${INPUT_STRING}")
else(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
set(TEMP_STRING "${INPUT_STRING}")
endif(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
# Next we detect if there is any trailing whitespace and remove any if there is
string(LENGTH "${TEMP_STRING}" STRING_LEN)
math(EXPR STRING_LEN "${STRING_LEN} - 1")
string(SUBSTRING "${TEMP_STRING}" ${STRING_LEN} 1 LAST_CHAR)
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
string(REGEX REPLACE "[ \t]+$" "" ${OUTPUT_STRING} "${TEMP_STRING}")
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
set(${OUTPUT_STRING} "${TEMP_STRING}")
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
endif(EMPTY_STRING)
endif(${INPUT_STRING} STREQUAL "")
endif(CMAKE26_OR_BETTER)
endmacro(strip_string)
###############################################################################
# append_to_list(<list> <args>...)
#
# A macro to handle appending to lists, uses list(APPEND) if using CMake 2.4.2
# or better, otherwise uses set() instead.
###############################################################################
macro(append_to_list LIST)
if(CMAKE242_OR_BETTER)
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
list(APPEND ${LIST} ${ARGN})
else(CMAKE242_OR_BETTER)
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
set(${LIST} ${${LIST}} ${ARGN})
endif(CMAKE242_OR_BETTER)
endmacro(append_to_list)
###############################################################################
# find_in_list(<list> <value> <output variable>)
#
# A macro to handle searching within a list, will store the result in the
# given <output variable>, uses list(FIND) if using CMake 2.6.x or better
# (or CMake 2.4.8 or better), otherwise it iterates through the list to find
# the item.
###############################################################################
macro(find_in_list LIST ITEM_TO_FIND FOUND)
if(CMAKE248_OR_BETTER)
# For CMake 2.4.8 or better, we can use the FIND sub-command of list()
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
else(CMAKE248_OR_BETTER)
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well)
# Firstly we set the position to -1 indicating nothing found, we also use a temporary position
set(ITEM_FOUND -1)
set(POS 0)
# Iterate through the list
foreach(ITEM ${${LIST}})
# If the item we are looking at is the item we are trying to find, set that we've found the item
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
set(ITEM_FOUND ${POS})
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
# Increase the position value by 1
math(EXPR POS "${POS} + 1")
endforeach(ITEM)
endif(CMAKE248_OR_BETTER)
# Set the given FOUND variable to the result
set(${FOUND} ${ITEM_FOUND})
endmacro(find_in_list)
###############################################################################
# remove_list_duplicates(<list>)
#
# A macro to handle removing duplicates from a list, uses
# list(REMOVE_DUPLICATES) if using CMake 2.6.x or better, otherwise it uses
# a slower method of creating a temporary list and only adding to it when
# a duplicate item hasn't been found.
###############################################################################
macro(remove_list_duplicates LIST)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, this can be done automatically
list(REMOVE_DUPLICATES ${LIST})
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
set(NEW_LIST)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# Check if the item is in the new list
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
if(FOUND_ITEM EQUAL -1)
# If the item was not found, append it to the list
append_to_list(NEW_LIST ${ITEM})
endif(FOUND_ITEM EQUAL -1)
endforeach(ITEM)
# Replace the old list with the new list
set(${LIST} ${NEW_LIST})
endif(CMAKE26_OR_BETTER)
endmacro(remove_list_duplicates)
###############################################################################
# remove_item_from_list(<list> <value>)
#
# A macro to handle removing a value from a list, uses list(REMOVE_ITEM) in
# both cases, but can remove the value itself using CMake 2.4.2 or better,
# while older versions use a slower method of iterating the list to find the
# index of the value to remove.
###############################################################################
macro(remove_item_from_list LIST VALUE)
if(CMAKE242_OR_BETTER)
# For CMake 2.4.2 or better, this can be done automatically
list(REMOVE_ITEM ${LIST} ${VALUE})
else(CMAKE242_OR_BETTER)
# For CMake 2.4.x before 2.4.2, we have to do this ourselves, firstly we set the index and a variable to indicate if the item was found
set(INDEX 0)
set(FOUND FALSE)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# If the item hasn't been found yet, but the current item is the same, remove it
if(NOT FOUND)
if(ITEM STREQUAL ${VALUE})
set(FOUND TRUE)
list(REMOVE_ITEM ${LIST} ${INDEX})
endif(ITEM STREQUAL ${VALUE})
endif(NOT FOUND)
# Increase the index value by 1
math(EXPR INDEX "${INDEX} + 1")
endforeach(ITEM)
endif(CMAKE242_OR_BETTER)
endmacro(remove_item_from_list)
###############################################################################
# sort_list(<list>)
#
# A macro to handle sorting a list, uses list(SORT) if using CMake 2.4.4 or
# better, otherwise it uses a slower method of creating a temporary list and
# adding elements in alphabetical order.
###############################################################################
macro(sort_list LIST)
if(CMAKE244_OR_BETTER)
# For CMake 2.4.4 or better, this can be done automatically
list(SORT ${LIST})
else(CMAKE244_OR_BETTER)
# For CMake 2.4.x before 2.4.4, we have to do this ourselves, firstly we'll create a teporary list
set(NEW_LIST)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# Temporary index position for the new list, as well as temporary value to store if the item was ever found
set(INDEX 0)
set(FOUND FALSE)
# Iterate through the new list
foreach(NEW_ITEM ${NEW_LIST})
# Compare the items, only if nothing was found before
if(NOT FOUND)
if(NEW_ITEM STRGREATER "${ITEM}")
set(FOUND TRUE)
list(INSERT NEW_LIST ${INDEX} ${ITEM})
endif(NEW_ITEM STRGREATER "${ITEM}")
endif(NOT FOUND)
# Increase the index value by 1
math(EXPR INDEX "${INDEX} + 1")
endforeach(NEW_ITEM)
# If the item was never found, just append it to the end
if(NOT FOUND)
append_to_list(NEW_LIST ${ITEM})
endif(NOT FOUND)
endforeach(ITEM)
# Replace the old list with the new list
set(${LIST} ${NEW_LIST})
endif(CMAKE244_OR_BETTER)
endmacro(sort_list)
###############################################################################
# read_from_file(<filename> <regex> <output variable>)
#
# A macro to handle reading specific lines from a file, uses file(STRINGS) if
# using CMake 2.6.x or better, otherwise we read in the entire file and
# perform a string(REGEX MATCH) on each line of the file instead. This
# macro can also be used to read in all the lines of a file if REGEX is set
# to "".
###############################################################################
macro(read_from_file FILE REGEX STRINGS)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRINGS sub-command to get the lines that match the given regular expression (if one is given, otherwise get all lines)
if(REGEX STREQUAL "")
file(STRINGS ${FILE} RESULT)
else(REGEX STREQUAL "")
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
endif(REGEX STREQUAL "")
else(CMAKE26_OR_BETTER)
# 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}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
# Next we replace all newlines with semicolons
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL "")
# For no regular expression, just set the result to all the lines
set(RESULT ${ALL_STRINGS})
else(REGEX STREQUAL "")
# Clear the result list
set(RESULT)
# Iterate through all the lines of the file
foreach(STRING ${ALL_STRINGS})
# Check for a match against the given regular expression
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
# If we had a match, append the match to the list
if(STRING_MATCH)
append_to_list(RESULT ${STRING})
endif(STRING_MATCH)
endforeach(STRING)
endif(REGEX STREQUAL "")
endif(CMAKE26_OR_BETTER)
# Set the given STRINGS variable to the result
set(${STRINGS} ${RESULT})
endmacro(read_from_file)
###############################################################################
# extract_include_filename(<line> <output variable> [<optional output variable of quote type>])
#
# This macro will take a #include line and extract the filename.
###############################################################################
macro(extract_include_filename INCLUDE FILENAME)
# Strip the leading and trailing spaces from the include line
strip_string(${INCLUDE} INCLUDE_STRIPPED)
# Make sure to only do the following if there is a string
if(INCLUDE_STRIPPED STREQUAL "")
set(FILE "")
else(INCLUDE_STRIPPED STREQUAL "")
# Extract the filename including the quotes or angle brackets
string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}")
# If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed
if(${ARGC} GREATER 2)
string(SUBSTRING ${FILE} 0 1 QUOTE)
if(QUOTE STREQUAL "<")
set(${ARGV2} "angle brackets")
else(QUOTE STREQUAL "<")
set(${ARGV2} "quotes")
endif(QUOTE STREQUAL "<")
endif(${ARGC} GREATER 2)
# Now remove the quotes or angle brackets
string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}")
endif(INCLUDE_STRIPPED STREQUAL "")
# Set the filename to the the given variable
set(${FILENAME} "${FILE}")
endmacro(extract_include_filename)
###############################################################################
# find_includes(<source filename> <output variable>)
#
# This macro will search through a file for #include lines, regardless of
# whitespace, but only returns the lines that are valid for the current
# platform CMake is running on.
###############################################################################
macro(find_includes SRC INCLUDES)
# Read all lines from the file that start with #, regardless of whitespace before the #
read_from_file(${SRC} "^[ \t]*#.*$" LINES)
# Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef
set(VALID_LINE TRUE)
set(LAST_DEF)
set(LAST_CHECK)
# Create an empty include list
set(INCLUDES_LIST)
# Iterate through all the # lines
foreach(LINE ${LINES})
# Search for #ifdef, #ifndef, #else, #endif, and #include
string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE})
# If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake
if(FOUND_IFDEF)
# Extract the define
string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
if(DEFINE STREQUAL "_WIN32")
set(DEFINE WIN32)
endif(DEFINE STREQUAL "_WIN32")
# Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check
set(LAST_DEF ${DEFINE})
set(LAST_CHECK TRUE)
# If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped
if(${DEFINE})
set(VALID_LINE TRUE)
else(${DEFINE})
set(VALID_LINE FALSE)
endif(${DEFINE})
else(FOUND_IFDEF)
# If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction
if(FOUND_IFNDEF)
# Extract the define
string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
if(DEFINE STREQUAL "_WIN32")
set(DEFINE WIN32)
endif(DEFINE STREQUAL "_WIN32")
# Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check
set(LAST_DEF ${DEFINE})
set(LAST_CHECK FALSE)
# If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped
if(${DEFINE})
set(VALID_LINE FALSE)
else(${DEFINE})
set(VALUE_LINE TRUE)
endif(${DEFINE})
else(FOUND_IFNDEF)
# If we found a #else on the line, we check the last define in the opposite direction
if(FOUND_ELSE)
# When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check
if(LAST_CHECK)
if(${LAST_DEF})
set(VALID_LINE FALSE)
else(${LAST_DEF})
set(VALID_LINE TRUE)
endif(${LAST_DEF})
# When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check
else(LAST_CHECK)
if(${LAST_DEF})
set(VALID_LINE TRUE)
else(${LAST_DEF})
set(VALID_LINE FALSE)
endif(${LAST_DEF})
endif(LAST_CHECK)
else(FOUND_ELSE)
# If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines
if(FOUND_ENDIF)
set(VALID_LINE TRUE)
else(FOUND_ENDIF)
# If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid
if(FOUND_INCLUDE)
if(VALID_LINE)
append_to_list(INCLUDES_LIST "${LINE}")
endif(VALID_LINE)
endif(FOUND_INCLUDE)
endif(FOUND_ENDIF)
endif(FOUND_ELSE)
endif(FOUND_IFNDEF)
endif(FOUND_IFDEF)
endforeach(LINE)
set(${INCLUDES} ${INCLUDES_LIST})
endmacro(find_includes)
###############################################################################
# calculate_depends(<source filename> [<optional output variable for includes>])
#
# This macro is used in most of the src (sub)directories to calculate the
# header file dependencies for the given source file.
###############################################################################
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
set(CHECK_ANGLE_INCLUDES FALSE)
# Check for a third argument
if(${ARGC} GREATER 1)
set(CHECK_ANGLE_INCLUDES TRUE)
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_includes(${SRC} INCLUDES)
# Reset the list of headers to empty
set(HEADERS)
# Iterate through the strings containing #include (if any)
foreach(INCLUDE ${INCLUDES})
# Extract the filename from the #include line
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
if(QUOTE_TYPE STREQUAL "angle brackets")
# The following checks will only be done if there was a request for angle includes to be checked
if(CHECK_ANGLE_INCLUDES)
# Find the path of the include file
if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include ${EXTRA_INCLUDE})
else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} ${EXTRA_INCLUDE})
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
# If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler
if(FOUND_${FILENAME}_INCLUDE)
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
set(FOUND_IN_DEFAULTS -1)
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
if(FOUND_DEFAULT)
set(FOUND_IN_DEFAULTS 0)
endif(FOUND_DEFAULT)
endforeach(DEFAULT_INCLUDE_DIR)
if(FOUND_IN_DEFAULTS EQUAL -1)
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
if(FOUND_IN_INCLUDES EQUAL -1)
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
endif(FOUND_IN_INCLUDES EQUAL -1)
endif(FOUND_IN_DEFAULTS EQUAL -1)
else(FOUND_${FILENAME}_INCLUDE)
# XXX
if(NOT ${FILENAME} STREQUAL "libintl.h")
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(NOT ${FILENAME} STREQUAL "libintl.h")
endif(FOUND_${FILENAME}_INCLUDE)
endif(CHECK_ANGLE_INCLUDES)
endif(QUOTE_TYPE STREQUAL "angle brackets")
endforeach(INCLUDE)
endmacro(calculate_depends)
###############################################################################
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
#
@@ -432,91 +14,73 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
# Reset libraries
set(LIBRARIES)
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
if(WIN32)
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\*/")
else()
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\*/")
endif()
# Iterate through those lines
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
# 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
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Iterate through the libraries given
foreach(LIBRARY ${REQUIRED_LIBRARY})
# If the library has multiple names extract the alternate.
unset(LIBRARY_ALT)
if (${LIBRARY} MATCHES "^.+\\|.+$")
string(REGEX REPLACE ".+\\|(.*)" "\\1" LIBRARY_ALT ${LIBRARY})
string(REGEX REPLACE "(.+)\\|.*" "\\1" LIBRARY ${LIBRARY})
endif()
# Locate the library to see if it exists
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS})
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
if(DEFAULT_LIBRARY_DIRS OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${DEFAULT_LIBRARY_DIRS} $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
else()
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS} NO_DEFAULT_PATH)
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS})
endif()
# If the library was found, we will add it to the linker flags
if(FOUND_${LIBRARY}_LIBRARY)
# Get the path only of the library, to add it to linker flags
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
if(MSVC)
# For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies
append_to_list(EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
else(MSVC)
# For all others, add the library paths and libraries
append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}")
append_to_list(LIBRARIES "${LIBRARY}")
endif(MSVC)
else(FOUND_${LIBRARY}_LIBRARY)
list(APPEND EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
else()
# Get the path only of the library, to add it to library paths.
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
list(APPEND LIBRARY_PATHS "${LIBRARY_PATH}")
# Extract the library short name, add it to the library path
get_filename_component(LIBRARY_NAME ${FOUND_${LIBRARY}_LIBRARY} NAME_WE)
string(REGEX REPLACE "^lib" "" LIBRARY_NAME ${LIBRARY_NAME})
list(APPEND LIBRARIES ${LIBRARY_NAME})
endif()
else()
# 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(FOUND_${LIBRARY}_LIBRARY)
endforeach(LIBRARY)
endforeach(REQUIRED_LIBRARY)
endif()
endforeach()
endforeach()
# Remove duplicates from the library paths
if(LIBRARY_PATHS)
remove_list_duplicates(LIBRARY_PATHS)
endif(LIBRARY_PATHS)
list(REMOVE_DUPLICATES LIBRARY_PATHS)
endif()
# Remove diplicates from the libraries
if(LIBRARIES)
remove_list_duplicates(LIBRARIES)
endif(LIBRARIES)
list(REMOVE_DUPLICATES LIBRARIES)
endif()
# Iterate through library paths and add them to the linker flags
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
if(FOUND_IN_DEFAULTS EQUAL -1)
if(NOT "${LIBRARY_PATH}" IN_LIST DEFAULT_LIBRARY_DIRS)
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
endif(FOUND_IN_DEFAULTS EQUAL -1)
endforeach(LIBRARY_PATH)
endif()
endforeach()
# Iterate through libraries and add them to the linker flags
foreach(LIBRARY ${LIBRARIES})
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
endforeach(LIBRARY)
list(APPEND EXTRA_DEPENDENCIES "${LIBRARY}")
endforeach()
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
endmacro(calculate_libraries)
###############################################################################
# check_functions(<source filename> <output variable set to TRUE on success>)
#
# This macro is used in most of the module (sub)directories to calculate the
# fcuntion dependencies for the given source file.
###############################################################################
macro(check_functions SRC SUCCESS)
# Default to true
set(${SUCCESS} TRUE)
# Check to see if there are any lines matching: /* RequiredFunctions: [something] */
read_from_file(${SRC} "/\\\\*[ \t]*RequiredFunctions:[ \t]*.*[ \t]*\\\\*/" REQUIRED_FUNCTIONS)
# Iterate through those lines
foreach(REQUIRED_FUNCTION ${REQUIRED_FUNCTIONS})
# Strip off the /* RequiredFunctions: and */ from the line
string(REGEX REPLACE "/\\*[ \t]*RequiredFunctions:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_FUNCTION ${REQUIRED_FUNCTION})
# Replace all commas with semicolons
string(REGEX REPLACE "," ";" REQUIRED_FUNCTION ${REQUIRED_FUNCTION})
# Iterate through the functions given
foreach(FUNCTION ${REQUIRED_FUNCTION})
# Check if the function exists
check_function_exists(${REQUIRED_FUNCTION} HAVE_${REQUIRED_FUNCTION})
# If we don't have the function warn the user and set SUCCESS to FALSE
if(NOT HAVE_${REQUIRED_FUNCTION})
message("${SRC} needs function ${REQUIRED_FUNCTION} but we were unable to locate that function!")
set(${SUCCESS} FALSE)
endif(NOT HAVE_${REQUIRED_FUNCTION})
endforeach(FUNCTION)
endforeach(REQUIRED_FUNCTION)
endmacro(check_functions)
endmacro()
###############################################################################
# add_to_cpack_ignored_files(<item> [TRUE])
@@ -526,17 +90,17 @@ endmacro(check_functions)
# of TRUE is given, periods will be converted to \\. for CPack.
###############################################################################
macro(add_to_cpack_ignored_files ITEM)
# Temporary copy of the orignal item
# Temporary copy of the original item
set(REAL_ITEM "${ITEM}")
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
if(${ARGC} GREATER 1)
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
endif(${ARGC} GREATER 1)
endif()
# If the environment variable is already defined, just tack the item to the end
if(DEFINED ENV{CPACK_IGNORED_FILES})
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
# Otherwise set the environment variable to the item
else(DEFINED ENV{CPACK_IGNORED_FILES})
else()
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
endif(DEFINED ENV{CPACK_IGNORED_FILES})
endmacro(add_to_cpack_ignored_files)
endif()
endmacro()
-34
View File
@@ -1,34 +0,0 @@
# Find the header files, libs, and executables for gettext
if(NOT WIN32)
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(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
else(NOT WIN32)
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(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})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
set(GETTEXT_FOUND TRUE)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
endif(NOT WIN32)
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
if(GETTEXT_FOUND)
include_directories("${GETTEXT_INCLUDE}")
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)
+25 -25
View File
@@ -118,7 +118,7 @@ Var AR_RegFlags
"exit_${SecName}:"
!macroend
!macro RemoveSection SecName
!macro RemoveSection_CPack SecName
; This macro is used to call section's Remove_... macro
;from the uninstaller.
;Input: section index constant name specified in Section command.
@@ -348,7 +348,7 @@ Function un.RemoveFromPath
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall sutff
; Uninstall stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
@@ -452,15 +452,15 @@ Done:
Exch $R1
FunctionEnd
Function ConditionalAddToRegisty
Function ConditionalAddToRegistry
Pop $0
Pop $1
StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
StrCmp "$0" "" ConditionalAddToRegistry_EmptyString
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \
"$1" "$0"
;MessageBox MB_OK "Set Registry: '$1' to '$0'"
DetailPrint "Set install registry entry: '$1' to '$0'"
ConditionalAddToRegisty_EmptyString:
ConditionalAddToRegistry_EmptyString:
FunctionEnd
;--------------------------------
@@ -558,44 +558,44 @@ Section "-Core installation"
WriteUninstaller "$INSTDIR\Uninstall.exe"
Push "DisplayName"
Push "@CPACK_NSIS_DISPLAY_NAME@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "DisplayVersion"
Push "@CPACK_PACKAGE_VERSION@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "Publisher"
Push "@CPACK_PACKAGE_VENDOR@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "UninstallString"
Push "$INSTDIR\Uninstall.exe"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "NoRepair"
Push "1"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
Push "$INSTDIR\AddRemove.exe"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
!else
Push "NoModify"
Push "1"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
!endif
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "HelpLink"
Push "@CPACK_NSIS_HELP_LINK@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "URLInfoAbout"
Push "@CPACK_NSIS_URL_INFO_ABOUT@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "Contact"
Push "@CPACK_NSIS_CONTACT@"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
@@ -607,19 +607,19 @@ Section "-Core installation"
; Write special uninstall registry entries
Push "StartMenu"
Push "$STARTMENU_FOLDER"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "DoNotAddToPath"
Push "$DO_NOT_ADD_TO_PATH"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "AddToPathAllUsers"
Push "$ADD_TO_PATH_ALL_USERS"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "AddToPathCurrentUser"
Push "$ADD_TO_PATH_CURRENT_USER"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
Push "InstallToDesktop"
Push "$INSTALL_DESKTOP"
Call ConditionalAddToRegisty
Call ConditionalAddToRegistry
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
@@ -731,7 +731,7 @@ Section "Uninstall"
DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
; Removes all optional components
!insertmacro SectionList "RemoveSection"
!insertmacro SectionList "RemoveSection_CPack"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
@@ -739,7 +739,7 @@ Section "Uninstall"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent diretories
;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
startMenuDeleteLoop:
@@ -752,13 +752,13 @@ Section "Uninstall"
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
; If the user changed the shortcut, then untinstall may not work. This should
; If the user changed the shortcut, then uninstall may not work. This should
; try to fix it.
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent diretories
;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
secondStartMenuDeleteLoop:
-5
View File
@@ -1,5 +0,0 @@
# This file is external to the read_from_file macro in Anope.cmake in order to
# get around a possible memory leak in older versions of CMake.
file(READ "${FILE}" RESULT)
message("${RESULT}")
+2 -2
View File
@@ -1,6 +1,6 @@
# Only install example.chk and example.conf from this directory
# Only install example.chk and anope.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)
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)
set(DATA example.chk anope.example.conf botserv.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}
DESTINATION ${CONF_DIR}
)
+325 -217
View File
@@ -1,8 +1,8 @@
/*
* 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".
* Example configuration file for Anope. After making the appropriate
* changes to this file, place it in the Anope conf directory (as
* specified in the "Config" script, default /home/username/anope/conf)
* under the name "anope.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
@@ -53,7 +53,7 @@
* included to indicate whether an option is required:
*
* [REQUIRED]
* Indicates a directive which must be given. Without it, Services will
* Indicates a directive which must be given. Without it, Anope will
* not start.
*
* [RECOMMENDED]
@@ -71,7 +71,7 @@
*
* [DEPRECATED]
* Indicates a directive which will disappear in a future version of
* Services, usually because its functionality has been either
* Anope, usually because its functionality has been either
* superseded by that of other directives or incorporated into the main
* program.
*/
@@ -80,7 +80,7 @@
* [OPTIONAL] Defines
*
* You can define values to other values, which can be used to easily change
* many values in the configuration. at once.
* many values in the configuration at once.
*/
/*
@@ -90,7 +90,7 @@
define
{
name = "services.host"
value = "services.localhost.net"
value = "services.example.com"
}
/*
@@ -110,7 +110,7 @@ define
#include
{
type = "executable"
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
name = "/usr/bin/wget -q -O - https://some.misconfigured.network.com/anope.conf"
}
/*
@@ -120,54 +120,63 @@ define
* 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
* Each uplink IRCd should have a corresponding configuration to allow Anope
* 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"
* # This goes in inspircd.conf, *NOT* your Anope config!
* <module name="hidechans">
* <module name="services_account">
* <module name="spanningtree">
* <bind address="127.0.0.1" port="7000" type="servers">
* <link name="services.example.com"
* 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">
* <uline server="services.example.com" silent="yes">
*
* 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;
* // This goes in unrealircd.conf, *NOT* your Anope config!
* listen {
* ip 127.0.0.1;
* port 7000;
* options {
* serversonly;
* };
* };
* ulines { services.localhost.net; };
* listen 127.0.0.1:7000;
* link services.example.com {
* incoming {
* mask *@127.0.0.1;
* };
* password "mypassword";
* class servers;
* };
* ulines { services.example.com; };
*/
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).
* The IP address, hostname, or UNIX socket path of the IRC server you wish
* to connect Anope to.
* Usually, you will want to connect 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.
* The protocol that Anope should use when connecting to the uplink. Can
* be set to "ipv4" (the default), "ipv6", or "unix".
*/
ipv6 = no
protocol = "ipv4"
/*
* Enable if Services should connect using SSL.
* Enable if Anope should connect using SSL.
* You must have an SSL module loaded for this to work.
*/
ssl = no
@@ -193,26 +202,26 @@ uplink
/*
* [REQUIRED] Server Information
*
* This section contains information about the Services server.
* This section contains information about the services server.
*/
serverinfo
{
/*
* The hostname that Services will be seen as, it must have no conflicts with any
* The hostname that Anope 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 = "services.localhost.net"
name = "services.example.com"
/*
* The text which should appear as the server's information in /whois and similar
* The text which should appear as the server's information in /WHOIS and similar
* queries.
*/
description = "Services for IRC Networks"
description = "Anope IRC Services"
/*
* 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 local address that Anope will bind to before connecting to the remote
* server. This may be useful for multihomed hosts. If omitted, Anope 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
@@ -228,16 +237,16 @@ serverinfo
#id = "00A"
/*
* The filename containing the Services process ID. The path is relative to the
* services root directory.
* The filename containing the Anope process ID. The path is relative to the
* data directory.
*/
pid = "data/services.pid"
pid = "anope.pid"
/*
* The filename containing the Message of the Day. The path is relative to the
* services root directory.
* config directory.
*/
motd = "conf/services.motd"
motd = "motd.txt"
}
/*
@@ -248,18 +257,17 @@ serverinfo
*
* Supported:
* - bahamut
* - charybdis
* - hybrid
* - inspircd12
* - inspircd20
* - inspircd
* - ngircd
* - plexus
* - ratbox
* - unreal
* - solanum
* - unrealircd
*/
module
{
name = "inspircd20"
name = "inspircd"
/*
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
@@ -281,50 +289,61 @@ module
/*
* [REQUIRED] Network Information
*
* This section contains information about the IRC network that Services will be
* This section contains information about the IRC network that Anope will be
* connecting to.
*/
networkinfo
{
/*
* This is the name of the network that Services will be running on.
* This is the name of the network that Anope 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.
* Anope being disconnected from the network. Defaults to 31.
*/
nicklen = 31
#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.
* Anope being disconnected from the network. Defaults to 10.
*/
userlen = 10
#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.
* Anope being disconnected from the network. Defaults to 64.
*/
hostlen = 64
#hostlen = 64
/* Set this to the maximum allowed channel length on your network.
* Defaults to 32.
*/
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.
* Set to 0 to disable. Defaults to 100.
*/
modelistsize = 100
#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 Anope
* 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.
* disallows could potentially break the IRCd and/or Anope.
*
* It is recommended you DON'T change this.
*/
@@ -349,22 +368,22 @@ networkinfo
}
/*
* [REQUIRED] Services Options
* [REQUIRED] Anope Options
*
* This section contains various options which determine how Services will operate.
* This section contains various options which determine how Anope 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
* 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
* installed on your machine. Anope uses 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.
@@ -377,36 +396,11 @@ options
casemap = "ascii"
/*
* 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
* key to anyone! Keep it private!
*
* NOTE: If you don't uncomment this or keep the default values, any talented
* programmer would be able to easily "guess" random strings used to mask
* information. Be safe, and come up with a 7-digit number.
*
* This directive is optional, but highly recommended.
*/
#seed = 9866235
/*
* 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
* entity (nickname name) with which it is associated. When set, however,
* Services will also check that the password is at least five
* characters long, and in the future will probably check other things
* as well.
*
* This directive is optional, but recommended.
*/
strictpasswords = yes
/*
* Sets the number of invalid password tries before Services removes a user
* Sets the number of invalid password tries before services removes a user
* from the network. If a user enters a number of invalid passwords equal to
* the given amount for any Services function or combination of functions
* during a single IRC session (subject to badpasstimeout, below), Services
* will issues a /KILL for the user. If not given, Services will ignore
* the given amount for any services function or combination of functions
* during a single IRC session (subject to badpasstimeout, below), services
* will issues a /KILL for the user. If not given, services will ignore
* failed password attempts (though they will be logged in any case).
*
* This directive is optional, but recommended.
@@ -448,7 +442,7 @@ options
/*
* Sets the (maximum) frequency at which the timeout list is checked. This,
* combined with readtimeout above, determines how accurately timed events,
* such as nick kills, occur; it also determines how much CPU time Services
* such as nick kills, occur; it also determines how much CPU time services
* will use doing this. Higher values will cause less accurate timing but
* less CPU usage.
*
@@ -461,8 +455,8 @@ options
timeoutcheck = 3s
/*
* If set, this will allow users to let Services send PRIVMSGs to them
* instead of NOTICEs. Also see the defmsg option of nickserv:defaults,
* If set, this will allow users to let services send PRIVMSGs to them
* instead of NOTICEs. Also see the "msg" option of nickserv:defaults,
* which also toggles the default communication (PRIVMSG or NOTICE) to
* use for unregistered users.
*
@@ -474,8 +468,8 @@ options
#useprivmsg = yes
/*
* If set, will force Services to only respond to PRIVMSGs addresses to
* Nick@ServerName - e.g. NickServ@localhost.net. This should be used in
* If set, will force services to only respond to PRIVMSGs addresses to
* Nick@ServerName - e.g. NickServ@example.com. This should be used in
* conjunction with IRCd aliases. This directive is optional.
*
* This option will have no effect on some IRCds, such as TS6 IRCds.
@@ -483,14 +477,14 @@ options
#usestrictprivmsg = yes
/*
* If set, Services will only show /stats o to IRC Operators. This directive
* If set, Anope 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
* A space-separated list of U-lined servers on your network, it is assumed that
* the servers in this list are allowed to set channel modes and Anope will
* not attempt to reverse their mode changes.
*
* WARNING: Do NOT put your normal IRC user servers in this directive.
@@ -505,30 +499,36 @@ options
retrywait = 60s
/*
* If set, Services will hide commands that users don't have the privilege to execute
* If set, services will hide commands that users don't have the privilege to execute
* from HELP output.
*/
hideprivilegedcommands = yes
/*
* If set, Services will hide commands that users can't execute because they are not
* If set, services will hide commands that users can't execute because they are not
* logged in from HELP output.
*/
hideregisteredcommands = yes
/*
* If set, the maximum difference between an invalid and valid command name to allow
* as a suggestion. Defaults to 4.
*/
didyoumeandifference = 4
/* The regex engine to use, as provided by the regex modules.
* Leave commented to disable regex matching.
*
* Note for this to work the regex module providing the regex engine must be loaded.
*/
regexengine = "regex/pcre"
#regexengine = "regex/stdlib"
/*
* A list of languages to load on startup that will be available in /nickserv set language.
* 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.
* 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.
* Removing .UTF-8 will instead use the default encoding for the language, e.g. 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"
@@ -644,6 +644,8 @@ log
* - a channel name
* - a filename
* - globops
*
* If you specify a filename the current date in the format ".YYYYMMDD" will be appended to the path.
*/
target = "services.log"
@@ -657,19 +659,19 @@ log
/*
* 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.
* This can be a users name, a channel name, one of our clients (e.g. 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.
* The bot used to log generic messages which have no predefined sender if the
* target directive is set to a channel or globops.
*/
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.
* The number of days to keep log files, only useful if you are logging to a file.
* Set to 0 to never delete old log files.
*
* Note that Anope must run 24 hours a day for this feature to work correctly.
*/
@@ -694,7 +696,7 @@ log
* means "* ~operserv/*" would log everything because * matches everything.
*
* Valid admin, override, and command options are:
* pesudo-serv/commandname (eg, operserv/akill, chanserv/set)
* pseudo-serv/commandname (e.g. operserv/akill, chanserv/set)
*
* Valid server options are:
* connect, quit, sync, squit
@@ -703,7 +705,7 @@ log
* create, destroy, join, part, kick, leave, mode
*
* 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.
*
@@ -725,8 +727,9 @@ log
*/
log
{
bot = "Global"
target = "globops"
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"
admin = "global/* operserv/chankill operserv/mode operserv/kick operserv/akill operserv/s*line operserv/noop operserv/jupe operserv/set operserv/svsnick operserv/svsjoin operserv/svspart nickserv/getpass */drop"
servers = "squit"
users = "oper"
other = "expire/* bados akill/*"
@@ -739,7 +742,6 @@ log
* You may define groups of commands and privileges, as well as who may use them.
*
* This block is recommended, as without it you will be unable to access most oper commands.
* It replaces the old ServicesRoot directive amongst others.
*
* The command names below are defaults and are configured in the *serv.conf's. If you configure
* additional commands with permissions, such as commands from third party modules, the permissions
@@ -747,49 +749,47 @@ log
*
* Available privileges:
* 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/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/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/no-limit - Can send memos through limits and throttles
* nickserv/access - Can modify other users access and certificate lists
* 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/cert - Can modify other users certificate lists
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
* nickserv/recover - Can recover other users nicks
* operserv/config - Can modify services's configuration
* protected - Can not be kicked from channels by Services
* 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:
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private
* 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/saset/bantype chanserv/saset/description chanserv/saset/email chanserv/saset/keepmodes
* chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/restricted
* chanserv/saset/peace chanserv/saset/persist chanserv/saset/private
* chanserv/saset/secure chanserv/saset/securefounder chanserv/saset/secureops
* chanserv/saset/signkick chanserv/saset/successor chanserv/saset/topiclock
* chanserv/saset/url chanserv/saset/noexpire chanserv/saset/autoop
* chanserv/saset/noexpire
*
* memoserv/sendall memoserv/staff
*
* nickserv/getpass nickserv/getemail nickserv/suspend nickserv/ajoin
* nickserv/resetpass nickserv/list
* nickserv/getemail nickserv/suspend nickserv/ajoin nickserv/list
*
* 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/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
* nickserv/saset/keepmodes
* nickserv/saset/autoop nickserv/saset/display nickserv/saset/email nickserv/saset/greet
* nickserv/saset/kill nickserv/saset/keepmodes nickserv/saset/language nickserv/saset/message
* nickserv/saset/neverop nickserv/saset/noexpire nickserv/saset/password nickserv/saset/private
* nickserv/saset/url
*
* hostserv/set hostserv/del hostserv/list
*
* global/global
* global/global global/queue global/server
*
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
@@ -797,12 +797,15 @@ log
* operserv/oper operserv/config operserv/umode operserv/logsearch
* operserv/modload operserv/jupe operserv/set operserv/noop
* operserv/quit operserv/update operserv/reload operserv/restart
* operserv/shutdown operserv/svs operserv/oline operserv/kill
* operserv/shutdown operserv/svs operserv/kill
*
* Firstly, we define 'opertypes' which are named whatever we want ('Network Administrator', etc).
* These can contain commands for oper-only strings (see above) which grants access to that specific command,
* and privileges (which grant access to more general permissions for the named area).
* Wildcard entries are permitted for both, e.g. 'commands = "operserv/*"' for all OperServ commands.
* You can also negate values with a ~. For example, "~operserv/akill operserv/*" would allow all OperServ
* commands except for operserv/akill. Note that processing stops at the first matching option, which
* means "* ~operserv/*" would allow everything because * matches everything.
*
* Below are some default example types, but this is by no means exhaustive,
* and it is recommended that you configure them to your needs.
@@ -822,11 +825,11 @@ opertype
/* The name of this opertype */
name = "Services Operator"
/* What opertype(s) this inherits from. Seperate with a comma. */
/* What opertype(s) this inherits from. Separate with a comma. */
inherits = "Helper, Another Helper"
/* 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 */
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm"
@@ -848,7 +851,7 @@ opertype
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/*"
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/noop operserv/forbid global/*"
privs = "*"
}
@@ -866,10 +869,10 @@ opertype
* After defining different types of operators in the above opertype section, we now define who is in these groups
* through 'oper' blocks, similar to ircd access.
*
* The default is to comment these out (so NOBODY will have Services access).
* The default is to comment these out (so NOBODY will have access).
* You probably want to add yourself and a few other people at minimum.
*
* 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.
*/
#oper
@@ -880,12 +883,12 @@ opertype
/* The opertype this person will have */
type = "Services Root"
/* If set, the user must be an oper on the IRCd to gain their Services
/* If set, the user must be an oper on the IRCd to gain their
* oper privileges.
*/
require_oper = yes
/* An optional password. If defined the user must login using "/msg OperServ LOGIN" first */
/* An optional password. If defined, the user must login using "/OPERSERV LOGIN" first */
#password = "secret"
/* An optional SSL fingerprint. If defined, it's required to be able to use this opertype. */
@@ -915,7 +918,7 @@ opertype
/*
* [OPTIONAL] Mail Config
*
* This section contains settings related to the use of e-mail from Services.
* This section contains settings related to the use of email from services.
* If the usemail directive is set to yes, unless specified otherwise, all other
* directives are required.
*
@@ -926,7 +929,7 @@ opertype
mail
{
/*
* If set, this option enables the mail commands in Services. You may choose
* If set, this option enables the mail commands in Anope. You may choose
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
* this directive (and entire block) is optional, it is required if
* nickserv:registration is set to yes.
@@ -935,7 +938,7 @@ mail
/*
* This is the command-line that will be used to call the mailer to send an
* e-mail. It must be called with all the parameters needed to make it
* email. It must be called with all the parameters needed to make it
* scan the mail input to find the mail recipient; consult your mailer
* documentation.
*
@@ -943,33 +946,24 @@ mail
* it. This one usually needs no parameters on the command-line. Most
* sendmail applications (or replacements of it) require the -t option
* to be used.
*
* If you are running on Windows you should use a Windows sendmail port
* like https://www.glob.com.au/sendmail/ for sending emails.
*/
sendmailpath = "/usr/sbin/sendmail -t"
#sendmailpath = "/usr/sbin/sendmail -it"
/*
* This is the e-mail address from which all the e-mails are to be sent from.
* This is the email address from which all the emails are to be sent from.
* It should really exist.
*/
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
sendfrom = "services@example.com"
/*
* 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
* a user must wait before they can receive another e-mail.
* another email after they have sent one. It also controls the minimum time
* a user must wait before they can receive another email.
*
* This feature prevents users from being mail bombed using Services and
* This feature prevents users from being mail bombed using services and
* it is highly recommended that it be used.
*
* This directive is optional, but highly recommended.
@@ -977,16 +971,29 @@ mail
delay = 5m
/*
* If set, Services will not attempt to put quotes around the TO: fields
* in e-mails.
* If set, Anope will not put quotes around the TO: fields
* in emails.
*
* This directive is optional, and as far as we know, it's only needed
* if you are using ESMTP or QMail to send out e-mails.
* if you are using ESMTP or QMail to send out emails.
*/
#dontquoteaddresses = yes
/*
* The content type to use when sending emails.
*
* This directive is optional, and is generally only needed if you want to
* use HTML or non UTF-8 text in your services emails.
*/
#content_type = "text/plain; charset=UTF-8"
/*
* The subject and message of emails sent to users when they register accounts.
*
* Available tokens for this template are:
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
registration_subject = "Nickname registration for %n"
registration_message = "Hi,
@@ -1000,6 +1007,11 @@ mail
/*
* The subject and message of emails sent to users when they request a new password.
*
* Available tokens for this template are:
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
reset_subject = "Reset password request for %n"
reset_message = "Hi,
@@ -1013,11 +1025,18 @@ mail
/*
* The subject and message of emails sent to users when they request a new email address.
*
* Available tokens for this template are:
* %e - Gets replaced with the old email address
* %E - Gets replaced with the new email address
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
emailchange_subject = "Email confirmation"
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.
If you don't know why this mail was sent to you, please ignore it silently.
@@ -1026,6 +1045,13 @@ mail
/*
* The subject and message of emails sent to users when they receive a new memo.
*
* Available tokens for this template are:
* %n - Gets replaced with the nickname
* %s - Gets replaced with the sender's nickname
* %d - Gets replaced with the memo number
* %t - Gets replaced with the memo text
* %N - Gets replaced with the network name
*/
memo_subject = "New memo"
memo_message = "Hi %n,
@@ -1066,6 +1092,22 @@ mail
#hash = "md5"
}
/*
* db_atheme
*
* This allows importing databases from Atheme. You should load another database module as
* well as this as it can only read Atheme databases not write them.
*/
#module
{
name = "db_atheme"
/*
* The database name db_atheme should use.
*/
database = "atheme.db"
}
/*
* [RECOMMENDED] db_flatfile
*
@@ -1082,18 +1124,18 @@ module
/*
* 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.
* or if you set it to 0, Anope won't backup the databases.
*
* NOTE: Services must run 24 hours a day for this feature to work.
* NOTE: Anope 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)
* Allows Anope 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
* allow Anope 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
@@ -1165,8 +1207,8 @@ module
/*
* 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.
* This module allows using Redis (https://redis.io/) as a database backend.
* This module requires that 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
@@ -1178,7 +1220,7 @@ module
name = "db_redis"
/*
* Redis database to use. This must be configured with m_redis.
* Redis database to use. This must be configured with redis.
*/
engine = "redis/main"
}
@@ -1186,55 +1228,121 @@ module
/*
* [RECOMMENDED] Encryption modules.
*
* The encryption modules are used when dealing with passwords. This determines how
* the passwords are stored in the databases, and does not add any security as
* far as transmitting passwords over the network goes.
*
* Without any encryption modules loaded users will not be able to authenticate unless
* there is another module loaded that provides authentication checking, such as
* m_ldap_authentication or m_sql_authentication.
*
* With enc_none, passwords will be stored in plain text, allowing for passwords
* to be recovered later but it isn't secure and therefore is not recommended.
*
* The other encryption modules use one-way encryption, so the passwords can not
* be recovered later if those are used.
*
* The first encryption module loaded is the primary encryption module. All new passwords are
* encrypted by this module. Old passwords stored in another encryption method are
* automatically re-encrypted by the primary encryption module on next identify.
*
* NOTE: enc_old is Anope's previous (broken) MD5 implementation which is present in
* 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
* potentially broken when moving between 2 different OSes, such as moving from
* Linux to Windows. It is recommended that you use enc_sha256 instead if you want
* to use an SHA-based encryption. If you choose to do so, it is also recommended
* that you first try to get everyone's passwords converted to enc_sha256 before
* switching OSes by placing enc_sha256 at the beginning of the list.
* The encryption modules are used when dealing with passwords. This determines
* how the passwords are stored in the databases.
*
* The first encryption module loaded is the primary encryption module. All new
* passwords are encrypted by this module. Old passwords encrypted with another
* encryption method are automatically re-encrypted with the primary encryption
* module the next time the user identifies.
*/
#module { name = "enc_bcrypt" }
module { name = "enc_sha256" }
/*
* enc_sha2
*
* Provides support for encrypting passwords using the HMAC-SHA-2 algorithm. See
* https://en.wikipedia.org/wiki/SHA-2 and https://en.wikipedia.org/wiki/HMAC
* for more information.
*/
module
{
name = "enc_sha2"
/** The sub-algorithm to use. Can be set to sha224 for SHA-224, sha256 for
* SHA-256, sha284 for SHA-384 or sha512 to SHA-512. Defaults to sha256.
*/
#algorithm = "sha256"
}
/*
* [EXTRA] enc_argon2
*
* Provides support for encrypting passwords using the Argon2 algorithm. See
* https://en.wikipedia.org/wiki/Argon2 for more information.
*/
#module
{
name = "enc_argon2"
/** The sub-algorithm to use. Can be set to argon2d for Argon2d, argon2i for
* Argon2i, or argon2id for Argon2id. Defaults to argon2id.
*/
#algorithm = "argon2id"
/** The memory hardness in kibibytes of the Argon2 algorithm. Defaults to
* 128 mebibytes.
*/
#memory_cost = 121072
/** The time hardness (iterations) of the Argon2 algorithm. Defaults to 3.
*/
#time_cost = 3
/** The amount of parallel threads to use when encrypting passwords.
* Defaults to 1.
*/
#parallelism = 1
/** The length in bytes of an Argon2 hash. Defaults to 32. */
#hash_length = 32
/** The length in bytes of an Argon2 salt. Defaults to 32. */
#salt_length = 32
}
/*
* enc_bcrypt
*
* Provides support for encrypting passwords using the Bcrypt algorithm. See
* https://en.wikipedia.org/wiki/Bcrypt for more information.
*/
#module
{
name = "enc_bcrypt"
/** The number of Bcrypt rounds to perform on passwords. Can be set to any
* number between 10 and 32 but higher numbers are more CPU intensive and
* may impact performance.
*/
#rounds = 10
}
/*
* [EXTRA] enc_posix
*
* Provides verify-only support for passwords encrypted using the POSIX crypt()
* function. Load this if you are migratign from another services packages such
* as Atheme. See https://en.wikipedia.org/wiki/Crypt_(C) for more information.
*
* You must load another encryption method before this to re-encrypt passwords
* with when a user logs in.
*/
#module { name = "enc_posix" }
/*
* [DEPRECATED] enc_md5, enc_none, enc_old, enc_sha1, enc_sha256
*
* Provides verify-only support for passwords encrypted using encryption methods
* from older versions of Anope. These methods are no longer considered secure
* and will be removed in a future version of Anope. Only load them if you are
* upgrading from a previous version of Anope that used them.
*
* enc_md5: Verifies passwords encrypted with the MD5 algorithm
* enc_none: Verifies passwords that are not encrypted
* enc_sha1: Verifies passwords encrypted with the SHA1 algorithm
* enc_old: Verifies passwords encrypted with the broken MD5 algorithm used
* before 1.7.17.
* enc_sha256: Verifies passwords encrypted with the SHA256 algorithm using a
* custom initialisation vector as a salt.
*
* You must load another encryption method before this to re-encrypt passwords
* with when a user logs in.
*/
#module { name = "enc_md5" }
#module { name = "enc_sha1" }
/*
* When using enc_none, passwords will be stored without encryption. This isn't secure
* therefore it is not recommended.
*/
#module { name = "enc_none" }
/*
* enc_old is Anope's previous (broken) MD5 implementation used from 1.4.x to 1.7.16.
* If your databases were made using that module, load it here to allow conversion to the primary
* encryption method.
*/
#module { name = "enc_old" }
#module { name = "enc_sha1" }
#module { name = "enc_sha256" }
/* Extra (optional) modules. */
include
+8 -6
View File
@@ -10,7 +10,7 @@
* 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 waant to map some of the below commands to other services, like placing botserv/bot on
* 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.
@@ -183,7 +183,7 @@ module
/*
* The maximum number of entries a single bad words list can have.
*/
badwordsmax = 32
badwordsmax = 50
/*
* If set, BotServ will use case sensitive checking for badwords.
@@ -202,7 +202,7 @@ command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords";
* Used for administrating BotServ bots.
*/
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
@@ -242,14 +242,14 @@ command { service = "BotServ"; name = "INFO"; command = "botserv/info"; }
* 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/bolds - Configures BotServ's bold text kicker.
* 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/kick/underlines - Configures BotServ's underline kicker.
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
*
@@ -323,6 +323,7 @@ command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/
privilege
{
name = "GREET"
desc = _("Greet message displayed on join")
rank = 40
level = 5
flag = "g"
@@ -333,7 +334,7 @@ privilege
/*
* fantasy
*
* Allows 'fantaisist' commands to be used in channels.
* Allows 'fantasist' commands to be used in channels.
*
* Provides the commands:
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
@@ -386,6 +387,7 @@ fantasy { name = "LEVELS"; command = "chanserv/levels"; }
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
fantasy { name = "LOG"; command = "chanserv/log"; }
fantasy { name = "MODE"; command = "chanserv/mode"; }
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"; }
+111 -34
View File
@@ -76,10 +76,8 @@ module
* access level or superior
* - cs_private: Hide the channel from ChanServ's LIST command
* - restricted: Kick/ban users who are restricted from the channel
* - cs_secure: Enable channel security, requiring the user to be identified with NickServ in
* order to be considered for being on the access list of the channel
* - secureops: Only allow operator status to be given if the user is on the access list
* - securefounder: Only allow the real founder of the channel to drop the channel, change it's
* - securefounder: Only allow the real founder of the channel to drop the channel, change its
* password, or change the founder or successor
* - signkick: Use of ChanServ's KICK command will cause the user's nick to be signed to the kick.
* - signkick_level: Same as above, but the kick will not be signed if the user is at the same access
@@ -89,12 +87,14 @@ module
* - noautoop: Disables autoop on the channel
* - cs_keep_modes: Enables keep modes on the channel, which retains modes when the channel is
* not in use.
* - cs_no_expire: Enables no expire. Needs founder, successor (if set) or anyone in the access list
* to be a registered nick, otherwise the channel will be dropped.
* - none: No defaults
*
* This directive is optional, if left blank, the options will default to keeptopic, cs_secure, securefounder,
* and signkick. If you really want no defaults, use "none" by itself as the option.
* This directive is optional, if left blank, the options will default to keeptopic, peace,
* securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
*/
defaults = "keeptopic peace cs_secure securefounder signkick"
defaults = "keeptopic peace securefounder signkick"
/*
* The maximum number of channels which may be registered to a single nickname.
@@ -108,21 +108,21 @@ module
* The length of time before a channel registration expires.
*
* This directive is optional, but recommended.
* If not set, the default is 14 days.
* If not set, the default is 30 days.
*/
expire = 14d
expire = 30d
/*
* The maximum number of entries on a channel's access list.
* If not set, the default is 1024. This can be set to 0 for unlimited.
* If not set, the default is 1000. This can be set to 0 for unlimited.
*/
accessmax = 1024
accessmax = 1000
/*
* The length of time ChanServ stays in a channel after kicking a user from a channel they are not
* permitted to be in. This only occurs when the user is the only one in the channel.
*/
inhabit = 15s
inhabit = 1m
/*
* Allow only IRC Operators to use ChanServ.
@@ -151,6 +151,13 @@ module
*/
reasonmax = 200
/*
* The message formatting to use for signed kick messages.
* %n is the nick of the kicker
* %m is the message specified
*/
signkickformat = "%m (%n)"
/*
* If set, prevents channel access entries from containing hostmasks.
*/
@@ -186,12 +193,12 @@ module
*
* If you load cs_xop, you may define a XOP command to associate the privilege with.
*
* The name of privileges are uesd to associate them with channel modes. If you are using an IRCd that allows you to define additional
* The name of privileges are used to associate them with channel modes. If you are using an IRCd that allows you to define additional
* channel status modes, such as InspIRCd, you can associate privileges (and thus access levels, flags, xop) with the mode by naming
* the privileges appropriately. For example, if you had a channel mode called admin, you could create AUTOADMIN, ADMIN, and ADMINME
* privileges which would automatically be associated with that channel mode.
*
* Defining new privileges here is not useful unless you have a module (eg, a third party one) made to check for
* Defining new privileges here is not useful unless you have a module (e.g. a third party one) made to check for
* the specific level you are defining.
*
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
@@ -207,6 +214,7 @@ module
privilege
{
name = "ACCESS_CHANGE"
desc = _("Allowed to modify the access list")
rank = 0
level = 10
flag = "f"
@@ -223,6 +231,7 @@ privilege
privilege
{
name = "ACCESS_LIST"
desc = _("Allowed to view the access list")
rank = 10
level = 3
flag = "f"
@@ -239,6 +248,7 @@ privilege
privilege
{
name = "AKICK"
desc = _("Allowed to use the AKICK command")
rank = 250
level = 10
flag = "K"
@@ -255,6 +265,7 @@ privilege
privilege
{
name = "ASSIGN"
desc = _("Allowed to assign/unassign a bot")
rank = 270
level = "founder"
flag = "s"
@@ -271,6 +282,7 @@ privilege
privilege
{
name = "AUTOHALFOP"
desc = _("Automatic halfop upon join")
rank = 100
level = 4
flag = "H"
@@ -287,6 +299,7 @@ privilege
privilege
{
name = "AUTOOP"
desc = _("Automatic channel operator status upon join")
rank = 210
level = 5
flag = "O"
@@ -303,6 +316,7 @@ privilege
privilege
{
name = "AUTOOWNER"
desc = _("Automatic owner upon join")
rank = 330
level = 9999
flag = "Q"
@@ -319,6 +333,7 @@ privilege
privilege
{
name = "AUTOPROTECT"
desc = _("Automatic protect upon join")
rank = 240
level = 10
flag = "A"
@@ -335,6 +350,7 @@ privilege
privilege
{
name = "AUTOVOICE"
desc = _("Automatic voice on join")
rank = 50
level = 3
flag = "V"
@@ -351,6 +367,7 @@ privilege
privilege
{
name = "BADWORDS"
desc = _("Allowed to modify channel badwords list")
rank = 260
level = 10
flag = "K"
@@ -367,6 +384,7 @@ privilege
privilege
{
name = "BAN"
desc = _("Allowed to ban users")
rank = 150
level = 4
flag = "b"
@@ -383,6 +401,7 @@ privilege
privilege
{
name = "FANTASIA"
desc = _("Allowed to use fantasy commands")
rank = 30
level = 3
flag = "c"
@@ -402,6 +421,7 @@ privilege
privilege
{
name = "FOUNDER"
desc = _("Allowed to issue commands restricted to channel founders")
rank = 360
level = 10000
flag = "F"
@@ -413,12 +433,13 @@ privilege
*
* Used by chanserv/getkey and nickserv/ajoin.
*
* Users with this permission can get they channel key with GETKEY and
* Users with this permission can get their channel key with GETKEY and
* can use nickserv/ajoin to join channels with keys.
*/
privilege
{
name = "GETKEY"
desc = _("Allowed to use GETKEY command")
rank = 180
level = 5
flag = "G"
@@ -436,6 +457,7 @@ privilege
privilege
{
name = "HALFOP"
desc = _("Allowed to (de)halfop users")
rank = 120
level = 5
flag = "h"
@@ -453,6 +475,7 @@ privilege
privilege
{
name = "HALFOPME"
desc = _("Allowed to (de)halfop themself")
rank = 110
level = 4
flag = "h"
@@ -470,6 +493,7 @@ privilege
privilege
{
name = "INFO"
desc = _("Allowed to get full INFO output")
rank = 80
level = 9999
flag = "I"
@@ -487,6 +511,7 @@ privilege
privilege
{
name = "INVITE"
desc = _("Allowed to use the INVITE command")
rank = 190
level = 5
flag = "i"
@@ -503,6 +528,7 @@ privilege
privilege
{
name = "KICK"
desc = _("Allowed to use the KICK command")
rank = 130
level = 4
flag = "k"
@@ -520,6 +546,7 @@ privilege
privilege
{
name = "MEMO"
desc = _("Allowed to read channel memos")
rank = 280
level = 10
flag = "m"
@@ -537,6 +564,7 @@ privilege
privilege
{
name = "MODE"
desc = _("Allowed to use the MODE command")
rank = 170
level = 9999
flag = "s"
@@ -553,6 +581,7 @@ privilege
privilege
{
name = "NOKICK"
desc = _("Prevents users being kicked by services")
rank = 20
level = 1
flag = "N"
@@ -570,6 +599,7 @@ privilege
privilege
{
name = "OP"
desc = _("Allowed to (de)op users")
rank = 230
level = 5
flag = "o"
@@ -587,6 +617,7 @@ privilege
privilege
{
name = "OPME"
desc = _("Allowed to (de)op themself")
rank = 220
level = 5
flag = "o"
@@ -604,6 +635,7 @@ privilege
privilege
{
name = "OWNER"
desc = _("Allowed to (de)owner users")
rank = 350
level = "founder"
flag = "q"
@@ -621,6 +653,7 @@ privilege
privilege
{
name = "OWNERME"
desc = _("Allowed to (de)owner themself")
rank = 340
level = 9999
flag = "q"
@@ -638,6 +671,7 @@ privilege
privilege
{
name = "PROTECT"
desc = _("Allowed to (de)protect users")
rank = 310
level = 9999
flag = "a"
@@ -655,10 +689,11 @@ privilege
privilege
{
name = "PROTECTME"
desc = _("Allowed to (de)protect themself")
rank = 300
level = 10
flag = "a"
xop = "AOP"
xop = "SOP"
}
/*
@@ -672,6 +707,7 @@ privilege
privilege
{
name = "SAY"
desc = _("Allowed to use SAY and ACT commands")
rank = 90
level = 5
flag = "B"
@@ -685,12 +721,13 @@ privilege
* chanserv/saset/noexpire and chanserv/set.
*
* Users with this permission can set what BotServ will kick for, change
* BotServ and ChanServ settings, clone ChanServ channel setings, and
* BotServ and ChanServ settings, clone ChanServ channel settings, and
* set ChanServ logging options.
*/
privilege
{
name = "SET"
desc = _("Allowed to set channel settings")
rank = 320
level = 9999
flag = "s"
@@ -708,6 +745,7 @@ privilege
privilege
{
name = "SIGNKICK"
desc = _("No signed kick when SIGNKICK LEVEL is used")
rank = 140
level = 9999
flag = "K"
@@ -724,6 +762,7 @@ privilege
privilege
{
name = "TOPIC"
desc = _("Allowed to change channel topics")
rank = 160
level = 5
flag = "t"
@@ -740,12 +779,30 @@ privilege
privilege
{
name = "UNBAN"
desc = _("Allowed to unban users")
rank = 200
level = 4
flag = "u"
xop = "HOP"
}
/*
* UNBANME privilege.
*
* Used by chanserv/unban.
*
* Users with this permission can unban themself through ChanServ.
*/
privilege
{
name = "UNBANME"
desc = _("Allowed to unban themself")
rank = 200
level = 4
flag = "U"
xop = "HOP"
}
/*
* VOICE privilege.
*
@@ -757,6 +814,7 @@ privilege
privilege
{
name = "VOICE"
desc = _("Allowed to (de)voice users")
rank = 70
level = 4
flag = "v"
@@ -774,6 +832,7 @@ privilege
privilege
{
name = "VOICEME"
desc = _("Allowed to (de)voice themself")
rank = 60
level = 3
flag = "v"
@@ -799,25 +858,25 @@ privilege
command_group
{
name = "chanserv/access"
description = "Used to manage the list of privileged users"
description = _("Used to manage the list of privileged users")
}
command_group
{
name = "chanserv/status"
description = "Used to modify the channel status of you or other users"
description = _("Used to modify the channel status of you or other users")
}
command_group
{
name = "chanserv/management"
description = "Used to manage channels"
description = _("Used to manage channels")
}
command_group
{
name = "chanserv/admin"
description = "Services Operator commands"
description = _("Services Operator commands")
}
/* Give it a help command. */
@@ -829,8 +888,8 @@ command { service = "ChanServ"; name = "HELP"; command = "generic/help"; }
* Provides commands chanserv/access and chanserv/levels.
* Provides the access system "levels".
*
* Used for giving users access in channels using a levels system. Allows allows redefining which privileges
* are representated by given level on a per channel basis.
* Used for giving users access in channels using a levels system. Allows redefining which privileges
* are represented by given level on a per channel basis.
*
* The "LIST" subcommand of chanserv/access will show every access entry on the channel, including access
* entries not added by cs_access. The "level" of these entries will be the representation of the access
@@ -854,7 +913,7 @@ module
/*
* The maximum number of entries on a channel's autokick list.
*/
autokickmax = 32
autokickmax = 50
/*
* The default reason for an autokick if none is given.
@@ -868,6 +927,12 @@ command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; grou
*
* Provides the command chanserv/ban.
*
* The configuration option 'kick' may be set in a command block for this command to control
* whether or not users will be kicked from the channel once banned. The default is 'yes'.
*
* The configuration option 'mode' may be set to control which mode is set, such as BAN or QUIET.
* The default is BAN.
*
* Used for banning users from channels.
*/
module { name = "cs_ban" }
@@ -928,8 +993,8 @@ command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"
* Used for giving users access in channels.
*
* The "LIST" subcommand of chanserv/flags will show every access entry on the channel, including access
* entries not added by cs_flags. The "Flags" of these entries will be the flags representation of the
* privilege set granted by the access entry.
* entries not added by cs_flags. The "flags" of these entries will be the flags representation of the
* privilege set granted by the access entry.
*/
module { name = "cs_flags" }
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; group = "chanserv/access"; }
@@ -1042,7 +1107,7 @@ command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; group =
* Provides the command chanserv/mode and chanserv/modes.
*
* Used for changing mode locks and changing modes. Multiple commands may be mapped to chanserv/modes, the
* configuration directive 'set' and 'unset' are used to tell chanserv/modes which modes should be set or
* configuration directives 'set' and 'unset' are used to tell chanserv/modes which modes should be set or
* unset when the command is executed.
*/
module
@@ -1055,6 +1120,13 @@ module
* If not set, the default is +nt.
*/
mlock = "+nt"
/*
* The maximum number of entries that may be on a mode lock list.
*
* This directive is optional.
*/
max = 50
}
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
@@ -1101,9 +1173,6 @@ module
/* Sets the time to keep seen entries in the seen database. */
purgetime = "30d"
/* Sets the delay between checks for expired seen entries. */
expiretimeout = "1d"
}
command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; permission = "operserv/seen"; }
@@ -1146,7 +1215,7 @@ module
defbantype = 2
/*
* If set, persisent channels have their creation times lowered to their
* If set, persistent channels have their creation times lowered to their
* original registration dates.
*/
persist_lower_ts = true
@@ -1155,7 +1224,7 @@ command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; group =
command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop"; }
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; }
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; hide = yes; }
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; }
command { service = "ChanServ"; name = "SET KEEPMODES"; command = "chanserv/set/keepmodes"; }
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; }
@@ -1178,7 +1247,7 @@ command { service = "ChanServ"; name = "SET NOEXPIRE"; command = "chanserv/saset
*/
module { name = "cs_set_misc" }
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); }
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an E-mail address with the channel"); }
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an email address with the channel"); }
/*
* cs_status
@@ -1190,6 +1259,7 @@ command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc
*/
module { name = "cs_status" }
command { service = "ChanServ"; name = "STATUS"; command = "chanserv/status"; }
command { service = "ChanServ"; name = "WHY"; command = "chanserv/status"; hide = true; }
/*
* cs_suspend
@@ -1209,6 +1279,13 @@ module
* If not set, the default is never.
*/
expire = 90d
/*
* Settings to show to non-opers in ChanServ's INFO output.
* Comment to completely disable showing any information about
* suspended channels to non-opers.
*/
show = "suspended, by, reason, on, expires"
}
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
@@ -1263,7 +1340,7 @@ command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "c
* Provides the access system "XOP".
*
* Used for giving users access in channels. Many commands may be linked to chanserv/xop, but the
* privileges given by each is determined by the privilege:xop settings above. These commands should
* privileges given by each are determined by the privilege:xop settings above. These commands should
* be ordered from highest to lowest, as each command inherits the privileges of the commands below
* it.
*
@@ -1285,7 +1362,7 @@ command { service = "ChanServ"; name = "VOP"; command = "chanserv/xop"; group =
/*
* cs_statusupdate
*
* This module automatically updates users status on channels when the
* This module automatically updates users' status on channels when the
* channel's access list is modified.
*/
module { name = "cs_statusupdate" }
+2 -2
View File
@@ -5,7 +5,7 @@
module
{
name = "m_chanstats"
name = "chanstats"
/*
* The name of this engine.
@@ -32,7 +32,7 @@ module
}
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; }
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; permission = "nickserv/saset/chanstats"; }
module { name = "cs_fantasy_stats" }
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
+6 -5
View File
@@ -9,16 +9,16 @@
###############################################################
# Anope binary directory
ANOPATH=/home/ircd/services/bin
ANOPATH=/home/ircd/anope/bin
# Anope data directory
ANODATA=/home/ircd/services/data
ANODATA=/home/ircd/anope/data
# Name of the pid file
ANOPIDF=services.pid
ANOPIDF=anope.pid
# Name of the executable
ANOPROG=services
ANOPROG=anope
# Parameters to pass to the executable
ANOARGS=""
@@ -37,7 +37,8 @@ cd $ANOPATH
if [ -f "$ANODATA/$ANOPIDF" ]
then
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
exit
fi
+30 -4
View File
@@ -66,15 +66,15 @@ module
client = "Global"
/*
* This is the global message that will be sent when Services are being
* This is the global message that will be sent when Anope is being
* shutdown/restarted.
*
* 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 they'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 Anope (re)joins the
* network.
*
* This directive is optional.
@@ -82,7 +82,7 @@ module
#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, Anope will hide the IRC Operator's nick in a global
* message/notice.
*
* This directive is optional.
@@ -113,3 +113,29 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
*/
module { name = "gl_global" }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
/*
* gl_queue
*
* Provides the command global/queue.
*
* Used for queuing messages to send to every online user.
*/
module
{
name = "gl_queue"
/* The maximum number of messages in a message queue. Defaults to 10. */
maxqueue = 10
}
command { service = "Global"; name = "QUEUE"; command = "global/queue"; permission = "global/queue"; }
/*
* gl_server
*
* Provides the command global/server.
*
* Used for sending a message to every online user on a server.
*/
module { name = "gl_server" }
command { service = "Global"; name = "SERVER"; command = "global/server"; permission = "global/server"; }
+16 -3
View File
@@ -103,7 +103,20 @@ command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; pe
*
* 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 = true
/*
* This makes vhosts act as if they are per account.
*/
synconset = true
}
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
/*
@@ -148,13 +161,13 @@ module
name = "hs_request"
/*
* If set, Services will send a memo to the user requesting a vHost when it's been
* If set, Anope will send a memo to the user requesting a vHost when it's been
* approved or rejected.
*/
#memouser = yes
/*
* If set, Services will send a memo to all Services staff when a new vHost is requested.
* If set, Anope will send a memo to all services staff when a new vHost is requested.
*/
#memooper = yes
}
+4 -5
View File
@@ -18,7 +18,7 @@ service
/*
* The hostname of the StatServ client.
*/
host = "services.host"
host = "stats.host"
/*
* The realname of the StatServ client.
@@ -45,7 +45,7 @@ service
*
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
#channels = "@#stats,#mychan"
}
module
@@ -58,7 +58,7 @@ module
*/
client = "StatServ"
/*
/*
* The name of the SQL engine to use.
* This must be MySQL and must match the name in the mysql{} block
*/
@@ -84,7 +84,7 @@ module
/*
* Get the CTCP version from users
* The users connecting to the network will receive a CTCP VERSION
* request from the above configured services client
* request from the above configured stats client
*/
ctcpuser = "yes"
@@ -95,4 +95,3 @@ module
*/
ctcpeob = "yes"
}
+12 -2
View File
@@ -83,7 +83,7 @@ module
*
* This directive is optional, but recommended.
*/
senddelay = 3s
senddelay = 30s
}
/*
@@ -137,7 +137,17 @@ command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
*
* 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 = 50
}
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
/*
+173 -119
View File
@@ -3,7 +3,7 @@
*
* 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
* 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 Anope 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.
@@ -19,18 +19,18 @@
module { name = "help" }
/*
* m_dns
* dns
*
* 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 dnsbl and os_dns require this.
*/
#module
{
name = "m_dns"
name = "dns"
/*
* 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
* from ipconfig /all and put the IP here.
*/
nameserver = "/etc/resolv.conf"
@@ -59,7 +59,7 @@ module { name = "help" }
* SOA record information.
*/
/* E-mail address of the DNS administrator. */
/* Email address of the DNS administrator. */
admin = "admin@example.com"
/* This should be the names of the public facing nameservers serving the records. */
@@ -80,7 +80,7 @@ module { name = "help" }
}
/*
* m_dnsbl
* dnsbl
*
* Allows configurable DNS blacklists to check connecting users against. If a user
* is found on the blacklist they will be immediately banned. This is a crucial module
@@ -88,17 +88,17 @@ module { name = "help" }
*/
#module
{
name = "m_dnsbl"
name = "dnsbl"
/*
* If set, Services will check clients against the DNSBLs when services connect to its uplink.
* If set, Anope 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.
* Whilst services are not drastically affected by this, your nameserver/DNSBL might care.
*/
check_on_connect = no
/*
* If set, Services will check clients when coming back from a netsplit. This can cause a large number
* If set, Anope will check clients when coming back from a netsplit. This can cause a large number
* of DNS queries open at once. Whilst services are not drastically affected by this, your nameserver/DNSBL
* might care.
*/
@@ -124,42 +124,74 @@ module { name = "help" }
* %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.
* %r is the reply 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"
reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i=%i for info"
/* Replies to ban and their reason. If this is totally omitted all replies get banned. */
1 = "Open Proxy"
/* Don't ban for result 2 or 3 */
#2 = "spamtrap666"
#3 = "spamtrap50"
4 = "TOR"
5 = "Drones / Flooding"
/* Replies to ban and their reason. If no replies are configured, all replies get banned. */
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
#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"
reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup_branded?ip=%i&network=%N"
}
/* Exempt localhost from DNSBL checks */
exempt { ip = "127.0.0.0/8" }
}
/*
* m_helpchan
* helpchan
*
* Gives users who are op in the specified help channel usermode +h (helpop).
*/
#module
{
name = "m_helpchan"
name = "helpchan"
helpchannel = "#help"
}
/*
* m_httpd
* httpd
*
* Allows services to serve web pages. By itself, this module does nothing useful.
*
@@ -168,7 +200,7 @@ module { name = "help" }
*/
#module
{
name = "m_httpd"
name = "httpd"
httpd
{
@@ -191,8 +223,9 @@ module { name = "help" }
* 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.
* Multiple IP addresses can be specified separated by a space character.
*/
#extforward_ip = "192.168.0.255"
#extforward_ip = "192.168.0.255 192.168.1.255"
/* The header to look for. These probably work as is. */
extforward_header = "X-Forwarded-For Forwarded-For"
@@ -200,18 +233,17 @@ module { name = "help" }
}
/*
* m_ldap [EXTRA]
* ldap [EXTRA]
*
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
*/
#module
{
name = "m_ldap"
name = "ldap"
ldap
{
server = "ldap://127.0.0.1"
port = 389
/*
* Admin credentials used for performing searches and adding users.
@@ -222,14 +254,14 @@ module { name = "help" }
}
/*
* m_ldap_authentication [EXTRA]
* ldap_authentication
*
* 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 ldap.
*/
#module
{
name = "m_ldap_authentication"
name = "ldap_authentication"
/*
* The distinguished name used for searching for users's accounts.
@@ -267,29 +299,31 @@ module { name = "help" }
password_attribute = "userPassword"
/*
* If set, the reason to give the users who try to "/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_register_reason = "To register on this network visit http://some.misconfigured.site/register"
#disable_register_reason = "To register on this network visit https://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"
#disable_email_reason = "To change your email address visit https://some.misconfigured.site"
}
/*
* m_ldap_oper [EXTRA]
* ldap_oper
*
* This module dynamically ties users to Anope opertypes when they identify
* via LDAP group membership. Requires m_ldap.
* via LDAP group membership. Requires 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 Anope.
*/
#module
{
name = "m_ldap_oper"
name = "ldap_oper"
/*
* An optional binddn to use when searching for groups.
@@ -321,13 +355,13 @@ module { name = "help" }
}
/*
* m_mysql [EXTRA]
* mysql [EXTRA]
*
* This module allows other modules to use MySQL.
*/
#module
{
name = "m_mysql"
name = "mysql"
mysql
{
@@ -340,14 +374,15 @@ module { name = "help" }
port = 3306
}
}
/*
* m_redis
* redis
*
* This module allows other modules to use Redis.
*/
#module
{
name = "m_redis"
name = "redis"
/* A redis database */
redis
@@ -366,45 +401,68 @@ module { name = "help" }
}
/*
* m_regex_pcre [EXTRA]
* regex_pcre2 [EXTRA]
*
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
* Provides the regex engine regex/pcre, which uses version 2 of the Perl Compatible Regular
* Expressions library.
*/
#module { name = "m_regex_pcre" }
#module { name = "regex_pcre2" }
/*
* m_regex_posix [EXTRA]
* 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" }
#module { name = "regex_posix" }
/*
* m_regex_tre [EXTRA]
* regex_stdlib
*
* Provides the regex engine regex/stdlib, which uses the regular expression library that is part of
* the C++ standard library.
*/
module
{
name = "regex_stdlib"
/*
* The syntax scheme to use. Can be set to awk to use the regular expression grammar used by the
* awk utility in POSIX, basic to use the basic POSIX regular expression grammar, ecmascript to
* use the modified ECMAScript regular expression grammar, egrep to use the regular expression
* grammar used by the grep utility with the -E option in POSIX, extended to use the extended
* POSIX regular expression grammar, or grep to use the regular expression grammar used by the
* grep utility in POSIX.
*
* See https://en.cppreference.com/w/cpp/regex/syntax_option_type for more information.
*/
syntax = "ecmascript"
}
/*
* regex_tre [EXTRA]
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
#module { name = "m_regex_tre" }
#module { name = "regex_tre" }
/*
* m_rewrite
* rewrite
*
* Allows rewriting commands sent to/from clients.
*/
#module { name = "m_rewrite" }
#module { name = "rewrite" }
#command
{
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
/* Enable m_rewrite. */
/* Enable 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
* Message to rewrite the source message to. A $ followed by a number, e.g. $0, gets
* replaced by the number-th word from the source_message, starting from 0.
*/
rewrite_target = "KICK $1 *"
@@ -418,7 +476,7 @@ module { name = "help" }
}
/*
* m_proxyscan
* proxyscan
*
* This module allows you to scan connecting clients for open proxies.
* Note that using this will allow users to get the IP of your services.
@@ -432,7 +490,7 @@ module { name = "help" }
*/
#module
{
name = "m_proxyscan"
name = "proxyscan"
/*
* The target IP services tells the proxy to connect back to. This must be a publicly
@@ -500,56 +558,39 @@ module { name = "help" }
}
/*
* m_sasl
* sasl
*
* 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
* Some IRCds allow "SASL" authentication to let users identify to services
* during the IRCd user registration process. If this module is loaded, Anope will allow
* authenticating users through this mechanism. Supported mechanisms are:
* PLAIN, EXTERNAL.
*/
#module { name = "m_sasl" }
module { name = "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-aes [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]
* 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.
* You may only load either ssl_gnutls or ssl_openssl, but not both.
*/
#module
{
name = "m_ssl_gnutls"
name = "ssl_gnutls"
/*
* An optional certificate and key for m_gnutls to give to the uplink.
* An optional certificate and key for ssl_gnutls to give to the uplink. All
* paths are relative to the config directory.
*
* You can generate your own certificate and key pair by using:
*
* certtool --generate-privkey --bits 2048 --outfile anope.key
* certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
* certtool --generate-privkey --bits 2048 --outfile privkey.pem
* certtool --generate-self-signed --load-privkey privkey.pem --outfile fullchain.pem
*
*/
cert = "data/anope.crt"
key = "data/anope.key"
cert = "fullchain.pem"
key = "privkey.pem"
/*
* Diffie-Hellman parameters to use when acting as a server. This is only
@@ -562,45 +603,55 @@ module { name = "help" }
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
*
*/
# dhparams = "data/dhparams.pem"
#dhparams = "dhparams.pem"
}
/*
* m_ssl_openssl [EXTRA]
* 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.
* You may only load either ssl_openssl or ssl_gnutls, but not both.
*
*/
#module
{
name = "m_ssl_openssl"
name = "ssl_openssl"
/*
* An optional certificate and key for m_openssl to give to the uplink.
* An optional certificate and key for ssl_openssl to give to the uplink.
* All paths are relative to the config directory.
*
* 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
* openssl genrsa -out privkey.pem 2048
* openssl req -new -x509 -key privkey.pem -out fullchain.pem -days 1095
*/
cert = "data/anope.crt"
key = "data/anope.key"
cert = "fullchain.pem"
key = "privkey.pem"
/*
* If you wish to increase security you can disable support for older
* versions of TLS with no known vulnerabilities but that provide less
* security. For your security SSLv2 and SSLv3 are always disabled.
*/
#tlsv10 = no
#tlsv11 = no
#tlsv12 = yes
}
/*
* m_sql_authentication [EXTRA]
* sql_authentication
*
* This module allows authenticating users against an external SQL database using a custom
* query.
*/
#module
{
name = "m_sql_authentication"
name = "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 mysql, sqlite, etc. */
engine = "mysql/main"
/* Query to execute to authenticate. A non empty result from this query is considered a success,
@@ -632,17 +683,17 @@ module { name = "help" }
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
* If not set, then registration is not blocked.
*/
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
#disable_reason = "To register on this network visit https://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"
#disable_email_reason = "To change your email address visit https://some.misconfigured.site"
}
/*
* m_sql_log [EXTRA]
* sql_log
*
* This module adds an additional target option to log{} blocks
* that allows logging Service's logs to SQL. To log to SQL, add
@@ -659,24 +710,24 @@ module { name = "help" }
* 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" }
#module { name = "sql_log" }
/*
* m_sql_oper [EXTRA]
* sql_oper
*
* This module allows granting users services operator privileges and possibly IRC Operator
* privileges based on an external SQL database using a custom query.
*/
#module
{
name = "m_sql_oper"
name = "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 mysql, sqlite, etc. */
engine = "mysql/main"
/* Query to execute to determine if a user should have operator privileges.
* A field named opertype must be returned in order to link the user to their oper type.
* The oper types must be configured earlier in services.conf.
* The oper types must be configured earlier in anope.conf.
*
* If a field named modes is returned from this query then those modes are set on the user.
* Without this, only a simple +o is sent.
@@ -688,13 +739,13 @@ module { name = "help" }
}
/*
* m_sqlite [EXTRA]
* sqlite [EXTRA]
*
* This module allows other modules to use SQLite.
*/
#module
{
name = "m_sqlite"
name = "sqlite"
/* A SQLite database */
sqlite
@@ -714,7 +765,7 @@ module { name = "help" }
* 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.
* This module requires httpd.
*/
#module
{
@@ -723,31 +774,34 @@ module { name = "help" }
/* Web server to use. */
server = "httpd/main";
/* Template to use. */
template = "default";
/*
* The directory containing the webcpanel templates. This is relative to the
* data directory.
*/
template_dir = "webcpanel/templates/default";
/* Page title. */
title = "Anope IRC Services";
}
/*
* m_xmlrpc
* xmlrpc
*
* 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 (xmlrpc_main) to receive and send XMLRPC queries.
*/
#module
{
name = "m_xmlrpc"
name = "xmlrpc"
/* Web service to use. Requires m_httpd. */
/* Web service to use. Requires httpd. */
server = "httpd/main"
}
/*
* m_xmlrpc_main
* xmlrpc_main
*
* Adds the main XMLRPC core functions.
* Requires m_xmlrpc.
* Requires xmlrpc.
*/
#module { name = "m_xmlrpc_main" }
#module { name = "xmlrpc_main" }
+78 -100
View File
@@ -66,9 +66,9 @@ module
client = "NickServ"
/*
* Force users to give an e-mail address when they register a nick.
* Requires users to give an email address when they register a nick.
*
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
* This directive defaults to "yes" and is recommended to be enabled.
*/
forceemail = yes
@@ -79,7 +79,7 @@ module
confirmemailchanges = no
/*
* 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. %n will be replaced with the user's nickname.
*
* This directive is optional.
*/
@@ -92,49 +92,52 @@ module
*
* The options are:
* - killprotect: Kill nick if not identified within 60 seconds
* - 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
* - ns_secure: Enable nickname security, requiring the nick's password before any operations
* can be done on it
* - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the killprotect
* option and the killprotect option must be specified with this one
* - kill_immed: Kill nick immediately if not identified, this one overrides both the killprotect
* and kill_quick options and the killprotect option must be specified with this one
* - ns_private: Hide the nick from NickServ's LIST command
* - hide_email: Hide's the nick's e-mail address from NickServ's INFO command
* - hide_mask: Hide's the nick's last or current user@host from NickServ's INFO command
* - hide_quit: Hide's the nick's last quit message
* - hide_email: Hide the nick's email address from NickServ's INFO command
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
* - hide_status: Hide the nick's services operator access status from NickServ's INFO command
* - hide_quit: Hide the nick's last quit message from NickServ's INFO command
* - 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_mail: Notify user if they have a new memo by mail
* - autoop: User will be automatically opped in channels they enter and have access to
* - 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
* - neverop: User can not be added to access lists
* - msg: Messages will be sent as PRIVMSGs instead of NOTICEs, requires options:useprivmsg
* to be enabled as well
* - ns_keep_modes: Enables keepmodes, which retains user modes across sessions
*
* This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
* This directive is optional, if left blank, the options will default to memo_signon, and
* memo_receive. If you really want no defaults, use "none" by itself as the option.
*/
defaults = "ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
defaults = "killprotect ns_private hide_email hide_mask memo_signon memo_receive autoop"
/*
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
* directive is optional, but recommended. If not set, this restriction will be disabled.
*/
regdelay = 30s
regdelay = 5m
/*
* The length of time before a nick's registration expires.
*
* This directive is optional, but recommended. If not set, the default is 21 days.
* This directive is optional, but recommended. If not set, the default is 90 days.
*/
expire = 21d
expire = 90d
/*
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND,
* GETPASS and SET PASSWORD commands by services operators on other services operators.
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND
* and SET PASSWORD commands by services operators on other services operators.
*
* This directive is optional, but recommended.
*/
secureadmins = yes
/*
* If set, Services will set the channel modes a user has access to upon identifying, assuming
* If set, Anope will set the channel modes a user has access to upon identifying, assuming
* they are not already set.
*
* This directive is optional.
@@ -142,14 +145,14 @@ module
modeonid = yes
/*
* If set, Services will set these user modes on any user who identifies.
* If set, Anope will set these user modes on any user who identifies.
*
* This directive is optional.
*/
#modesonid = "+R"
/*
* If set, Services will not show netsplits in the last quit message field
* If set, Anope will not show netsplits in the last quit message field
* of NickServ's INFO command.
*/
hidenetsplitquit = no
@@ -163,7 +166,7 @@ module
/*
* If set, forbids the registration of nicks that contain an existing
* nick with Services access. For example, if Tester is a Services Oper,
* 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.
*
@@ -176,14 +179,14 @@ module
#restrictopernicks = yes
/*
* The username, and possibly hostname, used for fake users created when Services needs to
* The username, and possibly hostname, used for fake users created when Anope needs to
* hold a nickname.
*/
enforceruser = "enforcer"
enforcerhost = "services.host"
/*
* The length of time Services hold nicknames.
* The length of time Anope should hold nicknames for.
*
* This directive is optional, but recommended. If not set it defaults to 1 minute.
*/
@@ -199,16 +202,23 @@ module
guestnickprefix = "Guest"
/*
* If set, Services do not allow ownership of nick names, only ownership of accounts.
* If set, Anope does not allow ownership of nick names, only ownership of accounts.
*/
nonicknameownership = no
/*
* The minimum length of passwords
*
* This directive is optional. If not set it defaults to 10.
*/
minpasslen = 10
/*
* The maximum length of passwords
*
* This directive is optional. If not set it defaults to 32.
* This directive is optional. If not set it defaults to 50.
*/
passlen = 32
maxpasslen = 50
}
/*
@@ -230,39 +240,12 @@ module
command_group
{
name = "nickserv/admin"
description = "Services Operator commands"
description = _("Services Operator commands")
}
/* Give it a help command. */
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
/*
* ns_access
*
* Provides the command nickserv/access.
*
* Used for configuring what hosts have access to your account.
*/
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"; }
/*
* ns_ajoin
*
@@ -290,6 +273,7 @@ command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
*/
module { name = "ns_alist" }
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/alist"; hide = true; }
/*
* ns_cert
@@ -306,7 +290,7 @@ module
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
*/
accessmax = 5
max = 5
}
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
@@ -330,18 +314,6 @@ command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
module { name = "ns_getemail" }
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
/*
* ns_getpass
*
* Provides the command nickserv/getpass.
*
* Used for getting users passwords.
*
* Requires no encryption is being used.
*/
#module { name = "ns_getpass" }
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
/*
* ns_group
*
@@ -358,7 +330,7 @@ module
*
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
*/
maxaliases = 16
maxaliases = 10
/*
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
@@ -380,7 +352,15 @@ command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup";
*
* Used for identifying to accounts.
*/
module { name = "ns_identify" }
module
{
name = "ns_identify"
/*
* If set, limits the number of concurrent users that can be logged in as a given account at once.
*/
maxlogins = 10
}
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = true; }
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
@@ -389,7 +369,7 @@ command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"
*
* 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.
* nickserv/set/hide, nickserv/saset/hide - Used for configuring which options are publicly shown in nickserv/info.
*
*/
module { name = "ns_info" }
@@ -444,17 +424,18 @@ module
name = "ns_recover"
/*
* If set, Services will svsnick and svsjoin users who use the recover
* If set, Anope 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.
* This directive is optional.
*/
restoreonrecover = yes
}
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
# Uncomment below to emulate 1.8's behavior of ghost and release.
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
# For compatibility with Anope 1.8 and Atheme.
command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; hide = true; }
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; hide = true; }
/*
* ns_register
@@ -487,7 +468,7 @@ module
*
* This directive is optional.
*/
#nickregdelay = 30s
nickregdelay = 15s
/*
* The length of time a user using an unconfirmed account has
@@ -521,9 +502,9 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
* 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/message, nickserv/saset/message - Used to configure how services send messages to you.
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
* nickserv/set/neverop, nickserv/saset/neverop - Used to configure whether a user can be added to access lists
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
*/
module
{
@@ -564,8 +545,8 @@ command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/sase
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
command { service = "NickServ"; name = "SET NEVEROP"; command = "nickserv/set/neverop"; }
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
@@ -581,22 +562,12 @@ command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/sas
module { name = "ns_set_misc" }
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); }
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; misc_description = _("Associate an ICQ account with your account"); }
#command { service = "NickServ"; name = "SASET ICQ"; command = "nickserv/saset/misc"; misc_description = _("Associate an ICQ account with this account"); permission = "nickserv/saset/icq"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET TWITTER"; command = "nickserv/set/misc"; misc_description = _("Associate a Twitter account with your account"); }
#command { service = "NickServ"; name = "SASET TWITTER"; command = "nickserv/saset/misc"; misc_description = _("Associate a Twitter account with this account"); permission = "nickserv/saset/twitter"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET DISCORD"; command = "nickserv/set/misc"; misc_description = _("Associate a Discord account with your account"); }
#command { service = "NickServ"; name = "SASET DISCORD"; command = "nickserv/saset/misc"; misc_description = _("Associate a Discord account with this account"); permission = "nickserv/saset/discord"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
/*
* ns_status
*
* Provides the nickserv/status command.
*
* Used to determine if a user is recognized or identified by services.
*/
module { name = "ns_status" }
command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
#command { service = "NickServ"; name = "SET MASTODON"; command = "nickserv/set/misc"; misc_description = _("Associate a Mastodon account with your account"); }
#command { service = "NickServ"; name = "SASET MASTODON"; command = "nickserv/saset/misc"; misc_description = _("Associate a Mastodon account with this account"); permission = "nickserv/saset/mastodon"; group = "nickserv/admin"; }
/*
* ns_suspend
@@ -615,6 +586,13 @@ module
* 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 = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
@@ -640,14 +618,14 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
* Limits how many times the same email address may be used in Anope
* to register accounts.
*/
module
#module
{
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 email address. If set to 0 or left
* commented, there will be no limit enforced when registering new accounts or using
* /msg NickServ SET EMAIL.
*/
#maxemails = 1
maxemails = 1
}
+19 -32
View File
@@ -75,7 +75,7 @@ module
sqlineexpiry = 30d
/*
* If set, this option will make Services send an AKILL command immediately after it has been
* If set, this option will make Anope send an AKILL command immediately after it has been
* added with AKILL ADD. This eliminates the need for killing the user after the AKILL has
* been added.
*
@@ -84,7 +84,7 @@ module
akillonadd = yes
/*
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
* If set, this option will make Anope send an (SVS)KILL command immediately after SNLINE ADD.
* This eliminates the need for killing the user after the SNLINE has been added.
*
* This directive is optional.
@@ -92,7 +92,7 @@ module
killonsnline = yes
/*
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
* If set, this option will make Anope send an (SVS)KILL command immediately after SQLINE ADD.
* This eliminates the need for killing the user after the SQLINE has been added.
*
* This directive is optional.
@@ -159,7 +159,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*
* Provides the command operserv/defcon.
*
* 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.
*/
#module
@@ -167,7 +167,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
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 Anope up. Level 5 constitutes normal operation
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to
* 0, DefCon will be disabled and the rest of this block will be ignored.
*/
@@ -184,8 +184,8 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
* - forcechanmodes: Forces all channels to have the modes given in the later chanmodes directive
* - reducedsessions: Reduces the session limit to the value given in the later sessionlimit directive
* - nonewclients: KILL any new clients trying to connect
* - operonly: Services will ignore all non-IRCops
* - silentoperonly: Services will silently ignore all non-IRCops
* - operonly: Ignore all non-IRCops
* - silentoperonly: Silently ignore all non-IRCops
* - akillnewclients: AKILL any new clients trying to connect
* - nonewmemos: No new memos will be sent to block MemoServ attacks
*/
@@ -209,7 +209,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
* The channel modes to set on all channels when the DefCon channel mode system is in use.
*
* Note 1: Choose these modes carefully, because when DefCon switches to a level which does NOT have
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
* the mode setting selected, Anope will set the reverse on all channels, e.g. if this setting
* is +RN when DefCon is used, all channels will be set to +RN, when DefCon is removed, all
* channels will be set to -RN. You don't want to set this to +k for example, because when DefCon
* is removed, all channels are set -k, removing the key from previously keyed channels.
@@ -227,14 +227,14 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
#timeout = 15m
/*
* If set, Services will send a global message on DefCon level changes.
* If set, Anope will send a global message on DefCon level changes.
*
* This directive is optional.
*/
#globalondefcon = yes
/*
* If set, Services will send the global message defined in the message directive on DefCon level
* If set, Anope will send the global message defined in the message directive on DefCon level
* changes.
*
* This directive is optional.
@@ -260,14 +260,14 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*/
#akillreason = "This network is currently not accepting connections, please try again later."
}
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; }
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon"; }
/*
* os_dns
*
* Provides the command operserv/dns.
*
* This module requires that m_dns is loaded.
* This module requires that dns is loaded.
*
* This module allows controlling a DNS zone. This is useful for
* controlling what servers users are placed on for load balancing,
@@ -348,7 +348,7 @@ command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; pe
*
* Provides the command operserv/ignore.
*
* Used to make Services ignore users.
* Used to make Anope ignore users.
*/
module { name = "os_ignore" }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
@@ -506,17 +506,6 @@ command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomn
module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
/*
* os_oline
*
* Provides the command operserv/oline.
*
* Used to set oper flags on users, and is specific to UnrealIRCd.
* See /helpop ?svso on your IRCd for more information.
*/
module { name = "os_oline" }
command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; permission = "operserv/oline"; }
/*
* os_oper
*
@@ -532,7 +521,7 @@ command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permis
*
* Provides the command operserv/reload.
*
* Used to reload the services.conf configuration file.
* Used to reload the anope.conf configuration file.
*/
module { name = "os_reload" }
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload"; }
@@ -544,7 +533,7 @@ command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; pe
*
* 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
* Once a host reaches its 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.
@@ -559,7 +548,7 @@ module
*
* This directive is required if os_session is loaded.
*/
defaultsessionlimit = 3
defaultsessionlimit = 5
/*
* The maximum session limit that may be set for a host in an exception.
@@ -570,10 +559,8 @@ module
/*
* Sets the default expiry time for session exceptions.
*
* This directive is required if os_session is loaded.
*/
exceptionexpiry = 1d
#exceptionexpiry = 1d
/*
* The message that will be NOTICE'd to a user just before they are removed from the network because
@@ -594,10 +581,10 @@ module
*
* This directive is optional, if not set, nothing will be sent.
*/
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
#sessionlimitdetailsloc = "Please visit https://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
* If set and is not 0, this directive tells Anope 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.
+80 -75
View File
@@ -1,8 +1,8 @@
/*
* 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".
* Example configuration file for Anope. After making the appropriate
* changes to this file, place it in the Anope conf directory (as
* specified in the "Config" script, default /home/username/anope/conf)
* under the name "anope.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
@@ -53,7 +53,7 @@
* included to indicate whether an option is required:
*
* [REQUIRED]
* Indicates a directive which must be given. Without it, Services will
* Indicates a directive which must be given. Without it, Anope will
* not start.
*
* [RECOMMENDED]
@@ -71,7 +71,7 @@
*
* [DEPRECATED]
* Indicates a directive which will disappear in a future version of
* Services, usually because its functionality has been either
* Anope, usually because its functionality has been either
* superseded by that of other directives or incorporated into the main
* program.
*/
@@ -80,17 +80,17 @@
* [OPTIONAL] Defines
*
* You can define values to other values, which can be used to easily change
* many values in the configuration. at once.
* many values in the configuration at once.
*/
/*
* The services.host define is used in multiple different locations throughout the
* configuration for services clients hostnames.
* The stats.host define is used in multiple different locations throughout the
* configuration for the stats client hostname.
*/
define
{
name = "services.host"
value = "services.localhost.net"
name = "stats.host"
value = "stats.example.com"
}
/*
@@ -110,7 +110,7 @@ define
#include
{
type = "executable"
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
name = "/usr/bin/wget -q -O - https://some.misconfigured.network.com/stats.conf"
}
/*
@@ -120,54 +120,60 @@ define
* 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
* Each uplink IRCd should have a corresponding configuration to allow Anope
* 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"
* # This goes in inspircd.conf, *NOT* your Anope config!
* <link name="stats.example.com"
* ipaddr="127.0.0.1"
* port="7000"
* sendpass="mypassword"
* recvpass="mypassword">
* <uline server="services.localhost.net" silent="yes">
* <uline server="stats.example.com" 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;
* // This goes in unrealircd.conf, *NOT* your Anope config!
* listen {
* ip 127.0.0.1;
* port 7000;
* options {
* serversonly;
* };
* };
* ulines { services.localhost.net; };
* listen 127.0.0.1:7000;
* link stats.example.com {
* incoming {
* mask *@127.0.0.1;
* };
* password "mypassword";
* class servers;
* };
* ulines { stats.example.com; };
*/
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).
* The IP address, hostname, or UNIX socket path of the IRC server you wish
* to connect Anope to.
* Usually, you will want to connect 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.
* The protocol that Anope should use when connecting to the uplink. Can
* be set to "ipv4" (the default), "ipv6", or "unix".
*/
ipv6 = no
protocol = "ipv4"
/*
* Enable if Services should connect using SSL.
* Enable if Anope should connect using SSL.
* You must have an SSL module loaded for this to work.
*/
ssl = no
@@ -193,26 +199,26 @@ uplink
/*
* [REQUIRED] Server Information
*
* This section contains information about the Services server.
* This section contains information about the services server.
*/
serverinfo
{
/*
* The hostname that Services will be seen as, it must have no conflicts with any
* The hostname that Anope 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"
name = "stats.example.com"
/*
* The text which should appear as the server's information in /whois and similar
* The text which should appear as the server's information in /WHOIS and similar
* queries.
*/
description = "Stats for IRC Networks"
description = "Anope IRC Statistics"
/*
* 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 local address that Anope will bind to before connecting to the remote
* server. This may be useful for multihomed hosts. If omitted, Anope 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
@@ -228,16 +234,16 @@ serverinfo
#id = "00A"
/*
* The filename containing the Services process ID. The path is relative to the
* services root directory.
* The filename containing the Anope process ID. The path is relative to the
* data directory.
*/
pid = "data/services.pid"
pid = "anope.pid"
/*
* The filename containing the Message of the Day. The path is relative to the
* services root directory.
* config directory.
*/
motd = "conf/services.motd"
motd = "motd.txt"
}
/*
@@ -248,55 +254,55 @@ serverinfo
*
* Supported:
* - bahamut
* - charybdis
* - hybrid
* - inspircd12
* - inspircd20
* - inspircd
* - ngircd
* - plexus
* - ratbox
* - unreal
* - solanum
* - unrealircd
*/
module
{
name = "inspircd20"
name = "inspircd"
}
/*
* [REQUIRED] Network Information
*
* This section contains information about the IRC network that Services will be
* This section contains information about the IRC network that Anope will be
* connecting to.
*/
networkinfo
{
/*
* This is the name of the network that Services will be running on.
* This is the name of the network that Anope 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.
* Anope being disconnected from the network. Defaults to 31.
*/
nicklen = 31
#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.
* Anope being disconnected from the network. Defaults to 10.
*/
userlen = 10
#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.
* Anope being disconnected from the network. Defaults to 64.
*/
hostlen = 64
#hostlen = 64
/* Set this to the maximum allowed channel length on your network.
* Defaults to 64.
*/
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.
@@ -308,7 +314,7 @@ networkinfo
* 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.
* disallows could potentially break the IRCd and/or Anope.
*
* It is recommended you DON'T change this.
*/
@@ -333,22 +339,22 @@ networkinfo
}
/*
* [REQUIRED] Services Options
* [REQUIRED] Anope Options
*
* This section contains various options which determine how Services will operate.
* This section contains various options which determine how Anope 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
* 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
* installed on your machine. Anope uses 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.
@@ -372,14 +378,14 @@ options
warningtimeout = 4h
/*
* If set, Services will only show /stats o to IRC Operators. This directive
* If set, Anope 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
* A space-separated list of U-lined servers on your network, it is assumed that
* the servers in this list are allowed to set channel modes and Anope will
* not attempt to reverse their mode changes.
*
* WARNING: Do NOT put your normal IRC user servers in this directive.
@@ -411,17 +417,17 @@ log
*/
target = "stats.log"
/* Log to both services.log and the channel #services
/* Log to both stats.log and the channel #stats
*
* 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"
#target = "stats.log #stats"
/*
* 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.
* This can be a users name, a channel name, one of our clients (e.g. OperServ), or a server name.
*/
#source = ""
@@ -432,8 +438,8 @@ log
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.
* The number of days to keep log files, only useful if you are logging to a file.
* Set to 0 to never delete old log files.
*
* Note that Anope must run 24 hours a day for this feature to work correctly.
*/
@@ -461,7 +467,7 @@ log
* create, destroy, join, part, kick, leave, mode
*
* 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.
*
@@ -478,13 +484,13 @@ log
/*
* [REQUIRED] MySQL Database configuration.
*
* m_mysql
* mysql
*
* This module allows other modules to use MySQL.
*/
module
{
name = "m_mysql"
name = "mysql"
mysql
{
@@ -510,4 +516,3 @@ include
type = "file"
name = "irc2sql.example.conf"
}
-4846
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
-1
View File
@@ -1 +0,0 @@
astyle --style=java --indent=tab --brackets=break-closing --indent-switches --indent-cases --brackets=break
-1
View File
@@ -1 +0,0 @@
For all bug reports / updates please see http://bugs.anope.org
-111
View File
@@ -1,111 +0,0 @@
C++-style Casting
=================
In C, you can cast in one of two ways:
(type)var
type(var)
The problem with C-style casting is that it allows a programmer to get away
with too much, and is also not designed to handle C++ classes.
C++ has 4 types of casting in addition to allowing C-style casting. They are:
static_cast
const_cast
dynamic_cast
reinterpret_cast
The syntax is usually *_cast<type>(var).
static_cast
-----------
From my expierence, this cast is closest to C-style casting for non-pointer
types as well as between some (but not all) pointer types. This type of cast,
like C-style casting, is performed at compile-time. static_cast can also do
a downcast of a derived class to a base class, but only if the base class is
not a virtual base class. Sometimes the result of this cast can become
undefined. static_cast is a bit more strict that C-style casting, though. It
disallows certain class conversions that would've been allowed with a C-style
cast. static_cast also doesn't allow you to cast to an incomplete type. In
these cases, I would try either dynamic_cast or reinterpret_cast.
const_cast
----------
This cast is mainly to add or remove const-ness or volatile-ness from a
variable. This is safer than using a C-style cast to change the const-ness
of a variable. In most cases if you try to use one of the other casts and it
complains about const-ness, you will want to either use this cast instead or
wrap the other cast around this cast. An example:
const int *a;
static_cast<void *>(a); <-- This will fail.
To remedy the above, you would might try this:
const int *a;
const_cast<void *>(a); <-- But this will still fail.
The real solution is this:
const int *a;
static_cast<void *>(const_cast<int *>(a));
It is not recommended to use const_cast on the this variable within a member
function of a class that is declared const. Instead you should use the mutable
keyword on the variable in the class's definition.
dynamic_cast
------------
This cast can only be used on pointers or references to classes. It can cast a
derived class to a base class, a derived class to another derived class
(provided that both are children of the same base class), or a base class to a
derived class. You can also use this to cast a class to void *. This cast is
done at run-time as opposed to the other casts, and relies on C++'s RTTI to be
enabled. It is meant to be used on polymorphic classes, so use static_cast on
non-polymorphic classes.
derived-to-base conversions are actually done statically, so you use either
dynamic_cast or static_cast on them, regardless of if the classes are
polymorphic or not.
derived-to-derived or base-to-derived conversions, however, rely on run-time
type information, and this cast is used on those classes that are polymorphic.
This is safer than C-style casting in that an invalid pointer conversion will
return a NULL pointer, and an invalid reference conversion will throw a
Bad_cast exception.
Note that in Anope we prefer if Anope::debug_cast is used.
This uses dynamic_cast (and checks for a NULL pointer return) on debug builds
and static_cast on release builds, to speed up the program beacuse of dynamic_cast's
reliance on RTTI.
reinterpret_cast
----------------
This cast I would use only as a last resort if static_cast isn't allowed on a
conversion. It allows for conversions between two unrelated types, such as
going from char * to int *. It can also be used to convert a pointer to an
integral type and vica versa. The sites I've read mention how the result is
non-portable, which I assume means the resulting object code is non-portable,
so since the code is compiled on many systems anyways, I don't see this as
being a huge issue. It is recommended to only use this if necessary, though.
Links
=====
The following links are web sites I've used to get this information, and might
describe some of the above a bit better than I have. :P
http://www.acm.org/crossroads/xrds3-1/ovp3-1.html
http://www.cplusplus.com/doc/tutorial/typecasting.html
http://www.codeguru.com/forum/showthread.php?t=312456
http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/cast.html
http://msdn.microsoft.com/en-us/library/5f6c9f8h(VS.80).aspx
http://en.wikibooks.org/wiki/C%2B%2B_Programming/Type_Casting
http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=134
-- CyberBotX, Nov 23, 2008
+3 -3
View File
@@ -6,10 +6,10 @@ if(WIN32)
if(IN_SOURCE)
# Add README.txt to list of files for CPack to ignore
add_to_cpack_ignored_files("README.txt$" TRUE)
endif(IN_SOURCE)
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
endif()
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
install(FILES ${DOCS}
DESTINATION ${DOC_DIR}
)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
endif(WIN32)
endif()
-239
View File
@@ -1,239 +0,0 @@
Orginally pulled from: http://www.inspircd.org/wiki/Coding_Guidelines
---
InspIRCd Coding Guidelines
The following are a set of guidelines for writing patches to InspIRCd, or for
creating modules for distribution with the official package. These guidelines
were written a time after InspIRCd development started, and so not all code
yet follows these. This will be rectified with time.
1. Comments
* Multi Line
Multiple line comments should follow the C-style comment, for example:
/*
* This is a multiple line comment, huzzah..
*/
* Single Line
Single line comments should also be in the C style, for example:
/* This is a boring one-line comment */
* Doxygen commenting
If you wish your comment to show in doxygen, the comment should be directly
above the item you are documenting (a class, function, enum, etc) and the
first line should be "/**". For example:
/** This is a doxygen multiline comment.
* Description of thingymebob here.
*/
The first line after the "**" is used as the short description of the item
(up to the full stop) and everything afterwards as the detailed description.
2. Indentation
Tabs. Tabs. ONLY TABS. Use a single tab for each level of indentation,
for example:
int main()
{
<tab>if (condition)
<tab>{
<tab><tab>code
<tab>}
}
3. Separation
Always put a space in between a keyword like if/while and the condition,
for example:
if (foo == bar)
NOT
if(foo == bar)
4. Braces
Always put braces opening and closing blocks on separate lines, see the
identation example. For example, place braces like this:
if (apples == "green")
{
cout << "Apples are green" << endl;
}
and not:
if (apples == "green") {
cout << "Apples are green" << endl;
}
The one exception to this is if you are declaring a class method which is
only one line long, in that case the following is acceptable in most cases:
class foo : public bar
{
foo() { }
getrandomfoo() { return rand(); }
};
5. Templates
Where possible, use templates rather than #defines. Avoid use of RTTI.
6. Structs
Structs should be declared in the following fashion:
struct BodyPartBasket
{
int arms;
int legs;
int scrotalsacs;
};
and not like this:
typedef struct
{
int arms;
int legs;
int scrotalsacs;
} BodyPartBasket;
The second way is not required in C++ to be able to do this:
BodyPartBasket mybasket;
Plus, placing the name at the bottom of the declaration makes readability
more difficult (as you have to scroll down to the bottom of the struct to
find its name). (where possible, call them classes rather than structs.)
7. Variable naming
Class and struct names should be in camel case with a leading capital letter,
for example "MyBagOfBones" and not "my_bag_of_bones" or "mybagofbones".
Variable names can be in either camel case with a leading capital letter or
alternatively all lower case, so long as the same naming convention is
adhered to throughout the class. No classes or variables should be named in
capitals unless this makes sense for the name (for example "class DNS").
Constants and enum values should always be completely in CAPITALS and
underscores may be used, for example:
enum DecayState
{
DECAYED_MOULDY = 0,
DECAYED_SMELLY = 1,
DECAYED_MAGGOTS = 2
};
All value names in an enum should be started with the same text which should
be related in some way to the enum's use. For example "DNS_CNAME, DNS_A,
DNS_AAAA".
8. Use of references
Wherever possible, when dealing with any complex class, pass a const reference
rather than a copy of the class. For example:
MyThingy::MyThingy(const std::string &thingyvalue)
{
}
Of course, if you intended to change the string you can just omit the 'const'.
9. Use of char pointers
Whenever you use char pointers (char*, char**) try to use const equivalents.
This is much safer and avoids ugly and dangerous casts. For example:
MyThingy::Thingify(const char* const* wotsits)
{
}
If it is possible without performance loss, consider avoiding char pointers
altogether and using std::string instead.
10. Use of STL
For more information on use of STL in InspIRCd, please see the separate
STL FAQ.
11. Making copies of data
Never ever make a copy of a piece of data unless it is absolutely necessary.
For example, don't use strlcpy() to make a copy of the const char* string
returned by std::string::c_str(), if the change can be done to the std::string
itself. The same goes for unnecessary variable assignments, especially those
which assign large classes.
12. namespace std
Avoid the following:
using namespace std;
It might take a bit more typing, but things work better if you don't set
(then later assume) the namespace -- specify it explicitly when you want to
use it.
13. Linefeeds
Unix linefeeds only please. We do not like to see our screens covered in ^M.
14. Portability
Always make sure your code is portable to all supported operating systems,
remember of course that as of 1.1.8 this includes windows. Don't write code
that only works on windows, or only works on Linux. Test your code on all
platforms or ask for help from other developers who have the platforms you
want to test on.
* new() and delete(), malloc() and free()
Apart from the fact that using malloc() and free() is bad practice in C++
code, you must never use malloc() or free() in InspIRCd, within its modules
or within the core. This is because if you use malloc() or free() in windows,
the memory is claimed from the program's local heap.
In windows, each shared object (module, dll) has its own heap, which is
protected from other dlls and executables. To get around this issue and
allow more posix-like memory access from other dlls in the program (other
modules), InspIRCd overrides the operators new and delete to ensure that
memory allocated by them comes from the windows global heap. If you use
malloc() and free() for this, the ircd will segfault when another module
tries to access the memory you have allocated!
* strdup()
As with malloc(), above, strdup() should be avoided. Where strdup() is
absolutely necessary, use strnewdup() which is our strdup() implementation
that calls operator new instead of using malloc().
char arrays allocated by strnewdup() should be deleted with operator delete[].
* CoreExport and DllImport
Prefix all types you want to import or export to other modules with CoreExport
and DllImport macros. These do nothing in POSIX operating systems, however
in windows these are expanded to the instructions __declspec(dllimport) and
__declspec(dllexport) respectively depending on where they are used and how.
15. External Dependencies
If a module is compiled as standard, or the code is part of the core, you must
not use any dependencies that are not available as standard on all supported
operating systems beyond libstdc++, libc, and whatever else is currently
required to build the core. Modules which use nonstandard dependencies belong
in the modules/extra directory.
16. Profiling and Performance
It is one thing to assume that code performs bad, it is another thing to prove
that it actually is. A lot of experienced programmers talk about 'premature
optimisation', and here is what it means: if you have a piece of code called
once on startup that takes 10 seconds instead of one second to run, and a
piece of code that takes 0.05 seconds to run when it should take 0.01, and
it is called once per second, the second piece of code is the priority.
In other words, make sure that what you think is slow, and a performance
problem in Insp actually is.
To do this, use the callgrind tool from Valgrind (valgrind --tool=cachegrind
bin/inspircd -nofork -debug), and kcachegrind (or similar) to view the output
files.
+81 -218
View File
@@ -1,223 +1,86 @@
Anope Version 2.0.0
Anope Version 2.1.4
-------------------
Added irc2sql stats module
Added a check for a non-deprecated encryption module on start.
Added a way for protocol modules to report an error to the uplink.
Added more account settings to the webcpanel.
Added self-test functionality for all encryption modules.
Added support for challenge authentication on InspIRCd.
Added support for importing databases from Atheme.
Added support for sending client tags on UnrealIRCd.
Added support for the InspIRCd 1206 (v4) protocol.
Added the --nopid option to disable writing a pid file.
Added the enc_argon2 module to encrypt passwords with Argon2.
Added the enc_sha2 module to encrypt passwords with HMAC-SHA-2.
Added the global/queue command for queueing multi-line messages.
Added the global/server command for sending messages to an individual server.
Added the PASSWORD category to operserv/stats to view password encryption methods.
Added the verify-only enc_posix module to validate passwords from Atheme that were encrypted with Argon2.
Changed nickserv/drop to use confirmation codes to confirm a nickname drop.
Changed various paths to be relative to the data and config directories.
Converted some IRCDProto member functions to variables.
Converted the enc_md5, enc_none, enc_old, enc_sha1, and enc_sha256 modules to be verify-only.
Deduplicated page headers and footers in the webcpanel templates.
Deprecated the enc_sha256 module.
Fixed inconsistent spelling/casing of email, vhost, and vident.
Fixed various bugs in the inspircd module.
Improved portability of email sending.
Improved protocol debug messages.
Improved the performance and reliability of internal conversion logic.
Improved the randomness of randomly generated numbers.
Refactored the enc_bcrypt module and exposed it as an encryption context.
Removed several duplicate translation strings.
Replaced the custom MD5 implementation in enc_md5 with a vendored one.
Replaced the custom SHA256 implementation in enc_sha256 with a vendored one.
The ldap_authentication, ldap_oper, sql_authentication, sql_log, and sql_oper modules are now always enabled.
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 2.1.3
-------------------
Added alternate command suggestions when a user runs an invalid command.
Added support for the IRCv3 +draft/channel-context tag.
Added support for the IRCv3 +draft/reply tag.
Allow using more than one fingerprint in an oper block.
Changed chanserv/drop to use confirmation codes to confirm a channel drop.
Cleaned up more of the codebase to use Modern C++17.
Enabled using more field limits sent by the IRC server instead of requiring the user to configure them.
Fixed NickServ lying about the minimum password length.
Fixed a crash when sending emails.
Fixed bs_kick not using the correct kick message for automatic kicks.
Increased the security of randomly generated confirmation codes.
Removed the ns_access module and associated cs_secure and ns_secure options.
Removed the ns_status module.
Reworked how messages are sent in protocol modules to allow sending message tags.
Anope Version 1.9.8
--------------------
A Ability to configure fantasy commands in the config
A Add SVSJOIN and SVSPART commands
F Fix "leave" channel log level from not logging
F Fix users able to "resend" their registration mail with registration set to admin only
F Fix build on OpenBSD
F Fix not logging debug logs to the logfile when debug mode is enabled
F Fix defcon timeout timer
F Fix crash in os_forbid with expiring entries
F Fix several issues with db_sql_live
Anope Version 2.1.2
-------------------
Bumped the minimum OpenSSL version to 1.1.0.
Bumped the minimum GnuTLS version to 3.0.0.
Disabled SSLv3 support in the m_ssl_openssl module.
Modernized mutex and thread code to use Modern C++.
Normalised the program exit codes.
Updated the Dutch translation.
Updated the French translation.
Anope Version 1.9.7
--------------------
A Added ability for using regex as patterns for various commands
A Extended ability of operserv/akill to also match against nick and realname
A Added chanserv:require configuration option
A Added nickserv:unregistered_notice and nickserv:registration configuration option
A Added options:casemap configuration option
A Added a web panel
A db_sql_live now allows all tables to be "live", not just a select few
Anope Version 2.1.1
-------------------
Added the UNBANME privilege to allow users to unban themselves.
Fixed building on Windows systems without chgrp/chmod.
Fixed creating sockets in the m_dns, m_httpd, m_proxyscan, and m_redis modules.
Fixed reading the values of command line arguments.
Moved core privilege descriptions to the example configs.
Updated the Italian translation.
Updated the Polish translation.
Anope Version 1.9.6
--------------------
A Added ability to configure emails sent by services
A Added chanserv/up and chanserv/down
A Added m_proxyscan
A Added more configurability for what vhosts are valid
A Added chanserv/log
A Added ability to configure ChanServ privileges
A Added a new database format
A Added SQLite support
A Added more verbose messages on startup
A Added ability for chanserv/suspend and nickserv/suspend to take an expiry time
A Added no nickname ownership config option
A Added m_rewrite
A Added akill IDs
F Fixed crash in clearusers
F Fixed crash in /os oper info
F Fixed eventfd Config check to work properly on OpenVZ
Anope Version 1.9.5
--------------------
A Extended LDAP support
A Added os_oper, os_kill, os_forbid, m_statusupdate, cs_sync, and bs_autoassign
A Added a new configuration file format
A Added a new commands system
A Added a new access system, and cs_flags
F Fixed not logging debug logs to file
F Fixed the mail delay time
F Fixed sending account data for unconfirmed nicks
F Fixed poll() engine build on FreeBSD
F Fixed really large HELP replies being truncated
F Fixed sometimes appending !*@* to valid hosts on access lists
F Fixed m_ssl sometimes failing connecting for no reason
F Fixed crash in cs_entrymsg
F Fixed setting -P on channels with only a botserv bot in it
F Fixed modemanager complaining about prefixless modes on InspIRCd
Anope Version 1.9.4
--------------------
A Automatically set channel founder to the user with the highest access if there is no successor
A /chanserv clone command to copy settings from one channel to another.
A /chanserv mode command
A Ability for users to delete their own access in channels
A Added support for Plexus 3
A Readded in support for /cs op/deop/etc to op/deop you in all channels
A Added LDAP support
A Added live SQL support
A Added support for learning tracking/storing/locking all modes at runtime
A Added m_alias
A Added support for XMLRPC queries
A Added /botserv set msg
A Added /operserv config
A Added /ns cert
A Added /operserv login
F Changed the GHOST command to not allow ghosting unidentified users if the RECOVER command exists
F Some failed logic in /operserv exception that prevents proper exceptions from being added
F Fixed the anope_os_sxlines MySQL table and code to work after restarting
Anope Version 1.9.3
--------------------
A Added italics BotServ kicks support
A Tell users when their nicks expire in /ns glist and /ns info
A Added SSL support
A Prevent negaitve mode changes, kicks, bans, and autokicks from affecting people with the 'god' user mode (On UnrealIRCd, usermode +q)
A Added nickserv/auxpex permission
A Added nickserv ungroup command
A Renamed the SGLINE to be SNLINE
A Added /chanserv saset command
A Added threads for mail sending
A Added m_dnsbl and an asynchronous DNS system
A Added a new language system that uses gettext
A Added m_mysql which uses threads to execute queries
A Added many subcommand modules for some commands, eg ns_set_autoop, ns_set_email, etc
A Added a new logging system that is a bit more flexible
A Added cs_set_misc and ns_set_misc to add miscellaneous set commands
A Added os_modreload, which allows reloading some modules not normally unloable, like the protocol module
A Added FOUNDER access level
A Made OperServ, Global, MemoServ, and ChanServ optional
F Shutting down if a config reload fails
F Autoid to live through restarts on Unreal
F Storing vhosts in MySQL
F Not flushing the anope_extra table before rewriting databaes
F Anoperc start/stop to send the globaloncycle global, and fixed anoperc rehash to really rehash
F Fixed a potential crash if HostServ or BotServ was disbled
Anope Version 1.9.2
--------------------
A K alias to chanserv kick command
A KB alias to chanserv ban command
A The ability to register empty nonregistered channels
A Flatfile plaintext databases and removed old binary ones
A Added in live updating SQL and the ability to execute commands through SQL (see docs/MYSQL)
A Added support for many more modes into Anope and the ability to have generic support for modes unknown to Anope
A Added a mode stacker to combine many mode changes into fewer
A Added in the CS SET PERSIST command which can be used to keep service bots in channels even when the channel is empty
A Added AUTOOWNER OWNER and OWNERME into CS LEVELS
A Added ns_resetpass module to the core
A CS ACCESS VIEW which shows who added the access and last time used
A Last used time to CS AKICK VIEW
A Added a sha_256 encryption module
A Added the ability to load multiple encryption modules, and the ability to seamlessly convert your database between diferent encryptions
A Added configuration options to allow Anope to reconnect if it disconnects from the uplink instead of dieing
A Added support for linking with IPv6
F Unban command to accept an optional nick arg
F Some typos in services.conf
F Crash when users change their host that are identified to a group, but not a nick
F Host length checking in HS SET(ALL) and HS REQUEST
F Only show if a user is online in NS INFO if they are really identiifed for the group of the nick they are on
F Crash when using BSSmartJoin
F Converting access entries to access from xop when a users access is below voice
F A bad pointer passed to the OnDelEvent which could cause some 3rd party modules to crash
F CS FORBID allows to you forbid unregistered channels
F The -nothird command line option to work
F ms_rsend to really work
F SQUITing juped servers on InspIRCd1.2+
Anope Version 1.9.1
--------------------
F Don't enforce akick/forbidden/etc.-restrictions on clients on ulined servers.
F Remove modules_unload_all fini + hack that goes with it.
F Signal handling cleanup.
A Seamless fantasy support on all ChanServ commands, instead of requiring bs_fantasy_*.
F Allow fantasy to be disabled on some commands (e.g. FORBID).
F Some commands (e.g. !help) need to strip the pre-provided channelname from them.
D HelpServ removed
F Command parser cleanup: mod_current_buffer removed and replaced with proper parser. Commands now indicate how they want the buffer split.
F Make NS ENFORCE/RELEASE stuff more sane, redo timers.
A Opertypes (similar to InspIRCd's opertypes)
Provided by Ankit <ankit@nevitus.com> - 2009
F Segfault on shutdown
Provided by Adam <adam@anope.org> - 2009
F NickServ registration is sometimes denied.
F Applied patch from Adam to fix some potential screwups
F More fixes to bs_bot from Adam, plus an extra fix within DoAdd not covered in Adam's patch.
F Fix bs_bot to use the correct parameters, patch from Adam.
F Fix for bug #1004, based from second half of patch from Adam.
F Partial patch by Adam, commenting fix for #1006 for future reference.
F Forward-port r1946: Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
Provided by DukePyrolator <dukepyrolator@gmx.de> - 2009
F Patch converting all match calls to new method, thanks!
F Add 'w' and 'y' support to dotime(), also prevent an overflow.
F Allow NS STATUS from unregistered users, thanks DP!
F Wild pointers do not a happy Anope make. Thanks DP :)
F Allow NS REGISTER to unregistered nicks, silly oversight. Thanks DP! :)
F Fix call order, thanks to DP
F Pass the right array to do_umode(), fixes mode tracking on Unreal. Thanks to DukePyrolator (yet again :P)
F Fix bs_set help, thanks to DukePyrolator! :)
F Fix two segfaults, noted by DukePyrolator. Thanks!
F Fix part one of #1010, reported by DukePyrolator. (Language settings are not respected in message sending.) Thanks!
F Memory leak on +beI modes.
Provided by Liber <Liber@jasonirc.net> - 2009
F Support operoverride and such things (stop reversing changes from nonopped people where unnecessary)
Anope Version 1.9.0
--------------------
F Modified compile to use g++
F Improve protocol modules support (classes, virtual methods, etc)
F Move core services to use BotInfo
F Move BotInfo and related methods into a class
F Move modules into a class
F Fixed ns resending of passcode issue
F Modules now delete themselves
F additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
F No struct Uid, ugly, and, unnecessary that we store UID in BotInfo.
F Prevent deletion of core services via /bs bot
F Module subsystem cleanup ('modules' branch)
F Move modules to use classes somewhat (AnopeInit, AnopeFini)
F Change MODULE_INIT to return a pointer
F Remove duplicate module creation.. have loadModule return a pointer rather than creating one
F Remove buffered loading/unloading, this makes os_modunload perm, but who cares
F Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
A Remove old config, replace with insp-inspired (albeit bind format) config (CBX)
F Clean up protocol modules a bit
A InspIRCd 1.2 support
F Remove old (prior to 1.8.0) db compat
F Establish a proper base for services pseudoclients
F Add ss_main StatServ Hal9000 to play with :)
F Burn automake with fire (CBX)
Provided by mooncup <mooncup@anonnet.org> - 2009
F Automatically reapply vhost on hs off for unreal.
Anope Version 2.1.0
-------------------
Added support for access list entry descriptions.
Added support for linking over a UNIX socket.
Added support for server-initiated logins and logouts on UnrealIRCd.
Added support for server-initiated logouts on InspIRCd.
Added support for the ANONYMOUS SASL mechanism.
Allowed users to opt-out of being added to channel access lists.
Cleaned up the codebase to use Modern C++17.
Modernized the build system to use a modern version of CMake.
Removed support for using insecure encryption methods as the primary method.
Removed the Windows-only anopesmtp tool.
Removed the two day X-line cap.
Updated all references to IRCServices to refer to Anope instead.
+58 -145
View File
@@ -1,154 +1,67 @@
Anope Version 2.0.0
Anope Version 2.1.4
-------------------
options:passlen, enforceruser, enforcerhost, releasetimeout, and guestnickprefix moved to nickserv's module configuration
options:hideregisteredcommands added
m_ssl renamed to m_ssl_openssl
Added the db_atheme module.
Added the enc_argon2 module.
Added the enc_posix module.
Added the enc_sha2 module.
Added the gl_queue module.
Added the gl_server module.
Added the global/queue operator privilege.
Added the global/server operator privilege.
Changed serverinfo:motd to be relative to the config directory.
Changed serverinfo:pid to be relative to the data directory.
Changed the default value of mail:sendmailpath to "/usr/sbin/sendmail -it".
Changed the default value of module:accessmax for the chanserv module to 1000.
Changed the default value of module:inhabit for the chanserv module to 1 minute.
Changed the default value of module:max for the cs_mode module to 50.
Changed the default value of module:max for the ms_ignore module to 50.
Removed options:seed.
Replaced module:template for the webcpanel module with module:template_dir.
Anope Version 1.9.9
Anope Version 2.1.3
-------------------
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.
Added options:didyoumeandifference.
Added support for multiple SSL fingerprints in oper:certfp.
Added the chanserv/cert oper privilege for modifying other user's certificate lists.
Changed networkinfo:chanlen to default to 32 if not set.
Changed networkinfo:hostlen to default to 64 if not set.
Changed networkinfo:modelistsize to default to 100 if not set.
Changed networkinfo:nicklen to default to 31 if not set.
Changed networkinfo:userlen to default to 10 if not set.
Increased the default maximum password length to 50 characters.
Increased the default minimum password length to 10 characters.
Removed the cs_secure option in module:defaults from the chanserv module (now always enabled).
Removed the nickserv/saset/secure command.
Removed the nickserv/saset/secure oper privilege.
Removed the nickserv/set/secure command.
Removed the nickserv/status command.
Removed the ns_access module.
Removed the ns_secure option in module:defaults from the nickserv module (now always enabled).
Anope Version 1.9.8
Anope Version 2.1.2
-------------------
networkinfo:chanlen added
options:user and options:group added
nickserv:modesonid added to set modes on everyone who identifies
nickserv:kill and nickserv:killquick added to configure NickServ's kill timeout
nickserv:restoreonrecover added to try to restore a user's session after a ghost
command:group added
fantasy block added
dns block has been moved to modules.conf as a part of m_dns
Added module:tlsv10 to the ssl_openssl module for configuring whether TLSv1.0 is usable (defaults to no).
Added module:tlsv11 to the ssl_openssl module for configuring whether TLSv1.1 is usable (defaults to yes).
Added module:tlsv12 to the ssl_openssl module for configuring whether TLSv1.2 is usable (defaults to yes).
Removed module:sslv3 from the ssl_openssl module (now always disabled).
Removed the m_ prefix from the names of the chanstats, dns, dnsbl, helpchan, httpd, ldap, ldap_oper, mysql, proxyscan, redis, regex_pcre2, regex_posix, regex_stdlib, regex_tre, rewrite, sasl, sql_log, sql_oper, sqlite, ssl_gnutls, ssl_openssl, xmlrpc, and xmlrpc_main modules.
Anope Version 1.9.7
Anope Version 2.1.1
-------------------
operserv:notifications removed in favor of log{} blocks
options:regexengine added
options:casemap added
chanserv:require added
nickserv:registration added, emailregistration removed.
nickserv:unregistered_notice added
Added the m_regex_stdlib module.
Removed the m_regex_pcre module (use m_regex_pcre2 instead).
Anope Version 1.9.6
Anope Version 2.1.0
-------------------
service:channels added to join services to channels
mail block modified to allow configuring of email messages
oper:host and oper:vhost added
oper:require_oper added
options:nonicknameownership added
operserv:akillids added
nickserv/access oper privilege added
Anope Version 1.9.5
-------------------
Don't even try it, get a new config and start over.
Anope Version 1.9.4
-------------------
** ADDED CONFIGURATION DIRECTIVES **
memoserv:modules added ms_ignore
chanserv:modules added cs_clone and cs_mode
nickserv:suspendexpire and nickserv:forbidexpire added
chanserv:suspendexpire and chanserv:forbidexpire added
module added cs_entrymsg
nickserv:modules added ns_ajoin, ns_cert
options:nomlock added
log:target added globops
nickserv:confirmemailchanges added
operserv:modules added os_config, os_login
** MODIFIED CONFIGURATION DIRECTIVES **
operserv:notifications removed osglobal, osmode, oskick, osakill, ossnline, ossqline, osszline, osnoop, osjupe, getpass, setpass, forbid, drop
renamed nickserv:preregexpire to nickserv:unconfirmedexpire
** DELETED CONFIGURATION DIRECTIVES **
opertype:commands removed operserv/umode
operserv:modules removed os_umode
Anope Version 1.9.3
------------------
** ADDED CONFIGURATION DIRECTIVES **
nickserv/auspex privilege added
SSL module added for SSL support
opertype:inherits added to allow opertypes to inherit commands and privs from other opertypes
Various nickserv/saset/* and chanserv/saset/* opertype command privileges added
nickserv:modules added many new ns_set_command modules
chanserv:modules added many new cs_set_command modules
opertype:commands added nickserv/saset/* and chanserv/saset/*
options:socketengine added to choose what socket engine to use
module:cs_set_misc and module:ns_set_misc added to replace the old set url/icq/email modules
options:hideprivilegedcommands added to hide privileged commands from normal users
log block added to customize logging
dns block added to configure dns settings
m_dnsbl added
mysql configuration block added
** MODIFIED CONFIGURATION DIRECTIVES **
opertype:commands changed operserv/sgline to opserv/snline
operserv:modules changed os_sgline to os_snline
operserv:modules added os_modreload
operserv:sglineexpiry changed to operserv:snlineexpiry
operserv:killonsgline changed to operserv:killonsnline
operserv:notifications ossgline changed ossnline
memoserv was made optional
moved operserv:global configuration into its own global block
chanserv was made optional
** DELETED CONFIGURATION DIRECTIVES **
serverinfo:helpchannel removed because it has been readded in m_helpchan
networkinfo:logchannel, logbot, logusers, logmaxusers, logchannel, and options:keeplogs removed because of the log block
dumpcore because it really didn't do anything
Anope Version 1.9.2
--------------------
** ADDED CONFIGURATION DIRECTIVES **
options:enablelogchannel added to auto turn on the logchannel on startup
options:mlock added to configure the default mlock modes on new channels
options:database added for the database modules
options:botmodes added to configure modes BotServ bots should use
options:userlen added to configure maxiumum ident length
options:hostlen added to configure maximum hostname length
options:database added to configure what database modules to use
options:passlen added to specify the maximum length of passwords
uplink:ipv6 added to enable IPv6 connectivity
options:maxretries added to specify the number of reconnect attempts allowed
options:retrywait added to specify how long to wait between reconnect attempts
opertype command chanserv/aop/list removed as it was unnecessary, use chanserv/access/list instead
** MODIFIED CONFIGURATION DIRECTIVES **
options:encryption added enc_sha256
chanserv:modules added cs_unban
nickserv:modules added ns_resetpass
** DELETED CONFIGURATION DIRECTIVES **
nickserv:database deleted because of new database system
nickserv:prenickdatabase deleted because of new database system
chanserv:database deleted because of the new database system
botserv:database deleted because of the new database system
hostserv:database deleted because of the new database system
operserv:database deleted because of the new database system
operserv:newsdatabase deleted because of the new database system
operserv:exceptiondatabase deleted because of the new database system
hs_request:database deleted because of the new database system
os_ignore:database deleted because of the new database system
serverinfo:localport deleted
Anope Version 1.9.1
-------------------
** ADDED CONFIGURATION DIRECTIVES **
Opertypes have been added, through the opertype blocks.
Services Operators are now specified in the oper blocks.
** MODIFIED CONFIGURATION DIRECTIVES **
botserv:modules no longer contains bs_fantasy* modules, fantasy is now seamless.
operserv:modules has replaced os_logonnews, os_opernews, and os_randomnews with os_news.
operserv:modules no longer contains os_admin and os_oper modules, removed in favor of oper blocks.
operserv:notifications no longer contains osraw due to removal of OS RAW.
** DELETED CONFIGURATION DIRECTIVES **
Nick tracking has been removed as an option.
Restricting of NS GETPASS and CS GETPASS removed in favor of opertypes.
Host Setters were removed in favor of opertypes.
HelpServ has been removed entirely.
operserv:disableraw removed due to removal of OS RAW.
Added nickserv:minpasslen for configuring the minimum password length (defaults to 8).
Removed nickserv:strictpasswords as it is obsolete now nickserv:minpasslen exists.
Removed the inspircd12 and inspircd20 modules (use inspircd instead).
Removed the ns_getpass module (no supported encryption modules).
Removed the os_oline module (no supported IRCds).
Removed the unreal module (use unrealircd instead).
Renamed nickserv:passlen to nickserv:maxpasslen.
Renamed the charybdis module to solanum.
Renamed the inspircd3 module to inspircd.
Renamed the unreal4 module to unrealircd.
Replaced uplink:ipv6 with uplink:protocol.
+19 -20
View File
@@ -1,4 +1,4 @@
Anope DefCon
Anope DefCon
------------
1) Introduction
@@ -10,8 +10,8 @@ Anope DefCon
1) Introduction
Anope 1.6 onwards supports a unique protection mechanism based on the
military "Defense Readiness Condition" (DefCon) system. It is based on
Anope supports a unique protection mechanism based on the
military "Defense Readiness Condition" (DefCon) system. It is based on
5 levels of defense readiness defined as:
DEFCON5 Normal peacetime readiness
@@ -23,9 +23,9 @@ Anope DefCon
These are configurable levels that mandates what actions Anope should
take in case of emergency and change in readiness status.
It is used to prevent abuse to both Services, and the ircd on which they
It is used to prevent abuse to both Anope, and the IRCd on which they
are running. Also to protect the users, primarily in the event of Clones
and/or FloodBOT attacks.
and/or FloodBOT attacks.
2) Installation
@@ -44,26 +44,26 @@ Anope DefCon
Pre-defined DefCon actions:
No new channel registrations
No New Nick Registrations
No new channel registrations
No New Nick Registrations
No Mode Lock changes
Force Chan Mode
Use Reduced Session Limit
KILL any new clients trying to connect
Services will ignore everyone but opers
Services will silently ignore everyone but opers
AKILL all new clients trying to connect
Force Chan Mode
Use Reduced Session Limit
KILL any new clients trying to connect
Ignore everyone but opers
Silently ignore everyone but opers
AKILL all new clients trying to connect
No new memos sent to block MemoServ attacks
Information regarding how to enable this for specific defcon levels can
be found in operserv.conf
4) Usage
Anope starts up in DEFCON5 (normal readiness). To change the Defcon level
in action use:
/msg OperServ DEFCON 1|2|3|4|5
Anope starts up in DEFCON5 (normal readiness). To change the Defcon level
in action use:
/msg OperServ DEFCON 1|2|3|4|5
5) Usage Example
@@ -89,6 +89,5 @@ Anope DefCon
6) Support
You might get DefCon support by posting on our online forum, or maybe on
You might get DefCon support by posting on our online forum, or maybe on
our #anope channel at /server irc.anope.org.
-35
View File
@@ -1,35 +0,0 @@
Anope Internal Events
---------------------
1) Intro
2) Using Events
1) Introduction to Internal Events
Internal Events are setup to give module developers more information
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
events such as the databases being saved.
Additionally there is a module included with the core
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.
2) Using Events
Each Event in Anope calls a function.
You must override these functions in your main modules class.
The full list of functions and parameters are in modules.h. In this
case, you would be overriding OnJoinChannel() and OnPartChannel() like so:
void OnJoinChannel(User *u, Channel *c) anope_override { }
void OnPartChannel(User *u, Channel *c) anope_override { }
Some of these event overrides can be used to prevent or allow things to
happen that would normally not be allowed or denied. You can also use
ModuleManager (not explained here) to set control which order the modules
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.
+5 -5
View File
@@ -1,10 +1,10 @@
Frequently Asked Questions (FAQ) concerning Anope
------------------------------------------------
The information in the 1.9 FAQ is subject to change at any
-------------------------------------------------
The information in the 2.0 FAQ is subject to change at any
moment due to new developments. Please visit our website
for the most up to date information.
An updated version of the FAQ can be found here:
http://wiki.anope.org/index.php/FAQ
https://wiki.anope.org/index.php/2.0/FAQ
+22 -41
View File
@@ -19,63 +19,48 @@ Note: You should also read the README and FAQ files!
The very first thing you need to do is to get the Anope package (if not
already done). You can find it at:
http://www.anope.org/
https://www.anope.org/
Anope can be built one of two ways. The recommended way is to use CMake.
You can check if CMake is already installed on your system using the
command:
Anope requires cmake to build. You can check if CMake is already
installed on your system using the command:
cmake --version
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
CMake unless you install it yourself into your home directory. CMake
can be downloaded from:
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.
https://cmake.org/download/
Next, unpack the package in your home directory, and go into the created
directory.
If there are any extra modules you want to enable, such as m_mysql, run
If there are any extra modules you want to enable, such as 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
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.
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
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
Now cd build and type make and make install. This will install
all the needed files in the paths you specified with the configure
script, and setup file permissions. You should ensure that the data
directory is not accessible by other users, as malicious users may
cause trouble on your network if passwords are not encrypted, or read
the memos of any user.
Now go into the conf directory (by default, ~/services/conf). Copy the example
configuration file (example.conf) to services.conf, and open the latter
Now go into the conf directory (by default, ~/anope/conf). Copy the example
configuration file (anope.example.conf) to anope.conf, and open the latter
with your favorite text editor. It contains all the configuration
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
most likely not work!
If you need help, you should visit http://forum.anope.org/ or #anope on
irc.anope.org. Provide *complete* error output, along with other relevant
If you need help, you should visit https://forum.anope.org/ or #anope on
irc.anope.org. Provide *complete* error output, along with other relevant
information eg. OS, compiler and C++ library versions.
See the README file for more information.
@@ -86,40 +71,36 @@ Note: You should also read the README and FAQ files!
* IMPORTANT: Back up your old databases!
* If you are upgrading to a new major release, ALWAYS restart a
fresh configuration file from example.conf.
fresh configuration file from anope.example.conf.
3) Setting up the IRCd
Services acts as an IRC server with pseudo-clients on it. To link them to
Anope acts as an IRC server with pseudo-clients on it. To link them to
your network, you'll need to configure your IRCd to allow services to link.
The configuration varies depending on the IRCd, but you will probably need
a link block (also called connect block, or C line), a U line (also called
a shared block), and be sure that the IRCd is listneing on the given port
a shared block), and be sure that the IRCd is listening on the given port
in the link block.
Example link configurations can be found in example.conf for some of the
Example link configurations can be found in anope.example.conf for some of the
popular IRCds.
Don't forget to /rehash your IRCd to apply changes.
You may also try our interactive link maker, which is located at:
http://anope.org/ilm.php
4) Starting Anope
Go into the directory where binaries were installed (by default, this is
~/services/bin). Type ./services to launch Anope.
~/anope/bin). Type ./anope to launch Anope.
If there are syntax errors in the configuration file they will be
displayed on the screen. Correct them until there are no errors anymore.
A successful startup won't generate any message.
Give Services at least one minute to link to your network, as certain
Give Anope at least one minute to link to your network, as certain
IRCds on some OSes may be really slow for the link process. If nothing
happens after about a minute, it is probably a configuration problem. Try
to launch Anope with ./services -debug -nofork to see any errors that it
to launch Anope with ./anope -debug -nofork to see any errors that it
encounters, and try to correct them.
If you need help to solve errors, feel free to subscribe to the Anope
@@ -131,16 +112,16 @@ Note: You should also read the README and FAQ files!
still running, and restart it if not.
First rename the example.chk script that is in Anope path (by default,
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
marked as executable by typing chmod +x services.chk, and try to launch the
this is ~/anope/conf) to anope.chk and edit it. You'll need to
modify the CONFIGURATION part of the file. Then ensure that the file is
marked as executable by typing chmod +x anope.chk, and try to launch the
script to see if it works (Anope must not be running when you do this ;))
When this is done, you'll have to add the crontab entry. Type crontab -e.
This will open the default text editor with the crontab file. Enter the
following (with correct path):
*/5 * * * * /home/ircd/services/conf/services.chk >/dev/null 2>&1
*/5 * * * * /home/ircd/anope/conf/anope.chk >/dev/null 2>&1
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
+90 -104
View File
@@ -1,5 +1,5 @@
Instructions d'installation d'Anope
------------------------------------
-----------------------------------
1) Installation d'Anope
2) Mettre à jour Anope
@@ -11,148 +11,134 @@ Note : Vous devrez également lire les fichiers README et FAQ !
1) Installation d'Anope
NOTE IMPORTANTE : il n'est pas recommandé d'utiliser (et même d'installer)
Anope en tant que root. Utilisez un utilisateur non
privilégié. Celui que vous utilisez pour l'IRCd ou un
utilisateur dédié suffira.
NOTE IMPORTANTE : il est déconseillé d'utiliser (et même d'installer)
Anope en tant que root. Utilisez un utilisateur non
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). Vous pouvez le trouver ici :
http://www.anope.org/
https://www.anope.org/
Anope peut être installé de deux façons. La méthode recommandée est
d'utiliser CMake. Vous pouvez vérifier si CMake est déjà installé
sur votre système en utilisant la commande :
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 similaire
à "cmake version 2.6 cmake-patch 1". 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 serez pas en mesure d'utiliser CMake, sauf si vous l'installez
vous-même dans votre répertoire home. CMake peut être téléchargé ici :
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 :
http://www.cmake.org/cmake/resources/software.html
https://cmake.org/download/
Si vous n'arrivez pas à l'installer (soit en raison du manque d'espace
ou de restrictions par votre fournisseur d'hébergement), vous pouvez encore
utiliser le script de configuration fourni. Cette option n'est pas
recommandée et finira par être retirée, mais est fournie pour la
compatibilité de ceux à qui il manque CMake.
Ensuite, décompressez le package dans votre répertoire home, et allez
dans le répértoire qui vient d'être créé.
Ensuite, décompressez le package dans votre répertoire home, et allez dans
le répértoire qui vient d'être créé.
Si il y a des modules facultatifs que vous voulez activer comme 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 compiler Anope sur votre système. Si vous
ne savez pas répondre à une question, utilisez la valeur par défaut. La
question d'utiliser CMake ou configure dépend de la décision que vous avez
prise précedemment. Si vous avez CMake et que vous souhaitez l'utiliser,
répondez avec cmake, sinon répondez avec configure.
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.
Vous pouvez maintenant taper make pour compiler Anope. S'il y'a des erreurs
dans le Makefile, *essayez d'utiliser* gmake à la place. Si cela ne
fonctionne toujours pas, vous (ou votre administrateur système) devriez
installer GNU make.
Vous pouvez le trouver ici : ftp://prep.ai.mit.edu/pub/gnu/.
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.
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é au script configure, et de régler les permissions des fichiers.
Vous devez vous assurer que le répertoire data n'est pas accessible par les
autres utilisateurs, 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 tout utilisateur.
Allez maintenant dans le répertoire conf (par défaut, ~/anope/conf).
Copiez l'exemple de fichier de configuration (anope.example.conf) en
anope.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 vous voyez des erreurs lors de ce processus, merci de nous envoyer un
e-mail avec la sortie d'erreur *complète* et n'oubliez pas de mentionner
les versions de votre système, compilateur et bibliothèque C++.
Allez maintenant dans le répertoire de données (par défaut, ~/services/data).
Copiez l'exemple de fichier de configuration (example.conf) en services.conf
et ouvrez ce dernier avec votre éditeur de texte favori. Il contient toute
les directives de configuration. Anope va l'utiliser au démarrage.
Lisez attentivement les instructions contenues dans le fichier.
L'utilisation des valeurs par défaut n'est pas recommendé et Anope ne
fonctionnera probablement pas.
Si vous avez besoin d'aide, abonnez-vous à la liste de diffusion Anope
et envoyez-y vos e-mails pour obtenir de l'aide de la part des autres
utilisateurs. Voir le fichier README pour plus d'informations.
Si vous avez besoin d'aide, vous pouvez aller sur le site
https://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.
2) Mettre à jour Anope
Pour mettre à jour Anope, suivez simplement les instructions d'installation
décrites dans la section 1. Il y a cependant une ligne de conduite
spécifique :
Pour mettre à jour Anope, suivez simplement les instructions
d'installation décrites dans la section 1. Prenez garde cependant :
* 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 neuf depuis example.conf.
* Si vous mettez à jour vers une nouvelle version majeure,
recommencez *toujours* toute votre configuration à partir du
fichier anope.example.conf.
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 linker.
Anope agit 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.
La configuration varie selon les IRCd, mais vous aurez probablement besoin
d'un block link (aussi appelé connect block, ou C line), un U line (aussi
appelé shared block) et assurez-vous que l'IRCd écoute sur le port donné
dans le block link.
La configuration dépend de l'IRCd utilisé, mais vous aurez probablement
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.
Des exemples de configurations de link peuvent être trouvés dans le fichier
example.conf pour certains des IRCd les plus populaires.
Des exemples de configurations de bloc link peuvent être trouvés dans
le fichier anope.example.conf pour certains des IRCd les plus populaires.
Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
Vous pouvez également essayer notre créateur de link interactif situé ici :
http://anope.org/ilm.php
4) Mettre en route Anope
Allez dans le répertoire où les fichiers binaires ont été installés (par
défaut, ~/services/bin). Tapez ./services pour lancer Anope.
Allez dans le répertoire où les fichiers binaires ont été installés
(par défaut, ~/anope/bin). Tapez ./anope pour lancer Anope.
S'il ya des erreurs de syntaxe dans le fichier de configuration, elles
seront affichées sur l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait plus.
Un démarrage réussi ne générera pas de message.
S'il y a des erreurs de syntaxe dans le fichier de configuration, elles
seront affichées à l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait
plus. Un démarrage réussi ne générera pas de message.
Donnez aux services au moins une minute pour se connecter à votre réseau.
Certains IRCds sur certains systèmes peuvent être très lents pour le
processus de liaison. Si rien n'arrive après environ une minute, il y a
probablement un problème de configuration. Essayez de lancer Anope en mode
debug ./services -debug -nofork pour voir toutes les erreurs rencontrées
et essayez de les corriger.
Donnez aux services au moins une minute pour se connecter à votre
réseau, car certains IRCds sur certains systèmes peuvent être très
lents pour le processus de liaison. Si rien ne se passe après environ
une minute, il y a probablement un problème de configuration. Essayez
de lancer Anope en mode debug avec ./anope -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 liste de diffusion Anope et d'y poser vos question.
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à
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
Une entrée crontab vous permettra de vérifier périodiquement si Anope est
toujours en cours d'exécution et de le redémarrer s'il n'est pas.
Une entrée crontab vous permettra de vérifier périodiquement si Anope
est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
D'abord renommez le script example.chk qui est dans le chemin d'Anope
(par défaut, ~/services/data) en services.chk et modifiez-le. Vous aurez
besoin de modifier la partie CONFIGURATION du fichier. Assurez-vous ensuite
que le fichier est marqué comme exécutable en 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 faites cela ;))
D'abord renommez le script example.chk qui est dans les dossiers
d'Anope (par défaut, ~/anope/conf) en anope.chk et modifiez-le.
Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
Assurez-vous ensuite que le fichier est marqué comme exécutable en
tapant chmod +x anope.chk et essayez de lancer le script pour voir
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
testez cela ;))
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Tapez crontab -e.
Cela va ouvrir l'éditeur de texte par défaut avec le fichier crontab.
Entrez la ligne suivante (avec le chemin correct) :
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Entrez
crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
*/5 * * * * /home/ircd/services/data/services.chk > /dev/null 2>&1
*/5 * * * * /home/ircd/anope/conf/anope.chk > /dev/null 2>&1
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
Consultez pages de manuel de votre système pour plus de détails sur la
syntaxe du fichier crontab. Les pages de manuel intéressantes sont
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
Consultez les pages de manuel de votre système pour plus de détails sur
la syntaxe du fichier crontab. Les pages de manuel intéressantes sont
crontab(5), crontab(1) et cron(8).
Sauvegardez, quittez et c'est installé.
Sauvegardez, quittez, et c'est installé !
+18 -6
View File
@@ -1,9 +1,10 @@
Anope Mutli Language Support
Anope Multi Language Support
----------------------------
1) Building Anope with gettext support
2) Adding a new language
3) Using languages with modules
4) Updating a language file
1) Building Anope with gettext support
@@ -22,21 +23,21 @@ Anope Mutli Language Support
2) Adding a new language
Anope uses gettext (http://www.gnu.org/software/gettext/) to translate messages for users. To add a new language
Anope uses gettext (https://www.gnu.org/software/gettext/) to translate messages for users. To add a new language
install gettext and run `msginit -l language -o anope.language.po -i anope.pot`. For example if I was translating to
Spanish I could run `msginit -l es_ES -o anope.es_ES.po -i anope.pot`. Open the newly generating .po file and start
translating. Once you are done simply rerun ./Config; make && make install and add the language to your services.conf.
translating. Once you are done simply rerun ./Config; make && make install and add the language to your anope.conf.
Note that on Windows it is not quite this simple, windows.cpp must be edited and Anope recompiled and restarted.
Poedit (http://www.poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
po files (especially on Windows).
If you have finished a language file translation and you want others to use it, please send it to team@anope.org
(don't forget to mention clearly your (nick)name, your e-mail and the language name). You'll of course get full credit for it.
(don't forget to mention clearly your (nick)name, your email and the language name). You'll of course get full credit for it.
NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
3) Using langages with modules
3) Using languages with modules
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).
@@ -51,3 +52,14 @@ Anope Mutli Language Support
All .po and .pot files should be placed in modules/third/language. Additionally an update script is provided there
that will create .pot files and merge any changes to it with existing .po files.
4) Updating a language file
Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
po files (especially on Windows).
Before editing the relevant file in languages/, run `update.sh` in the languages/ folder, i.e. `cd` to it and run
./update.sh
This will update the language file to contain all strings that need a translation.
Then commit only the changed .po files in git.
+7 -7
View File
@@ -12,7 +12,7 @@ Anope Modules
1) Introduction
Anope 1.6 onwards supports external modules. External modules are pieces
Anope supports external modules. External modules are pieces
of code that can be attached to a running Anope process dynamically. These
modules can serve several purposes, and perform all kind of operations to
enhance your network.
@@ -22,7 +22,7 @@ Anope Modules
1. If modules are supported by your system, they will be configured
automatically when you run ./Config. The modules will be installed
to the modules directory in your data path (by default this will
be ~/services/data/modules).
be ~/anope/data/modules).
2. Compile Anope as usual using ./Config. The "make" process will now
compile module support into Anope, and compile the default sample
@@ -87,7 +87,7 @@ Anope Modules
5) More Modules
You can download more useful modules from http://modules.anope.org/. Just
You can download more useful modules from https://modules.anope.org/. Just
grab the module file (usually with a .cpp extension). Place the module
file in your modules (anope-1.9.x/modules/third) folder; although any of
the other folders within the modules directory will work.
@@ -98,7 +98,7 @@ Anope Modules
1. Make sure you're in the main source directory. (usually anope-1.X.XX/)
2. Run ./Config to find and configure modules, then `cd build`.
3. Run `make` to compile Anope, and any modules.
4. Run `make install` to copy the compiled binaries to the ~/services/
4. Run `make install` to copy the compiled binaries to the ~/anope/
directory.
You can now use /msg OperServ MODLOAD to load the new modules.
@@ -117,12 +117,12 @@ Anope Modules
There are a number of useful documents on the Anope Wiki. The Anope Wiki
can be reached at:
* http://wiki.anope.org/
* https://wiki.anope.org/
8) Modules Repository
You can find modules at http://modules.anope.org
You can find modules at https://modules.anope.org/
These modules are 3rd party and as such are not supported by the Anope Team.
Contact the Module Author directly with problems, not the Anope Team.
-7
View File
@@ -1,7 +0,0 @@
Highlighted News in Anope 1.9
=============================
* Added in live updating SQL and the ability to execute commands through SQL
* Re-designed configuration file
* Code refresh / rewrite into C++
+17 -19
View File
@@ -1,16 +1,14 @@
Anope -- a set of IRC services for IRC networks
-----------------------------------------------
Anope is 2003-2014 Anope Team <team@anope.org>.
Anope is 2003-2024 Anope Team <team@anope.org>.
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
This program is free but copyrighted software; see the file COPYING for
details.
Information about Anope may be found at http://www.anope.org/
Information about Epona may be found at http://www.epona.org/
Information about Services may be found at http://www.ircservices.esper.net/
Information about Anope may be found at https://www.anope.org/
Table of Contents
-----------------
@@ -19,7 +17,7 @@ Table of Contents
3) Installation
4) Command Line Options
5) Messages Translation
6) Contact and Mailing List
6) Contact
1) Credits
@@ -94,7 +92,7 @@ Table of Contents
* Lee Holmes <lethality@anope.org>
* Lucas Nussbaum <lucas@lucas-nussbaum.net>
* Mark Summers <mark@goopler.net>
* Matthew Beeching <jobe@invictachat.net>
* Matthew Beeching <jobe@mdbnet.co.uk>
* Naram Qashat <cyberbotx@anope.org>
* Phil Lavin <phil@anope.org>
* Pieter Bootsma <geniusdex@anope.org>
@@ -107,11 +105,11 @@ Table of Contents
Anope Translations:
* Robby <robby@chat.be> (nl_NL)
* Robby <robby@chatbelgie.be> (nl_NL)
* Kein <kein-of@yandex.ru> (ru_RU)
* Maik Funke <Han@mefalcon.org> (de_DE)
* Isaac Fontal <i_fontal@hotmail.com> (es_ES)
* Janos Kapitany <sarkanyka@cjbchat.hu> (hu_HU)
* Janos Kapitany <sarkanyka@cjbchat.hu> (hu_HU)
* Szymon S'wierkosz <szymek@adres.pl> (pl_PL)
* Christopher N. <saka@epiknet.org> (fr_FR)
* Yusuf Kurekci <ysfm.20@gmail.com> (tr_TR)
@@ -122,7 +120,7 @@ Table of Contents
2) Presentation
Anope is a set of Services for IRC networks that allows users to manage
Anope is a set of services for IRC networks that allows users to manage
their nicks and channels in a secure and efficient way, and administrators
to manage their network with powerful tools.
@@ -169,13 +167,13 @@ Table of Contents
Anope currently works with:
* Bahamut 1.4.27 or later (including 1.8)
* Charybdis 3.4 or later
* Hybrid 8.1 or later
* InspIRCd 1.2 or 2.0
* ircd-hybrid 8.2.23 or later
* InspIRCd 3 or later
* ngIRCd 19.2 or later
* Plexus 3 or later
* Ratbox 2.0.6 or later
* UnrealIRCd 3.2 or later
* Solanum (all versions)
* UnrealIRCd 4 or later
Anope could also work with some of the daemons derived by the ones listed
above, but there's no support for them if they work or don't work.
@@ -227,7 +225,7 @@ Table of Contents
the log file; if you send a bug report, PLEASE include an excerpt from
the log file WITH DEBUGGING ACTIVE; we cannot emphasize enough how
important this is to tracking down problems. (You can also enable
debugging while Services is running using OperServ's SET DEBUG command.)
debugging while Anope is running using OperServ's SET DEBUG command.)
If you repeat use --debug=<level>, the debugging level will be increased,
which provides more detailed information but may also slow Anope down
considerably and make the log file grow dramatically faster. In general,
@@ -242,19 +240,19 @@ Table of Contents
6) Contact
For announcements and discussions about Anope, please visit our
Portal and Forums at http://www.anope.org/ -- make sure you register
Portal and Forums at https://www.anope.org/ -- make sure you register
yourself to get full benefits.
If you read the documentation carefully, and didn't find the answer to
your question, feel free to post on the website forums or join our irc
channel (irc.anope.org #anope). Once you join our Support channel be as
channel (irc.anope.org #anope). Once you join our Support channel be as
precise as possible when asking a question, because we have no extraordinary
powers and can't guess things if they aren't provided.
powers and can't guess things if they aren't provided.
The more precise you are the sooner you'll be likely to get an answer.
If you think you found a bug, add it to the bug tracking system
(http://bugs.anope.org) and - again - be as precise as possible. Also say
whether the bug happens always or under what circumstances, and anything
(https://github.com/anope/anope/issues) and - again - be as precise as possible.
Also say whether the bug happens always or under what circumstances, and anything
that could be useful to track your bug down. If you wrote a patch, send
it over. :)
+10 -10
View File
@@ -1,8 +1,8 @@
Starting in Anope 1.9.9, Anope has Redis database support (http://redis.io/).
Anope has Redis database support (https://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
This is not a tutorial on how to use Redis, see https://redis.io/documentation
for that.
Table of Contents
@@ -14,7 +14,7 @@ Table of Contents
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:
@@ -32,7 +32,7 @@ Table of Contents
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:
over all of them, I would start by:
redis 127.0.0.1:6379> HGETALL hash:BotInfo:1
@@ -70,10 +70,10 @@ Table of Contents
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
(https://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.
and will not regularly read from the database 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
@@ -93,7 +93,7 @@ Table of Contents
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.
update them for you to correctly reflect 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
@@ -149,12 +149,12 @@ Table of Contents
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"
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Anope IRC Services"
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:
If you are watching your services logs you will immediately see:
USERS: redis!redis@services.anope.org (Services for IRC Networks) connected to the network (services.anope.org)
USERS: redis!redis@services.anope.org (Anope IRC Services) 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.
-26
View File
@@ -1,26 +0,0 @@
Anope Bundled Tools
-------------------
1) Anope SMTP Client
Provided with Anope is a simple SMTP client which can be used instead of
programs like SendMail in some cases.
The SMTP client can be used instead of sendmail for use with Anope's mail
options. To use the SMTP client instead of sendmail, find the line in your
services configuration file (services.conf) that defines sendmailpath. On
that line, change the path to your services installation directory, then
followed by "bin/anopesmtp" and the IP address of a valid SMTP server. It
should look like this:
sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1"
If the SMTP client doesn't send mail, or if there's an other problem with
it, you can enable debug mode by passing the --debug flag after the server
address. This should generate a log file of what happened when it tried
to connect to the SMTP server.
Credits:
Originally written by Dominick Meglio <codemastr@unrealircd.com>
Ported to *nix by Trystan Scott Lee <trystan@nomadirc.net>
+8 -17
View File
@@ -18,10 +18,10 @@ Anope for Windows
1) Download the required files:
* Current Anope source:
http://sourceforge.net/project/showfiles.php?group_id=94081
https://github.com/anope/anope/releases
* CMake:
http://www.cmake.org/cmake/resources/software.html
https://cmake.org/download/
(NOTE: When installing, tell CMake to add itself to the PATH.)
@@ -70,21 +70,13 @@ Anope for Windows
If you cannot find whats causing the error, please visit our forums or
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 mysql and
the SSL modules. If these libraries are installed in nonstandard
locations, cmake will probably not find them and should be told where
they are by passing additional search paths to the last question in
Config, such as:
they are by passing their location to Config.
-DEXTRA_INCLUDE:STRING=c:/openssl/include;c:/mysql/include
-DEXTRA_LIBS:STRING=c:/openssl/lib;c:/mysql/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.
The libraries used to build the 'extra' modules are available at
https://github.com/Adam-/windows-scripts.
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type:
@@ -111,7 +103,7 @@ Anope for Windows
INSTALL within the Solution Explorer. Right-click on INSTALL and choose Build.
When you have done this, all the files will be installed to where they belong.
The only thing you need to do is rename "data/example.conf" to be "data/services.conf",
The only thing you need to do is rename "data/anope.example.conf" to be "data/anope.conf",
and then follow the steps to set up Anope.
You have now completed the building phase of Anope for Windows. You can
@@ -128,7 +120,7 @@ Anope for Windows
Notepad will cause strange characters to appear, and you may not be able to
edit the file correctly.
Open services.conf, and read through it carefully and adjust the settings
Open anope.conf, and read through it carefully and adjust the settings
you think you need to adjust.
If you are unsure of the settings, you can go to the dos command prompt
@@ -167,4 +159,3 @@ Anope for Windows
Anope's Windows Installer was made using:
* NSIS 2.20 <http://nsis.sourceforge.net>
+10 -7
View File
@@ -1,13 +1,13 @@
Starting with Anope 1.9.4 XMLRPC using PHP's xmlrpc_encode_request and xmlrpc_decode functions is supported.
XMLRPC using PHP's xmlrpc_encode_request and xmlrpc_decode functions is supported.
This allows external applications, such as websites, to execute remote procedure calls to Anope in real time.
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
Currently there are 5 supported XMLRPC calls, provided by xmlrpc_main:
checkAuthetication - 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.
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.
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 the given command to Anope using the given service name. If the user given is online, the
command reply will go to them, if not it is returned by XMLRPC.
stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command.
@@ -17,10 +17,13 @@ channel - Takes one parameter, a channel name, and returns real time information
user - Takes one parameter, a user name, and returns real time information regarding that user.
opers - Takes no parameters, returns opertypes, their privileges and commands.
notice - Takes three parameters, source user, target user, and message. Sends a message to the user.
XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will
be stored by Anope and the same id will be passed back in the result.
+126 -71
View File
@@ -1,90 +1,145 @@
<?php
/* XMLRPC Functions
/**
* XMLRPC Functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
*/
class AnopeXMLRPC
{
private $Host;
/**
* The XMLRPC host
*
* @var string
*/
private $host;
function __construct($Host)
{
$this->Host = $Host;
}
/**
* Initiate a new AnopeXMLRPC instance
*
* @param $host
*/
public function __construct($host)
{
$this->host = $host;
}
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
* $this->RunXMLRPC("checkAuthentication", array("adam", "qwerty"));
* If successful returns back an array of useful information.
*
* Note that $params["id"] is reserved for query ID, you may set it to something if you wish.
* If you do, the same ID will be passed back with the reply from Anope.
*/
function RunXMLRPC($name, $params)
{
$xmlquery = xmlrpc_encode_request($name, $params);
$context = stream_context_create(array("http" => array(
"method" => "POST",
"header" => "Content-Type: text/xml",
"content" => $xmlquery)));
/**
* Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
* $this->raw("checkAuthentication", ["adam", "qwerty"]);
* If successful returns back an array of useful information.
*
* Note that $params["id"] is reserved for query ID, you may set it to something if you wish.
* If you do, the same ID will be passed back with the reply from Anope.
*
* @param $name
* @param $params
* @return array|null
*/
public function run($name, $params)
{
$xmlquery = xmlrpc_encode_request($name, $params);
$context = stream_context_create(["http" => [
"method" => "POST",
"header" => "Content-Type: text/xml",
"content" => $xmlquery]]);
$inbuf = file_get_contents($this->Host, false, $context);
$response = xmlrpc_decode($inbuf);
$inbuf = file_get_contents($this->host, false, $context);
$response = xmlrpc_decode($inbuf);
if (isset($response[0]))
return $response[0];
return NULL;
}
if ($response) {
return $response;
}
/** Do Command on Service as User, eg:
* $anope->DoCommand("ChanServ", "Adam", "REGISTER #adam");
* Returns an array of information regarding the command execution, if
* If 'online' is set to yes, then the reply to the command was sent to the user on IRC.
* If 'online' is set to no, then the reply to the command is in the array member 'return'
*/
function DoCommand($Service, $User, $Command)
{
return $this->RunXMLRPC("command", array($Service, $User, $Command));
}
return null;
}
/** Check an account/nick name and password to see if they are valid
* Returns the account display name if valid
*/
function CheckAuthentication($Account, $Pass)
{
$ret = $this->RunXMLRPC("checkAuthentication", array($Account, $Pass));
/**
* Do Command on Service as User, eg:
* $anope->command("ChanServ", "Adam", "REGISTER #adam");
* Returns an array of information regarding the command execution, if
* If 'online' is set to yes, then the reply to the command was sent to the user on IRC.
* If 'online' is set to no, then the reply to the command is in the array member 'return'
*
* @param $service
* @param $user
* @param $command
* @return array|null
*/
public function command($service, $user, $command)
{
return $this->run("command", [$service, $user, $command]);
}
if ($ret && $ret["result"] == "Success")
return $ret["account"];
return NULL;
}
/**
* Check an account/nick name and password to see if they are valid
* Returns the account display name if valid
*
* @param $account
* @param $pass
* @return string|null
*/
public function auth($account, $pass)
{
$ret = $this->run("checkAuthentication", [$account, $pass]);
/* Returns an array of misc stats regarding Anope
*/
function DoStats()
{
return $this->RunXMLRPC("stats", NULL);
}
if ($ret && $ret["result"] == "Success") {
return $ret["account"];
}
/* Look up data for a channel
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*/
function DoChannel($Channel)
{
return $this->RunXMLRPC("channel", array($Channel));
}
return null;
}
/* Like DoChannel(), but different.
*/
function DoUser($User)
{
return $this->RunXMLRPC("user", array($User));
}
/**
* Returns an array of misc stats regarding Anope
*
* @return array|null
*/
public function stats()
{
return $this->run("stats", null);
}
/**
* Look up data for a channel
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*
* @param $channel
* @return array|null
*/
public function channel($channel)
{
return $this->run("channel", [$channel]);
}
/**
* Sent a notice to a user.
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*
* @param $source
* @param $target
* @param $message
* @return array|null
*/
public function notice($source, $target, $message)
{
return $this->run("notice", [$source, $target, $message]);
}
/**
* Like channel(), but different.
*
* @param $user
* @return array|null
*/
public function user($user)
{
return $this->run("user", [$user]);
}
}
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
?>
$anope = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
+3 -8
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
#
# Script taken from InspIRCd, www.inspircd.org
# Script taken from InspIRCd, https://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
@@ -9,7 +9,7 @@
# 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/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
@@ -148,12 +148,7 @@ while (1)
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/.");
}
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"
+11 -52
View File
@@ -1,63 +1,22 @@
# Set version.cpp to use C++ as well as set its compile flags
set_source_files_properties(version.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Generate version executable to modify version.h, setting it's linker flags as well
add_executable(version version.cpp)
set_target_properties(version PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
get_target_property(version_BINARY version LOCATION)
# Generate version-bin executable to modify version.h, setting it's linker flags as well
add_executable(version-bin version.cpp)
set_target_properties(version-bin PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
set(version_BINARY "$<TARGET_FILE:version-bin>")
# Modify version.h from the above executable, with dependencies to version.cpp
# and all of the source files in the main build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h
DEPENDS version ${SRC_SRCS}
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
COMMAND version-bin ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
DEPENDS version-bin ${SRC_SRCS}
)
# Add version to list of files for CPack to ignore
# Add version-bin to list of files for CPack to ignore
get_filename_component(version_BINARY ${version_BINARY} NAME)
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
if(NOT WIN32)
add_to_cpack_ignored_files("version.h$" TRUE)
endif(NOT WIN32)
set(PCH_SOURCES_GCH "")
if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}")
file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
sort_list(PCH_SOURCES)
foreach(PCH_SOURCE ${PCH_SOURCES})
find_includes(${PCH_SOURCE} INCLUDES)
set(INCLUDES_LIST)
append_to_list(INCLUDES_LIST ${PCH_SOURCE})
foreach(INCLUDE ${INCLUDES})
# Extract the filename from the #include line
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
if(QUOTE_TYPE STREQUAL "quotes")
find_in_list(PCH_SOURCES "${FILENAME}" FOUND)
if(NOT FOUND EQUAL -1)
append_to_list(INCLUDES_LIST ${FILENAME})
endif(NOT FOUND EQUAL -1)
endif(QUOTE_TYPE STREQUAL "quotes")
endforeach(INCLUDE)
set(PCH_EXTRAFLAGS "")
if(DEBUG_BUILD)
set(PCH_EXTRAFLAGS "-g")
endif(DEBUG_BUILD)
if(PCH_SOURCE STREQUAL "module.h")
set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC)
endif(PCH_SOURCE STREQUAL "module.h")
if(GETTEXT_INCLUDE)
set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}")
endif(GETTEXT_INCLUDE)
set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS}
${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
DEPENDS ${INCLUDES_LIST} VERBATIM
)
endforeach(PCH_SOURCE ${PCH_SOURCES})
endif(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
add_to_cpack_ignored_files("build.h$" TRUE)
endif()
# Add a custom target to the above file
add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version_build ${PCH_SOURCES_GCH})
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h)
+37 -35
View File
@@ -1,17 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef ACCESS_H
#define ACCESS_H
#pragma once
#include "services.h"
#include "anope.h"
@@ -29,7 +27,7 @@ enum
* backing each ChanAccess determines whether that ChanAccess has a given
* privilege.
*/
struct CoreExport Privilege
struct CoreExport Privilege final
{
Anope::string name;
Anope::string desc;
@@ -40,10 +38,10 @@ struct CoreExport Privilege
bool operator==(const Privilege &other) const;
};
class CoreExport PrivilegeManager
class CoreExport PrivilegeManager final
{
static std::vector<Privilege> Privileges;
public:
public:
static void AddPrivilege(Privilege p);
static void RemovePrivilege(Privilege &p);
static Privilege *FindPrivilege(const Anope::string &name);
@@ -54,9 +52,10 @@ class CoreExport PrivilegeManager
/* A provider of access. Only used for creating ChanAccesses, as
* they contain pure virtual functions.
*/
class CoreExport AccessProvider : public Service
class CoreExport AccessProvider
: public Service
{
public:
public:
AccessProvider(Module *owner, const Anope::string &name);
virtual ~AccessProvider();
@@ -65,46 +64,50 @@ class CoreExport AccessProvider : public Service
*/
virtual ChanAccess *Create() = 0;
private:
private:
static std::list<AccessProvider *> Providers;
public:
public:
static const std::list<AccessProvider *>& GetProviders();
};
/* Represents one entry of an access list on a channel. */
class CoreExport ChanAccess : public Serializable
class CoreExport ChanAccess
: public Serializable
{
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;
Anope::string mask;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
/* The provider that created this access entry */
public:
typedef std::vector<ChanAccess *> Path;
/* The provider that created this access entry */
AccessProvider *provider;
/* Channel this access entry is on */
Serialize::Reference<ChannelInfo> ci;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
Anope::string mask;
Anope::string creator;
Anope::string description;
time_t last_seen;
time_t created;
ChanAccess(AccessProvider *p);
virtual ~ChanAccess();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
void SetMask(const Anope::string &mask, ChannelInfo *ci);
const Anope::string &Mask() const;
NickCore *GetAccount() const;
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
static const unsigned int MAX_DEPTH = 4;
/** Check if this access entry matches the given user or account
* @param u The user
* @param nc The account
* @param p The path to the access object which matches will be put here
* @param next Next channel to check if any
*/
virtual bool Matches(const User *u, const NickCore *nc, Path &p) const;
virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo *&next) const;
/** Check if this access entry has the given privilege.
* @param name The privilege name
@@ -132,13 +135,13 @@ class CoreExport ChanAccess : public Serializable
/* A group of access entries. This is used commonly, for example with ChannelInfo::AccessFor,
* to show what access a user has on a channel because users can match multiple access entries.
*/
class CoreExport AccessGroup : public std::vector<ChanAccess *>
class CoreExport AccessGroup final
{
public:
public:
/* access entries + paths */
std::vector<ChanAccess::Path> paths;
/* Channel these access entries are on */
const ChannelInfo *ci;
/* Path from these entries to other entries that they depend on */
ChanAccess::Path path;
const ChannelInfo *ci;
/* Account these entries affect, if any */
const NickCore *nc;
/* super_admin always gets all privs. founder is a special case where ci->founder == nc */
@@ -166,7 +169,6 @@ class CoreExport AccessGroup : public std::vector<ChanAccess *>
bool operator<(const AccessGroup &other) const;
bool operator>=(const AccessGroup &other) const;
bool operator<=(const AccessGroup &other) const;
inline bool empty() const { return paths.empty(); }
};
#endif
+63 -103
View File
@@ -1,17 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef ACCOUNT_H
#define ACCOUNT_H
#pragma once
#include "extensible.h"
#include "serialize.h"
@@ -19,21 +17,25 @@
#include "memo.h"
#include "base.h"
typedef Anope::hash_map<NickAlias *> nickalias_map;
typedef Anope::hash_map<NickCore *> nickcore_map;
typedef Anope::unordered_map<NickAlias *> nickalias_map;
typedef Anope::unordered_map<NickCore *> nickcore_map;
typedef std::unordered_map<uint64_t, NickCore *> nickcoreid_map;
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
extern CoreExport nickcoreid_map NickCoreIdList;
/* 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)
*/
class CoreExport NickAlias : public Serializable, public Extensible
class CoreExport NickAlias final
: public Serializable
, public Extensible
{
Anope::string vhost_ident, vhost_host, vhost_creator;
time_t vhost_created;
time_t vhost_created = 0;
public:
public:
Anope::string nick;
Anope::string last_quit;
Anope::string last_realname;
@@ -41,57 +43,63 @@ class CoreExport NickAlias : public Serializable, public Extensible
Anope::string last_usermask;
/* Last uncloaked usermask, requires nickserv/auspex to see */
Anope::string last_realhost;
time_t time_registered;
time_t last_seen;
time_t time_registered = Anope::CurTime;
time_t last_seen = Anope::CurTime;
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
Serialize::Reference<NickCore> nc;
/** Constructor
/** Constructor
* @param nickname The nick
* @param nickcore The nickcore for this nick
*/
NickAlias(const Anope::string &nickname, NickCore *nickcore);
~NickAlias();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
/** Set a vhost for the user
/** Set a vhost for the user
* @param ident The ident
* @param host The host
* @param creator Who created the vhost
* @param time When the vhost was craated
* @param time When the vhost was created
*/
void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
void SetVHost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
/** Remove a users vhost
**/
void RemoveVhost();
void RemoveVHost();
/** Check if the user has a vhost
* @return true or false
*/
bool HasVhost() const;
bool HasVHost() const;
/** Retrieve the vhost ident
* @return the ident
*/
const Anope::string &GetVhostIdent() const;
const Anope::string &GetVHostIdent() const;
/** Retrieve the vhost host
* @return the host
*/
const Anope::string &GetVhostHost() const;
const Anope::string &GetVHostHost() const;
/** Retrieve the vhost mask
* @param the mask
*/
Anope::string GetVHostMask() const;
/** Retrieve the vhost creator
* @return the creator
*/
const Anope::string &GetVhostCreator() const;
const Anope::string &GetVHostCreator() const;
/** Retrieve when the vhost was created
* @return the time it was created
*/
time_t GetVhostCreated() const;
time_t GetVHostCreated() const;
/** Finds a registered nick
* @param nick The nick to lookup
@@ -104,21 +112,24 @@ class CoreExport NickAlias : public Serializable, public Extensible
* account's display.
* It matters that Base is here before Extensible (it is inherited by Serializable)
*/
class CoreExport NickCore : public Serializable, public Extensible
class CoreExport NickCore final
: public Serializable
, public Extensible
{
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
public:
/* Name of the account. Find(display)->nc == this. */
/* Unique identifier for the account. */
uint64_t id;
public:
/* Name of the account. Find(display)->nc == this. */
Anope::string display;
/* User password in form of hashm:data */
Anope::string pass;
Anope::string email;
/* Locale name of the language of the user. Empty means default language */
Anope::string language;
/* 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. */
std::vector<Anope::string> access;
/* Last time an email was sent to this user */
time_t lastmail = 0;
MemoInfo memos;
std::map<Anope::string, Anope::string> last_modes;
@@ -127,26 +138,25 @@ class CoreExport NickCore : public Serializable, public Extensible
*/
Serialize::Checker<std::vector<NickAlias *> > aliases;
/* Set if this user is a services operattor. o->ot must exist. */
Oper *o;
/* Set if this user is a services operator. o->ot must exist. */
Oper *o = nullptr;
/* Unsaved data */
/* Number of channels registered by this account */
uint16_t channelcount;
/* Last time an email was sent to this user */
time_t lastmail;
uint16_t channelcount = 0;
/* Users online now logged into this account */
std::list<User *> users;
/** Constructor
* @param display The display nick
* @param id The account id
*/
NickCore(const Anope::string &nickdisplay);
NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0);
~NickCore();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
/** Changes the display for this account
* @param na The new display, must be grouped to this account.
@@ -158,64 +168,15 @@ class CoreExport NickCore : public Serializable, public Extensible
*/
virtual bool IsServicesOper() const;
/** Add an entry to the nick's access list
*
* @param entry The nick!ident@host entry to add to the access list
*
* Adds a new entry into the access list.
*/
void AddAccess(const Anope::string &entry);
/** Get an entry from the nick's access list by index
*
* @param entry Index in the access list vector to retrieve
* @return The access list 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 access list corresponding to the given index.
*/
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
*
* @param entry The nick!ident@host entry to search for
* @return True if the entry is found in the access list, false otherwise
*
* Search for an entry within the access list.
*/
bool FindAccess(const Anope::string &entry);
/** Erase an entry from the nick's access list
*
* @param entry The nick!ident@host entry to remove
*
* Removes the specified access list entry from the access list.
*/
void EraseAccess(const Anope::string &entry);
/** Clears the entire nick's access list
*
* Deletes all the memory allocated in the access list vector and then clears the vector.
*/
void ClearAccess();
/** Is the given user on this accounts access list?
*
* @param u The user
*
* @return true if the user is on the access list
*/
bool IsOnAccess(const User *u) const;
/** Retrieves the account id for this user */
uint64_t GetId();
/** Finds an account
* @param nick The account name to find
* @return The account, if it exists
*/
static NickCore* Find(const Anope::string &nick);
static NickCore *Find(const Anope::string &nick);
void AddChannelReference(ChannelInfo *ci);
void RemoveChannelReference(ChannelInfo *ci);
void GetChannelReferences(std::deque<ChannelInfo *> &queue);
@@ -227,26 +188,27 @@ class CoreExport NickCore : public Serializable, public Extensible
class CoreExport IdentifyRequest
{
/* Owner of this request, used to cleanup requests if a module is unloaded
* while a reqyest us pending */
* while a request us pending */
Module *owner;
Anope::string account;
Anope::string password;
std::set<Module *> holds;
bool dispatched;
bool success;
bool dispatched = false;
bool success = false;
static std::set<IdentifyRequest *> Requests;
protected:
protected:
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
virtual ~IdentifyRequest();
public:
/* One of these is called when the request goes through */
public:
/* One of these is called when the request goes through */
virtual void OnSuccess() = 0;
virtual void OnFail() = 0;
Module *GetOwner() const { return owner; }
const Anope::string &GetAccount() const { return account; }
const Anope::string &GetPassword() const { return password; }
@@ -254,17 +216,17 @@ class CoreExport IdentifyRequest
* for the request to complete. Multiple modules may hold a request at any time,
* but the request is not complete until every module has released it. If you do not
* require holding this (eg, your password check is done in this thread and immediately)
* then you don't need to hold the request before Successing it.
* then you don't need to hold the request before calling `Success()`.
* @param m The module holding this request
*/
void Hold(Module *m);
/** Releases a held request
* @param m The module releaseing the hold
* @param m The module releasing the hold
*/
void Release(Module *m);
/** Called by modules when this IdentifyRequest has successeded successfully.
/** Called by modules when this IdentifyRequest has succeeded.
* If this request is behind held it must still be Released after calling this.
* @param m The module confirming authentication
*/
@@ -278,5 +240,3 @@ class CoreExport IdentifyRequest
static void ModuleUnload(Module *m);
};
#endif // ACCOUNT_H
+142 -135
View File
@@ -1,17 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef ANOPE_H
#define ANOPE_H
#pragma once
#include <signal.h>
@@ -24,15 +22,15 @@ namespace Anope
* allow us to only require one type of string everywhere that can be converted
* at any time to a specific type of string.
*/
class CoreExport string
class CoreExport string final
{
private:
private:
/**
* The actual string is stored in an std::string as it can be converted to
* ci::string, or a C-style string at any time.
*/
std::string _string;
public:
public:
/**
* Extras.
*/
@@ -41,6 +39,7 @@ namespace Anope
typedef std::string::reverse_iterator reverse_iterator;
typedef std::string::const_reverse_iterator const_reverse_iterator;
typedef std::string::size_type size_type;
typedef std::string::value_type value_type;
static const size_type npos = static_cast<size_type>(-1);
/**
@@ -55,6 +54,7 @@ namespace Anope
string(const ci::string &_str) : _string(_str.c_str()) { }
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
string(const string &) = default;
/**
* Assignment operators, so any type of string can be assigned to this class.
@@ -141,8 +141,8 @@ namespace Anope
*/
inline void push_back(char c) { return this->_string.push_back(c); }
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
inline string &append(const string &s) { this->_string.append(s.str()); return *this; }
inline string &append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
/**
* Resizes the string content to n characters.
@@ -160,21 +160,21 @@ namespace Anope
* Trim leading and trailing white spaces from the string.
*/
inline string& ltrim(const Anope::string &what = " \t\r\n")
inline string &ltrim(const Anope::string &what = " \t\r\n")
{
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
this->_string.erase(this->_string.begin());
return *this;
}
inline string& rtrim(const Anope::string &what = " \t\r\n")
inline string &rtrim(const Anope::string &what = " \t\r\n")
{
while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
this->_string.erase(this->_string.length() - 1);
return *this;
}
inline string& trim(const Anope::string &what = " \t\r\n")
inline string &trim(const Anope::string &what = " \t\r\n")
{
this->ltrim(what);
this->rtrim(what);
@@ -211,6 +211,10 @@ namespace Anope
inline size_type find_last_not_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_not_of(_str._string, pos); }
inline size_type find_last_not_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_not_of(ci::string(_str._string.c_str()), pos); }
inline int compare(size_t pos, size_t len, const string &str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); }
inline int compare(size_t pos, size_t len, const string &str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); }
inline int compare(size_t pos, size_t len, const char *s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); }
/**
* Determine if string consists of only numbers.
*/
@@ -255,8 +259,8 @@ namespace Anope
inline string lower() const
{
Anope::string new_string = *this;
for (size_type i = 0; i < new_string.length(); ++i)
new_string[i] = Anope::tolower(new_string[i]);
for (auto &chr : new_string)
chr = Anope::tolower(chr);
return new_string;
}
@@ -266,8 +270,8 @@ namespace Anope
inline string upper() const
{
Anope::string new_string = *this;
for (size_type i = 0; i < new_string.length(); ++i)
new_string[i] = Anope::toupper(new_string[i]);
for (auto &chr : new_string)
chr = Anope::toupper(chr);
return new_string;
}
@@ -309,23 +313,23 @@ namespace Anope
inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
inline const string operator+(const std::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
struct hash_ci
struct hash_ci final
{
inline size_t operator()(const string &s) const
{
return TR1NS::hash<std::string>()(s.lower().str());
return std::hash<std::string>()(s.lower().str());
}
};
struct hash_cs
struct hash_cs final
{
inline size_t operator()(const string &s) const
{
return TR1NS::hash<std::string>()(s.str());
return std::hash<std::string>()(s.str());
}
};
struct compare
struct compare final
{
inline bool operator()(const string &s1, const string &s2) const
{
@@ -333,11 +337,18 @@ namespace Anope
}
};
template<typename T> class map : public std::map<string, T, ci::less> { };
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> { };
template<typename T>
using map = std::map<string, T, ci::less>;
template<typename T>
using multimap = std::multimap<string, T, ci::less>;
template<typename T>
using unordered_map = std::unordered_map<string, T, hash_ci, compare>;
#ifndef REPRODUCIBLE_BUILD
static const char *const compiled = __TIME__ " " __DATE__;
#endif
/** The time Anope started.
*/
@@ -356,20 +367,21 @@ namespace Anope
* Use this unless you need very specific time checks
*/
extern CoreExport time_t CurTime;
extern CoreExport long long CurTimeNs;
/** The debug level we are running at.
*/
extern CoreExport int Debug;
/** Other comand line options.
/** Other command line options.
*/
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
extern CoreExport bool ReadOnly, NoFork, NoThird, NoPID, NoExpire, ProtocolDebug;
/** The root of the services installation. Usually ~/services
/** The root of the Anope installation. Usually ~/anope
*/
extern CoreExport Anope::string ServicesDir;
/** Services binary name (eg services)
/** Anope binary name (eg anope)
*/
extern CoreExport Anope::string ServicesBin;
@@ -383,7 +395,7 @@ namespace Anope
/** The uplink we are currently connected to
*/
extern CoreExport int CurrentUplink;
extern CoreExport size_t CurrentUplink;
/** Various methods to determine the Anope version running
*/
@@ -402,7 +414,7 @@ namespace Anope
/** Used to "fork" the process and go into the background during initial startup
* while we are AtTerm(). The actual fork is not done here, but earlier, and this
* simply notifys the parent via kill() to exit().
* simply notifies the parent via kill() to exit().
*/
extern void Fork();
@@ -412,10 +424,10 @@ namespace Anope
/** One of the first functions called, does general initialization such as reading
* command line args, loading the configuration, doing the initial fork() if necessary,
* initializating language support, loading modules, and loading databases.
* initializing language support, loading modules, and loading databases.
* @throws CoreException if something bad went wrong
*/
extern void Init(int ac, char **av);
extern bool Init(int ac, char **av);
/** Calls the save database event
*/
@@ -442,13 +454,13 @@ namespace Anope
*/
extern CoreExport void Unhex(const string &src, string &dest);
extern CoreExport void Unhex(const string &src, char *dest, size_t sz);
/** Base 64 encode a string
* @param src The string to encode
* @param target Where the encoded string is placed
*/
extern CoreExport void B64Encode(const string &src, string &target);
/** Base 64 decode a string
* @param src The base64 encoded string
* @param target The plain text result
@@ -459,15 +471,14 @@ namespace Anope
* @param src The source string to encrypt
* @param dest The destination where the encrypted string is placed
*/
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
extern CoreExport bool Encrypt(const Anope::string &src, Anope::string &dest);
/** Decrypts what is in 'src' to 'dest'.
* @param src The source string to decrypt
* @param dest The destination where the decrypted string is placed
* @return true if decryption was successful. This is usually not the case
* as most encryption methods we use are one way.
/** Hashes a buffer with SipHash-2-4
* @param src The start of the buffer to hash
* @param src_sz The total number of bytes in the buffer
* @param key A 16 byte key to hash the buffer with.
*/
extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest);
extern CoreExport uint64_t SipHash24(const void *src, unsigned long src_sz, const char key[16]);
/** Returns a sequence of data formatted as the format argument specifies.
** After the format parameter, the function expects at least as many
@@ -476,7 +487,7 @@ namespace Anope
* @param ... any number of parameters
* @return a Anope::string
*/
extern CoreExport string printf(const char *fmt, ...);
extern CoreExport string printf(const char *fmt, ...) ATTR_FORMAT(1, 2);
/** Return the last error code
* @return The error code
@@ -486,7 +497,7 @@ namespace Anope
/** Return the last error, uses errno/GetLastError() to determine this
* @return An error message
*/
extern CoreExport const string LastError();
extern CoreExport string LastError();
/** Determines if a path is a file
*/
@@ -525,10 +536,18 @@ namespace Anope
*/
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
/** Main processing routine. Parses the message and takes the appropriate action.
* @param Raw message from the uplink
/** Parses a raw message from the uplink and calls its command handler.
* @param message Raw message from the uplink
*/
extern void Process(const Anope::string &);
extern void Process(const Anope::string &message);
/** Calls the command handler for an already parsed message.
* @param source Source of the message.
* @param command Command name.
* @param params Any extra parameters.
* @param tags IRCv3 message tags.
*/
extern CoreExport void ProcessInternal(MessageSource &src, const Anope::string &command, const std::vector<Anope::string> &params, const Anope::map<Anope::string> & tags);
/** Does a blocking dns query and returns the first IP.
* @param host host to look up
@@ -537,36 +556,80 @@ namespace Anope
*/
extern Anope::string Resolve(const Anope::string &host, int type);
/** Does a blocking dns query and returns all IPs.
* @param host host to look up
* @param type inet addr type
* @return A list of all IPs that the host resolves to
*/
extern std::vector<Anope::string> ResolveMultiple(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);
/** Generate a random number. */
extern CoreExport int RandomNumber();
/** Calculates the levenshtein distance between two strings.
* @param s1 The first string.
* @param s2 The second string.
*/
extern CoreExport size_t Distance(const Anope::string &s1, const Anope::string &s2);
/** Update the current time. */
extern CoreExport void UpdateTime();
/** Expands a path fragment that is relative to the base directory.
* @param base The base directory that it is relative to.
* @param fragment The fragment to expand.
*/
extern CoreExport Anope::string Expand(const Anope::string &base, const Anope::string &fragment);
/** Expands a config path. */
inline auto ExpandConfig(const Anope::string &path) { return Expand(ConfigDir, path); }
/** Expands a data path. */
inline auto ExpandData(const Anope::string &path) { return Expand(DataDir, path); }
/** Expands a locale path. */
inline auto ExpandLocale(const Anope::string &path) { return Expand(LocaleDir, path); }
/** Expands a log path. */
inline auto ExpandLog(const Anope::string &path) { return Expand(LogDir, path); }
/** Expands a module path. */
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
}
/** sepstream allows for splitting token seperated lists.
/** sepstream allows for splitting token separated lists.
* Each successive call to sepstream::GetToken() returns
* the next token, until none remain, at which point the method returns
* an empty string.
*/
class CoreExport sepstream
{
private:
private:
/** Original string.
*/
Anope::string tokens;
/** Seperator value
/** Separator value
*/
char sep;
/** Current string position
*/
size_t pos;
size_t pos = 0;
/** If set then GetToken() can return an empty string
*/
bool allow_empty;
public:
public:
/** Create a sepstream and fill it with the provided data
*/
sepstream(const Anope::string &source, char seperator, bool allowempty = false);
sepstream(const Anope::string &source, char separator, bool allowempty = false);
/** Retrieves the underlying string. */
const auto &GetString() const { return tokens; }
/** Fetch the next token from the stream
* @param token The next token from the stream is placed here
@@ -576,7 +639,7 @@ class CoreExport sepstream
/** Gets token number 'num' from the stream
* @param token The token is placed here
* @param num The token number to featch
* @param num The token number to fetch
* @return True if the token was able to be fetched
*/
bool GetToken(Anope::string &token, int num);
@@ -584,7 +647,7 @@ class CoreExport sepstream
/** Gets every token from this stream
* @param token Tokens are pushed back here
*/
template<typename T> void GetTokens(T& token)
template<typename T> void GetTokens(T &token)
{
token.clear();
Anope::string t;
@@ -594,7 +657,7 @@ class CoreExport sepstream
/** Gets token number 'num' from the stream and all remaining tokens.
* @param token The token is placed here
* @param num The token number to featch
* @param num The token number to fetch
* @return True if the token was able to be fetched
*/
bool GetTokenRemainder(Anope::string &token, int num);
@@ -607,7 +670,7 @@ class CoreExport sepstream
/** Fetch the entire remaining stream, without tokenizing
* @return The remaining part of the stream
*/
const Anope::string GetRemaining();
Anope::string GetRemaining();
/** Returns true if the end of the stream has been reached
* @return True if the end of the stream has been reached, otherwise false
@@ -615,22 +678,24 @@ class CoreExport sepstream
bool StreamEnd();
};
/** A derived form of sepstream, which seperates on commas
/** A derived form of sepstream, which separates on commas
*/
class commasepstream : public sepstream
class commasepstream final
: public sepstream
{
public:
/** Initialize with comma seperator
public:
/** Initialize with comma separator
*/
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 separates on spaces
*/
class spacesepstream : public sepstream
class spacesepstream final
: public sepstream
{
public:
/** Initialize with space seperator
public:
/** Initialize with space separator
*/
spacesepstream(const Anope::string &source) : sepstream(source, ' ') { }
};
@@ -641,17 +706,18 @@ class spacesepstream : public sepstream
* be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
* attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
*/
class CoreException : public std::exception
class CoreExport CoreException
: public std::exception
{
protected:
protected:
/** Holds the error message to be displayed
*/
Anope::string err;
/** Source of the exception
*/
Anope::string source;
public:
/** Default constructor, just uses the error mesage 'Core threw an exception'.
public:
/** Default constructor, just uses the error message 'Core threw an exception'.
*/
CoreException() : err("Core threw an exception"), source("The core") { }
/** This constructor can be used to specify an error message before throwing.
@@ -665,7 +731,7 @@ class CoreException : public std::exception
* Actually no, it does nothing. Never mind.
* @throws Nothing!
*/
virtual ~CoreException() throw() { }
virtual ~CoreException() noexcept = default;
/** Returns the reason for the exception.
* The module should probably put something informative here as the user will see this upon failure.
*/
@@ -680,10 +746,11 @@ class CoreException : public std::exception
}
};
class ModuleException : public CoreException
class CoreExport ModuleException
: public CoreException
{
public:
/** Default constructor, just uses the error mesage 'Module threw an exception'.
public:
/** Default constructor, just uses the error message 'Module threw an exception'.
*/
ModuleException() : CoreException("Module threw an exception", "A Module") { }
@@ -694,71 +761,11 @@ class ModuleException : public CoreException
* Actually no, it does nothing. Never mind.
* @throws Nothing!
*/
virtual ~ModuleException() throw() { }
virtual ~ModuleException() noexcept = default;
};
class ConvertException : public CoreException
{
public:
ConvertException(const Anope::string &reason = "") : CoreException(reason) { }
virtual ~ConvertException() throw() { }
};
/** Convert something to a string
*/
template<typename T> inline Anope::string stringify(const T &x)
{
std::ostringstream stream;
if (!(stream << x))
throw ConvertException("Stringify fail");
return stream.str();
}
template<typename T> inline void convert(const Anope::string &s, T &x, Anope::string &leftover, bool failIfLeftoverChars = true)
{
leftover.clear();
std::istringstream i(s.str());
char c;
if (!(i >> x))
throw ConvertException("Convert fail");
if (failIfLeftoverChars)
{
if (i.get(c))
throw ConvertException("Convert fail");
}
else
{
std::string left;
getline(i, left);
leftover = left;
}
}
template<typename T> inline void convert(const Anope::string &s, T &x, bool failIfLeftoverChars = true)
{
Anope::string Unused;
convert(s, x, Unused, failIfLeftoverChars);
}
template<typename T> inline T convertTo(const Anope::string &s, Anope::string &leftover, bool failIfLeftoverChars = true)
{
T x;
convert(s, x, leftover, failIfLeftoverChars);
return x;
}
template<typename T> inline T convertTo(const Anope::string &s, bool failIfLeftoverChars = true)
{
T x;
convert(s, x, failIfLeftoverChars);
return x;
}
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
* for debug builds and static_cast on releass builds
* for debug builds and static_cast on release builds
* to speed up the program because dynamic_cast relies on RTTI.
*/
#ifdef DEBUG_BUILD
@@ -777,4 +784,4 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
}
#endif
#endif // ANOPE_H
#include "convert.h"
+18 -25
View File
@@ -1,14 +1,12 @@
/*
*
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
* (C) 2008-2011 Adam <Adam@anope.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*/
#ifndef BASE_H
#define BASE_H
#pragma once
#include "services.h"
@@ -17,9 +15,8 @@
class CoreExport Base
{
/* References to this base class */
std::set<ReferenceBase *> *references;
public:
Base();
std::set<ReferenceBase *> *references = nullptr;
public:
virtual ~Base();
/** Adds a reference to this object. Eg, when a Reference
@@ -33,12 +30,12 @@ class CoreExport Base
class ReferenceBase
{
protected:
bool invalid;
public:
ReferenceBase() : invalid(false) { }
protected:
bool invalid = false;
public:
ReferenceBase() = default;
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
virtual ~ReferenceBase() { }
virtual ~ReferenceBase() = default;
inline void Invalidate() { this->invalid = true; }
};
@@ -46,14 +43,13 @@ class ReferenceBase
* no longer be valid once the object it refers is destructed.
*/
template<typename T>
class Reference : public ReferenceBase
class Reference
: public ReferenceBase
{
protected:
T *ref;
public:
Reference() : ref(NULL)
{
}
protected:
T *ref = nullptr;
public:
Reference() = default;
Reference(T *obj) : ref(obj)
{
@@ -107,14 +103,14 @@ class Reference : public ReferenceBase
return NULL;
}
inline T* operator->()
inline T *operator->()
{
if (operator bool())
return this->ref;
return NULL;
}
inline T* operator*()
inline T *operator*()
{
if (operator bool())
return this->ref;
@@ -140,6 +136,3 @@ class Reference : public ReferenceBase
return false;
}
};
#endif // BASE_H
+14 -13
View File
@@ -1,14 +1,12 @@
/*
*
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
* (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*/
#ifndef BOTS_H
#define BOTS_H
#pragma once
#include "users.h"
#include "anope.h"
@@ -21,11 +19,13 @@ typedef Anope::map<BotInfo *> botinfo_map;
extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
class CoreExport BotInfo : public User, public Serializable
class CoreExport BotInfo final
: public User
, public Serializable
{
/* Channels this bot is assigned to */
Serialize::Checker<std::set<ChannelInfo *> > channels;
public:
public:
time_t created;
/* Last time this bot said something (via privmsg) */
time_t lastmsg;
@@ -56,10 +56,12 @@ class CoreExport BotInfo : public User, public Serializable
virtual ~BotInfo();
void Serialize(Serialize::Data &data) const;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
void GenerateUID();
void OnKill();
/** Change the nickname for the bot.
* @param newnick The nick to change to
*/
@@ -106,8 +108,9 @@ class CoreExport BotInfo : public User, public Serializable
/** Called when a user messages this bot
* @param u The user
* @param message The users' message
* @params tags Message tags
*/
virtual void OnMessage(User *u, const Anope::string &message);
virtual void OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags);
/** Link a command name to a command in services
* @param cname The command name
@@ -115,7 +118,7 @@ class CoreExport BotInfo : public User, public Serializable
* @param permission Permission required to execute the command, if any
* @return The commandinfo for the newly created command
*/
CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
CommandInfo &SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
/** Get command info for a command
* @param cname The command name
@@ -128,7 +131,5 @@ class CoreExport BotInfo : public User, public Serializable
* @param nick_only True to only look by nick, and not by UID
* @return The bot, if it exists
*/
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
static BotInfo *Find(const Anope::string &nick, bool nick_only = false);
};
#endif // BOTS_H
+40 -27
View File
@@ -1,26 +1,25 @@
/* Channel support
*
* (C) 2008-2014 Anope Team
* (C) 2008-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
#ifndef CHANNELS_H
#define CHANNELS_H
#pragma once
#include "anope.h"
#include "extensible.h"
#include "modes.h"
#include "serialize.h"
typedef Anope::hash_map<Channel *> channel_map;
typedef Anope::unordered_map<Channel *> channel_map;
extern CoreExport channel_map ChannelList;
/* A user container, there is one of these per user per channel. */
struct ChanUserContainer : public Extensible
struct ChanUserContainer final
: public Extensible
{
User *user;
Channel *chan;
@@ -30,17 +29,21 @@ struct ChanUserContainer : public Extensible
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
};
class CoreExport Channel : public Base, public Extensible
class CoreExport Channel final
: public Base
, public Extensible
{
public:
static std::vector<Channel *> deleting;
public:
typedef std::multimap<Anope::string, Anope::string> ModeList;
private:
private:
/** A map of channel modes with their parameters set on this channel
*/
ModeList modes;
public:
/* Channel name */
public:
/* Channel name */
Anope::string name;
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
Serialize::Reference<ChannelInfo> ci;
@@ -59,7 +62,7 @@ class CoreExport Channel : public Base, public Extensible
Anope::string topic;
/* Who set the topic */
Anope::string topic_setter;
/* The timestamp associated with the topic. Not necessarually anywhere close to Anope::CurTime.
/* The timestamp associated with the topic. Not necessarily anywhere close to Anope::CurTime.
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
* to this, but we can only do this on certain IRCds.
*/
@@ -73,14 +76,14 @@ class CoreExport Channel : public Base, public Extensible
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
int16_t bouncy_modes; /* Did we fail to set modes here? */
private:
private:
/** Constructor
* @param name The channel name
* @param ts The time the channel was created
*/
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
public:
public:
/** Destructor
*/
~Channel();
@@ -107,7 +110,7 @@ class CoreExport Channel : public Base, public Extensible
* @param status The status to give the user, if any
* @return The UserContainer for the user
*/
ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
ChanUserContainer *JoinUser(User *u, const ChannelStatus *status);
/** Remove a user internally from the channel
* @param u The user
@@ -138,7 +141,7 @@ class CoreExport Channel : public Base, public Extensible
/** See if a channel has a mode
* @param name The mode name
* @return The number of modes set
* @param param The optional mode param
* @param param The optional mode param
*/
size_t HasMode(const Anope::string &name, const Anope::string &param = "");
@@ -204,7 +207,8 @@ class CoreExport Channel : public Base, public Extensible
* @param enforce_mlock Should mlock be enforced on this mode change
* @param cmodes The modes to set
*/
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...) ATTR_FORMAT(4, 5);
void SetModes(BotInfo *bi, bool enforce_mlock, const Anope::string &cmodes);
/** Set a string of modes internally on a channel
* @param source The setter
@@ -231,9 +235,10 @@ class CoreExport Channel : public Base, public Extensible
* @param bi The sender, can be NULL for the service bot for this channel
* @param u The user being kicked
* @param reason The reason for the kick
* @return true if the kick was scucessful, false if a module blocked the kick
* @return true if the kick was successful, false if a module blocked the kick
*/
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...) ATTR_FORMAT(4, 5);
bool Kick(BotInfo *bi, User *u, const Anope::string &reason);
/** Get all modes set on this channel, excluding status modes.
* @return a map of modes and their optional parameters.
@@ -242,13 +247,13 @@ class CoreExport Channel : public Base, public Extensible
/** Get a list of modes on a channel
* @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
* @param complete Include mode parameters
* @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
* @param plus If set to false (with complete), mode parameters will not be given for modes requiring no parameters to be unset
* @return A mode string
*/
Anope::string GetModes(bool complete, bool plus);
@@ -258,7 +263,7 @@ class CoreExport Channel : public Base, public Extensible
* @param newtopic The new topic
* @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
* @param user The user setting the topic
@@ -276,10 +281,11 @@ class CoreExport Channel : public Base, public Extensible
/** Unbans a user from this channel.
* @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
* @return whether or not a ban was removed
*/
bool Unban(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
@@ -287,11 +293,16 @@ class CoreExport Channel : public Base, public Extensible
*/
bool CheckKick(User *user);
/** Find which bot should send mode/topic/etc changes for this channel
* @return The bot
*/
BotInfo *WhoSends() const;
/** Finds a channel
* @param name The channel to find
* @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
@@ -299,6 +310,8 @@ class CoreExport Channel : public Base, public Extensible
* @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
void QueueForDeletion();
static void DeleteChannels();
};
+34 -31
View File
@@ -1,6 +1,6 @@
/* Declarations for command data.
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,25 +9,22 @@
* Based on the original code of Services by Andy Church.
*/
#ifndef COMMAND_H
#define COMMAND_H
#pragma once
#include "service.h"
#include "anope.h"
#include "channels.h"
struct CommandGroup
struct CommandGroup final
{
Anope::string name, description;
};
/* Used in BotInfo::commands */
struct CommandInfo
struct CommandInfo final
{
typedef Anope::map<CommandInfo> map;
CommandInfo() : hide(false), prepend_channel(false) { }
/* Service name of the command */
Anope::string name;
/* Permission required to execute the command */
@@ -35,42 +32,47 @@ struct CommandInfo
/* Group this command is in */
Anope::string group;
/* whether or not to hide this command in help output */
bool hide;
bool hide = false;
/* Only used with fantasy */
bool prepend_channel;
bool prepend_channel = false;
};
/* Where the replies from commands go to. User inheits from this and is the normal
/* Where the replies from commands go to. User inherits from this and is the normal
* source of a CommandReply
*/
struct CoreExport CommandReply
{
virtual ~CommandReply() { }
virtual ~CommandReply() = default;
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
virtual void SendMessage(CommandSource &source, const Anope::string &msg);
};
/* The source for a command */
class CoreExport CommandSource
class CoreExport CommandSource final
{
/* The nick executing the command */
Anope::string nick;
/* User executing the command, may be NULL */
Reference<User> u;
public:
public:
/* The account executing the command */
Reference<NickCore> nc;
/* for web clients */
Anope::string ip;
/* Where the reply should go */
CommandReply *reply;
/* Channel the command was executed on (fantasy) */
Reference<Channel> c;
Reference<Channel> c = nullptr;
/* The service this command is on */
Reference<BotInfo> service;
/* The actual name of the command being executed */
Anope::string command;
/* The permission of the command being executed */
Anope::string permission;
/* The unique identifier of the executing message. */
Anope::string msgid;
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi, const Anope::string &m = "");
const Anope::string &GetNick() const;
User *GetUser();
@@ -78,7 +80,7 @@ class CoreExport CommandSource
AccessGroup AccessFor(ChannelInfo *ci);
bool IsFounder(ChannelInfo *ci);
void Reply(const char *message, ...);
void Reply(const char *message, ...) ATTR_FORMAT(2, 3);
void Reply(const Anope::string &message);
bool HasCommand(const Anope::string &cmd);
@@ -89,7 +91,8 @@ class CoreExport CommandSource
/** Every services command is a class, inheriting from Command.
*/
class CoreExport Command : public Service
class CoreExport Command
: public Service
{
Anope::string desc;
std::vector<Anope::string> syntax;
@@ -98,8 +101,8 @@ class CoreExport Command : public Service
/* Command requires that a user is executing it */
bool require_user;
public:
/* Maximum paramaters accepted by this command */
public:
/* Maximum parameters accepted by this command */
size_t max_params;
/* Minimum parameters required to use this command */
size_t min_params;
@@ -107,7 +110,7 @@ class CoreExport Command : public Service
/* Module which owns us */
Module *module;
protected:
protected:
/** Create a new command.
* @param owner The owner of the command
* @param sname The command name
@@ -117,10 +120,10 @@ class CoreExport Command : public Service
*/
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
public:
virtual ~Command();
public:
virtual ~Command() = default;
protected:
protected:
void SetDesc(const Anope::string &d);
void ClearSyntax();
@@ -130,15 +133,15 @@ class CoreExport Command : public Service
void AllowUnregistered(bool b);
void RequireUser(bool b);
public:
public:
bool AllowUnregistered() const;
bool RequireUser() const;
/** Get the command description
/** Get the command description
* @param source The source wanting the command description
* @return The commands description
*/
virtual const Anope::string GetDesc(CommandSource &source) const;
virtual const Anope::string GetDesc(CommandSource &source) const;
/** Execute this command.
* @param source The source
@@ -146,7 +149,7 @@ class CoreExport Command : public Service
*/
virtual void Execute(CommandSource &source, const std::vector<Anope::string> &params) = 0;
/** Called when HELP is requsted for the client this command is on.
/** Called when HELP is requested for the client this command is on.
* @param source The source
*/
virtual void OnServHelp(CommandSource &source);
@@ -170,14 +173,14 @@ class CoreExport Command : public Service
*/
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
* @param name If found, is set to the command name, eg REGISTER
* @return true if the given command service exists
*/
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
static bool FindCommandFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name);
};
#endif // COMMANDS_H
+44 -46
View File
@@ -1,85 +1,78 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef CONFIG_H
#define CONFIG_H
#pragma once
#include "account.h"
#include "regchannel.h"
#include "users.h"
#include "opertype.h"
#include <stack>
namespace Configuration
{
namespace Internal
{
class CoreExport Block
{
friend struct Conf;
friend struct Configuration::Conf;
public:
public:
typedef Anope::map<Anope::string> item_map;
typedef Anope::multimap<Block> block_map;
private:
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);
/* Represents a missing tag. */
static Block EmptyBlock;
template<typename T> inline T Get(const Anope::string &tag)
public:
Block(const Anope::string &);
const Anope::string &GetName() const;
int CountBlock(const Anope::string &name) const;
const Block *GetBlock(const Anope::string &name, int num = 0) const;
Block *GetMutableBlock(const Anope::string &name, int num = 0);
template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const
{
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);
try
{
return convertTo<T>(value);
}
catch (const ConvertException &)
{
return T();
}
return Anope::TryConvert<T>(this->Get<const Anope::string>(tag, def)).value_or(T());
}
bool Set(const Anope::string &tag, const Anope::string &value);
const item_map* GetItems() const;
const item_map &GetItems() const;
};
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) 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;
} // namespace Internal
typedef const Internal::Block Block;
typedef Internal::Block MutableBlock;
/** Represents a configuration file
*/
class File
class File final
{
Anope::string name;
bool executable;
FILE *fp;
public:
FILE *fp = nullptr;
public:
File(const Anope::string &, bool);
~File();
const Anope::string &GetName() const;
Anope::string GetPath() const;
bool IsOpen() const;
bool Open();
@@ -90,7 +83,8 @@ namespace Configuration
struct Uplink;
struct CoreExport Conf : Block
struct CoreExport Conf final
: Block
{
/* options:readtimeout */
time_t ReadTimeout;
@@ -104,6 +98,8 @@ namespace Configuration
time_t TimeoutCheck;
/* options:usestrictprivmsg */
bool UseStrictPrivmsg;
/* networkinfo:nickchars */
Anope::string NickChars;
/* either "/msg " or "/" */
Anope::string StrictPrivmsg;
@@ -132,22 +128,25 @@ namespace Configuration
~Conf();
void LoadConf(File &file);
void Post(Conf *old);
Block *GetModule(Module *);
Block *GetModule(const Anope::string &name);
BotInfo *GetClient(const Anope::string &name);
const Block *GetCommand(CommandSource &);
};
struct Uplink
struct Uplink final
{
Anope::string host;
unsigned port;
Anope::string password;
bool ipv6;
int protocol;
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && ipv6 == other.ipv6; }
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, int _protocol) : host(_host), port(_port), password(_password), protocol(_protocol) { }
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && protocol == other.protocol; }
inline bool operator!=(const Uplink &other) const { return !(*this == other); }
};
}
@@ -158,10 +157,11 @@ namespace Configuration
* be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
* attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
*/
class ConfigException : public CoreException
class CoreExport ConfigException final
: public CoreException
{
public:
/** Default constructor, just uses the error mesage 'Config threw an exception'.
public:
/** Default constructor, just uses the error message 'Config threw an exception'.
*/
ConfigException() : CoreException("Config threw an exception", "Config Parser") { }
/** This constructor can be used to specify an error message before throwing.
@@ -171,10 +171,8 @@ class ConfigException : public CoreException
* Actually no, it does nothing. Never mind.
* @throws Nothing!
*/
virtual ~ConfigException() throw() { }
virtual ~ConfigException() noexcept = default;
};
extern Configuration::File ServicesConf;
extern CoreExport Configuration::Conf *Config;
#endif // CONFIG_H
+132
View File
@@ -0,0 +1,132 @@
/*
*
* (C) 2003-2024 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.
*/
#pragma once
#include <optional>
namespace Anope
{
/** Attempts to convert a string to any type.
* @param in The value to convert.
* @param leftover If non-nullptr then the location to store leftover data.
*/
template<typename T>
inline std::optional<T> TryConvert(const Anope::string &in, Anope::string *leftover = nullptr)
{
std::istringstream tmp(in.str());
T out;
if (!(tmp >> out))
return std::nullopt;
if (leftover)
{
leftover->clear();
std::getline(tmp, leftover->str());
}
else
{
char extra;
if (tmp >> extra)
return std::nullopt;
}
return out;
}
/** Converts a string to any type.
* @param in The value to convert.
* @param def The default to use if the conversion failed.
* @param leftover If non-nullptr then the location to store leftover data.
*/
template<typename T>
inline T Convert(const Anope::string &in, T def, Anope::string *leftover = nullptr)
{
return TryConvert<T>(in, leftover).value_or(def);
}
/** Attempts to convert any type to a string.
* @param in The value to convert.
*/
template <class T>
inline std::optional<Anope::string> TryString(const T &in)
{
std::ostringstream tmp;
if (!(tmp << in))
return std::nullopt;
return tmp.str();
}
/** No-op function that returns the string that was passed to it.
* @param in The string to return.
*/
inline const string &ToString(const string &in)
{
return in;
}
/** Converts a std::string to a string.
* @param in The value to convert.
*/
inline string ToString(const std::string &in)
{
return in;
}
/** Converts a char array to a string.
* @param in The value to convert.
*/
inline string ToString(const char *in)
{
return string(in);
}
/** Converts a char to a string.
* @param in The value to convert.
*/
inline string ToString(char in)
{
return string(1, static_cast<string::value_type>(in));
}
/** Converts an unsigned char to a string.
* @param in The value to convert.
*/
inline string ToString(unsigned char in)
{
return string(1, static_cast<string::value_type>(in));
}
/** Converts a bool to a string.
* @param in The value to convert.
*/
inline string ToString(bool in)
{
return (in ? "1" : "0");
}
/** Converts a type that std::to_string is implemented for to a string.
* @param in The value to convert.
*/
template<typename Stringable>
inline std::enable_if_t<std::is_arithmetic_v<Stringable>, string> ToString(const Stringable &in)
{
return std::to_string(in);
}
/** Converts any type to a string.
* @param in The value to convert.
*/
template <class T>
inline std::enable_if_t<!std::is_arithmetic_v<T>, string> ToString(const T &in)
{
return TryString(in).value_or(Anope::string());
}
}
+2 -3
View File
@@ -1,15 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#pragma once
class AccessGroup;
class AutoKick;
@@ -53,4 +53,3 @@ struct MemoInfo;
struct ModeLock;
struct Oper;
namespace SASL { struct Message; }
+60 -52
View File
@@ -1,14 +1,12 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
#ifndef EXTENSIBLE_H
#define EXTENSIBLE_H
#pragma once
#include "anope.h"
#include "serialize.h"
@@ -17,15 +15,16 @@
class Extensible;
class CoreExport ExtensibleBase : public Service
class CoreExport ExtensibleBase
: public Service
{
protected:
protected:
std::map<Extensible *, void *> items;
ExtensibleBase(Module *m, const Anope::string &n);
~ExtensibleBase();
public:
public:
virtual void Unset(Extensible *obj) = 0;
/* called when an object we are keep track of is serializing */
@@ -35,17 +34,19 @@ class CoreExport ExtensibleBase : public Service
class CoreExport Extensible
{
public:
public:
std::set<ExtensibleBase *> extension_items;
virtual ~Extensible();
template<typename T> T* GetExt(const Anope::string &name) const;
void UnsetExtensibles();
template<typename T> T *GetExt(const Anope::string &name) const;
bool HasExt(const Anope::string &name) const;
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> 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);
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
@@ -53,12 +54,13 @@ class CoreExport Extensible
};
template<typename T>
class BaseExtensibleItem : public ExtensibleBase
class BaseExtensibleItem
: public ExtensibleBase
{
protected:
protected:
virtual T *Create(Extensible *) = 0;
public:
public:
BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
~BaseExtensibleItem()
@@ -75,24 +77,24 @@ class BaseExtensibleItem : public ExtensibleBase
}
}
T* Set(Extensible *obj, const T &value)
T *Set(Extensible *obj, const T &value)
{
T* t = Set(obj);
T *t = Set(obj);
if (t)
*t = value;
return t;
}
T* Set(Extensible *obj)
T *Set(Extensible *obj)
{
T* t = Create(obj);
T *t = Create(obj);
Unset(obj);
items[obj] = t;
obj->extension_items.insert(this);
return t;
}
void Unset(Extensible *obj) anope_override
void Unset(Extensible *obj) override
{
T *value = Get(obj);
items.erase(obj);
@@ -100,7 +102,7 @@ class BaseExtensibleItem : public ExtensibleBase
delete value;
}
T* Get(const Extensible *obj) const
T *Get(const Extensible *obj) const
{
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
if (it != items.end())
@@ -113,9 +115,9 @@ class BaseExtensibleItem : public ExtensibleBase
return items.find(const_cast<Extensible *>(obj)) != items.end();
}
T* Require(Extensible *obj)
T *Require(Extensible *obj)
{
T* t = Get(obj);
T *t = Get(obj);
if (t)
return t;
@@ -124,89 +126,97 @@ class BaseExtensibleItem : public ExtensibleBase
};
template<typename T>
class ExtensibleItem : public BaseExtensibleItem<T>
class ExtensibleItem
: public BaseExtensibleItem<T>
{
protected:
T* Create(Extensible *obj) anope_override
protected:
T *Create(Extensible *obj) override
{
return new T(obj);
}
public:
public:
ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
};
template<typename T>
class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
class PrimitiveExtensibleItem
: public BaseExtensibleItem<T>
{
protected:
T* Create(Extensible *obj) anope_override
protected:
T *Create(Extensible *obj) override
{
return new T();
}
public:
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
protected:
bool *Create(Extensible *) override
{
return NULL;
}
public:
public:
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
};
template<typename T>
class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
class SerializableExtensibleItem
: public PrimitiveExtensibleItem<T>
{
public:
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
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
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
{
T* t = this->Get(e);
T *t = this->Get(e);
data[this->name] << *t;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) 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) { }
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
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
{
data[this->name] << true;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) 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> >
struct ExtensibleRef final
: ServiceReference<BaseExtensibleItem<T> >
{
ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
};
template<typename T>
T* Extensible::GetExt(const Anope::string &name) const
T *Extensible::GetExt(const Anope::string &name) const
{
ExtensibleRef<T> ref(name);
if (ref)
@@ -217,16 +227,16 @@ T* Extensible::GetExt(const Anope::string &name) const
}
template<typename T>
T* Extensible::Extend(const Anope::string &name, const T &what)
T *Extensible::Extend(const Anope::string &name, const T &what)
{
T* t = Extend<T>(name);
T *t = Extend<T>(name);
if (t)
*t = what;
return t;
}
template<typename T>
T* Extensible::Extend(const Anope::string &name)
T *Extensible::Extend(const Anope::string &name)
{
ExtensibleRef<T> ref(name);
if (ref)
@@ -237,7 +247,7 @@ T* Extensible::Extend(const Anope::string &name)
}
template<typename T>
T* Extensible::Require(const Anope::string &name)
T *Extensible::Require(const Anope::string &name)
{
if (HasExt(name))
return GetExt<T>(name);
@@ -254,5 +264,3 @@ void Extensible::Shrink(const Anope::string &name)
else
Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
}
#endif // EXTENSIBLE_H
+21 -29
View File
@@ -1,25 +1,16 @@
/*
*
* Copyright (C) 2002-2011 InspIRCd Development Team
* Copyright (C) 2009-2014 Anope Team <team@anope.org>
* (C) 2002-2011 InspIRCd Development Team
* (C) 2009-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*/
#ifndef HASHCOMP_H
#define HASHCOMP_H
#pragma once
#include <string>
#include <locale>
#if defined _LIBCPP_VERSION || defined _WIN32
#include <unordered_map>
#define TR1NS std
#else
#include <tr1/unordered_map>
#define TR1NS std::tr1
#endif
#include "services.h"
@@ -27,19 +18,20 @@ namespace Anope
{
class string;
/* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */
/* Casemap in use by Anope. ci::string's comparison functions use this (and thus Anope::string) */
extern std::locale casemap;
extern void CaseMapRebuild();
extern unsigned char tolower(unsigned char);
extern unsigned char toupper(unsigned char);
extern CoreExport void CaseMapRebuild();
extern CoreExport unsigned char tolower(unsigned char);
extern CoreExport unsigned char toupper(unsigned char);
/* ASCII case insensitive ctype. */
template<typename char_type>
class ascii_ctype : public std::ctype<char_type>
class ascii_ctype
: public std::ctype<char_type>
{
public:
char_type do_toupper(char_type c) const anope_override
public:
char_type do_toupper(char_type c) const override
{
if (c >= 'a' && c <= 'z')
return c - 32;
@@ -47,7 +39,7 @@ namespace Anope
return c;
}
char_type do_tolower(char_type c) const anope_override
char_type do_tolower(char_type c) const override
{
if (c >= 'A' && c <= 'Z')
return c + 32;
@@ -58,10 +50,11 @@ namespace Anope
/* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */
template<typename char_type>
class rfc1459_ctype : public ascii_ctype<char_type>
class rfc1459_ctype final
: public ascii_ctype<char_type>
{
public:
char_type do_toupper(char_type c) const anope_override
public:
char_type do_toupper(char_type c) const override
{
if (c == '{' || c == '}' || c == '|')
return c - 32;
@@ -69,7 +62,7 @@ namespace Anope
return ascii_ctype<char_type>::do_toupper(c);
}
char_type do_tolower(char_type c) const anope_override
char_type do_tolower(char_type c) const override
{
if (c == '[' || c == ']' || c == '\\')
return c + 32;
@@ -87,7 +80,8 @@ namespace ci
* This class is used to implement ci::string, a case-insensitive, ASCII-
* comparing string class.
*/
struct CoreExport ci_char_traits : std::char_traits<char>
struct CoreExport ci_char_traits final
: std::char_traits<char>
{
/** Check if two chars match.
* @param c1st First character
@@ -123,7 +117,7 @@ namespace ci
* @param s1 String to find in
* @param n Position to search up to
* @param c Character to search for
* @return Pointer to the first occurance of c in s1
* @return Pointer to the first occurrence of c in s1
*/
static const char *find(const char *s1, int n, char c);
};
@@ -132,7 +126,7 @@ namespace ci
*/
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
struct CoreExport less
struct CoreExport less final
{
/** Compare two Anope::strings as ci::strings and find which one is less
* @param s1 The first string
@@ -196,5 +190,3 @@ inline bool operator!=(const std::string &leftval, const ci::string &rightval)
{
return !(leftval.c_str() == rightval);
}
#endif // HASHCOMP_H
+26 -26
View File
@@ -1,18 +1,19 @@
/*
*
* (C) 2008-2014 Anope Team
* (C) 2008-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
#pragma once
#include "anope.h"
namespace Language
{
/* Languages we support as configured in services.conf. They are
/* Languages we support as configured in anope.conf. They are
* added to this list if we detect a language exists in the correct
* location for each language.
*/
@@ -24,7 +25,7 @@ namespace Language
* and we detect a language file exists for at least one of the supported
* languages for the module, then we add the module's domain (its name)
* here.
*
*
* When strings are translated they are checked against all domains.
*/
extern std::vector<Anope::string> Domains;
@@ -41,7 +42,7 @@ namespace Language
extern CoreExport const char *Translate(const char *string);
/** Translates a string to the language of the given user.
* @param u The user to transate the string for
* @param u The user to translate the string for
* @param string A string to translate
* @return The translated string if found, else the original string.
*/
@@ -64,17 +65,20 @@ namespace Language
} // namespace Language
/* Commonly used language strings */
#define CONFIRM_DROP _("Please confirm that you want to drop \002%s\002 with \002%s%s DROP %s %s\002")
#define SERVICE_UNAVAILABLE _("Sorry, %s is temporarily unavailable.")
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
#define READ_ONLY_MODE _("Services are in read-only mode!")
#define READ_ONLY_MODE _("Services are temporarily in read-only mode.")
#define PASSWORD_INCORRECT _("Password incorrect.")
#define ACCESS_DENIED _("Access denied.")
#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" \
"(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 MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should not be\n" \
"something that could be easily guessed (e.g. your real name or your nick) and\n" \
"cannot contain the space or tab characters.\n")
#define PASSWORD_TOO_SHORT _("Your password is too short. It must be longer than %u characters.")
#define PASSWORD_TOO_LONG _("Your password is too long. It must be shorter than %u characters.")
#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_IN_USE _("Nick \002%s\002 isn't currently in use.")
@@ -83,13 +87,11 @@ namespace Language
#define CHAN_X_SUSPENDED _("Channel %s is currently suspended.")
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
#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 NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
#define MAIL_X_INVALID _("\002%s\002 is not a valid email address.")
#define UNKNOWN _("<unknown>")
#define NO_EXPIRE _("does not expire")
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
#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.)")
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
"please choose a different nick.")
@@ -97,7 +99,7 @@ namespace Language
#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_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the email again, and retry.")
#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_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
@@ -107,23 +109,21 @@ namespace Language
#define CHAN_SETTING_UNSET _("%s for %s unset.")
#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_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" \
"Type \002%s%s READ %s %d\002 to read it.")
"Type \002%s%s READ %s %zu\002 to read it.")
#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 %zu\002 to read it.")
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
#define MEMO_HAVE_NO_NEW_MEMOS _("You have 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_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 HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
#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_IDENTTOOLONG _("Error! The vHost 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_NO_VIDENT _("Your IRCd does not support vIdent's, if this is incorrect, please report this as a possible bug")
#define HOST_SET_ERROR _("A vhost must be in the format of a valid hostname.")
#define HOST_SET_IDENT_ERROR _("A vident 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 %zu characters.")
#define HOST_SET_IDENTTOOLONG _("Error! The vident is too long, please use an ident shorter than %zu characters.")
#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 vidents. If this is incorrect please report this as a possible bug.")
+15 -20
View File
@@ -1,17 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef LISTS_H
#define LISTS_H
#pragma once
#include "services.h"
#include "anope.h"
@@ -25,13 +23,13 @@
*/
class CoreExport NumberList
{
private:
bool is_valid;
private:
bool is_valid = true;
std::set<unsigned> numbers;
bool desc;
public:
public:
/** Processes a numbered list
* @param list The list
* @param descending True to make HandleNumber get called with numbers in descending order
@@ -40,7 +38,7 @@ class CoreExport NumberList
/** Destructor, does nothing
*/
virtual ~NumberList();
virtual ~NumberList() = default;
/** Should be called after the constructors are done running. This calls the callbacks.
*/
@@ -52,7 +50,7 @@ class CoreExport NumberList
virtual void HandleNumber(unsigned number);
/** Called when there is an error with the numbered list
* Return false to immediatly stop processing the list and return
* Return false to immediately stop processing the list and return
* This is all done before we start calling HandleNumber, so no numbers will have been processed yet
* @param list The list
* @return false to stop processing
@@ -62,15 +60,15 @@ class CoreExport NumberList
/** This class handles formatting LIST/VIEW replies.
*/
class CoreExport ListFormatter
class CoreExport ListFormatter final
{
public:
typedef std::map<Anope::string, Anope::string> ListEntry;
private:
public:
typedef std::map<Anope::string, Anope::string> ListEntry;
private:
NickCore *nc;
std::vector<Anope::string> columns;
std::vector<ListEntry> entries;
public:
public:
ListFormatter(NickCore *nc);
ListFormatter &AddColumn(const Anope::string &name);
void AddEntry(const ListEntry &entry);
@@ -80,17 +78,14 @@ class CoreExport ListFormatter
/** This class handles formatting INFO replies
*/
class CoreExport InfoFormatter
class CoreExport InfoFormatter final
{
NickCore *nc;
std::vector<std::pair<Anope::string, Anope::string> > replies;
unsigned longest;
public:
unsigned longest = 0;
public:
InfoFormatter(NickCore *nc);
void Process(std::vector<Anope::string> &);
Anope::string &operator[](const Anope::string &key);
void AddOption(const Anope::string &opt);
};
#endif // LISTS_H
+26 -26
View File
@@ -1,26 +1,24 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef LOGGER_H
#define LOGGER_H
#pragma once
#include "anope.h"
#include "defs.h"
enum LogType
{
/* Used whenever an administrator uses an administrative comand */
/* Used whenever an administrator uses an administrative command */
LOG_ADMIN,
/* Used whenever an administrator overides something, such as adding
/* Used whenever an administrator overrides something, such as adding
* access to a channel where they don't have permission to.
*/
LOG_OVERRIDE,
@@ -39,7 +37,7 @@ enum LogType
LOG_DEBUG_4
};
struct LogFile
struct LogFile final
{
Anope::string filename;
std::ofstream stream;
@@ -50,27 +48,27 @@ struct LogFile
};
/* Represents a single log message */
class CoreExport Log
class CoreExport Log final
{
public:
/* Bot that should log this message */
BotInfo *bi;
public:
/* Bot that should log this message */
BotInfo *bi = nullptr;
/* For commands, the user executing the command, but might not always exist */
User *u;
User *u = nullptr;
/* For commands, the account executing the command, but will not always exist */
NickCore *nc;
NickCore *nc = nullptr;
/* For commands, the command being executed */
Command *c;
Command *c = nullptr;
/* For commands, the command source */
CommandSource *source;
CommandSource *source = nullptr;
/* Used for LOG_CHANNEL */
Channel *chan;
Channel *chan = nullptr;
/* For commands, the channel the command was executed on, will not always exist */
const ChannelInfo *ci;
const ChannelInfo *ci = nullptr;
/* For LOG_SERVER */
Server *s;
Server *s = nullptr;
/* For LOG_MODULE */
Module *m;
Module *m = nullptr;
LogType type;
Anope::string category;
@@ -96,6 +94,11 @@ class CoreExport Log
~Log();
private:
Anope::string FormatSource() const;
Anope::string FormatCommand() const;
public:
Anope::string BuildPrefix() const;
template<typename T> Log &operator<<(T val)
@@ -106,13 +109,13 @@ class CoreExport Log
};
/* Configured in the configuration file, actually does the message logging */
class CoreExport LogInfo
class CoreExport LogInfo final
{
public:
BotInfo *bot;
public:
BotInfo *bot = nullptr;
std::vector<Anope::string> targets;
std::vector<LogFile *> logfiles;
int last_day;
int last_day = 0;
std::vector<Anope::string> sources;
int log_age;
std::vector<Anope::string> admin;
@@ -136,6 +139,3 @@ class CoreExport LogInfo
/* Logs the message l if configured to */
void ProcessMessage(const Log *l);
};
#endif // LOGGER_H
+11 -14
View File
@@ -1,18 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*
*/
#ifndef MAIL_H
#define MAIL_H
#pragma once
#include "anope.h"
#include "threadengine.h"
@@ -25,20 +22,22 @@ namespace Mail
extern CoreExport bool Validate(const Anope::string &email);
/* A email message being sent */
class Message : public Thread
class Message final
: public Thread
{
private:
Anope::string sendmail_path;
private:
Anope::string error;
Anope::string sendmail_path;
Anope::string send_from;
Anope::string mail_to;
Anope::string addr;
Anope::string subject;
Anope::string message;
Anope::string content_type;
bool dont_quote_addresses;
bool success;
public:
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
public:
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
* @param sf Config->SendFrom
* @param mailto Name of person being mailed (u->nick, nc->display, etc)
* @param addr Destination address to mail
@@ -50,9 +49,7 @@ namespace Mail
~Message();
/* Called from within the thread to actually send the mail */
void Run() anope_override;
void Run() override;
};
} // namespace Mail
#endif // MAIL_H
+12 -14
View File
@@ -1,31 +1,31 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef MEMO_H
#define MEMO_H
#pragma once
#include "anope.h"
#include "serialize.h"
class CoreExport Memo : public Serializable
class CoreExport Memo final
: public Serializable
{
public:
bool unread;
public:
MemoInfo *mi;
bool unread;
bool receipt;
Memo();
Memo();
~Memo();
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
Anope::string owner;
/* When it was sent */
@@ -37,9 +37,9 @@ class CoreExport Memo : public Serializable
/* Memo info structures. Since both nicknames and channels can have memos,
* we encapsulate memo data in a MemoInfo to make it easier to handle.
*/
struct CoreExport MemoInfo
struct CoreExport MemoInfo final
{
int16_t memomax;
int16_t memomax = 0;
Serialize::Checker<std::vector<Memo *> > memos;
std::vector<Anope::string> ignores;
@@ -51,5 +51,3 @@ struct CoreExport MemoInfo
static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan);
};
#endif // MEMO_H
+118 -98
View File
@@ -1,15 +1,16 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#pragma once
#include "protocol.h"
/* Common IRCD messages.
@@ -20,42 +21,47 @@
namespace Message
{
struct CoreExport Away : IRCDMessage
struct CoreExport Away
: IRCDMessage
{
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Capab : IRCDMessage
{
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Error : IRCDMessage
struct CoreExport Capab
: IRCDMessage
{
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Error
: IRCDMessage
{
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Invite : IRCDMessage
struct CoreExport Invite
: IRCDMessage
{
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Join : IRCDMessage
struct CoreExport Join
: IRCDMessage
{
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
typedef std::pair<ChannelStatus, User *> SJoinUser;
/** Handle a SJOIN.
* @param source The source of the SJOIN
* @param chan The channel the users are joining to
@@ -65,111 +71,125 @@ namespace Message
*/
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
};
struct CoreExport Kick : IRCDMessage
struct CoreExport Kick
: IRCDMessage
{
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Kill : IRCDMessage
struct CoreExport Kill
: IRCDMessage
{
Kill(Module *creator, const Anope::string &mname = "KILL") : 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, const Anope::map<Anope::string> &tags) override;
};
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(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport MOTD : IRCDMessage
struct CoreExport MOTD
: IRCDMessage
{
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
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;
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Part : IRCDMessage
struct CoreExport Notice
: IRCDMessage
{
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Ping : IRCDMessage
struct CoreExport Part
: IRCDMessage
{
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Privmsg : IRCDMessage
struct CoreExport Ping
: IRCDMessage
{
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Quit : IRCDMessage
struct CoreExport Privmsg
: IRCDMessage
{
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport SQuit : IRCDMessage
struct CoreExport Quit
: IRCDMessage
{
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Stats : IRCDMessage
struct CoreExport SQuit
: IRCDMessage
{
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Time : IRCDMessage
struct CoreExport Stats
: IRCDMessage
{
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Topic : IRCDMessage
struct CoreExport Time
: IRCDMessage
{
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Version : IRCDMessage
struct CoreExport Topic
: IRCDMessage
{
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Whois : IRCDMessage
struct CoreExport Version
: IRCDMessage
{
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Whois
: IRCDMessage
{
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
} // namespace Message
+111 -67
View File
@@ -1,13 +1,12 @@
/* Mode support
*
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
* (C) 2008-2011 Adam <Adam@anope.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*/
#ifndef MODES_H
#define MODES_H
#pragma once
#include "anope.h"
#include "base.h"
@@ -36,11 +35,12 @@ enum ModeClass
/** This class is the basis of all modes in Anope
*/
class CoreExport Mode : public Base
class CoreExport Mode
: public Base
{
public:
/* Mode name */
Anope::string name;
public:
/* Mode name */
Anope::string name;
/* Class of mode this is (user/channel) */
ModeClass mclass;
/* Mode char for this, eg 'b' */
@@ -55,7 +55,7 @@ class CoreExport Mode : public Base
* @param type The mode type
*/
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
virtual ~Mode();
virtual ~Mode() = default;
/** Can a user set this mode, used for mlock
* @param u The user
@@ -65,9 +65,10 @@ class CoreExport Mode : public Base
/** This class is a user mode, all user modes use this/inherit from this
*/
class CoreExport UserMode : public Mode
class CoreExport UserMode
: public Mode
{
public:
public:
/** constructor
* @param name The mode name
* @param mc The mode char
@@ -75,10 +76,11 @@ class CoreExport UserMode : public Mode
UserMode(const Anope::string &name, char mc);
};
class CoreExport UserModeParam : public UserMode
class CoreExport UserModeParam
: public UserMode
{
public:
/** constructor
public:
/** constructor
* @param name The mode name
* @param mc The mode char
*/
@@ -88,28 +90,47 @@ class CoreExport UserModeParam : public UserMode
* @param value The param
* @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
*/
class CoreExport ChannelMode : public Mode
class CoreExport ChannelMode
: public Mode
{
public:
public:
/* channel modes that can possibly unwrap this mode */
std::vector<ChannelMode *> listeners;
/** constructor
* @param name The mode name
* @param mc The mode char
*/
ChannelMode(const Anope::string &name, char mc);
bool CanSet(User *u) const anope_override;
bool CanSet(User *u) const override;
virtual void Check() { }
/** 'wrap' this channel mode and param to the underlying mode and param
*/
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
*/
class CoreExport ChannelModeList : public ChannelMode
class CoreExport ChannelModeList
: public ChannelMode
{
public:
public:
/** constructor
* @param name The mode name
* @param mc The mode char
@@ -120,7 +141,7 @@ class CoreExport ChannelModeList : public ChannelMode
* @param mask The mask
* @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
* Should only be used for extbans or other weird ircd-specific things.
@@ -143,11 +164,12 @@ class CoreExport ChannelModeList : public ChannelMode
virtual void OnDel(Channel *chan, const Anope::string &mask) { }
};
/** This is a mode with a paramater, eg +k/l. These modes should use/inherit from this
/** This is a mode with a parameter, eg +k/l. These modes should use/inherit from this
*/
class CoreExport ChannelModeParam : public ChannelMode
class CoreExport ChannelModeParam
: public ChannelMode
{
public:
public:
/** constructor
* @param name The mode name
* @param mc The mode char
@@ -162,38 +184,61 @@ class CoreExport ChannelModeParam : public ChannelMode
* @param value The param
* @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.
*/
class CoreExport ChannelModeStatus : public ChannelMode
class CoreExport ChannelModeStatus
: public ChannelMode
{
public:
public:
/* The symbol, eg @ % + */
char symbol;
/* The "level" of the mode, used to compare with other modes.
* Used so we know op > halfop > voice etc.
*/
short level;
unsigned level;
/** constructor
* @param name The mode name
* @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
*/
ChannelModeStatus(const Anope::string &name, char mc, char msymbol, short mlevel);
ChannelModeStatus(const Anope::string &name, char mc, char msymbol, unsigned mlevel);
};
/** A virtual mode. This mode doesn't natively exist on the IRCd (like extbans),
* but we still have a representation for it.
*/
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() override;
ChannelMode *Wrap(Anope::string &param) override;
ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) override = 0;
};
/* The status a user has on a channel (+v, +h, +o) etc */
class CoreExport ChannelStatus
class CoreExport ChannelStatus final
{
Anope::string modes;
public:
ChannelStatus();
ChannelStatus(const Anope::string &modes);
void AddMode(char c);
public:
ChannelStatus() = default;
ChannelStatus(const Anope::string &modes);
void AddMode(char c);
void DelMode(char c);
bool HasMode(char c) const;
bool Empty() const;
@@ -202,51 +247,56 @@ class CoreExport ChannelStatus
Anope::string BuildModePrefixList() const;
};
class CoreExport UserModeOperOnly : public UserMode
class CoreExport UserModeOperOnly
: public UserMode
{
public:
public:
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *u) const anope_override;
bool CanSet(User *u) const override;
};
class CoreExport UserModeNoone : public UserMode
class CoreExport UserModeNoone
: public UserMode
{
public:
public:
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *u) const anope_override;
bool CanSet(User *u) const override;
};
/** Channel mode +k (key)
*/
class CoreExport ChannelModeKey : public ChannelModeParam
class CoreExport ChannelModeKey
: public ChannelModeParam
{
public:
public:
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
bool IsValid(const Anope::string &value) const anope_override;
bool IsValid(Anope::string &value) const override;
};
/** This class is used for oper only channel modes
*/
class CoreExport ChannelModeOperOnly : public ChannelMode
class CoreExport ChannelModeOperOnly
: public ChannelMode
{
public:
public:
ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
/* Opers only */
bool CanSet(User *u) const anope_override;
bool CanSet(User *u) const override;
};
/** This class is used for channel modes only servers may set
*/
class CoreExport ChannelModeNoone : public ChannelMode
class CoreExport ChannelModeNoone
: public ChannelMode
{
public:
public:
ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
bool CanSet(User *u) const anope_override;
bool CanSet(User *u) const override;
};
/** This is the mode manager
@@ -255,16 +305,9 @@ class CoreExport ChannelModeNoone : public ChannelMode
* This also contains a mode stacker that will combine multiple modes and set
* them on a channel or user at once
*/
class CoreExport ModeManager
class CoreExport ModeManager final
{
protected:
/* Array of all modes Anope knows about. Modes are in this array at position
* modechar. Additionally, status modes are in this array (again) at statuschar.
*/
static std::vector<ChannelMode *> ChannelModes;
static std::vector<UserMode *> UserModes;
public:
public:
/* Number of generic channel and user modes we are tracking */
static unsigned GenericChannelModes;
@@ -358,24 +401,27 @@ class CoreExport ModeManager
/** Represents a mask set on a channel (b/e/I)
*/
class CoreExport Entry
class CoreExport Entry final
{
Anope::string name;
Anope::string mask;
public:
unsigned short cidr_len;
public:
unsigned short cidr_len = 0;
int family = 0;
Anope::string nick, user, host, real;
/** Constructor
* @param mode What mode this host is for, can be empty for unknown/no mode
* @param host A full or poartial nick!ident@host/cidr#real name mask
* @param mode What mode this host is for, can be empty for unknown/no mode
* @param host A full or partial nick!ident@host/cidr#real name mask
*/
Entry(const Anope::string &mode, const Anope::string &host);
/** Get the banned mask for this entry
* @return The mask
*/
const Anope::string GetMask() const;
Anope::string GetMask() const;
Anope::string GetNUHMask() const;
/** Check if this entry matches a user
* @param u The user
@@ -384,5 +430,3 @@ class CoreExport Entry
*/
bool Matches(User *u, bool full = false) const;
};
#endif // MODES_H
+2 -5
View File
@@ -1,6 +1,6 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,8 +9,7 @@
* Based on the original code of Services by Andy Church.
*/
#ifndef MODULE_H
#define MODULE_H
#pragma once
#include "access.h"
#include "account.h"
@@ -50,5 +49,3 @@
#include "modules/pseudoclients/global.h"
#include "modules/pseudoclients/memoserv.h"
#include "modules/pseudoclients/nickserv.h"
#endif // MODULE_H
+86 -100
View File
@@ -1,48 +1,30 @@
/* Modular support
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#pragma once
#include "serialize.h"
#ifndef MODULES_H
#define MODULES_H
#include "base.h"
#include "modes.h"
#include "timers.h"
#include "logger.h"
#include "extensible.h"
#include "version.h"
/** This definition is used as shorthand for the various classes
* and functions needed to make a module loadable by the OS.
* It defines the class factory and external AnopeInit and AnopeFini functions.
*/
#ifdef _WIN32
# define MODULE_INIT(x) \
extern "C" DllExport Module *AnopeInit(const Anope::string &, const Anope::string &); \
extern "C" Module *AnopeInit(const Anope::string &modname, const Anope::string &creator) \
{ \
return new x(modname, creator); \
} \
BOOLEAN WINAPI DllMain(HINSTANCE, DWORD, LPVOID) \
{ \
return TRUE; \
} \
extern "C" DllExport void AnopeFini(x *); \
extern "C" void AnopeFini(x *m) \
{ \
delete m; \
}
#else
# define MODULE_INIT(x) \
#define MODULE_INIT(x) \
extern "C" DllExport Module *AnopeInit(const Anope::string &modname, const Anope::string &creator) \
{ \
return new x(modname, creator); \
@@ -50,13 +32,20 @@
extern "C" DllExport void AnopeFini(x *m) \
{ \
delete m; \
} \
extern "C" DllExport ModuleVersionC AnopeVersion() \
{ \
ModuleVersionC ver; \
ver.version_major = VERSION_MAJOR; \
ver.version_minor = VERSION_MINOR; \
ver.version_patch = VERSION_PATCH; \
return ver; \
}
#endif
/**
* This #define allows us to call a method in all
* loaded modules in a readable simple way, e.g.:
*
*
* FOREACH_MOD(OnUserConnect, (user, exempt));
*/
#define FOREACH_MOD(ename, args) \
@@ -88,7 +77,7 @@ else \
* This define is similar to the one above but returns a result.
* The first module to return a result other than EVENT_CONTINUE is the value to be accepted,
* and any modules after are ignored. This is used like:
*
*
* EventReturn MOD_RESULT;
* FOREACH_RESULT(OnUserConnect, MOD_RESULT, (user, exempt));
*/
@@ -173,23 +162,23 @@ enum
};
typedef unsigned short ModType;
struct ModuleVersionC final
{
int version_major, version_minor, version_patch;
};
/** Returned by Module::GetVersion, used to see what version of Anope
* a module is compiled against.
*/
class ModuleVersion
class ModuleVersion final
{
private:
private:
int version_major;
int version_minor;
int version_patch;
public:
/** Constructor
* @param major The major version number
* @param minor The minor version number
* @param patch The patch version number
*/
ModuleVersion(int major, int minor, int patch);
public:
ModuleVersion(const ModuleVersionC &);
/** Get the major version of Anope this was built against
* @return The major version
@@ -207,15 +196,19 @@ class ModuleVersion
int GetPatch() const;
};
class NotImplementedException : public CoreException { };
class CoreExport NotImplementedException final
: public CoreException
{
};
/** Every module in Anope is actually a class.
*/
class CoreExport Module : public Extensible
class CoreExport Module
: public Extensible
{
private:
private:
bool permanent;
public:
public:
/** The module name (e.g. os_modload)
*/
Anope::string name;
@@ -279,16 +272,17 @@ class CoreExport Module : public Extensible
*/
void SetAuthor(const Anope::string &author);
/** Get the version of Anope this module was
* compiled against
* @return The version
*/
ModuleVersion GetVersion() const;
virtual void Prioritize();
/* Everything below here are events. Modules must ModuleManager::Attach to these events
* before they will be called.
*/
/** Called on startup after database load, but before
* connecting to the uplink.
*/
virtual void OnPostInit() { throw NotImplementedException(); }
/** Called before a user has been kicked from a channel.
* @param source The kicker
* @param cu The user, channel, and status of the user being kicked
@@ -305,7 +299,7 @@ class CoreExport Module : public Extensible
*/
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) { throw NotImplementedException(); }
/** Called when Services' configuration is being (re)loaded.
/** Called when the configuration is being (re)loaded.
* @param conf The config that is being built now and will replace the global Config object
* @throws A ConfigException to abort the config (re)loading process.
*/
@@ -385,10 +379,8 @@ class CoreExport Module : public Extensible
virtual EventReturn OnLoadDatabase() { throw NotImplementedException(); }
/** Called when anope needs to check passwords against encryption
* see src/encrypt.c for detailed informations
*/
virtual EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) { throw NotImplementedException(); }
virtual EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) { throw NotImplementedException(); }
/** Called on fantasy command
* @param source The source of the command
@@ -472,11 +464,12 @@ class CoreExport Module : public Extensible
virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); }
/** Called when a new topic is set
* @param source The user changing the topic, if any
* @param c The channel
* @param setter The user who set the new topic
* @param setter The user who set the new topic, if there is no source
* @param topic The new topic
*/
virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
/** Called before a channel expires
* @param ci The channel
@@ -489,7 +482,7 @@ class CoreExport Module : public Extensible
*/
virtual void OnChanExpire(ChannelInfo *ci) { throw NotImplementedException(); }
/** Called before Anope connecs to its uplink
/** Called before Anope connects to its uplink
*/
virtual void OnPreServerConnect() { throw NotImplementedException(); }
@@ -537,7 +530,7 @@ class CoreExport Module : public Extensible
/** Called before an exception is deleted
* @param source The source deleting it
* @param ex The exceotion
* @param ex The exception
*/
virtual void OnExceptionDel(CommandSource &source, Exception *ex) { throw NotImplementedException(); }
@@ -719,11 +712,6 @@ class CoreExport Module : public Extensible
*/
virtual void OnNickDrop(CommandSource &source, NickAlias *na) { throw NotImplementedException(); }
/** Called when a nick is forbidden
* @param na The nick alias of the forbidden nick
*/
virtual void OnNickForbidden(NickAlias *na) { throw NotImplementedException(); }
/** Called when a user groups their nick
* @param u The user grouping
* @param target The target they're grouping to
@@ -748,15 +736,22 @@ class CoreExport Module : public Extensible
/** Called when a nick is registered
* @param user The user registering the nick, of any
* @param The nick
* @param pass The password of the newly registered nick
*/
virtual void OnNickRegister(User *user, NickAlias *na) { throw NotImplementedException(); }
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
* @param user The user confirming the nick
* @param The account being confirmed
*/
virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); }
/** Called when a nick is suspended
* @param na The nick alias
*/
virtual void OnNickSuspend(NickAlias *na) { throw NotImplementedException(); }
/** Called when a nick is unsuspneded
/** Called when a nick is unsuspended
* @param na The nick alias
*/
virtual void OnNickUnsuspended(NickAlias *na) { throw NotImplementedException(); }
@@ -782,23 +777,6 @@ class CoreExport Module : public Extensible
*/
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
/** called from NickCore::ClearAccess()
* @param nc pointer to the NickCore
*/
virtual void OnNickClearAccess(NickCore *nc) { throw NotImplementedException(); }
/** Called when a user adds an entry to their access list
* @param nc The nick
* @param entry The entry
*/
virtual void OnNickAddAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
/** Called from NickCore::EraseAccess()
* @param nc pointer to the NickCore
* @param entry The access mask
*/
virtual void OnNickEraseAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
/** called from NickCore::ClearCert()
* @param nc pointer to the NickCore
*/
@@ -860,12 +838,12 @@ class CoreExport Module : public Extensible
/** Called when a vhost is deleted
* @param na The nickalias of the vhost
*/
virtual void OnDeleteVhost(NickAlias *na) { throw NotImplementedException(); }
virtual void OnDeleteVHost(NickAlias *na) { throw NotImplementedException(); }
/** Called when a vhost is set
* @param na The nickalias of the vhost
*/
virtual void OnSetVhost(NickAlias *na) { throw NotImplementedException(); }
virtual void OnSetVHost(NickAlias *na) { throw NotImplementedException(); }
/** Called when a users host changes
* @param u The user
@@ -919,12 +897,12 @@ class CoreExport Module : public Extensible
*/
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
/** Called when a channel mode is introducted into Anope
/** Called when a channel mode is introduced into Anope
* @param cm The mode
*/
virtual void OnChannelModeAdd(ChannelMode *cm) { throw NotImplementedException(); }
/** Called when a user mode is introducted into Anope
/** Called when a user mode is introduced into Anope
* @param um The mode
*/
virtual void OnUserModeAdd(UserMode *um) { throw NotImplementedException(); }
@@ -969,23 +947,26 @@ class CoreExport Module : public Extensible
* @param u The user sending the PRIVMSG
* @param bi The target of the PRIVMSG
* @param message The message
* @param tags Message tags
* @return EVENT_STOP to halt processing
*/
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); }
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
/** Called when we receive a NOTICE for one of our clients
* @param u The user sending the NOTICE
* @param bi The target of the NOTICE
* @param tags Message tags
* @param message The message
*/
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); }
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
/** Called when we receive a PRIVMSG for a registered channel we are in
* @param u The source of the message
* @param c The channel
* @param msg The message
* @param tags Message tags
*/
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg) { throw NotImplementedException(); }
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
/** Called when a message is logged
* @param l The log message
@@ -1000,7 +981,7 @@ class CoreExport Module : public Extensible
*/
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) { throw NotImplementedException(); }
/** Called when a DNS request (question) is recieved.
/** Called when a DNS request (question) is received.
* @param req The dns request
* @param reply The reply that will be sent
*/
@@ -1010,7 +991,7 @@ class CoreExport Module : public Extensible
* mostly to ensure mlock/+r are set.
* @param c The channel
*/
virtual void OnCheckModes(Channel *c) { throw NotImplementedException(); }
virtual void OnCheckModes(Reference<Channel> &c) { throw NotImplementedException(); }
/** Called when a channel is synced.
* Channels are synced after a sjoin is finished processing
@@ -1046,7 +1027,7 @@ class CoreExport Module : public Extensible
/** Called when a nickserv/set command is used.
* @param source The source of the command
* @param cmd The command
* @param nc The nickcore being modifed
* @param nc The nickcore being modified
* @param setting The setting passed to the command. Probably ON/OFF.
* @return EVENT_STOP to halt immediately
*/
@@ -1056,11 +1037,12 @@ class CoreExport Module : public Extensible
* @param source The source of the message
* @param command The command being executed
* @param params Parameters
* @param tags Tags
* @return EVENT_STOP to prevent the protocol module from processing this message
*/
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> &param) { throw NotImplementedException(); }
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> &params, Anope::map<Anope::string> &tagss) { throw NotImplementedException(); }
/** Called to determine if a chnanel mode can be set by a user
/** Called to determine if a channel mode can be set by a user
* @param u The user
* @param cm The mode
*/
@@ -1073,7 +1055,7 @@ class CoreExport Module : public Extensible
*/
virtual void OnExpireTick() { throw NotImplementedException(); }
/** Called when a nick is validated. That is, to determine if a user is permissted
/** Called when a nick is validated. That is, to determine if a user is permitted
* to be on the given nick.
* @param u The user
* @param na The nick they are on
@@ -1084,6 +1066,7 @@ class CoreExport Module : public Extensible
enum Implementation
{
I_OnPostInit,
I_OnPreUserKicked, I_OnUserKicked, I_OnReload, I_OnPreBotAssign, I_OnBotAssign, I_OnBotUnAssign, I_OnUserConnect,
I_OnNewServer, I_OnUserNickChange, I_OnPreHelp, I_OnPostHelp, I_OnPreCommand, I_OnPostCommand, I_OnSaveDatabase,
I_OnLoadDatabase, I_OnEncrypt, I_OnDecrypt, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan, I_OnBadWordAdd,
@@ -1094,11 +1077,11 @@ enum Implementation
I_OnPreUserLogoff, I_OnPostUserLogoff, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnAccessDel, I_OnAccessAdd,
I_OnAccessClear, I_OnLevelChange, I_OnChanDrop, I_OnChanRegistered, I_OnChanSuspend, I_OnChanUnsuspend,
I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickForbidden, I_OnNickGroup, I_OnNickIdentify,
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert,
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickGroup, I_OnNickIdentify,
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickConfirm, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearCert,
I_OnNickAddCert, I_OnNickEraseCert, I_OnNickInfo, I_OnBotInfo, I_OnCheckAuthentication, I_OnNickUpdate,
I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVhost, I_OnSetVhost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel,
I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVHost, I_OnSetVHost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
I_OnMLock, I_OnUnMLock, I_OnModuleLoad, I_OnModuleUnload, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnBotNotice,
I_OnPrivmsg, I_OnLog, I_OnLogMessage, I_OnDnsRequest, I_OnCheckModes, I_OnChannelSync, I_OnSetCorrectModes,
@@ -1110,14 +1093,14 @@ enum Implementation
/** Used to manage modules.
*/
class CoreExport ModuleManager
class CoreExport ModuleManager final
{
public:
public:
/** Event handler hooks.
*/
static std::vector<Module *> EventHandlers[I_SIZE];
/** List of all modules loaded in Anope
/** List of all modules loaded in Anope
*/
static std::list<Module *> Modules;
@@ -1156,7 +1139,7 @@ class CoreExport ModuleManager
/** Checks whether this version of Anope is at least major.minor.patch.build
* Throws a ModuleException if not
* @param major The major version
* @param minor The minor vesion
* @param minor The minor version
* @param patch The patch version
*/
static void RequireVersion(int major, int minor, int patch);
@@ -1195,12 +1178,15 @@ class CoreExport ModuleManager
*/
static void UnloadAll();
private:
private:
/** Call the module_delete function to safely delete the module
* @param m the module to delete
* @return MOD_ERR_OK on success, anything else on fail
*/
static ModuleReturn DeleteModule(Module *m);
};
#endif // MODULES_H
/** Get the version of Anope the module was compiled against
* @return The version
*/
static ModuleVersion GetVersion(void *handle);
};
+9 -10
View File
@@ -1,16 +1,16 @@
/* BotServ core functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*
*/
#pragma once
/** Flags for badwords
*/
enum BadWordType
@@ -32,27 +32,27 @@ struct BadWord
Anope::string word;
BadWordType type;
virtual ~BadWord() { }
protected:
BadWord() { }
virtual ~BadWord() = default;
protected:
BadWord() = default;
};
struct BadWords
{
virtual ~BadWords() { }
virtual ~BadWords() = default;
/** 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;
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;
virtual BadWord *GetBadWord(unsigned index) const = 0;
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
@@ -70,4 +70,3 @@ struct BadWords
virtual void Check() = 0;
};
+7 -7
View File
@@ -1,16 +1,16 @@
/* BotServ core functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*
*/
#pragma once
/* Indices for TTB (Times To Ban) */
enum
{
@@ -37,10 +37,10 @@ struct KickerData
bool dontkickops, dontkickvoices;
protected:
KickerData() { }
protected:
KickerData() = default;
public:
virtual ~KickerData() { }
public:
virtual ~KickerData() = default;
virtual void Check(ChannelInfo *ci) = 0;
};
+37
View File
@@ -0,0 +1,37 @@
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
struct EntryMsg
{
Anope::string chan;
Anope::string creator;
Anope::string message;
time_t when;
virtual ~EntryMsg() = default;
protected:
EntryMsg() = default;
};
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;
};
+11 -9
View File
@@ -1,6 +1,6 @@
/* ChanServ core functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,6 +9,8 @@
* Based on the original code of Services by Andy Church.
*/
#pragma once
struct LogSetting
{
Anope::string chan;
@@ -22,22 +24,22 @@ struct LogSetting
Anope::string creator;
time_t created;
virtual ~LogSetting() { }
protected:
LogSetting() { }
virtual ~LogSetting() = default;
protected:
LogSetting() = default;
};
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
struct LogSettings
: Serialize::Checker<std::vector<LogSetting *> >
{
typedef std::vector<LogSetting *>::iterator iterator;
protected:
protected:
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
{
}
public:
virtual ~LogSettings() { }
public:
virtual ~LogSettings() = default;
virtual LogSetting *Create() = 0;
};
+9 -8
View File
@@ -1,6 +1,6 @@
/* ChanServ core functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,6 +9,8 @@
* Based on the original code of Services by Andy Church.
*/
#pragma once
struct ModeLock
{
Anope::string ci;
@@ -18,16 +20,16 @@ struct ModeLock
Anope::string setter;
time_t created;
virtual ~ModeLock() { }
protected:
ModeLock() { }
virtual ~ModeLock() = default;
protected:
ModeLock() = default;
};
struct ModeLocks
{
typedef std::vector<ModeLock *> ModeList;
virtual ~ModeLocks() { }
virtual ~ModeLocks() = default;
/** Check if a mode is mlocked
* @param mode The mode
@@ -74,17 +76,16 @@ struct ModeLocks
/** Get details for a specific mlock
* @param mname The mode name
* @param An optional param to match with
* @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
* @param complete True to show mlock parameters as well
* @return A string of mode locks, eg: +nrt
*/
virtual Anope::string GetMLockAsString(bool complete) const = 0;
virtual void Check() = 0;
};
+49 -45
View File
@@ -1,17 +1,15 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#ifndef DNS_H
#define DNS_H
#pragma once
namespace DNS
{
@@ -53,7 +51,7 @@ namespace DNS
QUERYFLAGS_Z = 0x70,
QUERYFLAGS_RCODE = 0xF
};
enum Error
{
ERROR_NONE,
@@ -70,42 +68,43 @@ namespace DNS
ERROR_NO_RECORDS,
ERROR_INVALIDTYPE
};
struct Question
{
Anope::string name;
QueryType type;
unsigned short qclass;
Question() : type(QUERY_NONE), qclass(0) { }
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; }
QueryType type = QUERY_NONE;
unsigned short qclass = 0;
struct hash
Question() = default;
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 final
{
size_t operator()(const Question &q) const
size_t operator()(const Question &q) const
{
return Anope::hash_ci()(q.name);
}
};
};
struct ResourceRecord : Question
struct ResourceRecord final
: Question
{
unsigned int ttl;
unsigned int ttl = 0;
Anope::string rdata;
time_t created;
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { }
ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { }
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), created(Anope::CurTime) { }
ResourceRecord(const Question &q) : Question(q), created(Anope::CurTime) { }
};
struct Query
{
std::vector<Question> questions;
std::vector<ResourceRecord> answers, authorities, additional;
Error error;
Query() : error(ERROR_NONE) { }
Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); }
};
@@ -115,57 +114,66 @@ namespace DNS
/** DNS manager
*/
class Manager : public Service
class Manager
: public Service
{
public:
public:
Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { }
virtual ~Manager() { }
virtual ~Manager() = default;
virtual void Process(Request *req) = 0;
virtual void RemoveRequest(Request *req) = 0;
virtual bool HandlePacket(ReplySocket *s, const unsigned char *const data, int len, sockaddrs *from) = 0;
virtual void UpdateSerial() = 0;
virtual void Notify(const Anope::string &zone) = 0;
virtual uint32_t GetSerial() const = 0;
};
/** A DNS query.
*/
class Request : public Timer, public Question
class Request
: public Timer
, public Question
{
Manager *manager;
public:
public:
/* Use result cache if available */
bool use_cache;
/* Request id */
unsigned short id;
/* Creator of this request */
unsigned short id = 0;
/* Creator of this request */
Module *creator;
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr),
use_cache(cache), id(0), creator(c) { }
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false)
: Timer(0)
, Question(addr, qt)
, manager(mgr)
, use_cache(cache)
, creator(c)
{
}
virtual ~Request()
{
manager->RemoveRequest(this);
}
/** Called when this request succeeds
* @param r The query sent back from the nameserver
*/
virtual void OnLookupComplete(const Query *r) = 0;
/** Called when this request fails or times out.
* @param r The query sent back from the nameserver, check the error code.
*/
virtual void OnError(const Query *r) { }
/** Used to time out the query, xalls OnError and lets the TimerManager
* delete this request.
*/
void Tick(time_t) anope_override
void Tick() override
{
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
Query rr(*this);
@@ -173,9 +181,5 @@ namespace DNS
this->OnError(&rr);
}
};
} // namespace DNS
#endif // DNS_H
+126 -16
View File
@@ -1,37 +1,147 @@
/*
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 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.
*
*/
#pragma once
namespace Encryption
{
typedef std::pair<const unsigned char *, size_t> Hash;
typedef std::pair<const uint32_t *, size_t> IV;
/** Base class for encryption contexts. */
class Context
{
public:
virtual ~Context() { }
public:
virtual ~Context() = default;
/** Updates the encryption context with the specified data.
* @param str The data to update the context with.
*/
inline void Update(const Anope::string &str)
{
Update(reinterpret_cast<const unsigned char *>(str.c_str()), str.length());
}
/** Updates the encryption context with the specified data.
* @param data The data to update the context with.
* @param len The length of the data.
*/
virtual void Update(const unsigned char *data, size_t len) = 0;
virtual void Finalize() = 0;
virtual Hash GetFinalizedHash() = 0;
/** Finalises the encryption context and returns the digest. */
virtual Anope::string Finalize() = 0;
};
class Provider : public Service
/** Provider of encryption contexts. */
class Provider
: public Service
{
public:
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
virtual ~Provider() { }
public:
/** The byte size of the block cipher. */
const size_t block_size;
virtual Context *CreateContext(IV * = NULL) = 0;
virtual IV GetDefaultIV() = 0;
/** The byte size of the resulting digest. */
const size_t digest_size;
/** Creates a provider of encryption contexts.
* @param creator The module that created this provider.
* @param algorithm The name of the encryption algorithm.
* @param bs The byte size of the block cipher.
* @param ds The byte size of the resulting digest.
*/
Provider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
: Service(creator, "Encryption::Provider", algorithm)
, block_size(bs)
, digest_size(ds)
{
}
virtual ~Provider() = default;
/** Checks whether a plain text value matches a hash created by this provider. */
virtual bool Compare(const Anope::string &hash, const Anope::string &plain)
{
return !hash.empty() && hash.equals_cs(ToPrintable(Encrypt(plain)));
}
/** Called on initialising a encryption provider to check it works properly. */
void Check(const Anope::map<Anope::string> &checks)
{
for (const auto &[hash, plain] : checks)
{
if (!Compare(hash, plain))
throw ModuleException("BUG: unable to generate " + this->name + " hashes safely! Please report this!");
}
Log(LOG_DEBUG) << "The " << this->name << " encryption provider appears to be working correctly.";
}
/** Creates a new encryption context. */
virtual std::unique_ptr<Context> CreateContext() = 0;
/** Quickly encrypts the specified values and returns the digest. */
template<typename... Args>
Anope::string Encrypt(Args &&...args)
{
auto context = CreateContext();
context->Update(std::forward<Args>(args)...);
return context->Finalize();
}
/** Calculates the RFC 2104 hash-based message authentication code for the specified data. */
inline Anope::string HMAC(const Anope::string &key, const Anope::string &data)
{
if (!block_size)
return {};
auto keybuf = key.length() > block_size ? Encrypt(key) : key;
keybuf.resize(block_size);
Anope::string hmac1;
Anope::string hmac2;
for (size_t i = 0; i < block_size; ++i)
{
hmac1.push_back(static_cast<char>(keybuf[i] ^ 0x5C));
hmac2.push_back(static_cast<char>(keybuf[i] ^ 0x36));
}
hmac2.append(data);
hmac1.append(Encrypt(hmac2));
return Encrypt(hmac1);
}
/** Converts a hash to its printable form. */
virtual Anope::string ToPrintable(const Anope::string &hash)
{
return Anope::Hex(hash);
}
};
/** Helper template for creating simple providers of encryption contexts. */
template <typename T>
class SimpleProvider final
: public Provider
{
public:
/** Creates a simple provider of encryption contexts.
* @param creator The module that created this provider.
* @param algorithm The name of the encryption algorithm.
* @param bs The byte size of the block cipher.
* @param ds The byte size of the resulting digest.
*/
SimpleProvider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
: Provider(creator, algorithm, bs, ds)
{
}
/** @copydoc Encryption::Provider::CreateContext. */
std::unique_ptr<Context> CreateContext() override
{
return std::make_unique<T>();
}
};
}
+23
View File
@@ -0,0 +1,23 @@
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
class HostRequest
{
protected:
HostRequest() = default;
public:
Anope::string nick;
Anope::string ident;
Anope::string host;
time_t time = 0;
virtual ~HostRequest() = default;
};
+48 -35
View File
@@ -1,5 +1,12 @@
#ifndef ANOPE_HTTPD_H
#define ANOPE_HTTPD_H
/*
*
* (C) 2012-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
enum HTTPError
{
@@ -11,34 +18,35 @@ enum HTTPError
};
/* A message to someone */
struct HTTPReply
struct HTTPReply final
{
HTTPError error;
HTTPError error = HTTP_ERROR_OK;
Anope::string content_type;
std::map<Anope::string, Anope::string> headers;
std::map<Anope::string, Anope::string, ci::less> headers;
typedef std::list<std::pair<Anope::string, Anope::string> > cookie;
std::vector<cookie> cookies;
HTTPReply() : error(HTTP_ERROR_OK), length(0) { }
HTTPReply() = default;
HTTPReply &operator=(const HTTPReply &) = default;
HTTPReply(const HTTPReply& other) : error(other.error), length(other.length)
HTTPReply(const HTTPReply &other) : error(other.error), length(other.length)
{
content_type = other.content_type;
headers = other.headers;
cookies = other.cookies;
for (unsigned i = 0; i < other.out.size(); ++i)
out.push_back(new Data(other.out[i]->buf, other.out[i]->len));
for (const auto &datum : other.out)
out.push_back(new Data(datum->buf, datum->len));
}
~HTTPReply()
{
for (unsigned i = 0; i < out.size(); ++i)
delete out[i];
for (const auto *datum : out)
delete datum;
out.clear();
}
struct Data
struct Data final
{
char *buf;
size_t len;
@@ -57,7 +65,7 @@ struct HTTPReply
};
std::deque<Data *> out;
size_t length;
size_t length = 0;
void Write(const Anope::string &message)
{
@@ -72,8 +80,8 @@ struct HTTPReply
}
};
/* A message from soneone */
struct HTTPMessage
/* A message from someone */
struct HTTPMessage final
{
std::map<Anope::string, Anope::string> headers;
std::map<Anope::string, Anope::string> cookies;
@@ -85,13 +93,14 @@ struct HTTPMessage
class HTTPClient;
class HTTPProvider;
class HTTPPage : public Base
class HTTPPage
: public virtual Base
{
Anope::string url;
Anope::string content_type;
public:
HTTPPage(const Anope::string &u, const Anope::string &ct = "text/html") : url(u), content_type(ct) { }
public:
HTTPPage(const Anope::string &u, const Anope::string &ct = "text/html") : url(u), content_type(ct) { }
const Anope::string &GetURL() const { return this->url; }
@@ -107,15 +116,18 @@ class HTTPPage : public Base
virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
};
class HTTPClient : public ClientSocket, public BinarySocket, public Base
class HTTPClient
: public ClientSocket
, public BinarySocket
, public Base
{
protected:
protected:
void WriteClient(const Anope::string &message)
{
BinarySocket::Write(message + "\r\n");
}
public:
public:
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BinarySocket() { }
virtual const Anope::string GetIP()
@@ -127,13 +139,15 @@ class HTTPClient : public ClientSocket, public BinarySocket, public Base
virtual void SendReply(HTTPReply *) = 0;
};
class HTTPProvider : public ListenSocket, public Service
class HTTPProvider
: public ListenSocket
, public Service
{
Anope::string ip;
Anope::string ip;
unsigned short port;
bool ssl;
public:
Anope::string ext_ip;
public:
std::vector<Anope::string> ext_ips;
std::vector<Anope::string> ext_headers;
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) { }
@@ -155,7 +169,7 @@ class HTTPProvider : public ListenSocket, public Service
virtual bool RegisterPage(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;
};
namespace HTTPUtils
@@ -166,7 +180,7 @@ namespace HTTPUtils
for (unsigned i = 0; i < url.length(); ++i)
{
const char& c = url[i];
const char &c = url[i];
if (c == '%' && i + 2 < url.length())
{
@@ -188,10 +202,8 @@ namespace HTTPUtils
{
Anope::string encoded;
for (unsigned i = 0; i < url.length(); ++i)
for (const auto c : url)
{
const char& c = url[i];
if (isalnum(c) || c == '.' || c == '-' || c == '*' || c == '_')
encoded += c;
else if (c == ' ')
@@ -207,9 +219,9 @@ namespace HTTPUtils
{
Anope::string dst;
for (unsigned i = 0; i < src.length(); ++i)
for (const auto c : src)
{
switch (src[i])
switch (c)
{
case '<':
dst += "&lt;";
@@ -220,13 +232,14 @@ namespace HTTPUtils
case '"':
dst += "&quot;";
break;
case '&':
dst += "&amp;";
break;
default:
dst += src[i];
dst += c;
}
}
return dst;
}
}
#endif // ANOPE_HTTPD_H
+49
View File
@@ -0,0 +1,49 @@
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
class OperInfo
{
protected:
OperInfo() = default;
OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c)
: target(t)
, info(i)
, adder(a)
, created(c)
{
}
public:
Anope::string target;
Anope::string info;
Anope::string adder;
time_t created = 0;
virtual ~OperInfo() = default;
};
class OperInfoList
: public Serialize::Checker<std::vector<OperInfo *>>
{
public:
OperInfoList()
: Serialize::Checker<std::vector<OperInfo *>>("OperInfo")
{
}
virtual ~OperInfoList()
{
for (auto *info : *(*this))
delete info;
}
virtual OperInfo *Create() = 0;
};
+38 -41
View File
@@ -1,17 +1,22 @@
#ifndef ANOPE_LDAP_H
#define ANOPE_LDAP_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
typedef int LDAPQuery;
#pragma once
class LDAPException : public ModuleException
class DllExport LDAPException : public ModuleException
{
public:
public:
LDAPException(const Anope::string &reason) : ModuleException(reason) { }
virtual ~LDAPException() throw() { }
virtual ~LDAPException() noexcept = default;
};
struct LDAPModification
struct LDAPModification final
{
enum LDAPOperation
{
@@ -26,7 +31,8 @@ struct LDAPModification
};
typedef std::vector<LDAPModification> LDAPMods;
struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string> >
struct LDAPAttributes final
: public std::map<Anope::string, std::vector<Anope::string>>
{
size_t size(const Anope::string &attr) const
{
@@ -37,8 +43,8 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
const std::vector<Anope::string> keys() const
{
std::vector<Anope::string> k;
for (const_iterator it = this->begin(), it_end = this->end(); it != it_end; ++it)
k.push_back(it->first);
for (const auto &[key, _] : *this)
k.push_back(key);
return k;
}
@@ -59,28 +65,26 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
}
};
struct LDAPResult
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
struct LDAPResult final
{
std::vector<LDAPAttributes> messages;
Anope::string error;
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
QueryType type;
LDAPQuery id;
LDAPResult()
{
this->type = QUERY_UNKNOWN;
this->id = -1;
}
size_t size() const
@@ -108,66 +112,59 @@ struct LDAPResult
class LDAPInterface
{
public:
public:
Module *owner;
LDAPInterface(Module *m) : owner(m) { }
virtual ~LDAPInterface() { }
virtual ~LDAPInterface() = default;
virtual void OnResult(const LDAPResult &r) = 0;
virtual void OnError(const LDAPResult &err) = 0;
virtual void OnDelete() { }
};
class LDAPProvider : public Service
class LDAPProvider
: public Service
{
public:
public:
LDAPProvider(Module *c, const Anope::string &n) : Service(c, "LDAPProvider", n) { }
/** Attempt to bind to the LDAP server as an admin
* @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
* @param i The LDAPInterface the result is sent to
* @param who The binddn
* @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
* @param i The LDAPInterface the result is sent to
* @param base The base DN to search
* @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
* @param i The LDAPInterface the result is sent to
* @param dn The dn of the entry to add
* @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
* @param i The LDAPInterface the result is sent to
* @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
* @param i The LDAPInterface the result is sent to
* @param base The base DN 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
+21 -10
View File
@@ -1,6 +1,6 @@
/* NickServ core functions
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,12 +9,14 @@
* Based on the original code of Services by Andy Church.
*/
#pragma once
struct NSCertList
{
protected:
NSCertList() { }
public:
virtual ~NSCertList() { }
protected:
NSCertList() = default;
public:
virtual ~NSCertList() = default;
/** Add an entry to the nick's certificate list
*
@@ -26,7 +28,7 @@ struct NSCertList
/** Get an entry from the nick's cert list by index
*
* @param entry Index in the certificaate list vector to retrieve
* @param entry Index in the certificate 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.
@@ -52,6 +54,15 @@ struct NSCertList
*/
virtual void EraseCert(const Anope::string &entry) = 0;
/** Replaces a fingerprint in the nick's certificate list
*
* @param oldentry The old fingerprint to remove
* @param newentry The new fingerprint to add
*
* Replaces the specified fingerprint in the cert list.
*/
virtual void ReplaceCert(const Anope::string &oldentry, const Anope::string &newentry) = 0;
/** Clears the entire nick's cert list
*
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
@@ -61,11 +72,11 @@ struct NSCertList
virtual void Check() = 0;
};
class CertService : public Service
class CertService
: public Service
{
public:
public:
CertService(Module *c) : Service(c, "CertService", "certs") { }
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
};
+20 -13
View File
@@ -1,5 +1,12 @@
#ifndef OS_FORBID_H
#define OS_FORBID_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
enum ForbidType
{
@@ -15,32 +22,32 @@ struct ForbidData
Anope::string mask;
Anope::string creator;
Anope::string reason;
time_t created;
time_t expires;
time_t created = 0;
time_t expires = 0;
ForbidType type;
virtual ~ForbidData() { }
protected:
ForbidData() : created(0), expires(0) { }
virtual ~ForbidData() = default;
protected:
ForbidData() = default;
};
class ForbidService : public Service
class ForbidService
: public Service
{
public:
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 *CreateForbid() = 0;
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
virtual ForbidData *FindForbidExact(const Anope::string &mask, ForbidType type) = 0;
virtual std::vector<ForbidData *> GetForbids() = 0;
};
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
#endif
+11 -10
View File
@@ -1,6 +1,6 @@
/* OperServ ignore interface
*
* (C) 2003-2014 Anope Team
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -9,25 +9,27 @@
* Based on the original code of Services by Andy Church.
*/
#pragma once
struct IgnoreData
{
Anope::string mask;
Anope::string creator;
Anope::string reason;
time_t time; /* When do we stop ignoring them? */
time_t time = 0; /* When do we stop ignoring them? */
virtual ~IgnoreData() { }
protected:
IgnoreData() : time(0) { }
virtual ~IgnoreData() = default;
protected:
IgnoreData() = default;
};
class IgnoreService : public Service
class IgnoreService
: public Service
{
protected:
protected:
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
public:
public:
virtual void AddIgnore(IgnoreData *) = 0;
virtual void DelIgnore(IgnoreData *) = 0;
@@ -42,4 +44,3 @@ class IgnoreService : public Service
};
static ServiceReference<IgnoreService> ignore_service("IgnoreService", "ignore");
+18 -12
View File
@@ -1,5 +1,12 @@
#ifndef OS_NEWS
#define OS_NEWS
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
enum NewsType
{
@@ -8,14 +15,15 @@ enum NewsType
NEWS_OPER
};
struct NewsMessages
struct NewsMessages final
{
NewsType type;
Anope::string name;
const char *msgs[10];
};
struct NewsItem : Serializable
struct NewsItem
: Serializable
{
NewsType type;
Anope::string text;
@@ -25,21 +33,19 @@ struct NewsItem : Serializable
NewsItem() : Serializable("NewsItem") { }
};
class NewsService : public Service
class NewsService
: public Service
{
public:
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
+23 -17
View File
@@ -1,16 +1,24 @@
#ifndef OS_SESSION_H
#define OS_SESSION_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
struct Session
#pragma once
struct Session final
{
cidr addr; /* A cidr (sockaddrs + len) representing this session */
unsigned count; /* Number of clients with this host */
unsigned hits; /* Number of subsequent kills for a host */
unsigned count = 1; /* Number of clients with this host */
unsigned hits = 0; /* 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) { }
};
struct Exception : Serializable
struct Exception final
: Serializable
{
Anope::string mask; /* Hosts to which this exception applies */
unsigned limit; /* Session limit for exception */
@@ -20,14 +28,15 @@ struct Exception : Serializable
time_t expires; /* Time when it expires. 0 == no expiry */
Exception() : Serializable("Exception") { }
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
};
class SessionService : public Service
class SessionService
: public Service
{
public:
typedef TR1NS::unordered_map<cidr, Session *, cidr::hash> SessionMap;
public:
typedef std::unordered_map<cidr, Session *, cidr::hash> SessionMap;
typedef std::vector<Exception *> ExceptionVector;
SessionService(Module *m) : Service(m, "SessionService", "session") { }
@@ -40,7 +49,7 @@ class SessionService : public Service
virtual Exception *FindException(User *u) = 0;
virtual Exception *FindException(const Anope::string &host) = 0;
virtual Exception *FindException(const Anope::string &host) = 0;
virtual ExceptionVector &GetExceptions() = 0;
@@ -61,7 +70,7 @@ void Exception::Serialize(Serialize::Data &data) const
data["expires"] << this->expires;
}
Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
{
if (!session_service)
return NULL;
@@ -82,6 +91,3 @@ Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
session_service->AddException(ex);
return ex;
}
#endif
+12 -7
View File
@@ -1,9 +1,17 @@
#ifndef CHANSERV_H
#define CHANSERV_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
class ChanServService : public Service
#pragma once
class ChanServService
: public Service
{
public:
public:
ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ")
{
}
@@ -13,6 +21,3 @@ class ChanServService : public Service
*/
virtual void Hold(Channel *c) = 0;
};
#endif // CHANSERV_H
+68 -13
View File
@@ -1,20 +1,75 @@
#ifndef GLOBAL_H
#define GLOBAL_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
class GlobalService : public Service
#pragma once
#define GLOBAL_NO_MESSAGE _("You do not have any messages queued and did not specify a message to send.")
#define GLOBAL_QUEUE_CONFLICT _("You can not send a single message while you have messages queued.")
class GlobalService
: public Service
{
public:
GlobalService(Module *m) : Service(m, "GlobalService", "Global")
public:
GlobalService(Module *m)
: Service(m, "GlobalService", "Global")
{
}
/** Send out a global message to all users
* @param sender Our client which should send the global
* @param source The sender of the global
* @param message The message
/** Retrieves the bot which sends global messages unless otherwise specified. */
virtual Reference<BotInfo> GetDefaultSender() const = 0;
/** Clears any queued messages for the specified account.
* @param nc The account to clear queued messages for.
*/
virtual void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
virtual void ClearQueue(NickCore *nc) = 0;
/** Retrieves the size of the messages queue for the specified user.
* @param nc The account to count queued messages for.
*/
inline size_t CountQueue(NickCore* nc) const
{
auto *q = GetQueue(nc);
return q ? q->size() : 0;
}
/** Retrieves the messages queue for the specified user.
* @param nc The account to retrieve queued messages for.
*/
virtual const std::vector<Anope::string> *GetQueue(NickCore* nc) const = 0;
/** Queues a message to be sent later.
* @param nc The account to queue the message for.
* @param message The message to queue.
* @return The new number of messages in the queue.
*/
virtual size_t Queue(NickCore *nc, const Anope::string &message) = 0;
/** Sends a single message to all users on the network.
* @param message The message to send.
* @param source If non-nullptr then the source of the message.
* @param sender If non-nullptr then the bot to send the message from.
* @param server If non-nullptr then the server to send messages to.
* @return If the message was sent then true; otherwise, false.
*/
virtual bool SendSingle(const Anope::string &message, CommandSource *source = nullptr, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
/** Sends a message queue to all users on the network.
* @param source The source of the message.
* @param sender If non-nullptr then the bot to send the message from.
* @param server If non-nullptr then the server to send messages to.
* @return If the message queue was sent then true; otherwise, false.
*/
virtual bool SendQueue(CommandSource &source, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
/** Unqueues a message from the message queue.
* @param nc The account to unqueue the message from.
* @param idx The index of the item to remove.
* @return Whether the message was removed from the queue.
*/
virtual bool Unqueue(NickCore *nc, size_t idx) = 0;
};
#endif // GLOBAL_H
+13 -8
View File
@@ -1,9 +1,17 @@
#ifndef MEMOSERV_H
#define MEMOSERV_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
class MemoServService : public Service
#pragma once
class MemoServService
: public Service
{
public:
public:
enum MemoResult
{
MEMO_SUCCESS,
@@ -17,7 +25,7 @@ class MemoServService : public Service
}
/** Sends a memo.
* @param source The source of the memo, can be anythin.
* @param source The source of the memo, can be anything.
* @param target The target of the memo, nick or channel.
* @param message Memo text
* @param force true to force the memo, restrictions/delays etc are not checked
@@ -29,6 +37,3 @@ class MemoServService : public Service
*/
virtual void Check(User *u) = 0;
};
#endif // MEMOSERV_H
+12 -7
View File
@@ -1,9 +1,17 @@
#ifndef NICKSERV_H
#define NICKSERV_H
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
class NickServService : public Service
#pragma once
class NickServService
: public Service
{
public:
public:
NickServService(Module *m) : Service(m, "NickServService", "NickServ")
{
}
@@ -12,6 +20,3 @@ class NickServService : public Service
virtual void Collide(User *u, NickAlias *na) = 0;
virtual void Release(NickAlias *na) = 0;
};
#endif // NICKSERV_H

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