This commit is contained in:
Mateusz Gruszczyński committed 2026-09-29 14:07:21 +02:00
1 parent 093e6a7c14
commit 1a2a5f0faf
24 files changed
+578 -537

No files matched your search

+64 -48
View File
@@ -1,66 +1,82 @@
# RustProxy OPNsense packaging repository
This repository contains only the OPNsense plugin and build/release automation. The RustProxy application source is **not vendored here**. The Debian scheduler downloads it dynamically from:
Docker-only build pipeline for RustProxy on Debian. No FreeBSD VM is required.
RustProxy itself is not stored here. Every scheduled run fetches it independently from:
`https://git.linuxiarz.pl/gru/RustProxy`
## What is included
- `opnsense-plugin/www/rustproxy/` - OPNsense plugin source.
- `builder/debian/` - hourly scheduler and optional cross-build helper.
- `builder/freebsd/` - native FreeBSD release builder and repository signing helper.
- `ci/build-release.sh` - Debian-to-FreeBSD orchestration and publishing.
- `deploy/opnsense/` - custom package repository install/update helpers.
- `docs/` - setup and architecture notes.
## Source/update flow
## Flow
```text
Packaging repository RustProxy upstream
(plugin + scripts) https://git.linuxiarz.pl/gru/RustProxy
| |
+------------------+-------------------+
v
Debian cron, hourly
|
detects either commit change
|
v
FreeBSD 15.1 amd64 builder
|
cargo test + cargo build
|
OPNsense make package
|
v
signed pkg repository
|
v
OPNsense
rustproxy-opnsense-repo RustProxy upstream
| |
+--------------+---------------+
v
Debian cron hourly
|
v
Docker cross-build image
Rust 1.88 + clang/lld + FreeBSD 15.1 sysroot
|
v
x86_64-unknown-freebsd binary
|
v
Linux-side .pkg assembly
|
v
dist/os-rustproxy-latest.pkg
|
v
pkg add -f on OPNsense
```
By default `APP_REPO_REF=HEAD`, so every cron run follows the current default branch of the RustProxy repository. You can instead pin a branch/tag/ref in `/etc/rustproxy-opnsense-builder.env`.
The Docker container does not emulate FreeBSD. It runs on the Linux kernel and uses the FreeBSD 15.1 headers/libraries only as a cross-compilation sysroot.
A release rebuild is triggered when either the packaging repository commit or the RustProxy upstream commit changes. The package version is read at build time from the dynamically downloaded `Cargo.toml`.
## Repository contents
## Recommended release build
- `opnsense-plugin/www/rustproxy/` - OPNsense plugin source.
- `builder/docker/Dockerfile` - Rust/Clang FreeBSD 15.1 cross toolchain.
- `builder/debian/hourly-build.sh` - fetch/change detection scheduler.
- `builder/debian/build-docker-release.sh` - Docker build orchestration.
- `builder/debian/package-freebsd.sh` - creates a FreeBSD `.pkg` archive on Linux.
- `ci/build-release.sh` - build/publish/test-deploy entrypoint.
- `deploy/opnsense/install-direct.sh` - direct package installer for OPNsense.
- `docs/FIRST_RUN.md` - exact first-run commands.
Use the Debian VM only as scheduler/orchestrator and a FreeBSD 15.1 amd64 VM as compiler/packager. The included Docker/cross path (`BUILD_MODE=cross-binary`) is for development validation only and does not publish production `.pkg` files.
## Build trigger
## Quick validation
A build starts when either:
- this packaging repository changes, or
- the fetched RustProxy commit changes.
`APP_REPO_REF=HEAD` follows the current default branch. A tag or branch can be pinned in `/etc/rustproxy-opnsense-builder.env`.
## Output
After a successful run:
```text
dist/
├── BUILD-INFO.txt
├── SHA256
├── os-rustproxy-latest.pkg
├── docker-build/rust-proxy
└── packages/26.7/amd64/os-rustproxy-<version>_<revision>.pkg
```
This version intentionally produces an installable `.pkg`, not a full `pkg repo` catalogue. Installation/update is currently done with `pkg add -f`.
## OPNsense UI
The first version exposes only **Services -> RustProxy -> Enabled**. RustProxy runs as the unprivileged `rustproxy` user.
## Validation
```sh
./scripts/check.sh
```
## Quick setup
Read `docs/FIRST_RUN.md`, copy `builder.env.example` to `/etc/rustproxy-opnsense-builder.env` on Debian and fill in your packaging-repository, SSH and publication settings. `APP_REPO_URL` is already set to your RustProxy repository.
## OPNsense UI scope
The plugin currently exposes only Enabled / Disabled. RustProxy is supervised by FreeBSD `daemon(8)`, runs as user `rustproxy`, and uses `/var/db/rustproxy` as its private data directory.
## License
RustProxy's `Cargo.toml` currently does not declare a license and the supplied source snapshot did not contain LICENSE/COPYING, so the plugin manifest remains `UNKNOWN`. Set the correct license before public redistribution.
See `docs/FIRST_RUN.md` for Debian setup.