Repository navigation
Installation
NewsCache needs a Unix system (it uses fork, signals and user switching).
It is built with GNU autoconf and automake, and tested in CI on Ubuntu
(x86_64 and ARM64), Debian 13, Fedora 43/44/45, Alpine (musl), FreeBSD and
macOS. On Windows, use WSL 2 or the container image.
After installing, continue with Configuration: the shipped configurations let no client in until you allow one.
| System | Packages |
|---|---|
| Debian, Ubuntu | build-essential autoconf automake texinfo libgnutls28-dev libpam0g-dev libcrypt-dev |
| Fedora |
gcc-c++ make autoconf automake libtool gnutls-devel pam-devel libxcrypt-devel texinfo (and redhat-rpm-config for Fedora's compiler flags) |
| Alpine | build-base autoconf automake texinfo gnutls-dev linux-pam-dev |
| FreeBSD |
autoconf automake gmake texinfo gnutls (build with gmake) |
| macOS (Homebrew) | autoconf automake texinfo gnutls |
- GnuTLS is optional; it is needed for TLS connections to upstream servers.
- PAM is optional (
--with-pam). -
texinfois required: withoutmakeinfo,makestops at the manual. - Go 1.26 or later is only needed for the end-to-end tests in
make check; without it they are skipped.
From a release tarball (NewsCache-<version>.tar.gz, which already
contains configure):
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make check # optional
sudo make installFrom a git checkout, run ./autogen first (it runs autoreconf):
git clone https://github.com/go-while/NewsCache.git
cd NewsCache
./autogen
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
makeAlways pass --prefix (or --sysconfdir): otherwise the built-in path of
the configuration file can end up as NONE/etc/newscache.conf.
| Option | Effect |
|---|---|
--with-gnutls / --without-gnutls
|
TLS to upstream servers (default: yes, if GnuTLS is found) |
--with-pam[=service] |
Authentication pam (default: no; PAM service name newscache) |
--with-shadow |
shadow password support for Authentication unix (default: auto, on where shadow.h exists) |
--with-syslog / --without-syslog
|
log to syslog (default) or to files in LogDirectory
|
--with-md5, --with-md5auto
|
MD5 password hashes in the auth file (default: yes) |
--enable-plainpass |
plain-text passwords in the auth file |
--enable-headerlog |
log the headers of posted articles |
--enable-debug |
verbose debug logging |
./configure --help lists all of them. newscache -o prints the options a
binary was built with.
-
newscacheandnewscachecleaninsbin,updatenewsinbin - the manual pages and the info manual (
NewsCache.info) - the samples
newscache.conf-distandnewscache.auth-distinsysconfdir
It installs no configuration, user, service file or spool directory; see below.
NewsCache starts as root (to bind port 119), then switches to Username
and Groupname from the configuration, usually news. The spool and, for
builds with --without-syslog, the log directory must belong to that user.
The spool must be on a local file system (NewsCache uses file locks).
# Fedora / systemd-sysusers; on Debian the user news already exists
echo 'u news - "News user" /var/cache/newscache -' |
sudo tee /usr/lib/sysusers.d/newscache.conf
sudo systemd-sysusers
sudo install -d -o news -g news -m 755 /var/cache/newscache /var/log/newscacheThe unit from the Debian package (debian/newscache.service):
[Unit]
Description=NewsCache caching news server
After=network-online.target remote-fs.target
Wants=network-online.target
[Service]
ExecStart=/usr/sbin/newscache -n
ExecReload=/bin/kill -HUP $MAINPID
IgnoreSIGPIPE=false
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target-n keeps the daemon in the foreground. systemctl reload newscache
re-reads the configuration (SIGHUP); if the new file has an error, the
daemon logs it and keeps the old one. After installing a new binary, use
systemctl restart. Under systemd no PidFile is needed.
Clean the spool regularly with newscacheclean, for example from a daily
timer; see Caching and Large Groups.
news stream tcp nowait news /usr/sbin/newscache -i
Set ServerType inetd in the configuration. In inetd mode the client is
called stdin, so the access list needs a Client stdin entry.
| Option | Meaning |
|---|---|
-c file |
configuration file |
-i |
inetd mode: serve one client on stdin/stdout |
-n |
no fork: run the daemon in the foreground (systemd, containers) |
-d |
don't detach |
-p |
print the parsed configuration and exit (passwords hidden) |
-o |
print the configure options |
-f |
print the fully qualified host name NewsCache uses |
-v |
print the version |
There is no official Debian package, but the repository builds one on
Debian 13 and Ubuntu 24.04 (from a git checkout; the release tarballs don't
contain debian/):
sudo apt-get build-dep ./
dpkg-buildpackage -us -uc -b
sudo apt install ../newscache_*.debThe package runs NewsCache as news under systemd, cleans the spool with a
daily timer (newscacheclean.timer), is built with GnuTLS and PAM, and
ships an /etc/newscache.conf that reads from news.blueworldhosting.com
over TLS and lets nobody in. See
debian/README.Debian.
Fedora's own newscache package is still 1.2rc6 from 2004.
FEDORA.md
shows how to build this version with Fedora's compiler flags and set it up
with a sysusers entry, a systemd unit, a cleanup timer, PAM, firewalld and
SELinux notes.
The Dockerfile
builds NewsCache on Ubuntu 24.04 and runs it in the foreground as news,
logging to the container's output:
docker build -t newscache .
docker run -d --name newscache -p 119:119 \
-v newscache-spool:/var/cache/newscache newscache
docker logs -f newscacheThe built-in configuration
(docker/newscache.conf)
lets nobody in. Copy it, add a Client entry or a login, and mount it with
-v /path/to/newscache.conf:/etc/newscache.conf:ro. Connections forwarded
with -p from the host itself arrive from the container network (for
example 172.17.0.1 with Docker, 10.88.0.1 with Podman). Purge the spool
now and then with docker exec newscache newscacheclean.
The README has more on volumes, DNS problems in containers and Windows: README.md, "In a container".
NewsCache is free software under the GNU General Public License, version 2 or (at your option) any later version — see COPYING. © 1996–1998 Thomas Gschwind, © 2001–2004 Herbert Straub, © 2008–2024 Christof Meerwald.