]> git.somenet.org - root/pub/somesible.git/blob - roles/server/irc-services/files/default/modules.conf
roles/server/irc-services/files
[root/pub/somesible.git] / roles / server / irc-services / files / default / modules.conf
1 #
2 ################################################
3 ### Managed by someone's ansible provisioner ###
4 ################################################
5 # Part of: https://git.somenet.org/root/pub/somesible.git
6 # 2017-2025 by someone <someone@somenet.org>
7 #
8
9 /*
10  * [OPTIONAL] Non-Core Modules
11  *
12  * The following blocks are used to load all non-core modules, including 3rd-party modules.
13  * Modules can be prevented from loading by commenting out the line, other modules can be added by
14  * adding a module block. These modules will be loaded prior to Services connecting to your network.
15  *
16  * Note that some of these modules are labeled EXTRA, and are not included in the Debian package. Please
17  * file a wishlist bug against anope in the Debian BTS if you would like to use an 'extra' module.
18  */
19
20 /*
21  * help
22  *
23  * Provides the command generic/help.
24  *
25  * This is a generic help command that can be used with any client.
26  */
27 module { name = "help" }
28
29 /*
30  * m_dns
31  *
32  * Adds support for the DNS protocol. By itself this module does nothing useful,
33  * but other modules such as m_dnsbl and os_dns require this.
34  */
35 #module
36 {
37         name = "m_dns"
38
39         /*
40          * The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
41          * The below should work fine on all UNIX-like systems. Windows users will have to find their nameservers
42          * from ipconfig /all and put the IP here.
43          */
44         nameserver = "/etc/resolv.conf"
45         #nameserver = "127.0.0.1"
46
47         /*
48          * How long to wait in seconds before a DNS query has timed out.
49          */
50         timeout = 5
51
52
53         /* Only edit below if you are expecting to use os_dns or otherwise answer DNS queries. */
54
55         /*
56          * The IP and port services use to listen for DNS queries.
57          * Note that ports less than 1024 are privileged on UNIX/Linux systems, and
58          * require Anope to be started as root. If you do this, it is recommended you
59          * set options:user and options:group so Anope can change users after binding
60          * to this port.
61          */
62         ip = "0.0.0.0"
63         port = 53
64
65
66         /*
67          * SOA record information.
68          */
69
70         /* E-mail address of the DNS administrator. */
71         admin = "admin@example.com"
72
73         /* This should be the names of the public facing nameservers serving the records. */
74         nameservers = "ns1.example.com ns2.example.com"
75
76         /* The time slave servers are allowed to cache. This should be reasonably low
77          * if you want your records to be updated without much delay.
78          */
79         refresh = 3600
80
81         /* A notify block. There should probably be one per nameserver listed in 'nameservers'.
82          */
83         notify
84         {
85                 ip = "192.0.2.0"
86                 port = 53
87         }
88 }
89
90 /*
91  * m_dnsbl
92  *
93  * Allows configurable DNS blacklists to check connecting users against. If a user
94  * is found on the blacklist they will be immediately banned. This is a crucial module
95  * to prevent bot attacks.
96  */
97 #module
98 {
99         name = "m_dnsbl"
100
101         /*
102          * If set, Services will check clients against the DNSBLs when services connect to its uplink.
103          * This is not recommended, and on large networks will open a very large amount of DNS queries.
104          * Whilst services are not drastically affected by this, your nameserver/DNSBL might care.
105          */
106         check_on_connect = no
107
108         /*
109          * If set, Services will check clients when coming back from a netsplit. This can cause a large number
110          * of DNS queries open at once. Whilst services are not drastically affected by this, your nameserver/DNSBL
111          * might care.
112          */
113         check_on_netburst = no
114
115         /*
116          * If set, OperServ will add clients found in the DNSBL to the akill list. Without it, OperServ simply sends
117          * a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
118          */
119         add_to_akill = yes
120
121         blacklist
122         {
123                 /* Name of the blacklist. */
124                 name = "rbl.efnetrbl.org"
125
126                 /* How long to set the ban for. */
127                 time = 4h
128
129                 /* Reason for akill.
130                  * %n is the nick of the user
131                  * %u is the ident/username of the user
132                  * %g is the realname of the user
133                  * %h is the hostname of the user
134                  * %i is the IP of the user
135                  * %r is the reply reason (configured below). Will be nothing if not configured.
136                  * %N is the network name set in networkinfo:networkname
137                  */
138                 reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i=%i for info"
139
140                 /* Replies to ban and their reason. If no replies are configured, all replies get banned. */
141                 reply
142                 {
143                         code = 1
144                         reason = "Open Proxy"
145                 }
146
147                 #reply
148                 {
149                         code = 2
150                         reason = "spamtrap666"
151                 }
152
153                 #reply
154                 {
155                         code = 3
156                         reason = "spamtrap50"
157                 }
158
159                 reply
160                 {
161                         code = 4
162                         reason = "TOR"
163
164                         /*
165                          * If set, users identified to services at the time the result comes back
166                          * will not be banned.
167                          */
168                         #allow_account = yes
169                 }
170
171                 reply
172                 {
173                         code = 5
174                         reason = "Drones / Flooding"
175                 }
176         }
177
178         #blacklist
179         {
180                 name = "dnsbl.dronebl.org"
181                 time = 4h
182                 reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup_branded?ip=%i&network=%N"
183         }
184
185         /* Exempt localhost from DNSBL checks */
186         exempt { ip = "127.0.0.0/8" }
187 }
188
189 /*
190  * m_helpchan
191  *
192  * Gives users who are op in the specified help channel usermode +h (helpop).
193  */
194 #module
195 {
196         name = "m_helpchan"
197
198         helpchannel = "#help"
199 }
200
201 /*
202  * m_httpd
203  *
204  * Allows services to serve web pages. By itself, this module does nothing useful.
205  *
206  * Note that using this will allow users to get the IP of your services.
207  * To prevent this we recommend using a reverse proxy or a tunnel.
208  */
209 #module
210 {
211         name = "m_httpd"
212
213         httpd
214         {
215                 /* Name of this service. */
216                 name = "httpd/main"
217
218                 /* IP to listen on. */
219                 ip = "0.0.0.0"
220
221                 /* Port to listen on. */
222                 port = 8080
223
224                 /* Time before connections to this server are timed out. */
225                 timeout = 30
226
227                 /* Listen using SSL. Requires an SSL module. */
228                 #ssl = yes
229
230                 /* If you are using a reverse proxy that sends one of the
231                  * extforward_headers set below, set this to its IP.
232                  * This allows services to obtain the real IP of users by
233                  * reading the forwarded-for HTTP header.
234                  * Multiple IP addresses can be specified separated by a space character.
235                  */
236                 #extforward_ip = "192.168.0.255 192.168.1.255"
237
238                 /* The header to look for. These probably work as is. */
239                 extforward_header = "X-Forwarded-For Forwarded-For"
240         }
241 }
242
243 /*
244  * m_ldap [EXTRA]
245  *
246  * This module allows other modules to use LDAP. By itself, this module does nothing useful.
247  */
248 #module
249 {
250         name = "m_ldap"
251
252         ldap
253         {
254                 server = "ldap://127.0.0.1"
255
256                 /*
257                  * Admin credentials used for performing searches and adding users.
258                  */
259                 admin_binddn = "cn=Manager,dc=anope,dc=org"
260                 admin_password = "secret"
261         }
262 }
263
264 /*
265  * m_ldap_authentication [EXTRA]
266  *
267  * This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
268  * LDAP to authenticate users. Requires m_ldap.
269 */
270 #module
271 {
272         name = "m_ldap_authentication"
273
274         /*
275          * The distinguished name used for searching for users's accounts.
276          */
277         basedn = "ou=users,dc=anope,dc=org"
278
279         /*
280          * The search filter used to look up users's accounts.
281          * %account is replaced with the user's account.
282          * %object_class is replaced with the object_class configured below.
283          */
284         search_filter = "(&(uid=%account)(objectClass=%object_class))"
285
286         /*
287          * The object class used by LDAP to store user account information.
288          * This is used for adding new users to LDAP if registration is allowed.
289          */
290         object_class = "anopeUser"
291
292         /*
293          * The attribute value used for account names.
294          */
295         username_attribute = "uid"
296
297         /*
298          * The attribute value used for email addresses.
299          * This directive is optional.
300          */
301         email_attribute = "email"
302
303         /*
304          * The attribute value used for passwords.
305          * Used when registering new accounts in LDAP.
306          */
307         password_attribute = "userPassword"
308
309         /*
310          * If set, the reason to give the users who try to register with NickServ,
311          * including nick registration from grouping.
312          *
313          * If not set, then registration is not blocked.
314          */
315         #disable_register_reason = "To register on this network visit https://some.misconfigured.site/register"
316
317         /*
318          * If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
319          * If not set, then email changing is not blocked.
320          */
321         #disable_email_reason = "To change your email address visit https://some.misconfigured.site"
322 }
323
324 /*
325  * m_ldap_oper [EXTRA]
326  *
327  * This module dynamically ties users to Anope opertypes when they identify
328  * via LDAP group membership. Requires m_ldap.
329  *
330  * Note that this doesn't give the user privileges on the IRCd, only in Services.
331  */
332 #module
333 {
334         name = "m_ldap_oper"
335
336         /*
337          * An optional binddn to use when searching for groups.
338          * %a is replaced with the account name of the user.
339          */
340         #binddn = "cn=Manager,dc=anope,dc=org"
341
342         /*
343          * An optional password to bind with.
344          */
345         #password = "secret"
346
347         /*
348          * The base DN where the groups are.
349          */
350         basedn = "ou=groups,dc=anope,dc=org"
351
352         /*
353          * The filter to use when searching for users.
354          * %a is replaced with the account name of the user.
355          */
356         filter = "(member=uid=%a,ou=users,dc=anope,dc=org)"
357
358         /*
359          * The attribute of the group that is the name of the opertype.
360          * The cn attribute should match a known opertype in the config.
361          */
362         opertype_attribute = "cn"
363 }
364
365 /*
366  * m_mysql [EXTRA]
367  *
368  * This module allows other modules to use MySQL.
369  */
370 #module
371 {
372         name = "m_mysql"
373
374         mysql
375         {
376                 /* The name of this service. */
377                 name = "mysql/main"
378                 database = "anope"
379                 server = "127.0.0.1"
380                 username = "anope"
381                 password = "mypassword"
382                 port = 3306
383         }
384 }
385
386 /*
387  * m_redis
388  *
389  * This module allows other modules to use Redis.
390  */
391 #module
392 {
393         name = "m_redis"
394
395         /* A redis database */
396         redis
397         {
398                 /* The name of this service */
399                 name = "redis/main"
400
401                 /*
402                  * The redis database to use. New connections default to 0.
403                  */
404                 db = 0
405
406                 ip = "127.0.0.1"
407                 port = 6379
408         }
409 }
410
411 /*
412  * m_regex_pcre [EXTRA]
413  *
414  * Provides the regex engine regex/pcre, which uses version 1 of the Perl Compatible Regular
415  * Expressions library. This can not be loaded at the same time as the m_regex_pcre2 module.
416  */
417 module { name = "m_regex_pcre" }
418
419 /*
420  * m_regex_pcre2 [EXTRA]
421  *
422  * Provides the regex engine regex/pcre, which uses version 2 of the Perl Compatible Regular
423  * Expressions library. This can not be loaded at the same time as the m_regex_pcre module.
424  */
425 #module { name = "m_regex_pcre2" }
426
427 /*
428  * m_regex_posix [EXTRA]
429  *
430  * Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
431  * This is likely the only regex module you will not need extra libraries for.
432  */
433 #module { name = "m_regex_posix" }
434
435 /*
436  * m_regex_tre [EXTRA]
437  *
438  * Provides the regex engine regex/tre, which uses the TRE regex library.
439  */
440 #module { name = "m_regex_tre" }
441
442 /*
443  * m_rewrite
444  *
445  * Allows rewriting commands sent to/from clients.
446  */
447 #module { name = "m_rewrite" }
448 #command
449 {
450         service = "ChanServ"; name = "CLEAR"; command = "rewrite"
451
452         /* Enable m_rewrite. */
453         rewrite = true
454
455         /* Source message to match. A $ can be used to match anything. */
456         rewrite_source = "CLEAR $ USERS"
457
458         /*
459          * Message to rewrite the source message to. A $ followed by a number, e.g. $0, gets
460          * replaced by the number-th word from the source_message, starting from 0.
461          */
462         rewrite_target = "KICK $1 *"
463
464         /*
465          * The command description. This only shows up in HELP's output.
466          * Comment this option to prevent the command from showing in the
467          * HELP command.
468          */
469         rewrite_description = "Clears all users from a channel"
470 }
471
472 /*
473  * m_proxyscan
474  *
475  * This module allows you to scan connecting clients for open proxies.
476  * Note that using this will allow users to get the IP of your services.
477  *
478  * Currently the two supported proxy types are HTTP and SOCKS5.
479  *
480  * The proxy scanner works by attempting to connect to clients when they
481  * connect to the network, and if they have a proxy running instruct it to connect
482  * back to services. If services are able to connect through the proxy to itself
483  * then it knows it is an insecure proxy, and will ban it.
484  */
485 #module
486 {
487         name = "m_proxyscan"
488
489         /*
490          * The target IP services tells the proxy to connect back to. This must be a publicly
491          * available IP that remote proxies can connect to.
492          */
493         #target_ip = "127.0.0.1"
494
495         /*
496          * The port services tells the proxy to connect to.
497          */
498         target_port = 7226
499
500         /*
501          * The listen IP services listen on for incoming connections from suspected proxies.
502          * This probably will be the same as target_ip, but may not be if you are behind a firewall (NAT).
503          */
504         #listen_ip = "127.0.0.1"
505
506         /*
507          * The port services should listen on for incoming connections from suspected proxies.
508          * This most likely will be the same as target_port.
509          */
510         listen_port = 7226
511
512         /*
513          * An optional notice sent to clients upon connect.
514          */
515         #connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately."
516
517         /*
518          * Who the notice should be sent from.
519          */
520         #connect_source = "OperServ"
521
522         /*
523          * If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
524          * a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being filled up by bots.
525          */
526         add_to_akill = yes
527
528         /*
529          * How long before connections should be timed out.
530          */
531         timeout = 5
532
533         proxyscan
534         {
535                 /* The type of proxy to check for. A comma separated list is allowed. */
536                 type = "HTTP"
537
538                 /* The ports to check. */
539                 port = "80,8080"
540
541                 /* How long to set the ban for. */
542                 time = 4h
543
544                 /*
545                  * The reason to ban the user for.
546                  * %h is replaced with the type of proxy found.
547                  * %i is replaced with the IP of proxy found.
548                  * %p is replaced with the port.
549                  */
550                 reason = "You have an open proxy running on your host (%t:%i:%p)"
551         }
552 }
553
554 /*
555  * m_sasl
556  *
557  * Some IRCds allow "SASL" authentication to let users identify to Services
558  * during the IRCd user registration process. If this module is loaded, Services will allow
559  * authenticating users through this mechanism. Supported mechanisms are:
560  * PLAIN, EXTERNAL.
561  */
562 module { name = "m_sasl" }
563
564 /*
565  * m_ssl_gnutls [EXTRA]
566  *
567  * This module provides SSL services to Anope using GnuTLS, for example to
568  * connect to the uplink server(s) via SSL.
569  *
570  * You may only load either m_ssl_gnutls or m_ssl_openssl, but not both.
571  */
572 #module
573 {
574         name = "m_ssl_gnutls"
575
576         /*
577          * An optional certificate and key for m_ssl_gnutls to give to the uplink.
578          *
579          * You can generate your own certificate and key pair by using:
580          *
581          *   certtool --generate-privkey --bits 2048 --outfile anope.key
582          *   certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
583          *
584          */
585         cert = "data/anope.crt"
586         key = "data/anope.key"
587
588         /*
589          * Diffie-Hellman parameters to use when acting as a server. This is only
590          * required for TLS servers that want to use ephemeral DH cipher suites.
591          *
592          * This is NOT required for Anope to connect to the uplink server(s) via SSL.
593          *
594          * You can generate DH parameters by using:
595          *
596          *   certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
597          *
598          */
599 #       dhparams = "data/dhparams.pem"
600 }
601
602 /*
603  * m_ssl_openssl [EXTRA]
604  *
605  * This module provides SSL services to Anope using OpenSSL, for example to
606  * connect to the uplink server(s) via SSL.
607  *
608  * You may only load either m_ssl_openssl or m_ssl_gnutls, but not both.
609  *
610  */
611 #module
612 {
613         name = "m_ssl_openssl"
614
615         /*
616          * An optional certificate and key for m_ssl_openssl to give to the uplink.
617          *
618          * You can generate your own certificate and key pair by using:
619          *
620          *   openssl genrsa -out anope.key 2048
621          *   openssl req -new -x509 -key anope.key -out anope.crt -days 1095
622          */
623         cert = "data/anope.crt"
624         key = "data/anope.key"
625
626         /*
627          * As of 2014 SSL 3.0 is considered insecure, but it might be enabled
628          * on some systems by default for compatibility reasons.
629          * You can use the following option to enable or disable it explicitly.
630          * Leaving this option not set defaults to the default system behavior.
631          */
632         #sslv3 = no
633 }
634
635 /*
636  * m_sql_authentication [EXTRA]
637  *
638  * This module allows authenticating users against an external SQL database using a custom
639  * query.
640  */
641 #module
642 {
643         name = "m_sql_authentication"
644
645         /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
646         engine = "mysql/main"
647
648         /* Query to execute to authenticate. A non empty result from this query is considered a success,
649          * and the user will be authenticated.
650          *
651          * @a@ is replaced with the user's account name
652          * @p@ is replaced with the user's password
653          * @n@ is replaced with the user's nickname
654          * @i@ is replaced with the user's IP
655          *
656          * Note that @n@ and @i@ may not always exist in the case of a user identifying outside of the normal
657          * nickserv/identify command, such as through the web panel.
658          *
659          * Furthermore, if a field named email is returned from this query the user's email is
660          * set to its value.
661          *
662          *
663          * We've included some example queries for some popular website/forum systems.
664          *
665          * Drupal 6: "SELECT `mail` AS `email` FROM `users` WHERE `name` = @a@ AND `pass` = MD5(@p@) AND `status` = 1"
666          * e107 cms: "SELECT `user_email` AS `email` FROM `e107_user` WHERE `user_loginname` = @a@ AND `user_password` = MD5(@p@)"
667          * SMF Forum: "SELECT `email_address` AS `email` FROM `smf_members` WHERE `member_name` = @a@ AND `passwd` = SHA1(CONCAT(LOWER(@a@), @p@))"
668          * vBulletin: "SELECT `email` FROM `user` WHERE `username` = @a@ AND `password` = MD5(CONCAT(MD5(@p@), `salt`))"
669          * IP.Board: "SELECT `email` FROM `ibf_members` WHERE `name` = @a@ AND `members_pass_hash` = MD5(CONCAT(MD5(`members_pass_salt`), MD5(@p@)))"
670          */
671         query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
672
673         /*
674          * If set, the reason to give the users who try to "/msg NickServ REGISTER".
675          * If not set, then registration is not blocked.
676          */
677         #disable_reason = "To register on this network visit https://some.misconfigured.site/register"
678
679         /*
680          * If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
681          * If not set, then email changing is not blocked.
682          */
683         #disable_email_reason = "To change your email address visit https://some.misconfigured.site"
684 }
685
686 /*
687  * m_sql_log [EXTRA]
688  *
689  * This module adds an additional target option to log{} blocks
690  * that allows logging Service's logs to SQL. To log to SQL, add
691  * the SQL service name to log:targets prefixed by sql_log:. For
692  * example:
693  *
694  * log
695  * {
696  *     targets = "services.log sql_log:mysql/main"
697  *     ...
698  * }
699  *
700  * By default this module logs to the table `logs`, and will create
701  * it if it doesn't exist. This module does not create any indexes (keys)
702  * on the table and it is recommended you add them yourself as necessary.
703  */
704 #module { name = "m_sql_log" }
705
706 /*
707  * m_sql_oper [EXTRA]
708  *
709  * This module allows granting users services operator privileges and possibly IRC Operator
710  * privileges based on an external SQL database using a custom query.
711  */
712 #module
713 {
714         name = "m_sql_oper"
715
716         /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
717         engine = "mysql/main"
718
719         /* Query to execute to determine if a user should have operator privileges.
720          * A field named opertype must be returned in order to link the user to their oper type.
721          * The oper types must be configured earlier in services.conf.
722          *
723          * If a field named modes is returned from this query then those modes are set on the user.
724          * Without this, only a simple +o is sent.
725          *
726          * @a@ is replaced with the user's account name
727          * @i@ is replaced with the user's IP
728          */
729         query = "SELECT `opertype` FROM `my_users` WHERE `user_name` = @a@"
730 }
731
732 /*
733  * m_sqlite [EXTRA]
734  *
735  * This module allows other modules to use SQLite.
736  */
737 module
738 {
739         name = "m_sqlite"
740
741         /* A SQLite database */
742         sqlite
743         {
744                 /* The name of this service. */
745                 name = "sqlite/main"
746
747                 /* The database name, it will be created if it does not exist. */
748                 database = "anope.sqlite"
749         }
750 }
751
752 /*
753  * m_xmlrpc
754  *
755  * Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
756  * By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
757  */
758 #module
759 {
760         name = "m_xmlrpc"
761
762         /* Web service to use. Requires m_httpd. */
763         server = "httpd/main"
764 }
765
766 /*
767  * m_xmlrpc_main
768  *
769  * Adds the main XMLRPC core functions.
770  * Requires m_xmlrpc.
771  */
772 #module { name = "m_xmlrpc_main" }