Infisical / infisical

♾ Infisical is the open-source secret management platform: Sync secrets across your team/infrastructure, prevent secret leaks, and manage internal PKI
https://infisical.com
Other
15.67k stars 978 forks source link

Login command in CLI does not respect --domain flag and INFISICAL_API_URL env var for self-hosted instances #2407

Open Badbird5907 opened 2 months ago

Badbird5907 commented 2 months ago

Describe the bug

The Infisical CLI should respect the --domain flag/INFISICAL_API_URL environment variable, bypassing the manual domain entry for self-hosted instances during login. Currently, even when specifying these parameters, users are prompted to input the domain manually.

This would make the CLI more user & script-friendly, particularly in scenarios where shell scripts use the CLI, and the user's session expires. I currently use this expect script in my shell scripts to automate the domain input. A way to bypass the prompt (or a flag like --self-hosted) would eliminate the need for these workarounds.

To Reproduce

Steps to reproduce the behavior:

  1. Set INFISICAL_API_URL or --domain to a self-hosted instance
  2. run infisical login

Expected behavior

When using the CLI for a self-hosted instance, the flow should be entirely non-interactive after providing the necessary environment variables or flags (other than the user passing in the token).

For example:

$ export INFISICAL_API_URL="https://infisical.example.com/"
$ infisical login
✔ Self Hosting
Domain: https://infisical.example.com
To complete your login, open this address in your browser: https://infisical.example.com/login?callback_port=1234
...
Token: 

Screenshots

image image

Platform you are having the issue on:

Linux

Rishabhg71 commented 2 months ago

Can i take this issue?

Dani4kor commented 1 month ago

same here

infisical version 0.31.0