Skip to content
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

nixos/syncthing: define and handle encryptionPassword option #383442

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jfly
Copy link
Contributor

@jfly jfly commented Feb 19, 2025

Many thanks to @h33p for the PR this was based on: #342138.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

h33p added 5 commits February 19, 2025 23:23
Rewrite the syncthing config update script to embed secrets into the
json request. Specifically, we handle the `encryptionPassword` secret.
With this code, the user can embed path to the encrpyption password for
a given device the folder is shared with, and have it loaded in, without
touching the nix store.
- Change `folder.devices` type into `oneOf [(listOf str) (attrsOf
  (submodule { ... }))]`.
- Expose `encryptionPassord` within the attrSet of the devices option.

This allows the user to set the encrpyption password use to share the
folder's data with. We do this by file path, as opposed to string
literal, because we do not want to embed the encrpyption password into
the nix store.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: documentation This PR adds or changes documentation labels Feb 19, 2025
@jfly jfly requested a review from a-kenji February 19, 2025 17:44
@jfly jfly force-pushed the syncthing_encryption_password branch from 2041ad3 to c5f68f3 Compare February 19, 2025 17:47
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 19, 2025
@jfly jfly force-pushed the syncthing_encryption_password branch 2 times, most recently from a64c44e to 3e527dd Compare February 20, 2025 01:40
@jfly jfly requested review from Lassulus and a-kenji February 20, 2025 01:41
@jfly jfly force-pushed the syncthing_encryption_password branch from 3e527dd to ab1b412 Compare February 20, 2025 01:43
@github-actions github-actions bot added 10.rebuild-darwin: 1 10.rebuild-darwin: 1-10 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-darwin: 1 10.rebuild-darwin: 1-10 labels Feb 20, 2025
Copy link
Contributor

@a-kenji a-kenji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would preferably have a syncthing maintainer also look into it though :).

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Feb 21, 2025
@jfly jfly force-pushed the syncthing_encryption_password branch from ab1b412 to 5c19dbd Compare February 23, 2025 00:59
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants