Skip to content

Commit

Permalink
Merge pull request #3272 from gravitl/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
abhishek9686 authored Dec 20, 2024
2 parents 2244054 + 4cbbfa9 commit ee5ab2a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ services:
ports:
- "$SERVER_HOST:80:80"
- "$SERVER_HOST:443:443"
#uncomment to enable IPv6 communication
# - "$SERVER_HOST6:80:80"
# - "$SERVER_HOST6:443:443"

coredns:
#network_mode: host
Expand Down
4 changes: 3 additions & 1 deletion scripts/netmaker.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
NM_EMAIL=
# The base domain of netmaker
NM_DOMAIN=
# Public IP of machine
# Public IPv4 endpoint of machine
SERVER_HOST=
# Public IPv6 endpoint of machine
SERVER_HOST6=
# The admin master key for accessing the API. Change this in any production installation.
MASTER_KEY=
# The username to set for MQ access
Expand Down
12 changes: 7 additions & 5 deletions scripts/nm-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ save_config() { (
save_config_item SERVER_IMAGE_TAG "$IMAGE_TAG"
fi
# copy entries from the previous config
local toCopy=("SERVER_HOST" "MASTER_KEY" "MQ_USERNAME" "MQ_PASSWORD" "LICENSE_KEY" "NETMAKER_TENANT_ID"
local toCopy=("SERVER_HOST" "SERVER_HOST6" "MASTER_KEY" "MQ_USERNAME" "MQ_PASSWORD" "LICENSE_KEY" "NETMAKER_TENANT_ID"
"INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT"
"CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "VERBOSITY"
"DEBUG_MODE" "REST_BACKEND" "DISABLE_REMOTE_IP_CHECK" "TELEMETRY" "ALLOWED_EMAIL_DOMAINS" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET"
Expand Down Expand Up @@ -509,14 +509,16 @@ set -e
# set_install_vars - sets the variables that will be used throughout installation
set_install_vars() {

IP_ADDR=$(dig -4 myip.opendns.com @resolver1.opendns.com +short)
if [ "$IP_ADDR" = "" ]; then
IP_ADDR=$(curl -s ifconfig.me)
fi
IP_ADDR=$(curl -s -4 ifconfig.me)
IP6_ADDR=$(curl -s -6 ifconfig.me)
if [ "$NETMAKER_BASE_DOMAIN" = "" ]; then
NETMAKER_BASE_DOMAIN=nm.$(echo $IP_ADDR | tr . -).nip.io
fi
SERVER_HOST=$IP_ADDR
SERVER_HOST6=$IP6_ADDR
if [ "$IP_ADDR" = "" ]; then
SERVER_HOST=$IP6_ADDR
fi
if test -z "$MASTER_KEY"; then
MASTER_KEY=$(
tr -dc A-Za-z0-9 </dev/urandom | head -c 30
Expand Down

0 comments on commit ee5ab2a

Please sign in to comment.