Documentation for our configuration manager.

Configuration

You will need to setup your configurations how you want them based on the example configurations provided by InspIRCd. This will operate as a base configuration for your network so setup your configurations how you want them, then proceed to the configuration management step. Make sure you use absolute paths for all includes.

Remember that while you are building your configuration you will want to place certain variables which will be used when generating the final configuration file for the program.

Variables

  • &ipv4-addr; - Put this wherever you need the IPv4 address of the server.
  • &ipv6-addr; - Put this wherever you need the IPv6 address of the server.
  • &network-name; - Put this wherever you need the network name.
  • &server; - Put this wherever you need the server address (eg- hostname.example.com)
  • &adminName; - Put this wherever you need the name of the admin for the server.
  • &adminNick; - Put this wherever you need the nickname of the admin for the server.
  • &adminEmail; - Put this wherever you need the email of the admin for the server.

InspIRCd configuration example

Final Configuration

Once your configuration is done your directory structure should look something like this:

|- conf
|\- base
| \- inspircd.conf
|\- sync
| |- modules.conf
| |- opers.conf
| \- rules.txt
\- .gitignore

Make sure you saved your inspircd.conf in the base directory.
The setup above would need a .gitignore file which would look something like this:
.gitignore:

./local
./inspircd.conf
*.pid

Configuration Management

### Preparing configurations for deployment You will need to setup a git repository (if it’s not private, you’re doing it wrong). Once your git repo is setup simply push your configs out to the repo. The structure of your configuration files should look like the one shown above minus the local directory which will be created on a per-server basis.
Make sure to setup deploy keys on your repository for your configuration for the irc account on each server that you setup otherwise you won’t be able to pull the configuration files.

config-manager Setup

You will need to open up a root terminal again and type the following commands:

$ su - irc # login to irc user
$ ssh-keygen
$ cat $HOME/.ssh/id_rsa.pub # copy the public key for later use.
$ exit # logout of irc user
$ mkdir /opt/config-manager
$ wget https://gitlab.com/BuddyIM/scripts/raw/master/config-manager/pull.js -O /opt/config-manager/pull.js
$ wget https://gitlab.com/BuddyIM/scripts/raw/master/config-manager/config.json -O /opt/config-manager/config.json
$ npm install --save fs replaceall simple-git
$ su - irc # login to irc user
$ cd /opt/inspircd/conf
$ rm -rf examples
$ git clone <[email protected]:config/path> . # git clone the configuration repository that you setup above.
$ mkdir local/
$ touch local/links.conf local/motd.txt local/opers.conf local/ssl.cert local/ssl.key inspircd.conf # be sure to actually edit these files too!
$ exit # end session as irc user.

Deploy configurations

The configuration file for config-manager is stored at /opt/config-manager/config.json and needs to be edited before you continue to the next step…

The configuration file at /opt/inspircd/conf/inspircd.conf should look something like this:

<include executable="/usr/bin/node /opt/config-manager/pull.js">
<include file="/opt/inspircd/conf/sync/modules.conf">
<include file="/opt/inspircd/conf/sync/opers.conf">
<include file="/opt/inspircd/conf/local/opers.conf">
<include file="/opt/inspircd/conf/local/links.conf">

Make sure the path to your nodejs install is correct, sometimes it is /usr/bin/nodejs instead of /usr/bin/node. In that case you will either need to create a symlink (recommended) or change the executable include to point to the correct path.

Tags: