Skip to content

Commit

Permalink
Update API_URL to INFISICAL_API_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 21, 2023
1 parent b91dc9e commit 840efbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cli/packages/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ func Execute() {
func init() {
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.PersistentFlags().BoolVarP(&debugLogging, "debug", "d", false, "Enable verbose logging")
rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_API_URL, "Point the CLI to your own backend [can also set via environment variable name: API_URL]")
rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_API_URL, "Point the CLI to your own backend [can also set via environment variable name: INFISICAL_API_URL]")
// rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
// }

// if config.INFISICAL_URL is set to the default value, check if INFISICAL_URL is set in the environment
// this is used to allow overrides of the default value
if !rootCmd.Flag("domain").Changed {
if envInfisicalBackendUrl, ok := os.LookupEnv("API_URL"); ok {
if envInfisicalBackendUrl, ok := os.LookupEnv("INFISICAL_API_URL"); ok {
config.INFISICAL_URL = envInfisicalBackendUrl
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/cli/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ infisical login
The CLI is set to connect to Infisical Cloud by default, but if you're running your own instance of Infisical, you can direct the CLI to it using one of the methods provided below.

#### Export environment variable
You can point the CLI to the self hosted Infisical instance by exporting the environment variable `API_URL` in your terminal.
You can point the CLI to the self hosted Infisical instance by exporting the environment variable `INFISICAL_API_URL` in your terminal.

```bash
# Example
export API_URL="https://your-self-hosted-infisical.com/api"
export INFISICAL_API_URL="https://your-self-hosted-infisical.com/api"
```

#### Set manually on every command
Expand Down

1 comment on commit 840efbd

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage report for backend

St.
Category Percentage Covered / Total
🟡 Statements 75.61% 62/82
🔴 Branches 0% 0/5
🔴 Functions 50% 1/2
🟡 Lines 76.54% 62/81

Test suite run success

1 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 840efbd

Please sign in to comment.