Switch to s6-overlay, add cron (and cronjobs), syslog.
ci/woodpecker/tag/build Pipeline was successful

This commit is contained in:
2026-07-27 00:18:03 +05:00
parent 6bb4e56607
commit 4346acb651
19 changed files with 79 additions and 25 deletions
+8
View File
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) but do not follows semantic versioning as it is useless in this type of project.
## [2.7.4-2] - 2026-07-26
### Added
* switch to s6-overlay (which is more suitable for containers than plain s6).
* syslogd support via s6-overlay.
## [2.7.4-1] - 2026-07-26
### Added
@@ -19,5 +26,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
Initial container release with inn 2.7.4 built with perl/python/sqlite support.
[2.7.4-2]: https://code.pztrn.name/containers/inn2/compare/2.7.4-1...2.7.4-2
[2.7.4-1]: https://code.pztrn.name/containers/inn2/compare/2.7.4...2.7.4-1
[2.7.4]: https://code.pztrn.name/containers/inn2/releases/tag/2.7.4
+5 -6
View File
@@ -19,7 +19,8 @@ RUN apk add --no-cache \
perl-utils \
python3 \
python3-dev \
s6 \
s6-overlay \
s6-overlay-syslogd \
shadow \
sqlite-dev \
ssmtp \
@@ -46,16 +47,14 @@ RUN mkdir /src && cd /src && \
mv /inn2/spool /inn2/spool-default && \
rm -rf /src
COPY configuration /etc
COPY start-innd.sh /start-innd
COPY etc /etc
RUN groupmod -g 600 news && usermod -u 600 -g 600 -d /inn2 news && chown -R news:news /inn2 && chown -R news:news /etc/s6
RUN groupmod -g 600 news && usermod -u 600 -g 600 -d /inn2 news && chown -R news:news /inn2 && chown -R news:news /etc/cont-init.d /etc/services.d
WORKDIR /inn2
ENV PATH=/inn2/bin:$PATH
USER news
EXPOSE 119
EXPOSE 563
VOLUME [ "/inn2/db", "/inn2/spool", "/inn2/log" ]
CMD ["/usr/bin/s6-svscan", "/etc/s6"]
ENTRYPOINT [ "/init" ]
+17 -2
View File
@@ -26,6 +26,7 @@ services:
- "./data/run:/inn2/run"
- "./data/spool:/inn2/spool"
- "./data/tmp:/inn2/tmp"
- "./data/syslog:/var/log"
ulimits:
nofile:
soft: 65535
@@ -47,6 +48,7 @@ services:
- "./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.
@@ -81,10 +83,12 @@ Note that this code is built to support dual-stack (IPv4+IPv6). You should eithe
## Cronjobs
There is a section in documentation about cron jobs you should configure. This docker image currently isn't supporting these, so configure it separately with lines like:
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:
```shell
0 3 * * * docker compose run inn news.daily expireover lowmark
0 3 * * * docker compose run inn news.daily expireover lowmark delayrm
```
## Sending emails
@@ -115,3 +119,14 @@ inn2 is launched as UID/GID 600 in container, so chown directories properly acco
* 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 be `chown 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.
-5
View File
@@ -1,5 +0,0 @@
#!/bin/sh
for file in /etc/s6/*/finish; do
$file
done
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
kill "$(cat /inn2/run/innd.pid)"
-3
View File
@@ -1,3 +0,0 @@
#!/bin/execlineb -P
/start-innd
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
kill "$(cat /inn2/run/nnrpd-563.pid)"
-3
View File
@@ -1,3 +0,0 @@
#!/bin/execlineb -P
nnrpd -D -f -p 563 -S
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh -e
mkdir -p /var/log/innd
chown -R 65534:65534 /var/log/innd
chmod 02755 /var/log/innd
mkdir -p /var/log/nnrpd
chown -R 65534:65534 /var/log/nnrpd
chmod 02755 /var/log/nnrpd
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
if [ ! -f "/inn2/etc/inn.conf" ]; then
cp -r /inn2/etc-default/* /inn2/etc
fi
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
if [ ! -f "/inn2/db/history" ]; then
cp -r /inn2/db-default/* /inn2/db
fi
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
if [ ! -d "/inn2/spool/articles" ]; then
cp -r /inn2/spool-default/* /inn2/spool
fi
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
chown news:news /etc/crontabs/news
+5
View File
@@ -0,0 +1,5 @@
# min hour day month weekday command
0 5 * * * cd /inn2; /inn2/bin/news.daily expireover lowmark delayrm
15 * * * * cd /inn2; /inn2/bin/rnews -U
0 4 * * * cd /inn2; /inn2/bin/ctlinnd -t 120 -s reload incoming.conf 'flush cache'
*/10 * * * * cd /inn2; /inn2/bin/nntpsend
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
/usr/sbin/crond -f
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec logutil-service /var/log/innd
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
exec 2>&1
exec s6-setuidgid news /inn2/bin/innd -f
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec logutil-service /var/log/nnrpd
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
exec 2>&1
exec s6-setuidgid news nnrpd -D -f -p 563 -S