Take a machine's registrations and rules somewhere else - #69
Merged
Merged
Conversation
Both live in one SQLite file, so rebuilding a machine meant either losing them or copying that file - which also carries the history, the snapshots, and whatever schema version that warden happened to be on. `warden state export` writes what somebody wrote down: which services hold which ports, and which rules decide what crosses. The history stays where it happened, because it is a record of that machine and means nothing on another one. The snapshots stay too, and that one is not a nicety: a snapshot is some other firewall's ruleset, and restoring one onto a different machine is the single thing this whole design exists to make impossible by accident. `warden state import` lands a row at a time. A name already registered here, or a port this machine does not hand out, is one row's problem rather than a reason to refuse the other forty - and every row that does not land is named. The pool belongs to the machine, so an imported registration does not get to widen it; `--any-port` says to take a free one instead, which is the other right answer on a different day. `--dry-run` says all of it and writes nothing, which is the reason somebody runs an import against a machine they care about at all. Rules land written down and not applied, and the import says so rather than letting somebody assume otherwise. The file carries a shape number and the version that wrote it. A file from a later warden is refused by name instead of read hopefully - the field exists so that the first time the shape changes is not the first time anybody thinks about it. Closes #61
|
Warning Review limit reachedNext included review available in 24 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Closes #61.
Registrations and firewall rules live in one SQLite file, so rebuilding a machine meant either losing them or copying that file — which also carries the history, the snapshots, and whatever schema version that warden happened to be on.
What does not travel
It lands a row at a time
A name already registered here, or a port this machine does not hand out, is one row's problem rather than a reason to refuse the other forty — and every row that does not land is named.
--dry-run--any-portThe pool belongs to the machine, so an imported registration does not get to widen it.
--any-portis the other right answer on a different day.Rules land written down, not applied, and the import says so rather than letting somebody assume otherwise — the same gap #57 is about, said the same way.
The shape
The file carries a
shapenumber and the version that wrote it. A file from a later warden is refused by name instead of read hopefully. The field exists so that the first time the shape changes is not the first time anybody thinks about it.701 → 712 tests.