#!/usr/bin/env bash set -Eeuo pipefail BUILDER_ROOT=${BUILDER_ROOT:-/opt/rust-package-builder} source "$BUILDER_ROOT/scripts/lib.sh" OUT=${1:?output file required} URL="${OPNSENSE_REPOSITORY_URL%/}/freebsd" export OUT URL FREEBSD_ABI python3 <<'PY' import html, os h=html.escape url=h(os.environ['URL']); abi=h(os.environ['FREEBSD_ABI']) page=f'''
This repository contains the rustproxy package and an rc.d service, without OPNsense plugin files. ABI: {abi}.
Development repository: unsigned pkg catalog. Use only in an environment where you trust the source and transport. Configure signing before production.
mkdir -p /usr/local/etc/pkg/repos
fetch -o /usr/local/etc/pkg/repos/RustProxy-FreeBSD.conf {url}/RustProxy-FreeBSD.conf
pkg update -f
pkg install rustproxy
sysrc rustproxy_enable=YES
service rustproxy start
service rustproxy reload
To use an external JSON configuration, set rustproxy_config="/usr/local/etc/rustproxy/config.json" in /etc/rc.conf. The file and parent directory must be writable by the service account.