hookdeck / hookdeck-cli

Alternative to ngrok for localhost asynchronous web development (e.g. webhooks). No account required.
https://hookdeck.com?ref=github-hookdeck-cli
Apache License 2.0
260 stars 9 forks source link

Global config flag ignored #86

Open rasmusson opened 2 months ago

rasmusson commented 2 months ago

I using hookdeck cli with docker and Im trying to run it as another user than root. To accomplish that Im trying to use --config flag of hookdeck cli. No matter what I try, the flag seems to be ignored.

I put the config file in /tmp/.config/hookdeck/config.toml and try to start hookdeck cli with hookdeck listen homeassistant-service:8080 automate --config /tmp/.config/hookdeck/config.toml

I always get "Not connected with any account. Creating a guest account..."

alexluong commented 2 months ago

@rasmusson can you share the config you have just so I understand how you're using it? Please remember to remove the secrets before sharing!

rasmusson commented 2 months ago

[default] api_key = "KEY" client_id = "cli_iL4DiP3O2SAcG4" device_name = "server" display_name = "Stefan Rasmusson" team_id = "tm_nekwmmmU0Nni" team_mode = "inbound" team_name = "home_automation"

alexluong commented 2 months ago

Thanks @rasmusson. Can you also share your Hookdeck CLI version you're running?

Have you tried hookdeck whoami to see which profile you're using?

It seems you may be running the CLI inside Docker? Let me test this out and see what's going on here.

rasmusson commented 2 months ago

version 0.8.6 Profile is default

alexluong commented 2 months ago

Hi @rasmusson, thanks for sharing. I tried recreating your issue locally but unable to encounter this problem. I noticed a few things, so maybe you can help explore these ideas maybe?

1: The config you shared seems a little dated. It looks like it's a "CI" client where you ran hookdeck ci to generate this key. Not a problem, but the schema seems like an old version. I would highly encourage you to re-run hookdeck ci or hookdeck login to get a new set of credentials. I think this should solve your issue.

2: Because you used /tmp/... so I assume you're working within a Docker container. Can you try recreating this issue locally first to make sure the issue is not Docker-specific?

3: You're using v0.8.6, which is a bit older version. We've had 2 breaking changes since. This should NOT be an issue here since I tried using this version too and things still work on my end, but maybe you should consider updating to the latest version, just to be up to date?

Again, I think the issue is probably the old credentials here. Sorry for the breaking change, we definitely should have considered a better migration path last year when we rolled out a new version where the CLI handles API keys differently.

Please let me know if you still run into issues here and I'd be happy to investigate further!

leggetter commented 2 months ago

@alexluong - just to quickly confirm, you have see the --config flag work as expected?

alexluong commented 2 months ago

@leggetter yes, when I tried the config flag, everything was working as expected. I tested on the latest version and v0.8.6.