Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow INFISICAL_URL to use domain for self-hosted #242

Merged
merged 7 commits into from
Jan 21, 2023

Conversation

asheliahut
Copy link
Contributor

@asheliahut asheliahut commented Jan 21, 2023

Description

Updates the cli to allow for an environment variable named INFISICAL_URL this way when a self hosted user is using the CLI they don't need to specify the domain over and over.

The order of respect for domains is as follows
Infisical Cloud Domain -> Environment Variable -> CLI Argument

This way the CLI argument can always override even the environment variable.

@asheliahut asheliahut changed the title Allow INFISCAL_URL to use domain for self-hosted Allow INFISICAL_URL to use domain for self-hosted Jan 21, 2023
@Grraahaam
Copy link
Contributor

Interesting feature! Imagine you have several projects locally and each of them uses a different Infisical instance/URL, how about the possibility to use a global config file instead, e.g. scoped on the file path? Here's an idea, including what you might want to do as well : #243

@asheliahut
Copy link
Contributor Author

@Grraahaam I like your idea, but sadly what you are suggesting wouldn't help in the case of global usage which is what I was looking for here. What if you don't have a project setup yet at all? I think having both options would be neat in the long run.

Copy link
Collaborator

@maidul98 maidul98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awsome PR! A lot of folks have asked for this. Let me know if you have ideas for further improving the CLI

@maidul98 maidul98 merged commit 7470cd7 into Infisical:main Jan 21, 2023
@Grraahaam
Copy link
Contributor

Grraahaam commented Jan 22, 2023

@Grraahaam I like your idea, but sadly what you are suggesting wouldn't help in the case of global usage which is what I was looking for here. What if you don't have a project setup yet at all? I think having both options would be neat in the long run.

My bad I forgot to mention this use case 🙃 , but it'd also be possible to define it globally, here's an example (updated in the PR as well) :

{
  "scope": [
    "/": {
      "token": "secret-xxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxx",
      "api-host": "https://app.infisical.com/api",
      "dashboard-host": "https://app.infisical.com/dashboard",
      "project": "project-global",
      "env": "dev",
    }
]

Thanks for pointing this out! Does that sounds more like what you're expecting? 🤔

@asheliahut
Copy link
Contributor Author

@Grraahaam that still isn't flexible enough for my use case. I need to be able to change it quickly between runs and I'd prefer not having to use a tool like jq or something to edit a config file constantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants