-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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/doc: fix acme dns-01 example #190052
Conversation
Summary: fix errors with example code in the manual that shows how to set up DNS-01 verification via the acme protocol, e.g. for those who want to get wildcard certificates from Let's Encrypt. Fix syntax error in nix arrays (there should not be commas.) Fix permissions on /var/lib/secrets so it can be read by bind daemon. Without this fix bind won't start. Add the missing feature: put the generated secret into certs.secret
@winterqt We good to go on this? I'm hoping we can get it merged before it bit-rots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this. I have one syntax fix but that's it, I'll approve now. I might revamp this entire section of the acme doc since it's still more complex than I think it needs to be.
|
||
cat > /var/lib/secrets/certs.secret << EOF | ||
RFC2136_NAMESERVER='127.0.0.1:53' | ||
RFC2136_TSIG_ALGORITHM='hmac-sha256.' | ||
RFC2136_TSIG_KEY='rfc2136key.example.com' | ||
RFC2136_TSIG_SECRET='your secret key' | ||
RFC2136_TSIG_SECRET='$secret' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight change: Should be using double quotes here since you want the var from the shell
RFC2136_TSIG_SECRET='$secret' | |
RFC2136_TSIG_SECRET="$secret" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would not work at all due to this -- single quotes don't expand anything.
@JasonWoof Did you test this at all? I ask since it shouldn't work without double quotes here.
Happy to merge once you fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works with single quotes. That's how it is in the version I'm using.
The single quotes don't interfere with $secret expanding. bash expands variables in that whole line because it's within a <<EOF section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I totally missed that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had found a bug until I looked at my in-production working version, and saw that it was working with single quotes. Then I figured out why it works this way :)
anything I can do to help this along? |
Summary: fix errors with example code in the manual that shows how to set up DNS-01 verification via the acme protocol, e.g. for those who want to get wildcard certificates from Let's Encrypt.
Fix syntax error in nix arrays (there should not be commas.)
Fix permissions on /var/lib/secrets so it can be read by bind daemon. Without this fix bind won't start.
Add the missing feature: put the generated secret into certs.secret
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes