4 setup
Deon George edited this page 2021-08-18 00:37:05 +00:00

Run Time Configuration

Since docker implies that containers are ephemeral, you need to provide some persistant storage, so that your configuration and data (which would be mail/files in transit) remains after the container is stopped and removed.

When you first start the container, the init script will make copies of a default config into specific directories (if there is no config there already). So when you provide an empty path, after starting the container there will be some configuration files there as your starting point.

These defaults are often not enough for each of the services to run, so you'll need to edit these configs after they are created.

Supervisor is starting the various services inside the container, and below is the path to the configuration file expected.

Mounts Required for Services and Default Ports

Service Path Port
binkd /etc/binkd 24554
qico /etc/qico 60179
ifcico /etc/ifmail 60177
hpt /etc/ftn -
jamnntpd /etc/jamnntpd 119
cron (daily) /etc/cron.daily -
zerotier /var/lib/zerotier-one -

This mounts are normally provided by the -v start command when starting a container.

The ports used by the services can be overridden by the -p for the host side or container side (and if you change the container side, you'll need to update the configuration file for the respective service).

NGINX is also used in the container, and it will forward anything coming from 24553 (TLS) to 24554 (non-TLS). You can modify that configuration by overwritting binkps.conf with a -v argument pointing to your own binkps.conf.

EG: -v ${SRC}/binkps.conf:/etc/nginx/modules-enabled/binkps.conf

Additional Mounts

Service Path
mail/file storage /fido
tools and scripts /usr/local/tools
logs /var/log/fido

Some of these mounts may be altered by the configuration of binkd, hpt, etc.

Suggested Start

Here is an example start script:

#!/bin/sh

MACHINE=$(uname -m)
SRC=/srv/docker/fidohub
IMAGE=registry.leenooks.net/bbs/fidohub:latest-${MACHINE}

# MAC Address used because ip6= is not working
docker run \
 -dt \
 --name=fidohub \
 --restart unless-stopped \
 --hostname=fidohub.yourdomain.name \
 --cap-add=NET_ADMIN \
 --sysctl net.ipv6.conf.all.disable_ipv6=0 \
 --mac-address=00:0a:00:01:00:01 \
 -e ENABLE_ZT=1 \
 -p 13119:119 \
 -p 13553:24553 \
 -p 13554:24554 \
 -p 13177:60177 \
 -p 13179:60179 \
 -v ${SRC}/binkd:/etc/binkd \
 -v ${SRC}/cron/cron.daily:/etc/cron.daily \
 -v ${SRC}/ifmail:/etc/ifmail \
 -v ${SRC}/ftn:/etc/ftn \
 -v ${SRC}/fido:/fido \
 -v ${SRC}/jamnntpd:/etc/jamnntpd \
 -v ${SRC}/qico:/etc/qico \
 -v ${SRC}/tools:/usr/local/tools \
 -v ${SRC}/log:/var/log/fido \
 -v ${SRC}/zerotier:/var/lib/zerotier-one \
 ${IMAGE} $@

The -p options map the ports opened on the host and passed through to the container. In the above example, the ports are 13xxx mapped to the default service port for the respective FTN service.

NOTE: Remember, the first time you start the service, if the directory passed by the -v is empty, a default config file will be put in there. You will probably need to modify the config file appropraite for your setup.