Browse Source

fixing default dns settings

afeiszli 4 years ago
parent
commit
1eb9decb15
3 changed files with 29 additions and 22 deletions
  1. 25 18
      compose/docker-compose.yml
  2. 1 1
      models/node.go
  3. 3 3
      netclient/main.go

+ 25 - 18
compose/docker-compose.yml

@@ -1,23 +1,19 @@
 version: "3.4"
 version: "3.4"
 
 
 services:
 services:
-  mongodb:
-    image: mongo:4.2
-    ports:
-      - "27017:27017"
-    container_name: mongodb
-    volumes:
-      - mongovol:/data/db
+  rqlite:
+    container_name: rqlite
+    image: rqlite/rqlite
+    network_mode: host
     restart: always
     restart: always
-    environment:
-      MONGO_INITDB_ROOT_USERNAME: mongoadmin
-      MONGO_INITDB_ROOT_PASSWORD: mongopass
+    volumes:
+      - sqldata:/rqlite/file/data
   netmaker:
   netmaker:
+    depends_on:
+      - rqlite
     privileged: true
     privileged: true
     container_name: netmaker
     container_name: netmaker
-    depends_on:
-      - mongodb
-    image: gravitl/netmaker:v0.5
+    image: gravitl/netmaker:v0.7
     volumes:
     volumes:
       - ./:/local
       - ./:/local
       - /etc/netclient:/etc/netclient
       - /etc/netclient:/etc/netclient
@@ -33,18 +29,29 @@ services:
     restart: always
     restart: always
     network_mode: host
     network_mode: host
     environment:
     environment:
-      SERVER_HOST: "HOST_IP"
+      SERVER_HOST: "SERVER_PUBLIC_IP"
+      SERVER_API_CONN_STRING: "SERVER_PUBLIC_IP:8081"
+      SERVER_GRPC_CONN_STRING: "SERVER_PUBLIC_IP:50051"
+      COREDNS_ADDR: "SERVER_PUBLIC_IP"
+      GRPC_SSL: "off"
+      DNS_MODE: "on"
+      SERVER_HTTP_HOST: "SERVER_PUBLIC_IP"
+      SERVER_GRPC_HOST: "SERVER_PUBLIC_IP"
+      API_PORT: "8081"
+      GRPC_PORT: "50051"
+      MASTER_KEY: "REPLACE_MASTER_KEY"
+      CORS_ALLOWED_ORIGIN: "*"
   netmaker-ui:
   netmaker-ui:
     container_name: netmaker-ui
     container_name: netmaker-ui
     depends_on:
     depends_on:
       - netmaker
       - netmaker
-    image: gravitl/netmaker-ui:v0.5
+    image: gravitl/netmaker-ui:v0.7
     links:
     links:
       - "netmaker:api"
       - "netmaker:api"
     ports:
     ports:
-      - "80:80"
+      - "8082:80"
     environment:
     environment:
-      BACKEND_URL: "http://HOST_IP:8081"
+      BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN"
   coredns:
   coredns:
     depends_on:
     depends_on:
       - netmaker 
       - netmaker 
@@ -57,5 +64,5 @@ services:
     volumes:
     volumes:
       - dnsconfig:/root/dnsconfig
       - dnsconfig:/root/dnsconfig
 volumes:
 volumes:
-  mongovol: {}
+  sqldata: {}
   dnsconfig: {}
   dnsconfig: {}

+ 1 - 1
models/node.go

@@ -120,7 +120,7 @@ func (node *Node) SetIsLocalDefault() {
 
 
 func (node *Node) SetDNSOnDefault() {
 func (node *Node) SetDNSOnDefault() {
 	if node.DNSOn == "" {
 	if node.DNSOn == "" {
-		node.DNSOn = "no"
+		node.DNSOn = "yes"
 	}
 	}
 }
 }
 
 

+ 3 - 3
netclient/main.go

@@ -147,10 +147,10 @@ func main() {
 			Usage:   "Local Range if network is local, for instance 192.168.1.0/24.",
 			Usage:   "Local Range if network is local, for instance 192.168.1.0/24.",
 		},
 		},
 		&cli.StringFlag{
 		&cli.StringFlag{
-			Name:    "dns",
+			Name:    "dnson",
 			EnvVars: []string{"NETCLIENT_DNS"},
 			EnvVars: []string{"NETCLIENT_DNS"},
-			Value:   "on",
-			Usage:   "Sets private dns if 'on'. Ignores if 'off'. Will retrieve from network if unset.",
+			Value:   "yes",
+			Usage:   "Sets private dns if 'yes'. Ignores if 'no'. Will retrieve from network if unset.",
 		},
 		},
 		&cli.StringFlag{
 		&cli.StringFlag{
 			Name:    "islocal",
 			Name:    "islocal",