Skip to content

Installation

go-while edited this page Oct 22, 2026 · 11 revisions

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.

Build dependencies

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).
  • texinfo is required: without makeinfo, make stops 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.

Building

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 install

From 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
make

Always pass --prefix (or --sysconfdir): otherwise the built-in path of the configuration file can end up as NONE/etc/newscache.conf.

configure options

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.

What make install installs

  • newscache and newscacheclean in sbin, updatenews in bin
  • the manual pages and the info manual (NewsCache.info)
  • the samples newscache.conf-dist and newscache.auth-dist in sysconfdir

It installs no configuration, user, service file or spool directory; see below.

User and directories

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/newscache

Running it

systemd

The 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.

inetd

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.

Command-line options of newscache

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

Debian and Ubuntu package

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_*.deb

The 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

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.

Container image (Docker, Podman)

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 newscache

The 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".

Clone this wiki locally