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

NET-1754: Remove default pro Installation #3181

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,20 @@

If you're looking for a managed service, you can get started with just few clicks, visit [netmaker.io](https://account.netmaker.io) to create your netmaker server.

# Self-Hosted Quick Start
# Self-Hosted Open Source Quick Start

These are the instructions for deploying a Netmaker server on your own cloud VM as quickly as possible. For more detailed instructions, visit the [Install Docs](https://docs.netmaker.io/docs/server-installation/quick-install#quick-install-script).

1. Get a cloud VM with Ubuntu 22.04 and a public IP.
2. Open ports 443, 80, 3479, 8089 and 51821-51830/udp on the VM firewall and in cloud security settings.
3. (recommended) Prepare DNS - Set a wildcard subdomain in your DNS settings for Netmaker, e.g. *.netmaker.example.com, which points to your VM's public IP.
4. Run the script:
4. Run the script to setup open source version of Netmaker:

`sudo wget -qO /root/nm-quick.sh https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick.sh && sudo chmod +x /root/nm-quick.sh && sudo /root/nm-quick.sh`

**<pre>To Install Self-Hosted PRO Version - https://docs.netmaker.io/docs/server-installation/netmaker-professional-setup</pre>**

`sudo wget -qO /root/nm-quick.sh https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick.sh && sudo chmod +x /root/nm-quick.sh && sudo /root/nm-quick.sh`

This script by default installs PRO version with 14-day trial, check out these instructions for post trial period https://docs.netmaker.io/docs/server-installation/quick-install#after-the-trial-period-ends. It also gives you the option to use your own domain (recommended) or an auto-generated domain.

<p float="left" align="middle">
<img src="https://raw.githubusercontent.com/gravitl/netmaker-docs/master/images/netmaker-github/readme.gif" />
Expand Down
12 changes: 6 additions & 6 deletions pro/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ func InitPro() {
controller.ListRoles = proControllers.ListRoles
logic.EnterpriseCheckFuncs = append(logic.EnterpriseCheckFuncs, func() {
// == License Handling ==
enableLicenseHook := false
licenseKeyValue := servercfg.GetLicenseKey()
netmakerTenantID := servercfg.GetNetmakerTenantID()
if licenseKeyValue != "" && netmakerTenantID != "" {
enableLicenseHook = true
}
enableLicenseHook := true
// licenseKeyValue := servercfg.GetLicenseKey()
// netmakerTenantID := servercfg.GetNetmakerTenantID()
// if licenseKeyValue != "" && netmakerTenantID != "" {
// enableLicenseHook = true
// }
if !enableLicenseHook {
err := initTrial()
if err != nil {
Expand Down
54 changes: 6 additions & 48 deletions scripts/nm-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ configure_netclient() {
nmctl host update $HOST_ID --default
sleep 5
nmctl node create_remote_access_gateway netmaker $NODE_ID
#setup failOver
sleep 5
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/v1/node/${NODE_ID}/failover" --header "Authorization: Bearer ${MASTER_KEY}"

sleep 2
# create network for internet access vpn
if [ "$INSTALL_TYPE" = "pro" ]; then
#setup failOver
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/v1/node/${NODE_ID}/failover" --header "Authorization: Bearer ${MASTER_KEY}"
INET_NODE_ID=$(sudo cat /etc/netclient/nodes.json | jq -r '."internet-access-vpn".id')
nmctl node create_remote_access_gateway internet-access-vpn $INET_NODE_ID
out=$(nmctl node list -o json | jq -r '.[] | select(.id=='\"$INET_NODE_ID\"') | .ingressdns = "8.8.8.8"')
Expand All @@ -181,7 +181,6 @@ configure_netclient() {
curl --location --request PUT "https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/internet-access-vpn/${INET_NODE_ID}" --data "$out" --header "Authorization: Bearer ${MASTER_KEY}"
curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/internet-access-vpn/${INET_NODE_ID}/inet_gw" --data '{}' --header "Authorization: Bearer ${MASTER_KEY}"
fi

set -e
}

Expand Down Expand Up @@ -593,52 +592,11 @@ set_install_vars() {
done
fi
wait_seconds 1
unset GET_MQ_USERNAME
unset GET_MQ_PASSWORD
unset CONFIRM_MQ_PASSWORD
echo "Enter Credentials For MQ..."

read -p "MQ Username (click 'enter' to use 'netmaker'): " GET_MQ_USERNAME
if [ -z "$GET_MQ_USERNAME" ]; then
echo "using default username for mq"
MQ_USERNAME="netmaker"
else
MQ_USERNAME="$GET_MQ_USERNAME"
fi

if test -z "$MQ_PASSWORD"; then
MQ_PASSWORD=$(
MQ_USERNAME="netmaker"
MQ_PASSWORD=$(
tr -dc A-Za-z0-9 </dev/urandom | head -c 30
echo ''
)
fi


select domain_option in "Auto Generated / Config Password" "Input Your Own Password"; do
case $REPLY in
1)
echo "using random password for mq"
break
;;
2)
while true; do
echo "Enter your Password For MQ: "
read -s GET_MQ_PASSWORD
echo "Enter your password again to confirm: "
read -s CONFIRM_MQ_PASSWORD
if [ ${GET_MQ_PASSWORD} != ${CONFIRM_MQ_PASSWORD} ]; then
echo "wrong password entered, try again..."
continue
fi
MQ_PASSWORD="$GET_MQ_PASSWORD"
echo "MQ Password Saved Successfully!!"
break
done
break
;;
*) echo "invalid option $REPLY" ;;
esac
done


wait_seconds 2
Expand Down Expand Up @@ -921,7 +879,7 @@ main (){
source "$CONFIG_PATH"
fi

INSTALL_TYPE="pro"
INSTALL_TYPE="ce"
while getopts :cudpv flag; do
case "${flag}" in
c)
Expand Down
Loading