s3rius / rustus

TUS protocol implementation in Rust.
https://s3rius.github.io/rustus/
MIT License
158 stars 13 forks source link

config: add secret path env var #135

Closed happysalada closed 1 year ago

happysalada commented 1 year ago

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.

happysalada commented 1 year ago

@s3rius I've had a go at it, let me know if I forgot something.

happysalada commented 1 year ago

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. This sets up a development environment with a precise rust version, openssl version... Those mostly work out of the box, but sometimes they don't, it's just a way to make sure everyone has the same environment no matter what is installed on their machine. Don't worry about it though, I've removed it, it's simpler that way.

happysalada commented 1 year ago

@s3rius I agree with all of your comments except maybe the match. The match with 2 branches I feel is less readable than the if else. Let me know if anything of course.

s3rius commented 1 year ago

Okay. Agree, that match can be not as readable as if else here.

happysalada commented 1 year ago

There was a clippy lint failing, I've just force pushed to fix it.