luci-app-pbr-1.2.3: Tor policy warning strings, drop dead iptables code - #39
Conversation
Companion to the pbr change that restores the Tor policy warnings. pbr now emits warningTorUnsetSrcPort and warningTorUnsetDestPort in place of the single warningTorUnsetParams, so the WebUI needs the matching entries or it renders 'Unknown warning'. - status.js: replace warningTorUnsetParams with warningTorUnsetSrcPort and warningTorUnsetDestPort. The old string told users to unset 'src_addr', which is in fact the correct way to match a Tor policy, so it is not carried over. The two new strings also state the consequence, which differs: src_port produces an invalid rule, dest_port is merely ignored. - compat 35 -> 36 in status.js (LuciCompat) and luci.pbr (rpcdCompat). Also removes render entries and branches for things pbr can no longer emit. The iptables backend was removed in pbr 1.1.7 and 'running_iptables' has been hardcoded false ever since; the companion PR drops it from the status payload entirely. - status.js: drop the running_iptables field and the "(iptables mode)" branch; drop errorNoIptables, errorNoIpset and errorIpsetNameTooLong, none of which exist in pbr's catalog; drop warningTorUnsetChainIpt, orphaned since the iptables variant was removed. - 72_pbr.js: drop the matching "(iptables mode)" branch. Net effect on the WebUI is nil -- every branch removed was unreachable and every string removed was for a code pbr cannot produce. Not touched: warningAGHVersionTooLow, which is dead in the same way but belongs to a separate AdGuardHome cleanup, and the 'resolver_ipset' -> 'resolver_set' migration in pbr's uci-defaults, which is still needed for upgrades from old configs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Erik Conijn <egc112@msn.com>
|
All three addressed. Comments added in 1 & 3. Compat coupling comments — added at both declarationsAgreed the coupling was invisible in the source: both values read as arbitrary constants, and the five-location bump is easy to get half-right. What I did not write is "DO NOT merge this PR without mossdef-org/pbr#150". That is PR-lifecycle state in a permanent source file — it goes stale the moment this merges, and every future reader sees a merge instruction for a PR that landed long ago. Worse, it would still be sitting there at the next compat bump, pointing at the wrong PR. Instead both comments state the durable invariant, which applies to every future catalog change rather than just this one: // Must equal pbr's pkg.compat and rpcdCompat in luci.pbr. Any change to
// pbr's error/warning catalog bumps all five in lockstep: pbr pkg.uc,
// pbr files/etc/init.d/pbr, pbr tests/04_policies/01_start_dynamic_routing,
// this getter, and rpcdCompat. A mismatch trips isVersionMismatch() below
// and tells the user their WebUI is outdated, so the two packages have to
// be released together.
get LuciCompat() {Naming the five locations is the part that actually prevents the mistake — two of them are easy to miss with a plain grep ( The merge coordination for this PR is stated in both PR descriptions, where transient information belongs and where it does not rot. 2. Translations — pot is generated, not hand-maintained
Current state, for the record: it still lists the removed string and does not yet carry the two new ones. That resolves on the next template regeneration. Added a Translations section to the PR description naming both new messages so translators have them:
|
LuciCompat and rpcdCompat have to equal pbr's pkg.compat, and a mismatch trips isVersionMismatch() and tells the user their WebUI is outdated. That invariant was nowhere in the source, so the two values read as arbitrary constants and the five-location bump is easy to get half-right. States the invariant at both declarations rather than referencing a specific PR: the coupling applies to every future catalog change, not just this one, and merge-time coordination belongs in the PR description where it does not go stale. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Erik Conijn <egc112@msn.com>
|
Co-Pilot comment:
|
Lockstep release bump with pbr. Covers errorInterfacePriorityExhausted (#37) and the Tor policy warning strings plus dead iptables cleanup (#39). Compat moved 34 -> 36 across those changes, so both packages have to be released together. Signed-off-by: Erik Conijn <egc112@msn.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
What
Companion to mossdef-org/pbr#150, which restores the Tor policy warnings.
pbr now emits
warningTorUnsetSrcPortandwarningTorUnsetDestPortin place of the singlewarningTorUnsetParams, so the WebUI needs the matching entries or it renders "Unknown warning".status.js: replacewarningTorUnsetParamswithwarningTorUnsetSrcPortandwarningTorUnsetDestPort. The old string told users to unsetsrc_addr, which is in fact the correct way to match a Tor policy, so it is not carried over. The two new strings state their differing consequence:src_portproduces an invalid rule,dest_portis merely ignored.status.js(LuciCompat) andluci.pbr(rpcdCompat).Dead iptables code removed
The iptables backend was removed in pbr 1.1.7 and
running_iptableshas been hardcodedfalseever since; pbr#150 drops it from the status payload entirely.status.js: drop therunning_iptablesfield and the "(iptables mode)" branch; droperrorNoIptables,errorNoIpsetanderrorIpsetNameTooLong, none of which exist in pbr's catalog; dropwarningTorUnsetChainIpt, orphaned since the iptables variant was removed.72_pbr.js: drop the matching "(iptables mode)" branch.Net effect on the WebUI is nil — every branch removed was unreachable and every string removed was for a code pbr cannot produce. The diff is a net deletion: +9 / −21.
Translations
po/templates/pbr.potis deliberately untouched — it is xgettext output, regenerated from the luci tree (its source references carryapplications/luci-app-pbr/paths), not hand-maintained here. It currently still lists the removedPlease unset 'src_addr', 'src_port' and 'dest_port'...string and does not yet carry the two new ones; that resolves on the next template regeneration. Translators will need the two new messages:Please unset 'src_port' for policy '%s': it produces an invalid rulePlease unset 'dest_port' for policy '%s': it is ignoredNot touched
warningAGHVersionTooLow, dead in the same way but belonging to a separate AdGuardHome cleanup.resolver_ipset→resolver_setmigration in pbr's uci-defaults, still needed for upgrades from old configs.These two are a matched pair. Merging either alone leaves a compat mismatch — users would see the "WebUI application is outdated" / version-mismatch warning until both are in.
🤖 Generated with Claude Code