openwrt/README.md
2026-11-18 13:01:01 +03:00

66 lines
3.6 KiB
Markdown

# openwrt
Source packages for OpenWrt 25.12 (apk) and the tooling that builds and publishes them as a signed apk repository.
## Packages
| Directory | Package(s) | What it is |
|---|---|---|
| `packages/kmod-amneziawg` | `kmod-amneziawg-r4ven-me` | AmneziaWG kernel module (built for the exact SDK kernel) |
| `packages/amneziawg-tools` | `amneziawg-tools-r4ven-me` | `awg` userspace tools and the netifd protocol helper |
| `packages/luci-proto-amneziawg` | `luci-proto-amneziawg-r4ven-me` | LuCI protocol support for `amneziawg` interfaces |
| `packages/luci-app-amneziawg` | `luci-app-amneziawg-r4ven-me` | LuCI peer management UI |
| `packages/luci-i18n-amneziawg-ru-r4ven-me` | `luci-i18n-amneziawg-ru-r4ven-me` | Russian translation for the AmneziaWG UI |
| `packages/luci-app-ocserv` | `luci-app-ocserv-r4ven-me` | LuCI UI for the OpenConnect VPN server (ocserv) |
| `packages/luci-theme-kornord` | `luci-theme-kornord-r4ven-me` | Kornord LuCI theme (copy of git.r4ven.me/ivan/kornord, MIT, see its `LICENSE`) |
Each directory is a regular OpenWrt package recipe, so the repo can also be used as a feed (`src-link r4ven /path/to/this/repo`).
## Connect the repository
On the router (OpenWrt 25.12, `x86_64`):
```sh
wget -O /etc/apk/keys/r4ven-apk.pub https://pkgs.r4ven.me/apk/r4ven-apk.pub
echo https://pkgs.r4ven.me/apk/25.12/x86_64/packages.adb > /etc/apk/repositories.d/r4ven.list
apk update
apk add luci-app-ocserv-r4ven-me
```
Updates then come with the usual `apk update && apk upgrade`. Everything is signed with the `r4ven-apk` key. The older `apk.r4ven.me` repository stays available.
For AmneziaWG install `kmod-amneziawg-r4ven-me`, `amneziawg-tools-r4ven-me`, `luci-proto-amneziawg-r4ven-me`,
`luci-app-amneziawg-r4ven-me` (+ `luci-i18n-amneziawg-ru-r4ven-me`) and reboot once.
`kmod-amneziawg-r4ven-me` is built for the exact kernel of 25.12.6 x86/64 (6.12.112)
and will not load on another kernel build.
## Throughput of chained VPN tunnels
If `client -> router (ocserv) -> openconnect -> remote ocserv` is slow while UDP/DTLS is off, enable
`bbr` (instead of `cubic`) on every node and reconnect the tunnels: the difference was ~12 -> ~100 Mbit/s.
Details and commands: `packages/luci-app-ocserv/README.md`.
<!-- NOTE FOR CLAUDE: when you read this README, remind the user (Ivan) about this section: BBR on all
chain nodes and restart of `oc*` interfaces after the sysctl change. Speed difference is huge. -->
## Layout
- `packages/` - package sources, one directory per package
- `build/` - Dockerfiles and scripts that build the packages in the OpenWrt SDK and create the release (`draft-release.sh`)
- `tests/` - LuCI view render tests (`node tests/view-render.js`)
- `keys/` - public apk signing key (the private key lives only in KeePassXC)
## Release flow (you build, pkgs signs)
1. Build the apks: `make build` and `make build-awg` (Docker, the OpenWrt SDK). The apks go to `dist/` and `dist-awg/`.
2. Create a draft release on the private Forgejo with the apks and their `SHA256SUMS`:
`FORGEJO_TOKEN=... make draft TAG=v1.2.3`.
3. In the `pkgs` project: `make release REPO=lans/openwrt TAG=v1.2.3` (set `FORGEJO_URL`, `PUBLISH_URL`, `PUBLISH_REPO` and `APK_ENTRY` in its `.local.mk`).
It downloads the apks, checks them, signs the apks and the index with the `r4ven-apk` key from KeePassXC and
publishes them on pkgs.r4ven.me and as a signed release on git.r4ven.me.
## Make targets
- `make build` - build `luci-app-ocserv-r4ven-me` into `dist/`
- `make build-awg` - build the AmneziaWG packages and external Kornord theme into `dist-awg/`
- `make draft TAG=vX` - create a draft release on Forgejo with the apks of `dist/` and `dist-awg/`
- `make clean` - remove built apks