-
Notifications
You must be signed in to change notification settings - Fork 12
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
config: add secret path env var #135
Conversation
let mut contents = String::new(); | ||
buf_reader | ||
.read_to_string(&mut contents) | ||
.unwrap_or_else(|_| panic!("failed to open path {}", path.display())); |
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.
.unwrap_or_else(|_| panic!("failed to open path {}", path.display())); | |
.unwrap_or_else(|_| panic!("failed to read from path {}", path.display())); |
flake.nix
Outdated
@@ -0,0 +1,103 @@ | |||
{ |
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.
Aren't flakes are NixOs only feature? How to use it?
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.
Looks good. But I'm not sure about flake, because as any other rust project, you can simply install it with cargo install
with no additional commands.
Also, can you please update documentation for new variables?
2252f1e
to
490ca43
Compare
@s3rius I've had a go at it, let me know if I forgot something. |
I've removed the flake.nix. However this is not just a nixos feature. I'm on macos, you just need the nix package manager to benefit from it. |
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.
Everything with docs look nice! Thank you. I just took a closer look to from_string_or_path
function. It looks good and I'm pretty sure it works, but I guess it may be even better.
490ca43
to
f5eb52b
Compare
@s3rius I agree with all of your comments except maybe the match. |
Okay. Agree, that match can be not as readable as if else here. |
f5eb52b
to
90a8f39
Compare
There was a clippy lint failing, I've just force pushed to fix it. |
hey, I had a go at #132
this is just an early attempt.
I've added a flake.nix which gives a development environment for anyone wanting to contribute. Happy to remove it in case you don't like it.
I've added what I thought would be a solution for reading secrets from path.
I haven't optimize the allocation, this should probably be a Cow, but I wanted to see how you felt about this.
Note that there is a bunch of clippy warnings that I didn't touch.
Let me know if anything, I'm flexible.