Closed johnsturgeon closed 4 months ago
Hi, Secrets passed via environment variables must be base64 encoded.
It appears that SECRET_IMAC_PASSWORD: UjA5ZzZkbGwL
is not a base64 string.
Hi, Secrets passed via environment variables must be base64 encoded.
It appears that
SECRET_IMAC_PASSWORD: UjA5ZzZkbGwL
is not a base64 string.
But it is. I just futzed it up for the report. I didn't want to give you the 'real' string 😊
Let's change it to this then: UHVycG9zZWx5IE9iZnVzY2F0ZWQK
(for the record the other strings are changed as well, so they might not base64 decode.. but trust me, I know what I'm doing wrt being able to encode a string via base64)
@johnsturgeon I've just made a test and it's working well on my side with secret as base64.
I've only found this bug but it's unrealed it seems: https://github.com/kestra-io/plugin-fs/commit/86e9ba940dfc8a7c89142298fde5b986f1c70adc
Maybe a special charts in the password, or invalid base64.
Are you using the -n
to avoid carriage return (for example)?
echo -n password | base64
I close the issue, reopen if you have a proper reproducer please
but trust me, I know what I'm doing wrt being able to encode a string via base64
Famous last words!!!
LOL, that's IT!!!
it was the -n
Thank you
OK, I'm back!!!
I decided to give it a go again today and I'm once again having the SAME issue. (I've never gotten this to work) I am absolutely not able to get this to work.
Can we re-open? @tchiotludo ?
Holy cow I figured out the problem!
You CANNOT set a 'variable' to a secret!
variables:
username: root
password: "{{ secret('IMAC_PASSWORD') }}"
host: goshdarnedserver.lan
autorestic_bin: /usr/local/bin/autorestic
does NOT work
I think you using is about recursive rendering, this must be working:
variables:
username: root
password: "{{ secret('IMAC_PASSWORD') }}"
tasks:
# This task runs a restic backup
- id: ssh-paperless-export-backup-cmd
type: "io.kestra.plugin.fs.ssh.Command"
host: selfhostserver.lan
port: "22"
username: johnsmith
password: "{{ render(vars.password) }}"
commands:
- sudo docker exec -t paperless-ngx-webserver-1 document_exporter -d ../export
Reopen if not
Yep! That was it, thank you so much.
Expected Behavior
I expect to be able to accesss
SECRET_etc...
environment variables (from docker compose) in my Kestra instance to be able to log into a remote server via thessh command
pluginActual Behaviour
I get a
auth fail
error2024-04-02 11:50:19.953 Auth fail
With the following trace:
Steps To Reproduce
Here's my docker-compose (password changed, obv)
and here's my flow:
Environment Information
6.5.0-25-generic #25~22.04.1-Ubuntu
Example flow
No response