Skip to content

Commit ee5ab2a

Browse files
authored
Merge pull request #3272 from gravitl/master
Master
2 parents 2244054 + 4cbbfa9 commit ee5ab2a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

compose/docker-compose.yml

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ services:
5454
ports:
5555
- "$SERVER_HOST:80:80"
5656
- "$SERVER_HOST:443:443"
57+
#uncomment to enable IPv6 communication
58+
# - "$SERVER_HOST6:80:80"
59+
# - "$SERVER_HOST6:443:443"
5760

5861
coredns:
5962
#network_mode: host

scripts/netmaker.default.env

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
NM_EMAIL=
33
# The base domain of netmaker
44
NM_DOMAIN=
5-
# Public IP of machine
5+
# Public IPv4 endpoint of machine
66
SERVER_HOST=
7+
# Public IPv6 endpoint of machine
8+
SERVER_HOST6=
79
# The admin master key for accessing the API. Change this in any production installation.
810
MASTER_KEY=
911
# The username to set for MQ access

scripts/nm-quick.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ save_config() { (
260260
save_config_item SERVER_IMAGE_TAG "$IMAGE_TAG"
261261
fi
262262
# copy entries from the previous config
263-
local toCopy=("SERVER_HOST" "MASTER_KEY" "MQ_USERNAME" "MQ_PASSWORD" "LICENSE_KEY" "NETMAKER_TENANT_ID"
263+
local toCopy=("SERVER_HOST" "SERVER_HOST6" "MASTER_KEY" "MQ_USERNAME" "MQ_PASSWORD" "LICENSE_KEY" "NETMAKER_TENANT_ID"
264264
"INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT"
265265
"CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "VERBOSITY"
266266
"DEBUG_MODE" "REST_BACKEND" "DISABLE_REMOTE_IP_CHECK" "TELEMETRY" "ALLOWED_EMAIL_DOMAINS" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET"
@@ -509,14 +509,16 @@ set -e
509509
# set_install_vars - sets the variables that will be used throughout installation
510510
set_install_vars() {
511511

512-
IP_ADDR=$(dig -4 myip.opendns.com @resolver1.opendns.com +short)
513-
if [ "$IP_ADDR" = "" ]; then
514-
IP_ADDR=$(curl -s ifconfig.me)
515-
fi
512+
IP_ADDR=$(curl -s -4 ifconfig.me)
513+
IP6_ADDR=$(curl -s -6 ifconfig.me)
516514
if [ "$NETMAKER_BASE_DOMAIN" = "" ]; then
517515
NETMAKER_BASE_DOMAIN=nm.$(echo $IP_ADDR | tr . -).nip.io
518516
fi
519517
SERVER_HOST=$IP_ADDR
518+
SERVER_HOST6=$IP6_ADDR
519+
if [ "$IP_ADDR" = "" ]; then
520+
SERVER_HOST=$IP6_ADDR
521+
fi
520522
if test -z "$MASTER_KEY"; then
521523
MASTER_KEY=$(
522524
tr -dc A-Za-z0-9 </dev/urandom | head -c 30

0 commit comments

Comments
 (0)