Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnuu-de/dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Aug 11, 2020
2 parents 8192015 + 966bd4c commit 72b2208
Show file tree
Hide file tree
Showing 15 changed files with 462 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/gnuuaio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
paths:
- 'Dockerfile.gnuuaio'
name: Build & Push Dockerfile.gnuuaio
jobs:
deploy:
name: Docker Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and push image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: Dockerfile.gnuuaio
repository: gnuu/gnuuaio
tags: latest
81 changes: 81 additions & 0 deletions Dockerfile.gnuuaio
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM ubuntu:20.04
#
# Run News, Mail, UUCP, ans shell access all in one
#
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=linux

# inn requires a config file with domain name instead FWDN in container (which is often not set)
COPY aio/inn.conf /etc/news/inn.conf
# entrypoint with program starts
COPY aio/entrypoint.sh /entrypoint.sh

# Upgrade system & install packages
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew vim-tiny bash curl wget git inn2 rsyslog rmail bsd-mailx xinetd cu gettext-base bind9-host cron shellinabox alpine telnet cron
RUN apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew postfix

# Add kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/

# Part Cron
# cron send-uucp, batcher, uucico every 5 min
COPY aio/gnuu.cron /etc/cron.d/gnuu.cron
RUN crontab /etc/cron.d/gnuu.cron

# Part Syslog
# deactivate kernel log in container for rsyslog
RUN sed -i '/imklog/s/^module/# /' /etc/rsyslog.conf

# Part NEWS
# create pid file dir
RUN mkdir -p /run/news
RUN chown news:news /run/news
RUN chmod 775 /run/news
# change news shell
RUN chsh news -s /bin/bash
RUN mkdir -p /var/www/inn && chown news:news /var/www/inn

# Part UUCP
# install szip batcher
COPY aio/sunbatch /usr/lib/news/bin/rnews.libexec/sunbatch
# install bsmtp package for uucp mail delivery
RUN wget https://download.opensuse.org/repositories/home:/eumel_8/Debian_7.0/amd64/bsmtp_1.02_amd64.deb
RUN dpkg -i bsmtp_1.02_amd64.deb
RUN chmod +s /usr/sbin/bsmtp
# install uucp package with lcyrpt
RUN wget https://k8s.gnuu.de/repo/uucp_1.07-27build1_amd64.deb
RUN dpkg -i uucp_1.07-27build1_amd64.deb
# install szip program
RUN wget https://k8s.gnuu.de/repo/szip
RUN chmod +x szip && mv szip /usr/local/bin/szip
# fix broken links from bsmtp package
RUN rm /usr/bin/rgsmtp && ln -s /usr/bin/rcsmtp /usr/bin/rgsmtp
RUN rm /usr/bin/cbsmtp && ln -s /usr/bin/rcsmtp /usr/bin/cbsmtp
RUN rm /usr/bin/crsmtp && ln -s /usr/bin/rcsmtp /usr/bin/crsmtp
RUN rm /usr/bin/bsmtp && ln -s /usr/bin/rsmtp /usr/bin/bsmtp
# copy custom config files
COPY uucp/transmitter.b-rbsmtp /usr/sbin/transmitter.b-rbsmtp
COPY uucp/transmitter.b-rcsmtp /usr/sbin/transmitter.b-rcsmtp
COPY uucp/transmitter.g-rcsmtp /usr/sbin/transmitter.g-rcsmtp
COPY uucp/transmitter.s-rcsmtp /usr/sbin/transmitter.s-rcsmtp
COPY uucp/transmitter.s-rssmtp /usr/sbin/transmitter.s-rssmtp
COPY uucp/transmitter.c-cbsmtp /usr/sbin/transmitter.c-cbsmtp
COPY uucp/transmitter.c-rcsmtp /usr/sbin/transmitter.c-rcsmtp
COPY uucp/transmitter.n-rsmtp /usr/sbin/transmitter.n-rsmtp
COPY uucp/rsmtp /usr/sbin/rsmtp

RUN chsh uucp -s /bin/bash

# install the default user and prepare home dir
RUN groupadd -g 1000 linux
RUN useradd -u 1000 -g 1000 -m -s /bin/bash linux;echo linux:linux | chpasswd -c SHA512
USER 1000
WORKDIR /home/linux
RUN alpine -conf > .pinerc
RUN sed -i 's/^smtp-server=/smtp-server=127.0.0.1/' /home/linux/.pinerc
RUN sed -i 's/^nntp-server=/nntp-server=127.0.0.1/' /home/linux/.pinerc

