From 6ba17b951ea7ee5bd5506bbb78101c1f9c14bfba Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Wed, 29 Jul 2026 11:34:53 +0500 Subject: [PATCH] cleanfeed installation, stale pids script fix, start-innd script removal. --- CHANGELOG.md | 9 +++++++++ Dockerfile | 12 +++++++++++- README.md | 10 +++++++++- etc/cont-init.d/30-nocem-keyring.sh | 1 - etc/cont-init.d/40-cleanfeed-post-install.sh | 13 +++++++++++++ etc/cont-init.d/90-stale-pids.sh | 2 +- start-innd.sh | 17 ----------------- 7 files changed, 43 insertions(+), 21 deletions(-) create mode 100755 etc/cont-init.d/40-cleanfeed-post-install.sh mode change 100644 => 100755 etc/cont-init.d/90-stale-pids.sh delete mode 100755 start-innd.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 017ef65..f29e31d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ### Added * nocem processing enablement with data from https://rosalind.home.xs4all.nl/nocemreg/nocemreg.html. +* cleanfeed installation + +### Changed + +* stale pids removal script now always exits 0 if removal failed. + +### Removed + +* start-innd script which was used previously for starting innd. ## [2.7.4-3] - 2026-07-29 diff --git a/Dockerfile b/Dockerfile index a04b195..454b885 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,15 @@ RUN mkdir /src && cd /src && \ mv /inn2/etc /inn2/etc-default && \ mv /inn2/db /inn2/db-default && \ mv /inn2/spool /inn2/spool-default && \ + # cleanfeed + cd /src && curl -sL https://github.com/infybofh/cleanfeed-ng/archive/refs/tags/2026-07-03-rc1.tar.gz | tar xz && cd cleanfeed-ng-2026-07-03-rc1 && \ + cp cleanfeed /inn2/bin/filter/filter_innd.pl && \ + mkdir /inn2/etc-default/cleanfeed && \ + cp cleanfeed.local.example /inn2/etc-default/cleanfeed/cleanfeed.local && \ + cp samples/* /inn2/etc-default/cleanfeed && \ + mkdir -p /inn2/spool-default/cleanfeed && \ + mkdir -p /var/www/ && \ + chown -R news:news /var/www && \ rm -rf /src COPY etc /etc @@ -53,8 +62,9 @@ RUN groupmod -g 600 news && usermod -u 600 -g 600 -d /inn2 news && chown -R news WORKDIR /inn2 ENV PATH=/inn2/bin:$PATH +ENV CLEANFEED_CONFIG_DIR=/inn2/etc/cleanfeed EXPOSE 119 EXPOSE 563 -VOLUME [ "/inn2/db", "/inn2/spool", "/inn2/log" ] +VOLUME [ "/inn2/db", "/inn2/spool", "/inn2/log", "/var/www" ] ENTRYPOINT [ "/init" ] diff --git a/README.md b/README.md index ab37103..2704fd4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository holds files neccessary to build inn2 (InterNet News 2), a NNTP server. -This container is based on [greenbender's image](https://github.com/greenbender/inn-docker). +This container is based on [greenbender's image](https://github.com/greenbender/inn-docker) and includes enabled nocems processing and cleanfeed. ## Usage @@ -27,6 +27,7 @@ services: - "./data/spool:/inn2/spool" - "./data/tmp:/inn2/tmp" - "./data/syslog:/var/log" + - "./data/www:/var/www" ulimits: nofile: soft: 65535 @@ -49,6 +50,7 @@ services: - "./data/spool:/inn2/spool" - "./data/tmp:/inn2/tmp" - "./data/syslog:/var/log" + - "./data/www:/var/www" networks: inn2-ipvlan: ipv4_address: 192.168.168.168 # ip address from real LAN. @@ -99,6 +101,12 @@ As this container has no postfix installed (why do you might ever need it here?) This container has nocem enabled and neccessary data will be loaded on first start from [NoCeM registry](https://rosalind.home.xs4all.nl/nocemreg/nocemreg.html). +Make sure you have `news.lists.filters` group created. + +## Cleanfeed + +Cleanfeed is automatically installed from [infybofh's repository](https://github.com/infybofh/cleanfeed-ng). Configuration is located in `/inn2/etc/cleanfeed` directory within container, please configure it according to your needs. + ## Versioning Image versioning follows official inn2 versions with additional optional version postfix added to indicate image fixes for particular version. diff --git a/etc/cont-init.d/30-nocem-keyring.sh b/etc/cont-init.d/30-nocem-keyring.sh index dffcd87..61f219a 100755 --- a/etc/cont-init.d/30-nocem-keyring.sh +++ b/etc/cont-init.d/30-nocem-keyring.sh @@ -11,7 +11,6 @@ fi echo "* Downloading NoCeM gpg keys and ctl file..." curl -o /inn2/etc/pgp/ncmring.gpg https://rosalind.home.xs4all.nl/nocemreg/ncmring.asc -curl -o /inn2/etc/nocem.ctl https://rosalind.home.xs4all.nl/nocemreg/ncmperm.txt chown -R news:news /inn2/etc/nocem.ctl /inn2/etc/pgp echo "* Enabling NoCeM processing..." diff --git a/etc/cont-init.d/40-cleanfeed-post-install.sh b/etc/cont-init.d/40-cleanfeed-post-install.sh new file mode 100755 index 0000000..761ad03 --- /dev/null +++ b/etc/cont-init.d/40-cleanfeed-post-install.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ ! -d "/inn2/etc/cleanfeed" ]; then + cp -r "/inn2/etc-default/cleanfeed" "/inn2/etc" + chown -R news:news "/inn2/etc/cleanfeed" +fi + +if [ ! -d "/inn2/spool/cleanfeed" ]; then + mkdir -p "/inn2/spool/cleanfeed" + chown -R news:news "/inn2/spool/cleanfeed" +fi + +chown -R news:news /var/www diff --git a/etc/cont-init.d/90-stale-pids.sh b/etc/cont-init.d/90-stale-pids.sh old mode 100644 new mode 100755 index 408be7f..495dda9 --- a/etc/cont-init.d/90-stale-pids.sh +++ b/etc/cont-init.d/90-stale-pids.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm "/inn2/run/*.pid" +rm "/inn2/run/*.pid" || exit 0 diff --git a/start-innd.sh b/start-innd.sh deleted file mode 100755 index de44a48..0000000 --- a/start-innd.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -if [ ! -f "/inn2/etc/inn.conf" ]; then - cp -r /inn2/etc-default/* /inn2/etc -fi - -if [ ! -f "/inn2/db/history" ]; then - cp -r /inn2/db-default/* /inn2/db -fi - -if [ ! -d "/inn2/spool/articles" ]; then - cp -r /inn2/spool-default/* /inn2/spool -fi - -cd /inn2 || exit 1 - -/inn2/bin/innd -f