THE DEPLOYMENT HANDBOOK / Alpine Linux

Install the Critical Pro relay on Alpine Linux.

Set up a private HTTPS relay on Alpine Linux, schedule feed updates and verify downloads from your firewall.

IPV4 ONLY
STANDARD + CRITICAL

Prepare an Alpine Linux host

This recipe uses Alpine Linux 3.24 on a dedicated, disk-installed server, with OpenRC and BusyBox crond. Run the commands in a root shell. First reserve a private DNS name, limit inbound TCP 443 to the appliance and allow upstream HTTPS and DNS as described in the network plan.

Alpine / packages and service user
apk update
apk add python3 nginx nginx-openrc openrc busybox-openrc su-exec ca-certificates curl
id data-shield-relay >/dev/null 2>&1 ||
  adduser -S -D -H -G nginx -s /sbin/nologin data-shield-relay
install -d -m 0755 /usr/local/lib/data-shield-relay /usr/local/sbin
install -d -o data-shield-relay -g nginx -m 0750 /var/lib/data-shield-relay

The updater runs as data-shield-relay. The nginx group can traverse the state directory and read verified files. Only the updater owns this directory.

Install the updater and save its credential

Download the Python updater, the Alpine launcher and the private HTTPS configuration. Review them and run the installation commands from that working directory.

Alpine / fetch the three files
work=$(mktemp -d) && cd "$work" && (
  set -eu
  for file in refresh.py nginx.conf.example alpine-refresh.sh; do
    curl --proto '=https' --fail --silent --show-error -o "$file" \
      "https://data-shield.eu/downloads/feed-relay/$file"
  done
)
ls -l
Alpine / install the updater
install -o root -g root -m 0644 refresh.py /usr/local/lib/data-shield-relay/refresh.py
install -o root -g root -m 0750 alpine-refresh.sh /usr/local/sbin/data-shield-relay-refresh

Use the masked Device ID and token prompts to create /etc/data-shield-relay/device, owned by root with mode 0600. Keep the path outside the web root. The launcher opens this file as root, then su-exec runs Python under the relay account. Python reads the credential from standard input. NGINX workers cannot read the credential file.

Fetch once and schedule updates

Run the first refresh interactively. Check the reported generation, IPv4 count and split count. The files under current/ should include critical.txt and critical-aa.txt. An upstream failure preserves the last verified generation.

Alpine / first verified download
/usr/local/sbin/data-shield-relay-refresh
ls -l /var/lib/data-shield-relay/current/

Open the root crontab with crontab -e and add the following line once. Keep the existing maintenance entries. This schedules the update at minute 17 of every even-numbered hour in the relay’s local time. The output goes to the system logger under data-shield-relay.

BusyBox / root crontab entry
17 */2 * * * /usr/local/sbin/data-shield-relay-refresh 2>&1 | /usr/bin/logger -t data-shield-relay
OpenRC / enable and check the scheduler
rc-update add crond default
rc-service crond start
rc-service crond status
crontab -l

Read the data-shield-relay tag in your configured syslog destination. A successful run reports its generation and counts. To retry or rotate the token, repeat the credential prompts if necessary and run /usr/local/sbin/data-shield-relay-refresh.

Serve the private HTTPS feed with NGINX

Obtain a certificate for the relay’s internal DNS name and trust its issuer on the appliance. Replace the certificate paths below with your files. Alpine includes server configurations from /etc/nginx/http.d/. Edit the listen address, both hostname references and the client allowlist before starting NGINX. See the TLS and access settings.

Alpine / configure the HTTPS virtual host
install -d -o root -g root -m 0700 /etc/nginx/tls
install -o root -g root -m 0644 /path/to/fullchain.pem /etc/nginx/tls/feed-relay.crt
install -o root -g root -m 0600 /path/to/privkey.pem /etc/nginx/tls/feed-relay.key
install -o root -g root -m 0644 nginx.conf.example /etc/nginx/http.d/data-shield-relay.conf
vi /etc/nginx/http.d/data-shield-relay.conf
OpenRC / start and enable NGINX
nginx -t && rc-service nginx start
rc-update add nginx default
rc-service nginx status

If NGINX is already running, use nginx -t && rc-service nginx reload after editing the configuration or renewing the certificate. The stock default.conf listens on port 80. On a dedicated relay, you can move that stock file outside http.d before starting the service if HTTP is unused.

Verify the firewall import

Copy https://feed-relay.example.invalid/critical.txt into the appliance, substituting the internal hostname. If the appliance requires splits, add one URL per current file, starting with https://feed-relay.example.invalid/critical-aa.txt. Check that the allowed firewall receives HTTP 200, imports IPv4 entries and shows a recent refresh. Check that a different source receives HTTP 403 or is blocked upstream. The download test shows the exact curl command. The operations guide covers stale data and retirement. Remove only the relay’s crontab line when retiring it.

Alpine supported releases · Alpine cron documentation · Alpine OpenRC documentation

BETTER DATA. TOGETHER.

Need a correction?

Report a documentation issue or request a review of an address. Keep credentials and private configuration out of public issues.

Report an issue ↗Block request ↗Whitelist request ↗