]> git.somenet.org - root/pub/somesible.git/blob - roles/server/irc-services/files/default/modules.conf
[roles/server/irc-services] install anope
[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-2024 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 must be enabled prior to compiling by
17  * running the 'extras' script on Linux and UNIX.
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 http://rbl.efnetrbl.org/?i=%i for info"
139
140                 /* Replies to ban and their reason. If no relies 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 http://dronebl.org/lookup_branded?ip=%i&network=%N"
183         }
184
185         /* Exempt localhost from DNSBL checks */
186         exempt { ip = "127.0.0.1" }
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                  */
235                 #extforward_ip = "192.168.0.255"
236
237                 /* The header to look for. These probably work as is. */
238                 extforward_header = "X-Forwarded-For Forwarded-For"
239         }
240 }
241
242 /*
243  * m_ldap [EXTRA]
244  *
245  * This module allows other modules to use LDAP. By itself, this module does nothing useful.
246  */
247 #module
248 {
249         name = "m_ldap"
250
251         ldap
252         {
253                 server = "ldap://127.0.0.1"
254                 port = 389
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 http://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 http://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  * m_redis
387  *
388  * This module allows other modules to use Redis.
389  */
390 #module
391 {
392         name = "m_redis"
393
394         /* A redis database */
395         redis
396         {
397                 /* The name of this service */
398                 name = "redis/main"
399
400                 /*
401                  * The redis database to use. New connections default to 0.
402                  */
403                 db = 0
404
405                 ip = "127.0.0.1"
406                 port = 6379
407         }
408 }
409
410 /*
411  * m_regex_pcre [EXTRA]
412  *
413  * Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
414  */
415 #module { name = "m_regex_pcre" }
416
417 /*
418  * m_regex_posix [EXTRA]
419  *
420  * Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
421  * This is likely the only regex module you will not need extra libraries for.
422  */
423 module { name = "m_regex_posix" }
424
425 /*
426  * m_regex_tre [EXTRA]
427  *
428  * Provides the regex engine regex/tre, which uses the TRE regex library.
429  */
430 #module { name = "m_regex_tre" }
431
432 /*
433  * m_rewrite
434  *
435  * Allows rewriting commands sent to/from clients.
436  */
437 #module { name = "m_rewrite" }
438 #command
439 {
440         service = "ChanServ"; name = "CLEAR"; command = "rewrite"
441
442         /* Enable m_rewrite. */
443         rewrite = true
444
445         /* Source message to match. A $ can be used to match anything. */
446         rewrite_source = "CLEAR $ USERS"
447
448         /*
449          * Message to rewrite the source message to. A $ followed by a number, eg $0, gets
450          * replaced by the number-th word from the source_message, starting from 0.
451          */
452         rewrite_target = "KICK $1 *"
453
454         /*
455          * The command description. This only shows up in HELP's output.
456          * Comment this option to prevent the command from showing in the
457          * HELP command.
458          */
459         rewrite_description = "Clears all users from a channel"
460 }
461
462 /*
463  * m_proxyscan
464  *
465  * This module allows you to scan connecting clients for open proxies.
466  * Note that using this will allow users to get the IP of your services.
467  *
468  * Currently the two supported proxy types are HTTP and SOCKS5.
469  *
470  * The proxy scanner works by attempting to connect to clients when they
471  * connect to the network, and if they have a proxy running instruct it to connect
472  * back to services. If services are able to connect through the proxy to itself
473  * then it knows it is an insecure proxy, and will ban it.
474  */
475 #module
476 {
477         name = "m_proxyscan"
478
479         /*
480          * The target IP services tells the proxy to connect back to. This must be a publicly
481          * available IP that remote proxies can connect to.
482          */
483         #target_ip = "127.0.0.1"
484
485         /*
486          * The port services tells the proxy to connect to.
487          */
488         target_port = 7226
489
490         /*
491          * The listen IP services listen on for incoming connections from suspected proxies.
492          * This probably will be the same as target_ip, but may not be if you are behind a firewall (NAT).
493          */
494         #listen_ip = "127.0.0.1"
495
496         /*
497          * The port services should listen on for incoming connections from suspected proxies.
498          * This most likely will be the same as target_port.
499          */
500         listen_port = 7226
501
502         /*
503          * An optional notice sent to clients upon connect.
504          */
505         #connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately."
506
507         /*
508          * Who the notice should be sent from.
509          */
510         #connect_source = "OperServ"
511
512         /*
513          * If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
514          * 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.
515          */
516         add_to_akill = yes
517
518         /*
519          * How long before connections should be timed out.
520          */
521         timeout = 5
522
523         proxyscan
524         {
525                 /* The type of proxy to check for. A comma separated list is allowed. */
526                 type = "HTTP"
527
528                 /* The ports to check. */
529                 port = "80,8080"
530
531                 /* How long to set the ban for. */
532                 time = 4h
533
534                 /*
535                  * The reason to ban the user for.
536                  * %h is replaced with the type of proxy found.
537                  * %i is replaced with the IP of proxy found.
538                  * %p is replaced with the port.
539                  */
540                 reason = "You have an open proxy running on your host (%t:%i:%p)"
541         }
542 }
543
544 /*
545  * m_sasl
546  *
547  * Some IRCds allow "SASL" authentication to let users identify to Services
548  * during the IRCd user registration process. If this module is loaded, Services will allow
549  * authenticating users through this mechanism. Supported mechanisms are:
550  * PLAIN, EXTERNAL.
551  */
552 module { name = "m_sasl" }
553
554 /*
555  * m_sasl_dh-aes [EXTRA]
556  *
557  * Add the DH-AES mechanism to SASL.
558  * Requires m_sasl to be loaded.
559  * Requires openssl.
560  */
561 module { name = "m_sasl_dh-aes" }
562
563 /*
564  * m_sasl_dh-blowfish [EXTRA]
565  *
566  * Add the DH-BLOWFISH mechanism to SASL.
567  * Requires m_sasl to be loaded.
568  * Requires openssl.
569  */
570 module { name = "m_sasl_dh-blowfish" }
571
572 /*
573  * m_ssl_gnutls [EXTRA]
574  *
575  * This module provides SSL services to Anope using GnuTLS, for example to
576  * connect to the uplink server(s) via SSL.
577  *
578  * You may only load either m_ssl_gnutls or m_ssl_openssl, bot not both.
579  */
580 #module
581 {
582         name = "m_ssl_gnutls"
583
584         /*
585          * An optional certificate and key for m_ssl_gnutls to give to the uplink.
586          *
587          * You can generate your own certificate and key pair by using:
588          *
589          *   certtool --generate-privkey --bits 2048 --outfile anope.key
590          *   certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
591          *
592          */
593         cert = "data/anope.crt"
594         key = "data/anope.key"
595
596         /*
597          * Diffie-Hellman parameters to use when acting as a server. This is only
598          * required for TLS servers that want to use ephemeral DH cipher suites.
599          *
600          * This is NOT required for Anope to connect to the uplink server(s) via SSL.
601          *
602          * You can generate DH parameters by using:
603          *
604          *   certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
605          *
606          */
607 #       dhparams = "data/dhparams.pem"
608 }
609
610 /*
611  * m_ssl_openssl [EXTRA]
612  *
613  * This module provides SSL services to Anope using OpenSSL, for example to
614  * connect to the uplink server(s) via SSL.
615  *
616  * You may only load either m_ssl_openssl or m_ssl_gnutls, bot not both.
617  *
618  */
619 #module
620 {
621         name = "m_ssl_openssl"
622
623         /*
624          * An optional certificate and key for m_ssl_openssl to give to the uplink.
625          *
626          * You can generate your own certificate and key pair by using:
627          *
628          *   openssl genrsa -out anope.key 2048
629          *   openssl req -new -x509 -key anope.key -out anope.crt -days 1095
630          */
631         cert = "data/anope.crt"
632         key = "data/anope.key"
633
634         /*
635          * As of 2014 SSL 3.0 is considered insecure, but it might be enabled
636          * on some systems by default for compatibility reasons.
637          * You can use the following option to enable or disable it explicitly.
638          * Leaving this option not set defaults to the default system behavior.
639          */
640         #sslv3 = no
641 }
642
643 /*
644  * m_sql_authentication [EXTRA]
645  *
646  * This module allows authenticating users against an external SQL database using a custom
647  * query.
648  */
649 #module
650 {
651         name = "m_sql_authentication"
652
653         /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
654         engine = "mysql/main"
655
656         /* Query to execute to authenticate. A non empty result from this query is considered a success,
657          * and the user will be authenticated.
658          *
659          * @a@ is replaced with the user's account name
660          * @p@ is replaced with the user's password
661          * @n@ is replaced with the user's nickname
662          * @i@ is replaced with the user's IP
663          *
664          * Note that @n@ and @i@ may not always exist in the case of a user identifying outside of the normal
665          * nickserv/identify command, such as through the web panel.
666          *
667          * Furthermore, if a field named email is returned from this query the user's email is
668          * set to its value.
669          *
670          *
671          * We've included some example queries for some popular website/forum systems.
672          *
673          * Drupal 6: "SELECT `mail` AS `email` FROM `users` WHERE `name` = @a@ AND `pass` = MD5(@p@) AND `status` = 1"
674          * e107 cms: "SELECT `user_email` AS `email` FROM `e107_user` WHERE `user_loginname` = @a@ AND `user_password` = MD5(@p@)"
675          * SMF Forum: "SELECT `email_address` AS `email` FROM `smf_members` WHERE `member_name` = @a@ AND `passwd` = SHA1(CONCAT(LOWER(@a@), @p@))"
676          * vBulletin: "SELECT `email` FROM `user` WHERE `username` = @a@ AND `password` = MD5(CONCAT(MD5(@p@), `salt`))"
677          * IP.Board: "SELECT `email` FROM `ibf_members` WHERE `name` = @a@ AND `members_pass_hash` = MD5(CONCAT(MD5(`members_pass_salt`), MD5(@p@)))"
678          */
679         query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
680
681         /*
682          * If set, the reason to give the users who try to "/msg NickServ REGISTER".
683          * If not set, then registration is not blocked.
684          */
685         #disable_reason = "To register on this network visit http://some.misconfigured.site/register"
686
687         /*
688          * If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
689          * If not set, then email changing is not blocked.
690          */
691         #disable_email_reason = "To change your email address visit http://some.misconfigured.site"
692 }
693
694 /*
695  * m_sql_log [EXTRA]
696  *
697  * This module adds an additional target option to log{} blocks
698  * that allows logging Service's logs to SQL. To log to SQL, add
699  * the SQL service name to log:targets prefixed by sql_log:. For
700  * example:
701  *
702  * log
703  * {
704  *     targets = "services.log sql_log:mysql/main"
705  *     ...
706  * }
707  *
708  * By default this module logs to the table `logs`, and will create
709  * it if it doesn't exist. This module does not create any indexes (keys)
710  * on the table and it is recommended you add them yourself as necessary.
711  */
712 #module { name = "m_sql_log" }
713
714 /*
715  * m_sql_oper [EXTRA]
716  *
717  * This module allows granting users services operator privileges and possibly IRC Operator
718  * privileges based on an external SQL database using a custom query.
719  */
720 #module
721 {
722         name = "m_sql_oper"
723
724         /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
725         engine = "mysql/main"
726
727         /* Query to execute to determine if a user should have operator privileges.
728          * A field named opertype must be returned in order to link the user to their oper type.
729          * The oper types must be configured earlier in services.conf.
730          *
731          * If a field named modes is returned from this query then those modes are set on the user.
732          * Without this, only a simple +o is sent.
733          *
734          * @a@ is replaced with the user's account name
735          * @i@ is replaced with the user's IP
736          */
737         query = "SELECT `opertype` FROM `my_users` WHERE `user_name` = @a@"
738 }
739
740 /*
741  * m_sqlite [EXTRA]
742  *
743  * This module allows other modules to use SQLite.
744  */
745 #module
746 {
747         name = "m_sqlite"
748
749         /* A SQLite database */
750         sqlite
751         {
752                 /* The name of this service. */
753                 name = "sqlite/main"
754
755                 /* The database name, it will be created if it does not exist. */
756                 database = "anope.db"
757         }
758 }
759
760 /*
761  * webcpanel
762  *
763  * This module creates a web configuration panel that allows users and operators to perform any task
764  * as they could over IRC. If you are using the default configuration you should be able to access
765  * this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
766  *
767  * This module requires m_httpd.
768  */
769 #module
770 {
771         name = "webcpanel"
772
773         /* Web server to use. */
774         server = "httpd/main";
775
776         /* Template to use. */
777         template = "default";
778
779         /* Page title. */
780         title = "Anope IRC Services";
781 }
782
783 /*
784  * m_xmlrpc
785  *
786  * Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
787  * By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
788  */
789 #module
790 {
791         name = "m_xmlrpc"
792
793         /* Web service to use. Requires m_httpd. */
794         server = "httpd/main"
795 }
796
797 /*
798  * m_xmlrpc_main
799  *
800  * Adds the main XMLRPC core functions.
801  * Requires m_xmlrpc.
802  */
803 #module { name = "m_xmlrpc_main" }