项目的 README,来自 github.com/smthdagg/wificalling-location-gateway。合并为一个 markdown 文件:README.md。
An all-in-one Wi‑Fi Calling + Apple WLOC gateway for OpenWrt / ImmortalWrt
A standalone Rust service handles exit geolocation, WLOC response rewriting, certificate lifecycle, precise traffic isolation, and LuCI management — all integrated into a single installable package.
English Guide · 中文完整教程 · Security Policy · Development & Test Plan
[!IMPORTANT] This project is intended for authorized devices, networks, and test environments only. It does not prove that your carrier has enabled Wi‑Fi Calling, and it is not a substitute for real call verification; WLOC target locations must never be treated as emergency-call location. Follow local law, carrier terms, and Apple device-management requirements.

Wi‑Fi Calling Location Gateway brings two previously separate flows together on one router:
The core boundary of the project is "independent, precise, and revertible": WLOC uses its own process, UCI config, Unix socket, nftables table, and logs. It never takes over the Gateway's nftables table and never intercepts UDP 500/4500. When the protocol is unknown, Geo data is invalid, or the service is unhealthy, no default fake coordinates are produced.
.mobileconfig install entry and fingerprint verification.[Interface]/[Peer] config import, real-handshake health checks, and
WLOC follow-device exit probing through sing-box endpoints.sing-box.json and loaded into memory - unreferenced WireGuard
tunnels and protocol stacks stay off, so memory scales with the nodes
actually in use rather than the total configured (measured on AX6S:
sing-box RSS ~19-23 MB → ~15 MB).%%{init: {"flowchart": {"toolbar": false}}}%%
flowchart TD
I["Authorized test iPhone"] -->|"Wi‑Fi Calling · UDP 500/4500"| G["Wi‑Fi Calling Gateway"]
G --> N["Bound sing-box node"]
I -->|"Apple WLOC · TCP 443"| D["Precise DNS / nftables isolation"]
D --> R["wloc-service · Rust"]
R -->|"TLS + HTTP/2, strict upstream validation"| A["Apple WLOC"]
R --> P["Exit probe"]
P --> N
P --> X["Geo resolution & cache"]
X --> R
L["LuCI / rpcd"] -->|"root-only UDS API"| R
A location update roughly goes through these steps:
More detail: WLOC Service API, Threat model, and fail-open constraints.
| Layer | Implementation | Key constraints |
|---|---|---|
| Service runtime | Rust 2021, Tokio, static musl ELF | Rust 1.90; release LTO, opt-level=z, panic abort |
| TLS / HTTP | rustls, ring, tokio-rustls, h2 | TLS 1.2/1.3, ALPN h2, strict upstream cert & hostname validation |
| WLOC protocol | standalone clean-room protocol model with bounded parsing | Unknown, malformed, or oversized content is never guessed or partially rewritten |
| Control plane | wloc.service/v1, 4-byte BE framing, JSON, Unix socket |
16 KiB max frame, 2s total timeout, socket 0600, no TCP management port |
| Exit & location | sing-box exit probe, Geo primary/fallback + cache, manual coordinates | Invalid or stale data never falls back to default coordinates |
| OpenWrt integration | procd, UCI, rpcd, dnsmasq, firewall4/nftables | WLOC keeps its own table; never touches the Gateway table or UDP 500/4500 |
| Admin UI | LuCI JavaScript | Auto/manual switch, certificate, status, and log; sensitive fields sanitized |
| Build & release | OpenWrt SDK / Docker images pinned by digest | locked/offline compile, SHA-256, architecture tag cannot masquerade as all |
"Installable" is not the same as "verified with a real iPhone / Wi‑Fi Calling". The table separates the evidence levels:
| Platform | Arch | Package manager | Current evidence | Status |
|---|---|---|---|---|
| Redmi AX6S · ImmortalWrt 24.10.6 | MediaTek MT7622 / AArch64 | opkg | r16 service installed; one WIFICalling sing-box remained running, WLOC was intercepting, crash-recovery re-interception was observed, and post-test available memory remained above 32 MiB |
Docker + router + iPhone WLOC passed |
| OpenWrt 24.10.8 | x86_64 | opkg / IPK | Docker boot of init/ubus, integrated package install, service start, socket and v1 status checks | Install matrix passed |
| iStoreOS 24.10.5 | x86_64 | opkg / IPK | Same as above | Install matrix passed |
| OpenWrt 25.12.3 | x86_64 | apk / APK v3 | Same, using native APK v3, not a renamed IPK | Install matrix passed |
| Other OpenWrt / ImmortalWrt versions or CPUs | — | — | No device/SDK evidence yet | Not verified |
The runtime packages contain architecture-specific ELF files and must match the router CPU architecture. x86_64 packages are built with pinned SDKs; AX6S uses a separate AArch64 cortex-a53 toolchain. The formal Docker matrix installs both runtime variants for all three targets (six assets, eight runtime cases). Docker verifies install and boot; the AX6S row adds real router and iPhone WLOC evidence.
sing-box; Lite bundles its own runtime.Release v1.4.0-r1 provides two installation variants for each of three targets. Both belong to this project and contain the same WCG, WLOC, control tools, LuCI and saved UCI schema:
wificalling-location-gateway_1.4.0-r1_aarch64_cortex-a53.ipk, wificalling-location-gateway_1.4.0-r1_x86_64.ipk, wificalling-location-gateway-1.4.0-r1.apkwificalling-location-gateway-lite_1.4.0-r1_aarch64_cortex-a53.ipk, wificalling-location-gateway-lite_1.4.0-r1_x86_64.ipk, wificalling-location-gateway-lite-1.4.0-r1.apktable 100) and
Gateway (table 166) rule/route/TPROXY state, and an empty device scope
cleans up after a previously bound device instead of leaving a stale static
route behind.probe_interval is clamped to the validator window.Choose Standard when the firmware already supplies a suitable /usr/bin/sing-box. Choose Lite for constrained gateways such as AX6S: it stores a hash-pinned compressed sing-box in flash, transparently expands one shared copy into /tmp, and keeps the single-worker/moderate-GC runtime profile with the Go heap bounded at 48 MiB via GOMEMLIMIT. Standard and Lite conflict intentionally and must not be installed together. Both preserve /etc/config/wificalling-gateway and /etc/config/wloc-service.
The variant suffix changes runtime ownership only; it does not create a separate product or restore split component packages.
Two ways to install:
Method A — package feed (recommended): add the signed feed and opkg install directly:
# Import the feed signing key (one-time)
wget -O /etc/opkg/keys/f7050198aa77cf15 \
https://raw.githubusercontent.com/smthdagg/Smthdagg-Repo-feeds/main/wloc.pub
# Add the feed and install
echo "src/gz wloc https://smthdagg.github.io/Smthdagg-Repo-feeds/wificalling-location-gateway" \
>> /etc/opkg/customfeeds.conf
opkg update && opkg install wificalling-location-gateway
Method B — manual download: grab the matching file from
Releases
and verify it against SHA256SUMS from the same release directory first.
Full instructions for both methods live in the
feed repository
(including the manual .apk install commands for OpenWrt 25.x).
opkg install /tmp/wificalling-location-gateway-lite_1.4.0-r1_aarch64_cortex-a53.ipk
Back up both UCI files first. On storage-constrained AX6S units, stop the services and remove the old integrated and sing-box packages before installing Lite; do not delete the saved UCI files. The r16 Lite package replaces the separate sing-box package and owns its transparent wrapper. /tmp is RAM: prefer the signed-feed upgrade (opkg update && opkg upgrade wificalling-location-gateway-lite), and when installing a local IPK, delete it right after installation (opkg install /tmp/x.ipk && rm -f /tmp/x.ipk) — leftover files in /tmp can push available memory below the cold-start memory gate.
opkg install /tmp/wificalling-location-gateway_1.4.0-r1_x86_64.ipk
# Or use the corresponding Lite asset when a bundled, bounded runtime is preferred.
apk add --allow-untrusted /tmp/wificalling-location-gateway-1.4.0-r1.apk
--allow-untrusted applies only to locally built packages that are not yet signed in a repository. Formal releases use repository signing; never rename an IPK into an APK.
test -S /var/run/wloc-service/control.sock
/usr/sbin/wloc-ctl status
/etc/init.d/wificalling-gateway status
logread -e wloc-service
The status response must contain "api_version":"wloc.service/v1". If the LuCI menu did not refresh, clear the browser cache and log back in instead of reinstalling packages for other architectures.
Configure in this order to avoid mixing network and location problems:
ASSURED in Wi‑Fi Calling Monitor & Log; always confirm with a real call in/out.wloc-service root CA under Settings → General → About → Certificate Trust Settings, and verify the fingerprint.Step-by-step guides:
./scripts/ci/verify.sh
This entry runs formatting, Clippy, unit/integration tests, Rust line coverage (minimum 80%), dependency audit, license policy, secret scan, release size, and repository contract checks. The formal 1.0 baseline is 69 Python tests passing, Rust line coverage ≥ 80%, and a release verification binary of about 0.97 MB.
OPENWRT_BIN_NAME=wloc-service \
OPENWRT_CROSS_CACHE_DIR=/tmp/wloc-rust-openwrt \
./scripts/ci/verify-rust-openwrt.sh
This pins the OpenWrt 24.10.8 mediatek/mt7622 toolchain, Rust version, and SHA-256, and verifies the AArch64 ELF, static linking, and size. See Rust OpenWrt cross-build notes.
./scripts/openwrt/build-x86_64-runtime.sh \
--out-dir "$PWD/dist/runtime/x86_64"
./scripts/openwrt/build-release-packages.sh \
--version 1.4.0 \
--release 1 \
--arch x86_64 \
--service-bin "$PWD/dist/runtime/x86_64/wloc-service" \
--ctl-bin "$PWD/dist/runtime/x86_64/wloc-ctl" \
--gateway-ipk /absolute/path/wificalling-location-gateway_1.3.0-r1_aarch64_cortex-a53.ipk \
--gateway-sha256 <verified-sha256> \
--out-dir "$PWD/dist/openwrt-release"
./scripts/openwrt/verify-docker-matrix.sh \
--dist-dir "$PWD/dist/wloc-openwrt-release-r16"
Builds use the official OpenWrt SDK pinned by digest; after dependency preparation, product compilation runs locked/offline with read-only sources in a network-disabled container. Full boundaries and results: OpenWrt packaging and Docker matrix.
A GitHub Linguist byte snapshot of the current main branch (2026-08-19). The router product runtime is mainly Rust, with JavaScript driving the LuCI admin UI and Shell handling OpenWrt lifecycle and network integration; Python is mostly used for reproducible builds, fixture governance, and CI.
pie showData
title GitHub Linguist language snapshot
"Rust · 46.36%" : 435146
"JavaScript · 26.18%" : 245706
"Shell · 17.28%" : 162237
"Python · 9.93%" : 93223
The numbers drift as main updates; whether LuCI JavaScript, docs, and generated/excluded files count depends on GitHub Linguist rules. Do not judge the project's primary language by helper-tool bytes alone.
src/ Rust service, protocol, TLS/H2, exit & Geo modules
openwrt/ procd/UCI, LuCI/rpcd, and OpenWrt package definitions
scripts/openwrt/ cross builds, dual-format packaging, Docker matrix
scripts/ci/ coverage, security, dependency, and repository gates
tests/ Rust, Python, JavaScript, and network-model tests
fixtures/ synthetic/sanitized fixture contracts and validators
docs/ API, security, deployment, testing, bilingual guides
.handoffs/ reproducible multi-agent handoff records
wloc-service root CA profile on the iPhone revokes device trust; after regenerating the CA, reinstall and verify the new fingerprint on every test device.Report vulnerabilities privately via SECURITY.md; never paste certificates, IPs, node configs, or device information into public issues.
These come from the working model above (device → TPROXY intercept → wloc MITM → Apple WLOC), not theory. Each was hit in real testing.
inet wificalling_gateway table and its own fwmark 0x66 → table 166 TPROXY return path, kept separate from PassWall. PassWall runs a global TPROXY on inet passwall (PSW_MANGLE / PSW_NAT) that would otherwise capture the test device's traffic before this plugin sees it. passwall-bypass.sh therefore inserts a return rule (WFC_GATEWAY_BYPASS) for each bound test-device IP into PassWall's chains. If that bypass is missing or stale, the device's Apple 443 traffic is silently taken by PassWall and the WLOC intercept never fires — the plugin looks installed but does nothing. Re-run the bypass whenever the device set changes.gs-loc.apple.com as a client. Its outbound handshake rides the same TPROXY plumbing (ip rule fwmark 0x66 lookup 166, ip route local 0.0.0.0/0 dev lo table 166). If that mark, route table, or the apple_hosts set is wrong, the service's own outbound handshake is caught by its own redirect and loops — the device reaches wloc fine, but wloc cannot complete the handshake with Apple. This is the classic "device reaches the server, server can't reach Apple" symptom; check the nftables return path and apple_hosts before blaming DNS or the proxy node.issue-17): a duplicated Content-Length makes Apple return 400 Bad Request; a response not forced to Accept-Encoding: identity comes back gzip-compressed and cannot be rewritten; and the 10-byte opaque header framing ([0:2]=0x0001, [6:10]=u32 BE block length) must be re-summed after the patch or locationd reads a truncated body.This repository uses GitHub Issues as the only assignable work units, integrated through dedicated branches, path leases, reproducible handoffs, and cross-role reviews. Before committing:
./scripts/ci/verify.sh;Detailed collaboration: Multi-agent workflow.
The chart is regenerated daily by the
star-history-chartworkflow (or manually from the Actions tab). It uses GitHub's auto-injectedGITHUB_TOKENto read the star timeline and renders the SVG locally — the token never leaves GitHub's workflow environment and is never written to any repository file or third-party service. The chart lives on thestar-chartbranch and is embedded via the jsDelivr CDN.
If this project helps your OpenWrt / Wi‑Fi Calling experiments, a Star, a reproducible bug report, or a note in the LINUX.DO community is welcome. Please never publish personal locations, certificates, or proxy credentials in public content.
This project's own code is licensed under the MIT License. Lite release assets also contain sing-box under GPL-3.0-or-later; third-party components retain their own licenses. The MIT grant does not change the isolation requirements for external AGPL implementation material defined in the clean-room boundary ADR.
The Wi‑Fi Calling Gateway component was originally a separate project. This repository integrates it as a single installable package; formal builds accept only published IPKs validated by identity, version, and SHA-256.
Wi‑Fi Calling Location Gateway 将两个原本分离的流程组织在同一台路由器上:
项目的核心边界是”独立、精确、可回退”:WLOC 使用自己的进程、UCI 配置、Unix Socket、nftables 表和日志,不接管 Gateway 的 nftables 表,也不拦截 UDP 500/4500。遇到未知协议、无效地理数据或服务异常时,不生成默认虚假坐标。
.mobileconfig 安装入口与指纹核验。sing-box.json 并加载到内存——未引用的 WireGuard 隧道和协议栈不驻留,内存随实际使用节点数而非配置总数增长(AX6S 实测:sing-box RSS 从约 19-23 MB 降到约 15 MB)。%%{init: {"flowchart": {"toolbar": false}}}%%
flowchart TD
I["授权测试 iPhone"] -->|"Wi‑Fi Calling · UDP 500/4500"| G["Wi‑Fi Calling Gateway"]
G --> N["绑定的 sing-box 节点"]
I -->|"Apple WLOC · TCP 443"| D["精确 DNS / nftables 隔离"]
D --> R["wloc-service · Rust"]
R -->|"TLS + HTTP/2,上游严格校验"| A["Apple WLOC"]
R --> P["出口探测"]
P --> N
P --> X["Geo 解析与缓存"]
X --> R
L["LuCI / rpcd"] -->|"root-only UDS API"| R
一次位置更新大致经历以下步骤:
更详细的接口与安全设计见 WLOC Service API、威胁模型 和 fail-open 约束。
| 层级 | 实现 | 关键约束 |
|---|---|---|
| 服务运行时 | Rust 2021、Tokio、静态 musl ELF | Rust 1.90;release LTO、opt-level=z、panic abort |
| TLS / HTTP | rustls、ring、tokio-rustls、h2 | TLS 1.2/1.3、ALPN h2、上游证书与主机名强校验 |
| WLOC 协议 | 独立 clean-room 协议模型与有界解析 | 未知、畸形、超限内容不猜测、不部分修改 |
| 控制面 | wloc.service/v1、4-byte BE 帧、JSON、Unix Socket |
最大 16 KiB、总超时 2 秒、Socket 0600、无 TCP 管理端口 |
| 出口与位置 | sing-box 出口探测、Geo 主备/缓存、手动坐标 | 无效或过期数据不回落到默认坐标 |
| OpenWrt 集成 | procd、UCI、rpcd、dnsmasq、firewall4/nftables | WLOC 独立表;不触碰 Gateway 表和 UDP 500/4500 |
| 管理界面 | LuCI JavaScript | 自动/手动切换、证书、状态和日志;敏感字段脱敏 |
| 构建发布 | 固定摘要的 OpenWrt SDK / Docker 镜像 | locked/offline 编译、SHA-256、架构标签不可伪装为 all |
“可安装”不等于“完成真实 iPhone/Wi‑Fi Calling 验证”。下表把证据等级分开列出:
| 平台 | 架构 | 包管理器 | 当前证据 | 状态 |
|---|---|---|---|---|
| Redmi AX6S · ImmortalWrt 24.10.6 | MediaTek MT7622 / AArch64 | opkg | 已升级 1.4.0-r1:双卡(Lebara+Vodafone)VoWiFi 同时注册并实际通话成功,单机多隧道按通道显示;WFC IPv6 进隧道、WLOC IPv6 兜底生效;升级后可用内存高于 32 MiB | Docker + 路由器 + iPhone WLOC 通过 |
| OpenWrt 24.10.8 | x86_64 | opkg / IPK | Docker 中启动 init/ubus、安装集成包、启动服务、Socket 与 v1 状态检查 | 安装矩阵通过 |
| iStoreOS 24.10.5 | x86_64 | opkg / IPK | 同上 | 安装矩阵通过 |
| OpenWrt 25.12.3 | x86_64 | apk / APK v3 | 同上,使用原生 APK v3,非改名 IPK | 安装矩阵通过 |
| 其他 OpenWrt / ImmortalWrt 版本或 CPU | — | — | 尚无对应设备/SDK证据 | 未验证 |
运行时包包含与架构相关的 ELF,必须与路由器 CPU 架构一致。x86_64 使用固定 SDK,AX6S 使用 AArch64 cortex-a53 工具链。正式矩阵覆盖三类目标的 Standard/Lite 两种规格,共六个资产、八个运行用例;AX6S 另有真机与 iPhone WLOC 证据。
以下提醒来自 2026-09 AX6S 真机与多运营商线路实测,排障时请先对照:
3gppnetwork.org 域名返回投毒应答(127.0.0.1/::1)。实测 Vodafone/Lebara 的 ePDG 域名未受影响;若手机"完全没有注册尝试",先在路由器上核对 ePDG 域名解析。Some carriers reject VoWiFi from datacenter exit IPs (observed: IKE INITs dropped outright, or EAP rejected right after the identity phase, while Vodafone/Lebara registered normally on the same exits). If a SIM never registers on any node, use a residential broadband exit via a self-hosted WireGuard node. ICMP reachability does not prove a node forwards traffic; some resolvers poison parts of 3gppnetwork.org; and the monitor's "registered" is network-layer evidence only - the phone's Wi-Fi Calling icon is authoritative.
v1.4.0-r1 为三个目标各提供 Standard 与 Lite 两种安装规格。它们属于同一个项目,WCG、WLOC、控制工具、LuCI 与 UCI 数据结构完全一致:
wificalling-location-gateway_1.4.0-r1_aarch64_cortex-a53.ipk、wificalling-location-gateway_1.4.0-r1_x86_64.ipk、wificalling-location-gateway-1.4.0-r1.apkwificalling-location-gateway-lite_1.4.0-r1_aarch64_cortex-a53.ipk、wificalling-location-gateway-lite_1.4.0-r1_x86_64.ipk、wificalling-location-gateway-lite-1.4.0-r1.apktable 100)与网关(table 166)的规则/路由/TPROXY 状态随之撤除;任何失败的同步都会先清理旧状态,不再残留过期静态路由。probe_interval 钳制到校验窗口。固件已有合适 /usr/bin/sing-box 时选择 Standard;AX6S 等受限设备推荐 Lite:flash 只保存带 SHA256 固定的压缩运行时,首次调用透明解压一份到 /tmp;WCG 在 Lite 上以 GOMEMLIMIT 把 Go 堆固定在 48 MiB 并保留单 worker 与适度 GC。两种规格故意互斥,不能同时安装;两者都保留 /etc/config/wificalling-gateway 与 /etc/config/wloc-service。
Lite 后缀只表示运行时所有权与内存策略不同,不是新项目,也不会恢复拆分组件安装。
两种安装方式:
方式 A — 包源安装(推荐):添加签名包源后直接 opkg install:
# 导入源签名公钥(一次性)
wget -O /etc/opkg/keys/f7050198aa77cf15 \
https://raw.githubusercontent.com/smthdagg/Smthdagg-Repo-feeds/main/wloc.pub
# 添加源并安装
echo "src/gz wloc https://smthdagg.github.io/Smthdagg-Repo-feeds/wificalling-location-gateway" \
>> /etc/opkg/customfeeds.conf
opkg update && opkg install wificalling-location-gateway
方式 B — 手动下载:从
Releases
下载对应文件,并先校验同一发布目录中的 SHA256SUMS。
两种方式的完整说明见
feed 仓库(含
OpenWrt 25.x 的 .apk 手动安装命令)。
opkg install /tmp/wificalling-location-gateway-lite_1.4.0-r1_aarch64_cortex-a53.ipk
安装前先备份两份 UCI 配置。AX6S 空间不足时,先停止服务并卸载旧整合包和旧 sing-box 包,再安装 Lite;不要删除 UCI 配置。r16 Lite 会替代独立 sing-box 包并拥有透明启动包装器。/tmp 是内存:优先使用签名软件源升级(opkg update && opkg upgrade wificalling-location-gateway-lite);本地上传 IPK 安装后请立即删除(opkg install /tmp/x.ipk && rm -f /tmp/x.ipk)——/tmp 残留文件可能把可用内存压到冷启动内存门禁以下。
opkg install /tmp/wificalling-location-gateway_1.4.0-r1_x86_64.ipk
# 需要内置、受限运行时时也可选择对应 Lite 文件。
apk add --allow-untrusted /tmp/wificalling-location-gateway-1.4.0-r1.apk
--allow-untrusted 仅适用于当前未接入软件源签名的本地构建包。正式软件源发布应使用仓库签名,且不能把 IPK 重命名为 APK。
test -S /var/run/wloc-service/control.sock
/usr/sbin/wloc-ctl status
/etc/init.d/wificalling-gateway status
logread -e wloc-service
状态响应应包含 "api_version":"wloc.service/v1"。如果 LuCI 菜单未刷新,请清理浏览器缓存并重新登录,而不是反复安装不同架构的包。
请按以下顺序完成配置,避免把网络问题与位置问题混在一起:
ASSURED;最后必须以真实呼入/呼出确认。wloc-service root CA 开启完全信任,并核对指纹。完整图文步骤请阅读:
./scripts/ci/verify.sh
该入口执行格式、Clippy、单元/集成测试、Rust 行覆盖率(最低 80%)、依赖审计、许可证策略、秘密扫描、发布体积和仓库契约检查。正式版 1.0 验证基线为 69 个 Python 测试通过、Rust 行覆盖率 ≥80%、release 验证二进制约 0.97 MB。
OPENWRT_BIN_NAME=wloc-service \
OPENWRT_CROSS_CACHE_DIR=/tmp/wloc-rust-openwrt \
./scripts/ci/verify-rust-openwrt.sh
该流程固定 OpenWrt 24.10.8 mediatek/mt7622 工具链、Rust 版本和 SHA-256,并验证 AArch64 ELF、静态链接与体积。详见 Rust OpenWrt 交叉构建说明。
./scripts/openwrt/build-x86_64-runtime.sh \
--out-dir "$PWD/dist/runtime/x86_64"
./scripts/openwrt/build-release-packages.sh \
--version 1.4.0 \
--release 1 \
--arch x86_64 \
--service-bin "$PWD/dist/runtime/x86_64/wloc-service" \
--ctl-bin "$PWD/dist/runtime/x86_64/wloc-ctl" \
--gateway-ipk /absolute/path/wificalling-location-gateway_1.3.0-r1_aarch64_cortex-a53.ipk \
--gateway-sha256 <verified-sha256> \
--out-dir "$PWD/dist/openwrt-release"
./scripts/openwrt/verify-docker-matrix.sh \
--dist-dir "$PWD/dist/wloc-openwrt-release-r16"
构建使用固定摘要的官方 OpenWrt SDK;依赖准备之后,产品编译采用 locked/offline、只读源码和禁网容器。完整边界和结果见 OpenWrt 发布打包与 Docker 矩阵。
下面是 GitHub Linguist 在 2026-08-19 对当前主分支给出的代码字节快照。路由器产品运行时以 Rust 为主,JavaScript 驱动 LuCI 管理界面,Shell 负责 OpenWrt 生命周期与网络集成;Python 主要用于可复现构建、fixture 治理和 CI。
pie showData
title GitHub Linguist language snapshot
"Rust · 46.36%" : 435146
"JavaScript · 26.18%" : 245706
"Shell · 17.28%" : 162237
"Python · 9.93%" : 93223
统计会随主分支更新而变化;LuCI JavaScript、文档和生成/排除文件是否计入,以 GitHub Linguist 规则为准。项目的技术主语言不应只按仓库辅助工具的字节数判断。
src/ Rust 服务、协议、TLS/H2、出口与 Geo 模块
openwrt/ procd/UCI、LuCI/rpcd 与 OpenWrt 包定义
scripts/openwrt/ 交叉构建、双格式打包与 Docker 矩阵
scripts/ci/ 覆盖率、安全、依赖和仓库质量门禁
tests/ Rust、Python、JavaScript 与网络模型测试
fixtures/ 合成/授权脱敏 fixture 契约与校验器
docs/ API、安全、部署、测试和双语用户教程
.handoffs/ 多 Agent 可复现接管记录
wloc-service root CA 描述文件即可撤销设备信任;重新生成 CA 后必须重新核对并安装新指纹。漏洞请按 SECURITY.md 私下报告,并向公开 Issue 中贴证书、IP、节点配置或设备信息。
以下条目来自上面的工作原理(设备 → TPROXY 拦截 → wloc 中间人 → Apple WLOC),均为实测踩坑,而非理论。
inet wificalling_gateway 表,以及独立的 fwmark 0x66 → table 166 TPROXY 回环路径,与 PassWall 隔离。PassWall 在 inet passwall(PSW_MANGLE / PSW_NAT)上做全局 TPROXY,否则会在本插件之前抢走测试设备的流量。passwall-bypass.sh 因此会为每个已绑定测试设备 IP 在 PassWall 链中插入一条 return 规则(WFC_GATEWAY_BYPASS)。若该旁路缺失或过旧,设备的 Apple 443 流量会被 PassWall 静默截走,WLOC 拦截根本不触发——插件看似已装,实则不工作。设备集合变化时务必重新执行旁路。gs-loc.apple.com。它的出站握手复用同一套 TPROXY 机制(ip rule fwmark 0x66 lookup 166、ip route local 0.0.0.0/0 dev lo table 166)。若该 mark、路由表或 apple_hosts 集合写错,服务自身的出站握手会被自己的重定向规则捕获并回环——表现为“设备能连到 wloc 服务器,但 wloc 与 Apple 握手失败”。遇到“设备到服务端正常、服务端到 Apple 不通”这类症状,先查 nftables 回环路径与 apple_hosts,别急着怀疑 DNS 或节点。issue-17):重复的 Content-Length 会让 Apple 返回 400 Bad Request;未强制 Accept-Encoding: identity 的响应会以 gzip 压缩返回、无法重写;且 10 字节不透明头帧([0:2]=0x0001、[6:10]=u32 BE block length)在补丁后必须重算长度,否则 locationd 读到截断的 body。本仓库使用 GitHub Issue 作为唯一可分配工作单元,并以独立分支、路径租约、可复现 handoff 和异角色审查完成集成。提交前必须:
./scripts/ci/verify.sh;详细协作方式见 多 Agent 工作流。
图表由
star-history-chart工作流每日自动更新(也可在 Actions 页面手动运行)。它使用 GitHub 自动注入的GITHUB_TOKEN读取 star 时间线并在本地生成 SVG——token 只在 GitHub 的工作流环境内使用,不写入仓库任何文件,也不经过第三方服务。图表发布在star-chart分支,经 jsDelivr CDN 嵌入。
如果这个项目对你的 OpenWrt / Wi‑Fi Calling 实验有帮助,欢迎 Star、提交可复现的问题报告,或在 LINUX.DO 社区交流使用经验。请勿在公开内容中发布个人位置、证书或代理凭据。
本项目自有代码采用 MIT License。Lite 发布资产还内含采用 GPL-3.0-or-later 的 sing-box;第三方组件继续遵循各自许可证。MIT 授权不改变 clean-room 边界 ADR 对外部 AGPL 实现材料的隔离要求。
Wi‑Fi Calling Gateway 组件原为独立项目。本仓库将其整合为单一安装包;正式包构建只接受经过身份、版本和 SHA-256 校验的已发布 IPK。