Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: cloud EU region support

Daniel Hougaard986bcaf0df8f
diff --git a/cli/packages/cmd/login.go b/cli/packages/cmd/login.go
index f661975172..6cba897f32 100644
--- a/cli/packages/cmd/login.go
+++ b/cli/packages/cmd/login.go
@@ -216,7 +216,9 @@ var loginCmd = &cobra.Command{
}
//override domain
domainQuery := true
- if config.INFISICAL_URL_MANUAL_OVERRIDE != "" && config.INFISICAL_URL_MANUAL_OVERRIDE != util.INFISICAL_DEFAULT_API_URL {
+ if config.INFISICAL_URL_MANUAL_OVERRIDE != "" &&
+ config.INFISICAL_URL_MANUAL_OVERRIDE != fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_EU_URL) &&
+ config.INFISICAL_URL_MANUAL_OVERRIDE != fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_US_URL) {
overrideDomain, err := DomainOverridePrompt()
if err != nil {
util.HandleError(err)
@@ -526,16 +528,17 @@ func askForDomain() error {
// query user to choose between Infisical cloud or self hosting
const (
- INFISICAL_CLOUD = "Infisical Cloud"
- SELF_HOSTING = "Self Hosting"
- ADD_NEW_DOMAIN = "Add a new domain"
+ INFISICAL_CLOUD_US = "Infisical Cloud (US Region)"
+ INFISICAL_CLOUD_EU = "Infisical Cloud (EU Region)"
+ SELF_HOSTING = "Self Hosting"
+ ADD_NEW_DOMAIN = "Add a new domain"
)
- options := []string{INFISICAL_CLOUD, SELF_HOSTING}
+ options := []string{INFISICAL_CLOUD_US, INFISICAL_CLOUD_EU, SELF_HOSTING}
optionsPrompt := promptui.Select{
Label: "Select your hosting option",
Items: options,
- Size: 2,
+ Size: 3,
}
_, selectedHostingOption, err := optionsPrompt.Run()
@@ -543,10 +546,15 @@ func askForDomain() error {
return err
}
- if selectedHostingOption == INFISICAL_CLOUD {
- //cloud option
- config.INFISICAL_URL = fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_URL)
- config.INFISICAL_LOGIN_URL = fmt.Sprintf("%s/login", util.INFISICAL_DEFAULT_URL)
+ if selectedHostingOption == INFISICAL_CLOUD_US {
+ // US cloud option
+ config.INFISICAL_URL = fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_US_URL)
+ config.INFISICAL_LOGIN_URL = fmt.Sprintf("%s/login", util.INFISICAL_DEFAULT_US_URL)
+ return nil
+ } else if selectedHostingOption == INFISICAL_CLOUD_EU {
+ // EU cloud option
+ config.INFISICAL_URL = fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_EU_URL)
+ config.INFISICAL_LOGIN_URL = fmt.Sprintf("%s/login", util.INFISICAL_DEFAULT_EU_URL)
return nil
}
diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.go
index e40c070226..c533f34159 100644
--- a/cli/packages/cmd/root.go
+++ b/cli/packages/cmd/root.go
@@ -40,7 +40,7 @@ func init() {
cobra.OnInitialize(initLog)
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "log level (trace, debug, info, warn, error, fatal)")
rootCmd.PersistentFlags().Bool("telemetry", true, "Infisical collects non-sensitive telemetry data to enhance features and improve user experience. Participation is voluntary")
- 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.PersistentFlags().StringVar(&config.INFISICAL_URL, "domain", fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_US_URL), "Point the CLI to your own backend [can also set via environment variable name: INFISICAL_API_URL]")
rootCmd.PersistentFlags().Bool("silent", false, "Disable output of tip/info messages. Useful when running in scripts or CI/CD pipelines.")
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
silent, err := cmd.Flags().GetBool("silent")
diff --git a/cli/packages/cmd/user.go b/cli/packages/cmd/user.go
index 844213e18a..d3e6096a9b 100644
--- a/cli/packages/cmd/user.go
+++ b/cli/packages/cmd/user.go
@@ -2,6 +2,7 @@ package cmd
import (
"errors"
+ "fmt"
"net/url"
"github.com/Infisical/infisical-merge/packages/config"
@@ -119,7 +120,7 @@ var domainCmd = &cobra.Command{
domain := ""
domainQuery := true
- if config.INFISICAL_URL_MANUAL_OVERRIDE != util.INFISICAL_DEFAULT_API_URL {
+ if config.INFISICAL_URL_MANUAL_OVERRIDE != fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_EU_URL) && config.INFISICAL_URL_MANUAL_OVERRIDE != fmt.Sprintf("%s/api", util.INFISICAL_DEFAULT_US_URL) {
override, err := DomainOverridePrompt()
if err != nil {
diff --git a/cli/packages/util/constants.go b/cli/packages/util/constants.go
index 1f9ec0c659..8b4c586e68 100644
--- a/cli/packages/util/constants.go
+++ b/cli/packages/util/constants.go
@@ -3,8 +3,8 @@ package util
const (
CONFIG_FILE_NAME = "infisical-config.json"
CONFIG_FOLDER_NAME = ".infisical"
- INFISICAL_DEFAULT_API_URL = "https://app.infisical.com/api"
- INFISICAL_DEFAULT_URL = "https://app.infisical.com"
+ INFISICAL_DEFAULT_US_URL = "https://app.infisical.com"
+ INFISICAL_DEFAULT_EU_URL = "https://eu.infisical.com"
INFISICAL_WORKSPACE_CONFIG_FILE_NAME = ".infisical.json"
INFISICAL_TOKEN_NAME = "INFISICAL_TOKEN"
INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN_NAME = "INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN"
diff --git a/cli/packages/util/init.go b/cli/packages/util/init.go
index 33350f3b77..fe705999ac 100644
--- a/cli/packages/util/init.go
+++ b/cli/packages/util/init.go
@@ -11,7 +11,7 @@ func GetOrganizationsNameList(organizationResponse api.GetOrganizationsResponse)
organizations := organizationResponse.Organizations
if len(organizations) == 0 {
- message := fmt.Sprintf("You don't have any organization created in Infisical. You must first create a organization at %s", INFISICAL_DEFAULT_URL)
+ message := fmt.Sprintf("You don't have any organization created in Infisical. You must first create a organization at %s", INFISICAL_DEFAULT_US_URL)
PrintErrorMessageAndExit(message)
}
@@ -37,7 +37,7 @@ func GetWorkspacesInOrganization(workspaceResponse api.GetWorkSpacesResponse, or
}
if len(filteredWorkspaces) == 0 {
- message := fmt.Sprintf("You don't have any projects created in Infisical organization. You must first create a project at %s", INFISICAL_DEFAULT_URL)
+ message := fmt.Sprintf("You don't have any projects created in Infisical organization. You must first create a project at %s", INFISICAL_DEFAULT_US_URL)
PrintErrorMessageAndExit(message)
}