openzfs / openzfs-docs

OpenZFS Documentation
https://openzfs.github.io/openzfs-docs/
132 stars 190 forks source link

Add bash helper script for loading encryption password for LUKS #482

Open mariaa144 opened 8 months ago

mariaa144 commented 8 months ago

I thought it would be nice if there was some check to make sure the password is correct because getting it wrong can be a real pain.

ghost commented 8 months ago

The intention is good, but the inplementation is overcomplicated. Just remove all printf commands, the pipe sign, and the single dash sign trailing each line.

This would let cryptsetup handle password input and validation.

ghost commented 8 months ago

And you will need to keep an automated version for CI/CD testing. See other sections for examples. Remember to get indentation right.

于 2023年12月16日 GMT+01:00 上午1:45:21, Maria @.***> 写到:

I thought it would be nice if there was some check to make sure the password is correct because getting it wrong can be a real pain. You can view, comment on, or merge this pull request online at:

https://github.com/openzfs/openzfs-docs/pull/482

-- Commit Summary --

  • Add bash helper script for loading encryption password for LUKS

-- File Changes --

M docs/Getting Started/NixOS/Root on ZFS.rst (7)

-- Patch Links --

https://github.com/openzfs/openzfs-docs/pull/482.patch https://github.com/openzfs/openzfs-docs/pull/482.diff

-- Reply to this email directly or view it on GitHub: https://github.com/openzfs/openzfs-docs/pull/482 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

mariaa144 commented 8 months ago

If we do that then you have to enter the passphrase 3 times for each disk instead of 2 times total.

I did expect the prompts to break the automation but I didn't expect the REHL guide to break. I assume the checks didn't get to NixOS.

ghost commented 8 months ago

That check failed due to a file removal on RHEL part:

2023-12-16T00:52:06.7771211Z + curl --fail-early --fail -L https://dl.rockylinux.org/pub/rocky/9.2/images/x86_64/Rocky-9-Container-Base-9.2-20230513.0.x86_64.tar.xz -o rootfs.tar.gz
2023-12-16T00:52:06.7797302Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2023-12-16T00:52:06.7798495Z                                  Dload  Upload   Total   Spent    Left  Speed
2023-12-16T00:52:06.7799121Z 
2023-12-16T00:52:07.0740505Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2023-12-16T00:52:07.0741637Z   0   146    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2023-12-16T00:52:07.0742276Z curl: (22) The requested URL returned error: 404

I currently do not have time to fix this.

gmelikov commented 3 months ago

Unfortunately, we don't have a maintainer of NixOS guide now, so I'll pick up at least reviews, if you're ready to walk this through - please rebase it and I'll merge it, thank you!