-
Notifications
You must be signed in to change notification settings - Fork 126
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
Unable to pipe string #282
Comments
Ok this seems like a darwin/macOS issue. echo "XXXX" | cp /dev/stdin /dev/stdout This outputs the original string on linux, while on darwin it errors with the above message |
Is there a way to pipe string to agenix on mac? I know |
I ended up using ragenix |
This bash script helps me pass the binary file to agenix without opening an editor. #!/usr/bin/env bash
src="$(realpath -s "$1")"
filename="${src##*/}"
cd ~/nix/secrets || exit 1
EDITOR="cp $src" agenix -e "$filename.age" |
I had the same issue on macos. Fortunately I was working with an existing file, so EDITOR="cp /path/to/file" agenix -e my-secret.age did the trick. I guess if you want to get data from a previous command into agenix on macos, the best way would be something like export TMP_FUTURE_SECRET=$(mktemp -t my-future-secret-XXXX)
echo "XXXXX" > "$TMP_FUTURE_SECRET"
EDITOR="cp $TMP_FUTURE_SECRET" agenix -e my-secret.age
rm "$TMP_FUTURE_SECRET"
unset TMP_FUTURE_SECRET It is not ideal since at some point the secret would be available in plain text on your filesystem so you'd need to be careful, but I guess it is better than nothing. |
I've been trying to use the pipe feature (#154), but I got this error.
From my understanding, the piped string should be available as /dev/stdin?
Sorry if this is unrelated to agenix itself.
Edit: it might be relevant that I'm running this on macOS
The text was updated successfully, but these errors were encountered: