Initial commit.
ci/woodpecker/tag/build Pipeline was successful

This commit is contained in:
2026-07-24 20:15:08 +05:00
commit e24afd9f98
9 changed files with 172 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
---
when:
- event: ["tag"]
steps:
- name: "Build tagged container"
image: "code.pztrn.name/containers/mirror/docker:29.6.2-dind"
environment:
DRONE_USER_PASSWORD:
from_secret: DRONE_USER_PASSWORD
commands:
- docker login -u drone -p $${DRONE_USER_PASSWORD} code.pztrn.name
- docker build --pull -t code.pztrn.name/containers/inn2:$${CI_COMMIT_TAG} -f Dockerfile .
- docker push code.pztrn.name/containers/inn2:$${CI_COMMIT_TAG}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
+58
View File
@@ -0,0 +1,58 @@
FROM code.pztrn.name/containers/mirror/alpine:3.24.1 AS build
ENV PERL_MM_USE_DEFAULT=1
RUN apk add --no-cache \
bison \
build-base \
curl \
gawk \
gd-dev \
gnupg \
libgd \
krb5-dev \
openssl \
openssl-dev \
perl \
perl-dev \
perl-utils \
python3 \
python3-dev \
s6 \
shadow \
sqlite-dev \
tar \
zlib-dev && \
cpan -T GD MIME::Parser && \
rm -rf /root/.cpan
ARG VERSION=2.7.4
RUN curl -sL https://github.com/InterNetNews/inn/releases/download/${VERSION}/inn-${VERSION}.tar.gz | tar xz
WORKDIR /inn-${VERSION}
RUN ./configure --prefix=/inn2 --with-zlib --with-openssl --with-sqlite --with-krb5 --with-perl --with-python && \
make && \
sed -i 's/#domain:/domain: news.localhost/' site/inn.conf && \
make install
RUN sed -i 's/#\(tlscapath:\)/\1/' /inn2/etc/inn.conf && \
sed -i 's/#\(tlscertfile:\)/\1/' /inn2/etc/inn.conf && \
sed -i 's/#\(tlskeyfile:\)/\1/' /inn2/etc/inn.conf && \
mv /inn2/etc /inn2/etc-default && \
mv /inn2/db /inn2/db-default && \
mv /inn2/spool /inn2/spool-default
COPY configuration /etc
COPY start-innd.sh /start-innd
RUN groupmod -g 600 news && usermod -u 600 -g 600 -d /inn2 news && chown -R news:news /inn2 && chown -R news:news /etc/s6
WORKDIR /inn2
ENV PATH=/inn2/bin:$PATH
ENV PERL_MM_USE_DEFAULT=1
USER news
EXPOSE 119
EXPOSE 563
VOLUME [ "/inn2/db", "/inn2/spool", "/inn2/log" ]
CMD ["/usr/bin/s6-svscan", "/etc/s6"]
+64
View File
@@ -0,0 +1,64 @@
# 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](https://github.com/greenbender/inn-docker).
## Usage
Configuration files are described on [inn official site](https://www.eyrie.org/~eagle/software/inn/) (select proper version from right sidebar).
Using this container with compose:
```yaml
---
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"
ulimits:
nofile:
soft: 65535
hard: 65535
```
## 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:
```shell
0 3 * * * docker compose run inn news.daily expireover lowmark
```
## 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.
* 2.7.6 - inn version 2.7.6 without additional container fixes.
## 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 be `chown 100600:100600`.
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
for file in /etc/s6/*/finish; do
$file
done
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
kill "$(cat /inn2/run/innd.pid)"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/execlineb -P
/start-innd
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
kill "$(cat /inn2/run/nnrpd-563.pid)"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/execlineb -P
nnrpd -D -f -p 563 -S
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/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
/inn2/bin/innd -f