Skip to content

Commit bb9ae46

Browse files
committed
Preserve peers.toml formatting on writes
1 parent d573973 commit bb9ae46

5 files changed

Lines changed: 458 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ EXPERIMENTAL, so on-disk formats and the CLI may change without notice.
88

99
### Fixed
1010

11+
- **Fabric commands no longer replace the formatting in `peers.toml`.** Add,
12+
remove, policy, and Git remote changes update only the affected entries.
13+
User comments, spacing, order, and an edited or removed file header remain.
14+
1115
- **A failed tunnel no longer reuses one bad shared connection forever.**
1216
Fabric counts post-admission attach failures on the exact current connection.
1317
Three consecutive failures replace it. Only sustained application progress

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ serde_json = "1"
3434
tokio = { version = "1", features = ["full"] }
3535
tokio-util = "0.7"
3636
toml = "0.9"
37+
toml_edit = "0.25"
3738
tracing = "0.1"
3839
tracing-appender = "0.2"
3940
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,10 @@ human-editable and can be provisioned before Fabric ever runs. The top-level
12141214
`allow_shell` and `allow_exec` fields control the services this machine offers.
12151215
Each field defaults to false. Each `[[peers]]` entry accepts:
12161216

1217+
Fabric commands update this file in place. They preserve comments, spacing,
1218+
entry order, and changes to the generated header. Fabric writes the default
1219+
header only when it creates a new file.
1220+
12171221
- `id` (required): the peer's 64-character hexadecimal iroh NodeID.
12181222
- `name` (optional): a non-empty, unique local alias for commands such as
12191223
`fabric ping workstation`.

0 commit comments

Comments
 (0)