Repository navigation
Allow disabling proxy rules without deleting them - #195
Merged
Merged
Conversation
Add an optional per-rule enabled flag (default true) so a rule can be turned off, saved, and left in app-config.json. The engine skips disabled rules at startup and logs each one. Overlap and catch-all warnings consider only enabled rules. DNS Proxy mode rejects a disabled selected proxy. The GUI exposes this as a checkbox on the routing grid and in the rule editor.
Rebuilding the routing grid from CellValueChanged detached the check box cell that was still handling the Space key, which crashed the GUI on .NET Framework. Toggling now refreshes row styles, warnings and the DNS proxy choices in place. Also treat "enabled": null as enabled, reject case variants of the enabled key, show DNS_PROXY_DISABLED on the rule's row, warn when every rule is disabled, gate the disabled-rule log line on the Info level, skip the editor's catch-all ordering warning for a disabled rule, fix the rule editor tab order and align docs/gui.md with the editor's checkbox label.
- Reject non-boolean "enabled" values with an error naming the rule and property; null still means enabled, and "true"/"false" strings are accepted and saved as booleans. - Move the rule editor's Enable checkbox to the OK/Cancel row so the dialog keeps its previous height and opens focused on the applications list instead of the checkbox. - Document that DNS Proxy mode blocks startup when its rule is disabled, and that within-rule duplicates are still reported for disabled rules. - Replace a vacuous validator assertion with positive controls.
…nt downgrade The rule editor warned that an enabled catch-all shadows later rules whenever any rule followed it, while CATCH_ALL_NOT_LAST now considers only enabled rules. The editor now receives the later rules and warns only when an enabled rule follows, so both report the same condition. A disabled catch-all that is not last shadows nothing today, but would shadow every later rule if re-enabled or run by ProxiFyre 2.7.0 or earlier, which ignore "enabled". The editor now warns about that case, and the docs explain that older versions run disabled rules.
- Validator: keep checking the DNS proxy's settings after DNS_PROXY_DISABLED, so re-enabling the rule does not reveal errors that were there all along. - Validator: PROXIES_ALL_DISABLED now fires when null entries sit beside disabled rules (still not for a list of only null entries). - Rule editor: block clearing "Enable this rule" on the rule DNS Proxy mode uses, instead of reporting the rule as valid until OK. - Rule list: show the disabled-catch-all-not-last warning on the row, so disabling it from the grid checkbox is flagged like it is in the editor. - Rule list: a null entry's Enabled box is unchecked. - Engine log: only an explicit "" is shown as <catch-all>; null and whitespace entries are left out of the disabled-rule message. - Model: drop the no-op Order = -1 on Enabled.
- Serializer: an "enabled" value that is not one true/false (a number, "yes", or keys differing only in case) no longer fails the load. Earlier releases ignored the key, so the rule stays enabled, the validator reports ENABLED_FLAG_IGNORED, and the GUI drops the value when it saves. - Rule list: the Enabled check box of the DNS proxy rule cannot be cleared, matching the rule editor; the change is undone with an explanation. - Rule list: a check box change the rule cannot follow is undone instead of leaving the row out of step with the configuration. - Rule list: after a load, the current cell is moved off the Enabled check box so Space does not silently toggle rule 1. - Rule editor: the blocking DNS proxy error is listed first so it is not cut off by the fixed-size validation label. - Version 2.8.0: the docs and warnings already say 2.7.0 and earlier ignore "enabled"; documented the upgrade effect of a previously ignored "enabled": false.
wiresock
force-pushed
the
feature/disable-proxy-rules
branch
from
November 30, 2026 20:14
2607553 to
7f8732b
Compare
- Rule list: toggling a rule's Enabled check box clears a flag that was ignored at load, so its ENABLED_FLAG_IGNORED warning no longer stays on a rule the user has just set. - Serializer: with several "proxies" keys differing only in case, Json.NET appends every array to one list (a null value starts a new one); ignored flags are now keyed by that combined position, not the index within each array, so the warning is reported on the rule that has the flag.
… proxy choice - CloneRule copies IgnoredEnabledFlag, so opening a rule in the editor or duplicating it no longer hides its ENABLED_FLAG_IGNORED warning; the editor clears the flag only when the user changes Enable this rule. - Choosing a disabled rule as the DNS proxy, or switching DNS to Proxy mode with one selected, offers to enable that rule instead of silently producing DNS_PROXY_DISABLED. - ENABLED_FLAG_IGNORED abbreviates the ignored value to 64 characters so a large object cannot flood the grid or the service log.
…inal - The offer to enable a disabled DNS proxy rule is no longer raised on every selection change, which asked about each rule passed with the arrow keys or the mouse wheel. It is asked once, when the DNS mode or proxy list closes or loses focus and DNS Proxy mode still points at a disabled rule. - ENABLED_FLAG_IGNORED no longer splits a surrogate pair when abbreviating. - A duplicate rule id is reported with the rule's position across all "proxies" keys, as ignored enabled flags already are.
…g on duplicates - DnsChoiceCommitted always defers the check for a pending offer. Windows can raise DropDownClosed before the SelectedIndexChanged it commits, so checking the flag immediately missed a disabled rule picked with the mouse. - A duplicated rule no longer reports the original's ignored enabled flag; the copy was never read from the file and is saved as plainly enabled.
…re-picked - After Yes to enabling the DNS proxy rule, the edit is applied only if no service or configuration operation happened while the question was open, as for the other confirmation dialogs. - Closing the DNS proxy list on the disabled rule already shown now offers to enable it too; choosing it again raises no selection change.
- The modal offer to enable a disabled DNS proxy rule is replaced by a notice in the DNS group, shown in place of the explanation while DNS Proxy mode points at a disabled rule, with an Enable rule button. Choosing in the DNS boxes with the keyboard, mouse wheel, or list no longer raises a question, repeats it on Escape, or can swallow the click that moved focus. - Double-clicking the Enabled cell outside the check box opens the rule editor like the other cells; a double-click on the box itself still only toggles it.
A null entry's Enabled check box is read-only and does not toggle, so a double-click on it now opens the editor, where the entry is replaced, as a double-click anywhere else on the row does.
GitHub release downloads (vcpkg.exe during vcpkg bootstrap, and the Windows Packet Filter MSI in Build-Installer.ps1) intermittently fail on hosted runners with HTTP 618, failing a build before it starts. - New composite action .github/actions/setup-vcpkg, used by both workflows: retries the vcpkg clone, bootstrap, and package install with backoff, and caches the bootstrapped vcpkg.exe keyed on the vcpkg-tool release the clone pins. - Build-Installer.ps1: prerequisites are downloaded with retry and backoff, and an optional -DownloadCacheDirectory reuses a copy that matches the pinned size and hashes (content-addressed by SHA-256). The existing size, hash, version, and signature checks still apply to every file. - The release workflow caches that directory per platform and no longer cancels the other matrix legs when one fails.
A single package made the split result a scalar string, which vcpkg received mangled. Force an array and pass it as plain arguments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
enabledflag so a proxy rule can be turned off without deleting it (#191). The release version is bumped to 2.8.0.enableddefaults totrue. Omitted,null, ortruemeans the rule is active, so existing configurations behave as before. Only"enabled": falseis written when the configuration is saved.Configuration
{ "proxies": [ { "id": "office", "appNames": ["firefox"], "socks5ProxyEndpoint": "10.0.0.1:1080" }, { "enabled": false, "appNames": ["firefox"], "socks5ProxyEndpoint": "10.0.0.2:1080" } ] }The strings
"true"and"false"(any letter case) are accepted and saved as booleans. Any other value (a number,"yes", an object, and so on), or two keys that differ only in case (enabledandEnabled), is ignored: the rule stays enabled, as earlier releases ran it, and validation reports anENABLED_FLAG_IGNOREDwarning. Saving from the GUI drops the ignored value.Validation
CATCH_ALL_NOT_LAST), consider only enabled rules, so an unused alternative for the same application can be kept disabled beside the active one. Duplicate matches within a single rule are still reported whether or not the rule is enabled.PROXIES_ALL_DISABLEDwarning. Exception: in DNS Proxy mode the rule selected bydns.proxyIdmust stay enabled. If it is disabled, validation reports theDNS_PROXY_DISABLEDerror (on that rule as well as in the full list) and the service does not start. DNS is never switched to another proxy automatically. In Direct mode a disabled rule with an id is fine.GUI
Rows.Clear(), so the .NET FrameworkDataGridViewCheckBoxCellis not detached while its key or mouse handler is still using it.Compatibility / upgrade notes
"enabled": falsevalue that an earlier version ignored takes effect. If that rule is the DNS proxy inProxymode, the service does not start until the rule is enabled.enabledand ignore it. After downgrading, rules saved with"enabled": falsebecome active again and traffic is routed through them. A disabled catch-all that is not last would then shadow every later rule; move it last or delete disabled rules before downgrading. This should be mentioned in the release notes.README,
docs/configuration.md, anddocs/gui.mdare updated to match.Testing
bfb5daais green: Build and publish release (x86, x64, and ARM64, plus artifact verification) and Native tests (netlib-tests Debug/Release and portable-native-tests) all passed. The x64 job ran the managed tests on Windows: 452 passed, 452 total.Closes #191