Create setup

Deon George 2021-08-15 05:35:09 +00:00
parent 875d1e3b20
commit d1988a0b09

73
setup.md Normal file

@ -0,0 +1,73 @@
# 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
| Service | Path |
| ------ | ------ |
| binkd | /etc/binkd |
| qico | /etc/qico |
| ifcico | /etc/ifmail |
| hpt | /etc/ftn |
| jamnntpd | /etc/jamnntpd |
| cron (daily) | /etc/cron.daily |
| zerotier | /var/lib/zerotier-one |
This mounts are normally provided by the `-v` start command when starting a container.
## 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:
```bash
#!/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.