-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.go
97 lines (70 loc) · 2.97 KB
/
build.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package build
import (
"strconv"
)
// Version the application version
var Version = "0.22.0"
// SHA is the git reference used to build this package
var SHA = "unknown"
// BuildDate is when it was build
var BuildDate = "unknown"
// License is the official Open Source Initiative license abbreviation
var License = "Apache-2.0"
// TLS controls the NATS protocol level TLS
var TLS = "true"
// maxBrokerClients defines the maximum clients a single choria broker will accept
var maxBrokerClients = "50000"
// ProvisionSecure when "false" will disable TLS provisioning mode
var ProvisionSecure = "true"
// ProvisionBrokerURLs defines where the daemon will connect when choria.server.provision is true
var ProvisionBrokerURLs = ""
// ProvisionBrokerSRVDomain defines a domain to query for provisioning brokers
var ProvisionBrokerSRVDomain = ""
// ProvisionModeDefault defines the value of plugin.choria.server.provision when it's not set
// in the configuration file at all.
var ProvisionModeDefault = "false"
// ProvisionAgent determines if the supplied provisioning agent should be started
// this lets you programatically or via the additional agents system supply your own
// agent to perform the provisioning duties
var ProvisionAgent = "true"
// ProvisionRegistrationData is a file that will be published by the registration system
var ProvisionRegistrationData = ""
// ProvisionFacts is a facts file to use for discovery purposes during provisioning mode
var ProvisionFacts = ""
// ProvisionToken when not empty this token will be required interact with the provisioner agent
var ProvisionToken = ""
// ProvisionJWTFile is a file holding a JWT identifying the node to the provisioner
var ProvisionJWTFile = ""
// ProvisionStatusFile is the file where server status will be written to while in provisioning mode
var ProvisionStatusFile = ""
// ProvisioningBrokerUsername is the username used to connect to the middleware with
var ProvisioningBrokerUsername = ""
// ProvisioningBrokerPassword is the password used to connect to the middleware with
var ProvisioningBrokerPassword = ""
// AgentProviders are registered systems capable of extending choria with new agents
var AgentProviders = []string{}
// MachineWatchers are registered Autonomous Agent watchers
var MachineWatchers = []string{}
// DataProviders are registered Data plugins
var DataProviders = []string{}
// HasTLS determines if TLS should be used on the wire
func HasTLS() bool {
return TLS == "true"
}
// MaxBrokerClients is the maximum number of clients the network broker may handle
func MaxBrokerClients() int {
c, err := strconv.Atoi(maxBrokerClients)
if err != nil {
return 50000
}
return c
}
// ProvisionDefault defines the value of plugin.choria.server.provision when it's not set
// in the configuration file at all.
func ProvisionDefault() bool {
return ProvisionModeDefault == "true"
}
// ProvisionSecurity determines if TLS should be enabled during provisioning
func ProvisionSecurity() bool {
return ProvisionSecure == "true"
}