{"id":273,"date":"2020-09-10T22:25:00","date_gmt":"2020-09-10T22:25:00","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=273"},"modified":"2020-09-12T03:30:58","modified_gmt":"2020-09-12T03:30:58","slug":"connecting-inspircd-and-anope-on-docker-swarm","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=273","title":{"rendered":"Connecting Inspircd and Anope on Docker-Swarm"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>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&#8217;t quite work as intended inside the docker swarm cluster. Since the containers use a local network available to only them, I&#8217;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.<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;link name=\"${INSP_SERVICES_NAME}\"\n      port=\"7000\"\n      hidden=\"${INSP_SERVICES_HIDDEN:-no}\"\n      sendpass=\"${INSP_SERVICES_SENDPASS}\"\n      recvpass=\"${INSP_SERVICES_RECVPASS}\"\n      ${INSP_SERVICES_OPTIONS}&gt;\n\n&lt;uline server=\"$INSP_SERVICES_NAME\" silent=\"yes\"&gt;\n\n&lt;module name=\"m_sasl.so\"&gt;\n&lt;sasl target=\"$INSP_SERVICES_NAME\"&gt;\nEOF\nfi\n#      allowmask=\"${INSP_SERVICES_ALLOWMASK}\"\n#      ipaddr=\"${INSP_SERVICES_IPADDR:-services}\"<\/pre>\n\n\n\n<p>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.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">services:\n  inspircd:\n    image: inspircd\/inspircd-docker\n    volumes:\n      - \/mnt\/data\/Inspircd:\/inspircd\/conf\/\n    ports:\n      - \"6667:6667\"\n      - \"6697:6697\"\n    environment:\n      - INSP_SERVICES_NAME=services.localhost.net\n      - INSP_SERVICES_IPADDR=anope\n      - INSP_SERVICES_SENDPASS=changemetoo\n      - INSP_SERVICES_RECVPASS=changemetoo\n      - INSP_SERVICES_TLS_ON=no\n    restart: always\n\n  anope:\n    image: anope\/anope\n    volumes:\n      - \/mnt\/data\/Anope:\/anope\/conf\n      - \/mnt\/data\/Anope\/data:\/data\n    depends_on:\n      - \"inspircd\"\n    environment:\n      - ANOPE_UPLINK_IP=inspircd\n      - ANOPE_UPLINK_PASSWORD=changemetoo\n      - ANOPE_SERVICES_NAME=services.localhost.net\n      - ANOPE_UPLINK_PORT=7000\n      - ANOPE_SQL_ENGINE=mysql\n      - ANOPE_MYSQL_DB=anope\n      - ANOPE_MYSQL_HOST=192.168.1.123\n      - ANOPE_MYSQL_PORT=3306\n      - ANOPE_MYSQL_USER=anope\n      - ANOPE_MYSQL_PASSWORD=changeme\n      - ANOPE_SQL_LIVE=yes\n    restart: always\n\n  webchat:\n    image: 127.0.0.1:5000\/qwebirc\n    ports:\n      - \"9090:9090\"\n    depends_on:\n      - \"inspircd\"\n    environment:\n      - QWEBIRC_SERVER=inspircd\n      - QWEBIRC_PORT=6667\n      - QWEBIRC_NETWORK_NAME=SkyNet<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Inspircd and Anope were relatively easy to configure together with docker-compose, but moving to a docker swarm proved to have its own challenges <\/p>\n","protected":false},"author":1,"featured_media":279,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[32,13,33,14],"class_list":["post-273","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","tag-clusters","tag-docker","tag-irc","tag-quick-bites"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273"}],"version-history":[{"count":5,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/273\/revisions"}],"predecessor-version":[{"id":396,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/273\/revisions\/396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/media\/279"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}