inn2 Docker container
This repository holds files neccessary to build inn2 (InterNet News 2), a NNTP server.
This container is based on greenbender's image.
Usage
Configuration files are described on inn official site (select proper version from right sidebar).
Using this container with compose is simple:
---
services:
inn:
image: "code.pztrn.name/containers/inn2"
restart: always
ports:
- 119:119
- 563:563
volumes:
- "./data/db:/inn2/db"
- "./data/etc:/inn2/etc"
- "./data/log:/inn2/log"
- "./data/run:/inn2/run"
- "./data/spool:/inn2/spool"
- "./data/tmp:/inn2/tmp"
- "./data/syslog:/var/log"
ulimits:
nofile:
soft: 65535
hard: 65535
It is recommended to use macvlan/ipvlan network for container so real user IP will flow within inn2 as by default it will be docker's network gateway for compose project. For that compose file will looks like:
---
services:
inn:
image: "code.pztrn.name/containers/inn2:2.7.4"
restart: always
volumes:
- "./data/db:/inn2/db"
- "./data/etc:/inn2/etc"
- "./data/log:/inn2/log"
- "./data/run:/inn2/run"
- "./data/spool:/inn2/spool"
- "./data/tmp:/inn2/tmp"
- "./data/syslog:/var/log"
networks:
inn2-ipvlan:
ipv4_address: 192.168.168.168 # ip address from real LAN.
ipv6_address: fd00:0:1:2::168 # ip address from real LAN.
ulimits:
nofile:
soft: 65535
hard: 65535
networks:
inn2-ipvlan:
driver: ipvlan
driver_opts:
parent: ens18 # put your real interface name here.
ipvlan_mode: l2
ipam:
config:
- subnet: 192.168.168.160/27 # put real LAN subnet here.
gateway: 192.168.168.161 # put real LAN gateway here.
ip_range: 192.168.168.168/32 # ip address from real LAN.
- subnet: fd00:0:1:2::/64 # put real LAN subnet here.
gateway: fd00:0:1:2::1 # put real LAN gateway here.
ip_range: fd00:0:1:2::168/128 # ip address from real LAN.
enable_ipv6: true
Note that this code is built to support dual-stack (IPv4+IPv6). You should either:
- Remove IPv6 things if not using it.
- Set up SNAT6 for outgoing connections to work (on host or router).
- Add globally routable address to IPAM config and network definition in container.
Cronjobs
This Docker image come with a recommended in documentation set of cronjobs. To customize it copy etc/crontabs/news file, make neccessary changes and mount it to container in /etc/crontabs/news.
If you want to use cron outside of your container:
0 3 * * * docker compose run inn news.daily expireover lowmark delayrm
Sending emails
As this container has no postfix installed (why do you might ever need it here?) you can use ssmtp which installed in container to get mails sent over SMTP.
Versioning
Image versioning follows official inn2 versions with additional optional version postfix added to indicate image fixes for particular version.
Examples:
- 2.7.4-3 - inn version 2.7.4 and 3 additional fixes applied to container or inn's dependencies.
- 2.7.6 - inn version 2.7.6 without additional container fixes.
All notable changes to container and it's building process are noted in CHANGELOG.md.
Data directories and permissions
Configuration is kept in /inn2/etc, mount it in your local filesystem. Entrypoint script will copy default configuration for you if missing.
This container exposes /inn2/db, /inn2/spool, /inn2/log as volumes, so you may either:
- Leave as is, Docker will create separate volume for your data.
- Mount volume somewhere, like in compose example above.
inn2 is launched as UID/GID 600 in container, so chown directories properly according to your Docker configuration:
- If you're not using userns isolation - use
chown 600:600. - If you're using it - use
600 + id from /etc/subuid, e.g. if you're using default Docker remapping this could bechown 100600:100600.
Logs
Logs are split in two destinations:
/inn2/log- default INN logs destination./var/log- syslog logs.
As INN might log in both of them you should mount a directory for each.
For syslog logs it is a known bug that logs isn't written in /var/log/innd or /var/log/nnrpd, take a look at /var/log/syslogd/everything/current for logs with news topic. This might be fixed somewhere soon.