keybase / bot-sshca

A chat bot that can manage your team's SSH accounts
BSD 3-Clause "New" or "Revised" License
222 stars 30 forks source link

make generate errors out because of env vars #78

Closed oskapt closed 4 years ago

oskapt commented 4 years ago

I've been chasing this for a couple of hours, and although I have it working, I'm unsure why it needs all this to work.

Summary

make generate fails with errors from keybase oneshot that there is no KEYBASE_USERNAME or TEAMS variables set.

Error parsing command line arguments: Need a --username option or a KEYBASE_USERNAME environment variable
2020/02/01 16:08:15 Failed to validate config: must specify at least one team via the TEAMS environment variable
Makefile:18: recipe for target 'generate' failed

First Workaround

Problem

Solution

export "TEAMS=$TEAMS"
export "KEYBASE_USERNAME=$KEYBASE_USERNAME"
export "KEYBASE_PAPERKEY=$KEYBASE_PAPERKEY"

Second Workaround

The previous workaround solved the problems of the vars not being available, but it generated a new error:

▶ ERROR No device found no device found for paper key
2020/02/01 17:09:08 Failed to validate config: failed to validate KEYBASE_USERNAME and KEYBASE_PAPERKEY: exit status 2

Problem

The previous workaround didn't solve the issue, and I noticed that when echoing the vars from entrypoint-generate.sh they included the double quotes:

TEAMS='"lurchy.ssh.root_everywhere,lurchy.ssh.standard"'

Solution

I'll submit a PR later today.