Connecting Inspircd and Anope on Docker-Swarm

I encountered some issues when connecting Anope and Inspircd on the docker swarm. When running them on a single node using docker-compose, the services were able to connect just fine to Inspircd, however running in a docker swarm, there were issues in how Inspircd was filtering IPs in the default services XML block.

In order for Inspircd and Anope to talk I had to comment out some of the link block for the services. The allowmask and expected IP address didn’t quite work as intended inside the docker swarm cluster. Since the containers use a local network available to only them, I’m not worried about a rogue services server getting in. This IRC server is also primarily used for developing and testing the IRC bots I have written over the years, so its not a core part of my infrastructure. Below shows the link block that I modified from the default included in the inspircd docker container setup.

<link name="${INSP_SERVICES_NAME}"
      port="7000"
      hidden="${INSP_SERVICES_HIDDEN:-no}"
      sendpass="${INSP_SERVICES_SENDPASS}"
      recvpass="${INSP_SERVICES_RECVPASS}"
      ${INSP_SERVICES_OPTIONS}>

<uline server="$INSP_SERVICES_NAME" silent="yes">

<module name="m_sasl.so">
<sasl target="$INSP_SERVICES_NAME">
EOF
fi
#      allowmask="${INSP_SERVICES_ALLOWMASK}"
#      ipaddr="${INSP_SERVICES_IPADDR:-services}"

The entire IRC stack also includes qwebirc for a simple webchat interface. Below is the docker-compose file used to start up all of these services.

services:
  inspircd:
    image: inspircd/inspircd-docker
    volumes:
      - /mnt/data/Inspircd:/inspircd/conf/
    ports:
      - "6667:6667"
      - "6697:6697"
    environment:
      - INSP_SERVICES_NAME=services.localhost.net
      - INSP_SERVICES_IPADDR=anope
      - INSP_SERVICES_SENDPASS=changemetoo
      - INSP_SERVICES_RECVPASS=changemetoo
      - INSP_SERVICES_TLS_ON=no
    restart: always

  anope:
    image: anope/anope
    volumes:
      - /mnt/data/Anope:/anope/conf
      - /mnt/data/Anope/data:/data
    depends_on:
      - "inspircd"
    environment:
      - ANOPE_UPLINK_IP=inspircd
      - ANOPE_UPLINK_PASSWORD=changemetoo
      - ANOPE_SERVICES_NAME=services.localhost.net
      - ANOPE_UPLINK_PORT=7000
      - ANOPE_SQL_ENGINE=mysql
      - ANOPE_MYSQL_DB=anope
      - ANOPE_MYSQL_HOST=192.168.1.123
      - ANOPE_MYSQL_PORT=3306
      - ANOPE_MYSQL_USER=anope
      - ANOPE_MYSQL_PASSWORD=changeme
      - ANOPE_SQL_LIVE=yes
    restart: always

  webchat:
    image: 127.0.0.1:5000/qwebirc
    ports:
      - "9090:9090"
    depends_on:
      - "inspircd"
    environment:
      - QWEBIRC_SERVER=inspircd
      - QWEBIRC_PORT=6667
      - QWEBIRC_NETWORK_NAME=SkyNet