An OpenWrt package feed that builds tollgate-wrt from the upstream
OpenTollGate/tollgate-module-basic-go
source using OpenWrt's golang-package.mk.
TollGate turns an OpenWrt router into a Cashu-powered payment gateway for
internet access. This feed produces a single package that installs both
binaries — the tollgate-wrt service and the tollgate CLI — plus its init
scripts, UCI defaults, captive-portal site, and hotplug hooks.
The upstream repository is not modified by this feed. It is downloaded, built, and packaged entirely from the release source tarball.
An earlier attempt (upstream PR #125)
tried to restructure upstream's Go source (src/ → repo root) to satisfy
golang-package.mk. That touched ~120 files and could not be rebased.
golang-package.mk accepts GO_PKG pointing at a subdirectory, so no
upstream restructure is needed. Keeping the feed glue in this separate repo
means:
- zero rebase collisions with upstream development, forever;
- the package is usable as a
src-gitfeed today; - the
net/tollgate-wrt/directory lifts cleanly into a future PR againstopenwrt/packagesas a small, reviewable addition.
Add it to an OpenWrt build:
echo "src-git tollgate https://github.com/FreedomTechFeed/feed.git" >> feeds.conf
./scripts/feeds update tollgate
./scripts/feeds install tollgate-wrtThen enable it in make menuconfig under Network → Captive Portals →
tollgate-wrt, and build.
The package depends on
nodogsplashandjq, which come from the standardpackagesfeed — keep that feed enabled too.golang-package.mk(the Go build helpers) also comes from thepackagesfeed.
The upstream source has two Go modules:
- the service, the main module at
src/(github.com/OpenTollGate/tollgate-module-basic-go), - the CLI, a self-contained module at
src/cmd/tollgate-cli/(module tollgate-cli).
golang-package.mk builds one module per Makefile. The Makefile overrides
Build/Compile to: (1) build the service through the framework helper, then
(2) build the CLI manually from its own module dir, reusing the framework's
exported cross-compile environment. One package, both binaries —
/usr/bin/tollgate-wrt and /usr/bin/tollgate.
scripts/sync-from-upstream.sh v0.5.1This downloads the tarball for the given tag, recomputes PKG_HASH, sets
PKG_VERSION, and re-vendors packaging/files/ into net/tollgate-wrt/files/.
Review the diff (the captive-portal-site assets change every release — that's
expected) and commit.
.github/workflows/validate-feed.yml runs three jobs:
- validate — Makefile lint (fields present, no
REPLACES),PKG_HASHverified against the live tarball, every referencedfiles/path exists. - go-smoke — fast
go buildof both modules for amd64/arm64/mipsle (no SDK, catches source breakage quickly). - build-sdk — the authoritative proof: a real OpenWrt SDK compile of the
package via
golang-package.mk, including the nested CLI-module build.
The SDK job is the gate before submitting upstream. See PLAN.md
for the full design and the highest-risk item.
When this feed is green in CI, the net/tollgate-wrt/ directory can be lifted
into a PR against openwrt/packages. The only change required is the
golang-package.mk include path:
-include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
+include ../../lang/golang/golang-package.mkFollow the
openwrt/packages contributing guide
(Signed-off-by, commit-message format) when opening that PR.
GPL-3.0-only — matches upstream. The built tollgate-wrt package ships
upstream's LICENSE.