USER 0
# expose shellinabox, all other services are internally
EXPOSE 4200
4 changes: 4 additions & 0 deletions Dockerfile.innuucp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ COPY uucp/transmitter.b-rcsmtp /usr/sbin/transmitter.b-rcsmtp
COPY uucp/transmitter.g-rcsmtp /usr/sbin/transmitter.g-rcsmtp
COPY uucp/transmitter.s-rcsmtp /usr/sbin/transmitter.s-rcsmtp
COPY uucp/transmitter.s-rssmtp /usr/sbin/transmitter.s-rssmtp
COPY uucp/transmitter.c-cbsmtp /usr/sbin/transmitter.c-cbsmtp
COPY uucp/transmitter.c-rcsmtp /usr/sbin/transmitter.c-rcsmtp
COPY uucp/transmitter.n-rsmtp /usr/sbin/transmitter.n-rsmtp
COPY uucp/rsmtp /usr/sbin/rsmtp

RUN chsh uucp -s /bin/bash

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.uucp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ COPY uucp/uucp.service /xinetd.conf
COPY uucp/transmitter.b-rbsmtp /usr/sbin/transmitter.b-rbsmtp
COPY uucp/transmitter.b-rcsmtp /usr/sbin/transmitter.b-rcsmtp
COPY uucp/transmitter.g-rcsmtp /usr/sbin/transmitter.g-rcsmtp
COPY uucp/transmitter.c-cbsmtp /usr/sbin/transmitter.c-cbsmtp
COPY uucp/transmitter.c-rcsmtp /usr/sbin/transmitter.c-rcsmtp
COPY uucp/transmitter.n-rsmtp /usr/sbin/transmitter.n-rsmtp
COPY uucp/rsmtp /usr/sbin/rsmtp

RUN chsh uucp -s /bin/bash

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ list:

File | Description
--------------------- | -------------------------------------------------
Dockerfile.gnuuaio | All in One UUCP Client
Dockerfile.inn | INN Server (News)
Dockerfile.innuucp | INN Server (News) with UUCP backend
Dockerfile.postfix | Postfix Server (Mail)
Expand Down
2 changes: 2 additions & 0 deletions aio/50-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#news.* action(type="ompipe" Pipe="/newslog/news.fifo")
*.* action(type="ompipe" Pipe="/newslog/news.fifo")
27 changes: 27 additions & 0 deletions aio/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# Catch active & newsgroups file
curl -o /var/lib/news/active http://www.gnuu.de/config/active
curl -o /var/lib/news/newsgroups http://www.gnuu.de/config/newsgroups
chown news:news /var/lib/news/*
# merge news config
if [ -d /etc/news-aio ]; then
cp /etc/news-aio/* /etc/news/
fi
# merge mail config
if [ -d /etc/postfix-aio ]; then
cp /etc/postfix-aio/* /etc/postfix/
fi
# build postfix db
if [ /etc/postfix/transport ]; then
postmap /etc/postfix/transport
fi
if [ /etc/postfix/virtual ]; then
postmap /etc/postfix/virtual
fi
# start services
/usr/sbin/cron
/usr/bin/shellinaboxd -tb
/usr/sbin/rsyslogd
/usr/lib/news/bin/rc.news
/usr/lib/postfix/sbin/master
6 changes: 6 additions & 0 deletions aio/gnuu.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SHELL=/bin/sh
PATH=/usr/lib/news/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
# Batch news to uucp accounts (needs running news server and uucp accounts)
*/5 * * * * test -x /usr/sbin/batcher && /usr/sbin/batcher g-rgsmtp uucp.gnuu.de
*/5 * * * * test -x /usr/sbin/uucico && /usr/sbin/uucico -f -s uucp.gnuu.de
*/5 * * * * test -x /usr/lib/news/bin/send-uucp && su news -c /usr/lib/news/bin/send-uucp
212 changes: 212 additions & 0 deletions aio/inn.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
## $Id: inn.conf.in 10049 2016-08-05 11:40:25Z iulius $
##
## inn.conf -- INN configuration data
##
## Format:
## <parameter>:<whitespace><value>
##
## Blank values are allowed for certain parameters.
##
## See the inn.conf(5) man page for a full description of each of these
## options. This sample file is divided into two sections; first, there
## are the parameters that must be set (or should be set in nearly all
## cases), and then all parameters are given with their defaults for
## reference in the same order and with the same organization as the
## inn.conf(5) documentation.

# The following parameters are most likely to need setting, although the
# defaults generated by configure may be reasonable.

mta: "/usr/sbin/sendmail -oi -oem %s"
organization: "A poorly-installed InterNetNews site"
ovmethod: tradindexed
hismethod: hisv6
pathhost: server.example.net
pathnews: /usr/lib/news

