Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Allow INFISCAL_URL to use domain for self-hosted
Ashley Hutson3c282460b2b4
diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.goindex 20d49173b6..9431af0a44 100644--- a/cli/packages/cmd/root.go+++ b/cli/packages/cmd/root.go@@ -6,8 +6,10 @@ package cmdimport ("os"- "github.com/Infisical/infisical-merge/packages/config""github.com/spf13/cobra"++ "github.com/Infisical/infisical-merge/packages/config"+ "github.com/Infisical/infisical-merge/packages/util")var rootCmd = &cobra.Command{@@ -30,7 +32,15 @@ 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", "https://app.infisical.com/api", "Point the CLI to your own backend")+ rootCmd.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", util.INFISICAL_DEFAULT_URL, "Point the CLI to your own backend [ENV: INFISICAL_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 config.INFISICAL_URL == util.INFISICAL_DEFAULT_URL {+ if envInfisicalURL, ok := os.LookupEnv("INFISICAL_URL"); ok {+ config.INFISICAL_URL = envInfisicalURL+ }+ }}diff --git a/cli/packages/util/constants.go b/cli/packages/util/constants.goindex fc7f5d581a..229f61c647 100644--- a/cli/packages/util/constants.go+++ b/cli/packages/util/constants.go@@ -3,6 +3,7 @@ package utilconst (CONFIG_FILE_NAME = "infisical-config.json"CONFIG_FOLDER_NAME = ".infisical"+ INFISICAL_DEFAULT_URL = "https://app.infisical.com/api"INFISICAL_WORKSPACE_CONFIG_FILE_NAME = ".infisical.json"INFISICAL_TOKEN_NAME = "INFISICAL_TOKEN"SECRET_TYPE_PERSONAL = "personal"