Skip to content

Commit 235fca1

Browse files
committed
Support disabling IPv6 notation
1 parent 0bdd85a commit 235fca1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ var (
8686
sslAutoOrganization string
8787
sslCAFile string
8888
rocksDBEncryptionKeyFile string
89+
disableIPv6 bool
8990
dockerEndpoint string
9091
dockerImage string
9192
dockerImagePullPolicy string
@@ -115,6 +116,7 @@ func init() {
115116
f.BoolVar(&allPortOffsetsUnique, "starter.unique-port-offsets", false, "If set, all peers will get a unique port offset. If false (default) only portOffset+peerAddress pairs will be unique.")
116117
f.StringVar(&dataDir, "starter.data-dir", getEnvVar("DATA_DIR", "."), "directory to store all data the starter generates (and holds actual database directories)")
117118
f.BoolVar(&debugCluster, "starter.debug-cluster", getEnvVar("DEBUG_CLUSTER", "") != "", "If set, log more information to debug a cluster")
119+
f.BoolVar(&disableIPv6, "starter.disable-ipv6", false, "If set, no IPv6 notation will be used. Use this only when IPv6 address family is disabled")
118120

119121
f.BoolVar(&verbose, "log.verbose", false, "Turn on debug logging")
120122

@@ -487,6 +489,7 @@ func mustPrepareService(generateAutoKeyFile bool) (*service.Service, service.Boo
487489
SslKeyFile: sslKeyFile,
488490
SslCAFile: sslCAFile,
489491
RocksDBEncryptionKeyFile: rocksDBEncryptionKeyFile,
492+
DisableIPv6: disableIPv6,
490493
}
491494
bsCfg.Initialize()
492495
serviceConfig := service.Config{

service/arangod_config_builder.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ func createArangodConf(log *logging.Logger, bsCfg BootstrapConfig, myHostDir, my
8484
threads = "16"
8585
v8Contexts = "4"
8686
}
87+
listenAddr := "[::]"
88+
if bsCfg.DisableIPv6 {
89+
listenAddr = "0.0.0.0"
90+
}
8791
scheme := NewURLSchemes(bsCfg.SslKeyFile != "").Arangod
8892
serverSection := &configSection{
8993
Name: "server",
9094
Settings: map[string]string{
91-
"endpoint": fmt.Sprintf("%s://[::]:%s", scheme, myPort),
95+
"endpoint": fmt.Sprintf("%s://%s:%s", scheme, listenAddr, myPort),
9296
"threads": threads,
9397
"authentication": "false",
9498
},

service/bootstrap_config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type BootstrapConfig struct {
3939
SslKeyFile string // Path containing an x509 certificate + private key to be used by the servers.
4040
SslCAFile string // Path containing an x509 CA certificate used to authenticate clients.
4141
RocksDBEncryptionKeyFile string // Path containing encryption key for RocksDB encryption.
42+
DisableIPv6 bool // If set, no IPv6 notation will be used
4243
}
4344

4445
// Initialize auto-configures some optional values

0 commit comments

Comments
 (0)