#!/usr/bin/env bash set -Eeuo pipefail source /opt/rust-package-builder/scripts/lib.sh OUT=${1:?output file required} URL=$(trim_trailing_slash "$OPNSENSE_REPOSITORY_URL") PACKAGE=${PACKAGE_NAME:-rustproxy} export OUT URL PACKAGE OPNSENSE_ABI FREEBSD_ABI python3 <<'PY' import html import os out = os.environ["OUT"] url = os.environ["URL"] package = os.environ["PACKAGE"] series = os.environ["OPNSENSE_ABI"] abi = os.environ["FREEBSD_ABI"] h = html.escape content = f'''
FreeBSD pkg repository for the os-rustproxy OPNsense plugin.
Repository: {h(url)}
OPNsense series: {h(series)} ABI: {h(abi)}
The separate optional native FreeBSD pkg repository is available at {h(url)}/freebsd/ when FREEBSD_NATIVE_ENABLED=1.
mkdir -p /usr/local/etc/pkg/repos
cat > /usr/local/etc/pkg/repos/RustProxy.conf <<'REPO'
RustProxy: {{
url: "{h(url)}",
enabled: yes,
mirror_type: "none",
signature_type: "none"
}}
REPO
pkg update -f
pkg install os-rustproxy