Skip to content

syncthing: use partial configuration updates - #9732

Open
khaneliman wants to merge 2 commits into
nix-community:masterfrom
khaneliman:agent/syncthing-rest-config-updates
Open

syncthing: use partial configuration updates#9732
khaneliman wants to merge 2 commits into
nix-community:masterfrom
khaneliman:agent/syncthing-rest-config-updates

Conversation

@khaneliman

@khaneliman khaneliman commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Use PATCH for partial Syncthing GUI, LDAP, and options updates so generated values such as the API key are preserved. Route defaults through their documented sub-endpoints, using PUT only for default ignore patterns.1

Closes #9659.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -A dev --run treefmt.

  • Code tested through nix build .#test-all
    or a targeted nix run .#tests -- <pattern>.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

Footnotes

  1. A more declarative alternative would fetch each current object, preserve only known Syncthing-generated fields, merge them into the declared settings, then PUT the complete object. This would reset removed settings, but requires maintaining a correct allowlist of generated fields; missing or newly added fields could be reset unintentionally.

Use PATCH for general REST configuration updates so unspecified values, including the generated GUI API key, are preserved.

Fixes nix-community#9659.
Route defaults settings to their documented folder, device, and ignores sub-endpoints. Use PATCH where supported and PUT for defaults/ignores.
@github-actions github-actions Bot added the sync label Jul 29, 2026
@home-manager-ci
home-manager-ci Bot requested review from aionescu and rycee July 29, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: syncthing apikey gets replaced when using settings.gui.*

1 participant