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

Nm quick ee instructions update #2441

Merged
merged 8 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
theguy951357 marked this conversation as resolved.
Show resolved Hide resolved
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")
theguy951357 marked this conversation as resolved.
Show resolved Hide resolved
if NetmakerTenantID == "" {
NetmakerTenantID = config.Config.Server.NetmakerTenantID
}
return netmakerAccountID
return NetmakerTenantID
}

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