From a8694d4ad841480a928f213d61f59b5e2648e605 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 May 2020 14:46:47 +0200 Subject: [PATCH] Initial commit, still needs configuration --- .gitignore | 1 + tasks/main.yml | 29 ++ templates/build.conf.j2 | 19 + templates/inspircd.conf.j2 | 632 ++++++++++++++++++++++++++++++++++ templates/inspircd.service.j2 | 26 ++ templates/main.motd.j2 | 17 + 6 files changed, 724 insertions(+) create mode 100644 .gitignore create mode 100644 tasks/main.yml create mode 100644 templates/build.conf.j2 create mode 100644 templates/inspircd.conf.j2 create mode 100644 templates/inspircd.service.j2 create mode 100644 templates/main.motd.j2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4dc51e8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vault/ diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..1f79f55 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,29 @@ +- name: Include sensitive info + include_vars: + dir: '{{ role_path }}/vault' + tags: + - vault + - inspircd +- name: Copy files + loop: + - { src: 'build.conf', dest: '{{ inspircd.paths.build }}/.configure/cache.cfg', mode: '655' } + - { src: 'inspircd.conf', dest: '{{ inspircd.paths.config }}/conf/inspircd.conf', mode: '600' } + - { src: 'main.motd', dest: '{{ inspircd.paths.config }}/conf/main.motd', mode: '655' } + - { src: 'inspircd.service', dest: '/etc/systemd/system/inspircd.service', mode: '655' } + template: + follow: yes + src: '{{ item.src }}.j2' + dest: '{{ item.dest }}' + mode: '{{ item.mode }}' + notify: Run service actions + tags: + - configs + - vault + - inspircd +- name: Build inspricd + make: + chdir: '{{ inspircd.paths.build }}' + target: 'install' + tags: + - build + - inspircd diff --git a/templates/build.conf.j2 b/templates/build.conf.j2 new file mode 100644 index 0000000..1332eb9 --- /dev/null +++ b/templates/build.conf.j2 @@ -0,0 +1,19 @@ +BASE_DIR {{ inspircd.paths.config }}/run +SOCKETENGINE epoll +DATA_DIR {{ inspircd.paths.config }}/run/data +HAS_CLOCK_GETTIME 1 +VERSION 1 +LOG_DIR {{ inspircd.paths.config }}/run/logs +MODULE_DIR {{ inspircd.paths.config }}/run/modules +MANUAL_DIR {{ inspircd.paths.config }}/run/manuals +GROUP nogroup +UID 65534 +CXX c++ +EXAMPLE_DIR {{ inspircd.paths.config }}/run/conf/examples +GID 65534 +BINARY_DIR {{ inspircd.paths.config }}/run/bin +USER nogroup +SCRIPT_DIR {{ inspircd.paths.config }}/run +CONFIG_DIR {{ inspircd.paths.config }}/run/conf +HAS_ARC4RANDOM_BUF +HAS_EVENTFD 1 diff --git a/templates/inspircd.conf.j2 b/templates/inspircd.conf.j2 new file mode 100644 index 0000000..b0ff4ad --- /dev/null +++ b/templates/inspircd.conf.j2 @@ -0,0 +1,632 @@ + + +# + + +#-#-#-#-#-#-#-#-#-#-#-#- SERVER DESCRIPTION -#-#-#-#-#-#-#-#-#-#-#-#- +# # +# Here is where you enter the information about your server. # +# # + + + + +#-#-#-#-#-#-#-#-#-#-#-#- ADMIN INFORMATION -#-#-#-#-#-#-#-#-#-#-#-# +# # +# Describes the Server Administrator's real name (optionally), # +# nick, and email address. # +# # + + + +{% for binds in inspircd.bind %} + +{% endfor %} +#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# +# # +# This is where you can configure which connections are allowed # +# and denied access onto your server. The password is optional. # +# You may have as many of these as you require. To allow/deny all # +# connections, use a '*' or 0.0.0.0/0. # +# # +# -- It is important to note that connect tags are read from the -- # +# TOP DOWN. This means that you should have more specific deny # +# and allow tags at the top, progressively more general, followed # +# by a # + + + #hash="&connecthash;" + + # password: Password to use for this block/user(s) + #password="&connectpassword;" + + # maxchans: Maximum number of channels a user in this class + # be in at one time. This overrides every other maxchans setting. + #maxchans="30" + + # timeout: How long (in seconds) the server will wait before + # disconnecting a user if they do not do anything on connect. + # (Note, this is a client-side thing, if the client does not + # send /nick, /user or /pass) + timeout="10" + + # pingfreq: How often (in seconds) the server tries to ping connecting clients. + pingfreq="120" + + # hardsendq: maximum amount of data allowed in a client's send queue + # before they are dropped. Keep this value higher than the length of + # your network's /LIST or /WHO output, or you will have lots of + # disconnects from sendq overruns! + # Setting this to "1M" is equivalent to "1048576", "8K" is 8192, etc. + hardsendq="1M" + + # softsendq: amount of data in a client's send queue before the server + # begins delaying their commands in order to allow the sendq to drain + softsendq="8192" + + # recvq: amount of data allowed in a client's queue before they are dropped. + # Entering "8K" is equivalent to "8192", see above. + recvq="8K" + + # threshold: This specifies the amount of command penalty a user is allowed to have + # before being quit or fakelagged due to flood. Normal commands have a penalty of 1, + # ones such as /OPER have penalties up to 10. + # + # If you are not using fakelag, this should be at least 20 to avoid excess flood kills + # from processing some commands. + threshold="10" + + # commandrate: This specifies the maximum rate that commands can be processed. + # If commands are sent more rapidly, the user's penalty will increase and they will + # either be fakelagged or killed when they reach the threshold + # + # Units are millicommands per second, so 1000 means one line per second. + commandrate="1000" + + # fakelag: Use fakelag instead of killing users for excessive flood + # + # Fake lag stops command processing for a user when a flood is detected rather than + # immediately killing them; their commands are held in the recvq and processed later + # as the user's command penalty drops. Note that if this is enabled, flooders will + # quit with "RecvQ exceeded" rather than "Excess Flood". + fakelag="on" + + # localmax: Maximum local connections per IP. + localmax="3" + + # globalmax: Maximum global (network-wide) connections per IP. + globalmax="30" + + # useident: Defines if users in this class must respond to a ident query or not. + useident="no" + + # usednsbl: Defines whether or not users in this class are subject to DNSBL. Default is yes. + # This setting only has effect when m_dnsbl is loaded. + #usednsbl="&usednsbl;" + + # limit: How many users are allowed in this class + limit="5000" + + # modes: Usermodes that are set on users in this block on connect. + # Enabling this option requires that the m_conn_umodes module be loaded. + # This entry is highly recommended to use for/with IP Cloaking/masking. + # For the example to work, this also requires that the m_cloaking + # module be loaded as well. + modes="+x"> + + +#-#-#-#-#-#-#-#-#-#-#-#- CIDR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#- +# # +# CIDR configuration allows detection of clones and applying of # +# throttle limits across a CIDR range. (A CIDR range is a group of # +# IPs, for example, the CIDR range 192.168.1.0-192.168.1.255 may be # +# represented as 192.168.1.0/24). This means that abuse across an ISP # +# is detected and curtailed much easier. Here is a good chart that # +# shows how many IPs the different CIDRs correspond to: # +# http://en.wikipedia.org/wiki/CIDR#Prefix_aggregation # +# # + + + + +#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-# +# # + +# Files block - contains files whose contents are used by the ircd +# +# motd - displayed on connect and when a user executes /MOTD +# rules - displayed when the user executes /RULES +# Modules can also define their own files + + + +#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Settings to define which features are usable on your server. # +# # + + + + # suffixpart: What (if anything) users' part message + # should be suffixed with. + suffixpart=""" + + # fixedquit: Set all users' quit messages to this value. + #fixedquit="" + + # fixedpart: Set all users' part messages in all channels + # to this value. + #fixedpart="" + + # syntaxhints: If enabled, if a user fails to send the correct parameters + # for a command, the ircd will give back some help text of what + # the correct parameters are. + syntaxhints="no" + + # cyclehosts: If enabled, when a user gets a host set, it will cycle + # them in all their channels. If not, it will simply change their host + # without cycling them. + cyclehosts="yes" + + # cyclehostsfromuser: If enabled, the source of the mode change for + # cyclehosts will be the user who cycled. This can look nicer, but + # triggers anti-takeover mechanisms of some obsolete bots. + cyclehostsfromuser="no" + + # ircumsgprefix: Use undernet-style message prefixing for NOTICE and + # PRIVMSG. If enabled, it will add users' prefix to the line, if not, + # it will just message the user normally. + ircumsgprefix="no" + + # announcets: If set to yes, when the timestamp on a channel changes, all users + # in the channel will be sent a NOTICE about it. + announcets="yes" + + # allowmismatch: Setting this option to yes will allow servers to link even + # if they don't have the same "optionally common" modules loaded. Setting this to + # yes may introduce some desyncs and unwanted behaviour. + allowmismatch="no" + + # defaultbind: Sets the default for tags without an address. Choices are + # ipv4 or ipv6; if not specified, IPv6 will be used if your system has support, + # falling back to IPv4 otherwise. + defaultbind="auto" + + # hostintopic: If enabled, channels will show the host of the topic setter + # in the topic. If set to no, it will only show the nick of the topic setter. + hostintopic="yes" + + # pingwarning: If a server does not respond to a ping within x seconds, + # it will send a notice to opers with snomask +l informing that the server + # is about to ping timeout. + pingwarning="15" + + # serverpingfreq: How often pings are sent between servers (in seconds). + serverpingfreq="60" + + # defaultmodes: What modes are set on a empty channel when a user + # joins it and it is unregistered. + defaultmodes="nt" + + # moronbanner: This is the text that is sent to a user when they are + # banned from the server. + moronbanner="You're banned! Email abuse@example.com with the ERROR line below for help." + + # exemptchanops: exemptions for channel access restrictions based on prefix. + exemptchanops="nonick:v flood:o" + + # invitebypassmodes: This allows /invite to bypass other channel modes. + # (Such as +k, +j, +l, etc.) + invitebypassmodes="yes" + + # nosnoticestack: This prevents snotices from 'stacking' and giving you + # the message saying '(last message repeated X times)'. Defaults to no. + nosnoticestack="no" + + # welcomenotice: When turned on, this sends a NOTICE to connecting users + # with the text Welcome to ! after successful registration. + # Defaults to yes. + welcomenotice="yes"> + + +#-#-#-#-#-#-#-#-#-#-#-# PERFORMANCE CONFIGURATION #-#-#-#-#-#-#-#-#-#-# +# # + + + +#-#-#-#-#-#-#-#-#-#-#-# SECURITY CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-# +# # + +