#runasuser:
#runasgroup:

# General Settings

domain: example.net
innflags: "-d -f"
mailcmd: /usr/lib/news/bin/innmail
#server:

# Feed Configuration

artcutoff: 10
#bindaddress:
#bindaddress6:
dontrejectfiltered: false
hiscachesize: 256
ignorenewsgroups: false
immediatecancel: false
linecountfuzz: 0
maxartsize: 1000000
maxconnections: 50
#pathalias:
#pathcluster:
pgpverify: true
port: 119
refusecybercancels: false
remembertrash: true
#sourceaddress:
#sourceaddress6:
verifycancels: false
verifygroups: false
wanttrash: false
wipcheck: 5
wipexpire: 10

# Article Storage

cnfscheckfudgesize: 0
enableoverview: true
extraoverviewadvertised: [ ]
extraoverviewhidden: [ ]
groupbaseexpiry: true
mergetogroups: false
nfswriter: false
overcachesize: 128
#ovgrouppat:
storeonxref: true
useoverchan: false
wireformat: true
xrefslave: false

# Reading

allownewnews: true
articlemmap: true
clienttimeout: 1800
initialtimeout: 10
msgidcachesize: 64000
nfsreader: false
nfsreaderdelay: 60
nnrpdcheckart: true
nnrpdflags: ""
nnrpdloadlimit: 16
noreader: false
readerswhenstopped: false
readertrack: false
tradindexedmmap: true

# Reading -- Keyword Support
#
# You should add "keywords" to extraoverviewadvertised or extraoverviewhidden
# if you enable this feature. You must have compiled this support in too
# with --enable-keywords at configure time.

keywords: false
keyartlimit: 100000
keylimit: 512
keymaxwords: 250

# Posting

addinjectiondate: true
addinjectionpostingaccount: false
addinjectionpostinghost: true
checkincludedtext: false
#complaints:
#fromhost:
localmaxartsize: 1000000
#moderatormailer:
nnrpdauthsender: false
#nnrpdposthost:
nnrpdpostport: 119
spoolfirst: false
strippostcc: false

# Posting -- Exponential Backoff

backoffauth: false
#backoffdb:
backoffk: 1
backoffpostfast: 0
backoffpostslow: 1
backofftrigger: 10000

# Reading and Posting -- TLS/SSL Support
#
# The OpenSSL SSL and crypto libraries must have been found
# at configure time to have this support, or you must have
# compiled this support in with --with-openssl at configure time.

#tlscafile:
#tlscapath: /etc/news
#tlscertfile: /etc/news/cert.pem
#tlskeyfile: /etc/news/key.pem
#tlsciphers:
#tlscompression: false
#tlseccurve:
#tlspreferserverciphers: true
#tlsprotocols: [ TLSv1 TLSv1.1 TLSv1.2 ]

# Monitoring

doinnwatch: true
innwatchbatchspace: 4000
innwatchlibspace: 25000
innwatchloload: 1000
innwatchhiload: 2000
innwatchpauseload: 1500
innwatchsleeptime: 600
innwatchspoolnodes: 200
innwatchspoolspace: 25000

# Logging

docnfsstat: false
htmlstatus: true
incominglogfrequency: 200
logartsize: true
logcancelcomm: false
logcycles: 3
logipaddr: true
logsitename: true
logstatus: true
logtrash: true
nnrpdoverstats: true
nntplinklog: false
#stathist:
status: 600
timer: 600

# System Tuning

badiocount: 5
blockbackoff: 120
chaninacttime: 600
chanretrytime: 300
datamovethreshold: 16384
icdsynccount: 10
keepmmappedthreshold: 1024
#maxcmdreadsize:
maxforks: 10
nicekids: 4
nicenewnews: 0
nicennrpd: 0
pauseretrytime: 300
peertimeout: 3600
rlimitnofile: -1

# Paths

patharchive: /var/spool/news/archive
patharticles: /var/spool/news/articles
pathbin: /usr/lib/news/bin
pathcontrol: /usr/lib/news/bin/control
pathdb: /var/lib/news
pathetc: /etc/news
pathfilter: /etc/news/filter
pathhttp: /var/www/inn
pathincoming: /var/spool/news/incoming
pathlog: /var/log/news
pathoutgoing: /var/spool/news/outgoing
pathoverview: /var/spool/news/overview
pathrun: /run/news
pathspool: /var/spool/news
pathtmp: /var/spool/news/incoming/tmp
2 changes: 2 additions & 0 deletions aio/sunbatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/sh
exec /usr/local/bin/szip -d
Loading

0 comments on commit 72b2208

Please sign in to comment.