Skip to content

Commit

Permalink
Nm quick ee instructions update (#2441)
Browse files Browse the repository at this point in the history
* updated instructions and fix exp env vars

* Tenant ID for clarity

* and

* changed account id to tenant id

* struct field to tenant & references to field

* fix local variables
  • Loading branch information
theguy951357 committed Jul 13, 2023
1 parent fd58499 commit dd7e553
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type ServerConfig struct {
MetricsExporter string `yaml:"metrics_exporter"`
BasicAuth string `yaml:"basic_auth"`
LicenseValue string `yaml:"license_value"`
NetmakerAccountID string `yaml:"netmaker_account_id"`
NetmakerTenantID string `yaml:"netmaker_tenant_id"`
IsEE string `yaml:"is_ee"`
StunPort int `yaml:"stun_port"`
StunList string `yaml:"stun_list"`
Expand Down
6 changes: 3 additions & 3 deletions ee/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func AddLicenseHooks() {
// if license is not valid, server should terminate
func ValidateLicense() error {
licenseKeyValue := servercfg.GetLicenseKey()
netmakerAccountID := servercfg.GetNetmakerAccountID()
netmakerTenantID := servercfg.GetNetmakerTenantID()
logger.Log(0, "proceeding with Netmaker license validation...")
if len(licenseKeyValue) == 0 || len(netmakerAccountID) == 0 {
if len(licenseKeyValue) == 0 || len(netmakerTenantID) == 0 {
logger.FatalLog0(errValidation.Error())
}

Expand All @@ -65,7 +65,7 @@ func ValidateLicense() error {
}

licenseSecret := LicenseSecret{
AssociatedID: netmakerAccountID,
AssociatedID: netmakerTenantID,
Limits: getCurrentServerLimit(),
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/netmaker.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MQ_USERNAME=
# The password to set for MQ access
MQ_PASSWORD=
INSTALL_TYPE=
NETMAKER_ACCOUNT_ID=
NETMAKER_TENANT_ID=
LICENSE_KEY=
SERVER_IMAGE_TAG=
UI_IMAGE_TAG=
Expand Down
20 changes: 10 additions & 10 deletions scripts/nm-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ set_buildinfo() {
elif [ -z "$INSTALL_TYPE" ]; then
echo "-----------------------------------------------------"
echo "Would you like to install Netmaker Community Edition (CE), or Netmaker Enterprise Edition (EE)?"
echo "EE will require you to create an account at https://dashboard.license.netmaker.io"
echo "EE will require you to create an account at https://app.netmaker.io"
echo "-----------------------------------------------------"
select install_option in "Community Edition" "Enterprise Edition"; do
case $REPLY in
Expand Down Expand Up @@ -291,7 +291,7 @@ save_config() { (
fi
# version-specific entries
if [ "$INSTALL_TYPE" = "ee" ]; then
save_config_item NETMAKER_ACCOUNT_ID "$ACCOUNT_ID"
save_config_item NETMAKER_TENANT_ID "$TENANT_ID"
save_config_item LICENSE_KEY "$LICENSE_KEY"
save_config_item METRICS_EXPORTER "on"
save_config_item PROMETHEUS "on"
Expand All @@ -307,7 +307,7 @@ save_config() { (
fi
# copy entries from the previous config
local toCopy=("SERVER_HOST" "MASTER_KEY" "TURN_USERNAME" "TURN_PASSWORD" "MQ_USERNAME" "MQ_PASSWORD"
"INSTALL_TYPE" "NODE_ID" "METRICS_EXPORTER" "PROMETHEUS" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT"
"INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT"
"CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "STUN_PORT" "VERBOSITY"
"DEFAULT_PROXY_MODE" "TURN_PORT" "USE_TURN" "DEBUG_MODE" "TURN_API_PORT" "REST_BACKEND"
"DISABLE_REMOTE_IP_CHECK" "NETCLIENT_ENDPOINT_DETECTION" "TELEMETRY" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET"
Expand Down Expand Up @@ -565,18 +565,18 @@ set_install_vars() {

echo "-----------------------------------------------------"
echo "Provide Details for EE installation:"
echo " 1. Log into https://dashboard.license.netmaker.io"
echo " 2. Copy License Key Value: https://dashboard.license.netmaker.io/license-keys"
echo " 3. Retrieve Account ID: https://dashboard.license.netmaker.io/user"
echo " 1. Log into https://app.netmaker.io"
echo " 2. follow instructions to get a license at: https://docs.netmaker.io/ee/ee-setup.html"
echo " 3. Retrieve License and Tenant ID"
echo " 4. note email address"
echo "-----------------------------------------------------"
unset LICENSE_KEY
while [ -z "$LICENSE_KEY" ]; do
read -p "License Key: " LICENSE_KEY
done
unset ACCOUNT_ID
while [ -z ${ACCOUNT_ID} ]; do
read -p "Account ID: " ACCOUNT_ID
unset TENANT_ID
while [ -z ${TENANT_ID} ]; do
read -p "Tenant ID: " TENANT_ID
done
fi

Expand Down Expand Up @@ -709,7 +709,7 @@ set_install_vars() {
echo " public ip: $SERVER_HOST"
if [ "$INSTALL_TYPE" = "ee" ]; then
echo " license: $LICENSE_KEY"
echo " account id: $ACCOUNT_ID"
echo " account id: $TENANT_ID"
fi
echo "-----------------------------------------------------------------"
echo "Confirm Settings for Installation"
Expand Down
12 changes: 6 additions & 6 deletions servercfg/serverconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,13 @@ func GetLicenseKey() string {
return licenseKeyValue
}

// GetNetmakerAccountID - get's the associated, Netmaker, account ID to verify ownership
func GetNetmakerAccountID() string {
netmakerAccountID := os.Getenv("NETMAKER_ACCOUNT_ID")
if netmakerAccountID == "" {
netmakerAccountID = config.Config.Server.NetmakerAccountID
// GetNetmakerTenantID - get's the associated, Netmaker, tenant ID to verify ownership
func GetNetmakerTenantID() string {
netmakerTenantID := os.Getenv("NETMAKER_TENANT_ID")
if netmakerTenantID == "" {
netmakerTenantID = config.Config.Server.NetmakerTenantID
}
return netmakerAccountID
return netmakerTenantID
}

// GetStunPort - Get the port to run the stun server on
Expand Down

0 comments on commit dd7e553

Please sign in to comment.