Skip to content

feat(syncthing): impl encryptionPasswordFile #7128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

plustik
Copy link

@plustik plustik commented May 25, 2025

Description

Syncthing allows setting a password for specific devices a specific folder is shared with. Files are encrypted before being send to this device. The password can be set using the API by setting the encryptionPassword property of the given device in a folder config.

Previously it was not possible to use this functionality of Syncthing with this Home Manager module, because the the devices attribute of a configured folder only accepted strings. The module than created a device item as expected by the Syncthing API, but only set the deviceID attribute of this item, but neglected the optional encryptionPassword attribute.

The changes of this PR enable the usage of encrypted folder sharing, by adjusting the handling of configured folders. The items of the devices list of a folder config may now be attribute sets instead of strings. While strings are handled in the same way as previously, the attribute sets must contain the deviceID attribute may additionally contain an encryptionPasswordFile attribute, whose value must be a path to a file, whose content will be used as the value for the encryptionPassword attribute send to Syncthing.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt-rfc-style keep-sorted --run treefmt.

  • Code tested through nix-shell --pure tests -A run.all
    or nix build --reference-lock-file flake.lock ./tests#test-all using Flakes.

  • 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.

Maintainer CC

@rycee

Enable the usage of encrypted folder sharing, by adjusting the handling
of configured folders. The items of the `devices` list of a folder config may
now be attribute sets instead of strings. While strings are handled in the same
way as previously, the attribute sets must contain the `deviceID` attribute may
additionally contain an `encryptionPasswordFile` attribute, whose value must be
a path to a file, whose content will be used as the value for the
`encryptionPassword` attribute send to Syncthing.
@github-actions github-actions bot added the sync label May 25, 2025
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.

1 participant