bad flag syntax while inserting certificate as secret #555

Open
opened 2025-05-14 13:01:59 +00:00 by fauno · 4 comments
Member

on abra 0.9, we were deploying our own certificates to traefik as secrets:

abra app secret insert traefik.$domain ssl_cert v1 "`cat $domain_crt`"
abra app secret insert traefik.$domain ssl_key  v1 "`cat $domain_key`"

but now the same command throws this:

Error: bad flag syntax: -----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----

we think it's because it takes the certificate header as the start of a flag, and fails because it's missing the data.

i see now there's a -f flag, is this an appropiate replacement? as in it will take the data argument as a file name and insert its contents?

abra app secret insert traefik.$domain ssl_cert v1 "$domain_crt" -f
abra app secret insert traefik.$domain ssl_key  v1 "$domain_key" -f
on abra 0.9, we were deploying our own certificates to traefik as secrets: ```sh abra app secret insert traefik.$domain ssl_cert v1 "`cat $domain_crt`" abra app secret insert traefik.$domain ssl_key v1 "`cat $domain_key`" ``` but now the same command throws this: ``` Error: bad flag syntax: -----BEGIN CERTIFICATE----- [...] -----END CERTIFICATE----- ``` we think it's because it takes the certificate header as the start of a flag, and fails because it's missing the data. i see now there's a `-f` flag, is this an appropiate replacement? as in it will take the data argument as a file name and insert its contents? ```sh abra app secret insert traefik.$domain ssl_cert v1 "$domain_crt" -f abra app secret insert traefik.$domain ssl_key v1 "$domain_key" -f ```
Author
Member

so the actual bug would be that secret data can't start with "-"

so the actual bug would be that secret data can't start with "-"
Owner

@fauno I believe passing -- will tell the underlying CLI lib to ignore anything after it and just take it as-is, e.g. abra app secret insert traefik.$domain ssl_cert v1 -- <your command>. I think this is an unforseen bug from the CLI handling library itself 😱 Sorry your commands / scripts are broken... looking at #417, I think the --file/-f is the flag you want. Is that working?

@fauno I believe passing `--` will tell the underlying CLI lib to ignore anything after it and just take it as-is, e.g. `abra app secret insert traefik.$domain ssl_cert v1 -- <your command>`. I think this is an unforseen bug from the CLI handling library itself 😱 Sorry your commands / scripts are broken... looking at https://git.coopcloud.tech/toolshed/abra/pulls/417, I think the `--file/-f` is the flag you want. Is that working?
decentral1se added the
bug
label 2025-05-15 19:43:58 +00:00
Author
Member

Yes, it worked and we're already patching the scripts, no urgency there! I prefer the -f flag than interspersing cat on a command actually.

Yes, it worked and we're already patching the scripts, no urgency there! I prefer the `-f` flag than interspersing `cat` on a command actually.
Owner

OK, nice! I will update the migration docs and make sure this is documented as an approach also.

Thanks for reporting!

OK, nice! I will update the migration docs and make sure this is documented as an approach also. Thanks for reporting!
decentral1se added this to the Abra "next" project 2025-05-19 09:04:36 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#555
No description provided.