mirror of
https://github.com/openziti/ziti.git
synced 2026-10-14 08:10:17 +00:00
Adding default values for template settings
This commit is contained in:
@@ -10,9 +10,9 @@ v: 3
|
||||
db: "{{ .ZitiHome }}/db/ctrl.db"
|
||||
|
||||
identity:
|
||||
cert: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .ZitiCtrlHostname }}-client.cert"
|
||||
server_cert: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .ZitiCtrlHostname }}-server.chain.pem"
|
||||
key: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/keys/{{ .ZitiCtrlHostname }}-server.key"
|
||||
cert: "{{ .ZitiPKI }}/certs/{{ .ZitiCtrlHostname }}-client.cert"
|
||||
server_cert: "{{ .ZitiPKI }}/certs/{{ .ZitiCtrlHostname }}-server.chain.pem"
|
||||
key: "{{ .ZitiPKI }}/keys/{{ .ZitiCtrlHostname }}-server.key"
|
||||
ca: "{{ .ZitiPKI }}/cas.pem"
|
||||
|
||||
ctrl:
|
||||
@@ -42,7 +42,7 @@ edge:
|
||||
#(optional, default 250) The number of API Sessions updated for last activity per transaction
|
||||
# activityUpdateBatchSize: 250
|
||||
# sessionTimeout - optional, default 10m
|
||||
# The number of minutes before an Edge API session will timeout. Timeouts are reset by
|
||||
# The number of minutes before an Edge API session will time out. Timeouts are reset by
|
||||
# API requests and connections that are maintained to Edge Routers
|
||||
sessionTimeout: 30m
|
||||
# address - required
|
||||
@@ -63,14 +63,14 @@ edge:
|
||||
edgeIdentity:
|
||||
# durationMinutes - optional, default 5m
|
||||
# The length of time that a Ziti Edge Identity enrollment should remain valid. After
|
||||
# this duration, the enrollment will expire and not longer be usable.
|
||||
# this duration, the enrollment will expire and no longer be usable.
|
||||
duration: 14400m
|
||||
# edgeRouter - Optional
|
||||
# A section for edge router enrollment specific settings.
|
||||
edgeRouter:
|
||||
# durationMinutes - optional, default 5m
|
||||
# The length of time that a Ziti Edge Router enrollment should remain valid. After
|
||||
# this duration, the enrollment will expire and not longer be usable.
|
||||
# this duration, the enrollment will expire and no longer be usable.
|
||||
duration: 14400m
|
||||
|
||||
# web
|
||||
@@ -96,10 +96,10 @@ web:
|
||||
# identity - optional
|
||||
# Allows the webListener to have a specific identity instead of defaulting to the root 'identity' section.
|
||||
identity:
|
||||
ca: "{{ .ZitiPKI }}/{{ .ZitiEdgeCtrlIntermediateName }}/certs/{{ .ZitiEdgeCtrlIntermediateName }}.cert"
|
||||
key: "{{ .ZitiPKI }}/{{ .ZitiEdgeCtrlIntermediateName }}/keys/{{ .ZitiEdgeCtrlHostname }}-server.key"
|
||||
server_cert: "{{ .ZitiPKI }}/{{ .ZitiEdgeCtrlIntermediateName }}/certs/{{ .ZitiEdgeCtrlHostname }}-server.chain.pem"
|
||||
cert: "{{ .ZitiPKI }}/{{ .ZitiEdgeCtrlIntermediateName }}/certs/{{ .ZitiEdgeCtrlHostname }}-client.cert"
|
||||
ca: "{{ .ZitiPKI }}/certs/{{ .ZitiEdgeCtrlIntermediateName }}.cert"
|
||||
key: "{{ .ZitiPKI }}/keys/{{ .ZitiEdgeCtrlHostname }}-server.key"
|
||||
server_cert: "{{ .ZitiPKI }}/certs/{{ .ZitiEdgeCtrlHostname }}-server.chain.pem"
|
||||
cert: "{{ .ZitiPKI }}/certs/{{ .ZitiEdgeCtrlHostname }}-client.cert"
|
||||
# options - optional
|
||||
# Allows the specification of webListener level options - mainly dealing with HTTP/TLS settings. These options are
|
||||
# used for all http servers started by the current webListener.
|
||||
@@ -108,23 +108,23 @@ web:
|
||||
# The maximum amount of idle time in milliseconds allowed for pipelined HTTP requests. Setting this too high
|
||||
# can cause resources on the host to be consumed as clients remain connected and idle. Lowering this value
|
||||
# will cause clients to reconnect on subsequent HTTPs requests.
|
||||
idleTimeout: 5000ms #http timeouts, new
|
||||
idleTimeout: {{ .WebListenerIdleTimeoutMS }}ms #http timeouts, new
|
||||
# readTimeoutMs - optional, default 5000ms
|
||||
# The maximum amount of time in milliseconds http servers will wait to read the first incoming requests. A higher
|
||||
# value risks consuming resources on the host with clients that are acting bad faith or suffering from high latency
|
||||
# or packet loss. A lower value can risk losing connections to high latency/packet loss clients.
|
||||
readTimeout: 5000ms
|
||||
readTimeout: {{ .WebListenerReadTimeoutMS }}ms
|
||||
# writeTimeoutMs - optional, default 10000ms
|
||||
# The total maximum time in milliseconds that the http server will wait for a single requests to be received and
|
||||
# responded too. A higher value can allow long running requests to consume resources on the host. A lower value
|
||||
# can risk ending requests before the server has a chance to respond.
|
||||
writeTimeout: 100000ms
|
||||
writeTimeout: {{ .WebListenerWriteTimeoutMS }}ms
|
||||
# minTLSVersion - optional, default TSL1.2
|
||||
# The minimum version of TSL to support
|
||||
minTLSVersion: TLS1.2
|
||||
minTLSVersion: {{ .WebListenerMinTLSVersion }}
|
||||
# maxTLSVersion - optional, default TSL1.3
|
||||
# The maximum version of TSL to support
|
||||
maxTLSVersion: TLS1.3
|
||||
maxTLSVersion: {{ .WebListenerMaxTLSVersion }}
|
||||
# apis - required
|
||||
# Allows one or more APIs to be bound to this webListener
|
||||
apis:
|
||||
|
||||
@@ -8,65 +8,35 @@
|
||||
v: 3
|
||||
|
||||
identity:
|
||||
cert: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .RouterName }}-client.cert"
|
||||
server_cert: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .RouterName }}-server.cert"
|
||||
key: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/keys/{{ .RouterName }}-server.key"
|
||||
ca: "{{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .RouterName }}-cas.cert"
|
||||
cert: "{{ .ZitiPKI }}/certs/{{ .RouterName }}-client.cert"
|
||||
server_cert: "{{ .ZitiPKI }}/certs/{{ .RouterName }}-server.cert"
|
||||
key: "{{ .ZitiPKI }}/keys/{{ .RouterName }}-server.key"
|
||||
ca: "{{ .ZitiPKI }}/certs/{{ .RouterName }}-cas.cert"
|
||||
|
||||
ctrl:
|
||||
endpoint: tls:{{ .ZitiCtrlHostname }}:{{ .ZitiFabCtrlPort }}
|
||||
|
||||
link:
|
||||
{{- if .IsPrivate }}
|
||||
# listeners:
|
||||
# - binding: transport
|
||||
# bind: tls:0.0.0.0:10080
|
||||
# advertise: tls:{{ .ZitiEdgeRouterHostname }}:10080
|
||||
# options:
|
||||
# outQueueSize: 16
|
||||
{{- else }}
|
||||
listeners:
|
||||
- binding: transport
|
||||
bind: tls:0.0.0.0:10080
|
||||
advertise: tls:{{ .ZitiEdgeRouterHostname }}:10080
|
||||
options:
|
||||
outQueueSize: 16
|
||||
{{- end }}
|
||||
{{ if .IsPrivate }}#{{ end }} listeners:
|
||||
{{ if .IsPrivate }}#{{ end }} - binding: transport
|
||||
{{ if .IsPrivate }}#{{ end }} bind: tls:0.0.0.0:{{ .ListenerBindPort }}
|
||||
{{ if .IsPrivate }}#{{ end }} advertise: tls:{{ .ZitiEdgeRouterHostname }}:{{ .ListenerBindPort }}
|
||||
{{ if .IsPrivate }}#{{ end }} options:
|
||||
{{ if .IsPrivate }}#{{ end }} outQueueSize: {{ .OutQueueSize }}
|
||||
dialers:
|
||||
- binding: transport
|
||||
|
||||
listeners:
|
||||
{{- if or .IsFabricRouter .IsPrivate }}
|
||||
# - binding: tunnel
|
||||
# options:
|
||||
# mode: host #tproxy|tun|host
|
||||
{{- else }}
|
||||
- binding: tunnel
|
||||
options:
|
||||
mode: host #tproxy|tun|host
|
||||
{{- end }}
|
||||
{{- if .IsPrivate }}
|
||||
# - binding: transport
|
||||
# address: {{if .WssEnabled}}ws{{else}}tls{{end}}:0.0.0.0:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
# options:
|
||||
# advertise: {{ .ZitiEdgeRouterHostname }}:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
# connectTimeoutMs: 5000
|
||||
# getSessionTimeout: 60s
|
||||
{{- else if .IsFabricRouter }}
|
||||
- binding: transport
|
||||
address: tls:0.0.0.0:{{ .ZitiEdgeRouterPort }}
|
||||
options:
|
||||
advertise: {{ .ZitiEdgeRouterHostname }}:{{ .ZitiEdgeRouterPort }}
|
||||
connectTimeoutMs: 5000
|
||||
getSessionTimeout: 60s
|
||||
{{- else }}
|
||||
- binding: edge
|
||||
address: {{if .WssEnabled}}ws{{else}}tls{{end}}:0.0.0.0:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
options:
|
||||
advertise: {{ .ZitiEdgeRouterHostname }}:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
connectTimeoutMs: 5000
|
||||
getSessionTimeout: 60s
|
||||
{{ end }}
|
||||
{{ if or .IsFabricRouter .IsPrivate }}#{{- end }} - binding: tunnel
|
||||
{{ if or .IsFabricRouter .IsPrivate }}#{{- end }} options:
|
||||
{{ if or .IsFabricRouter .IsPrivate }}#{{- end }} mode: host #tproxy|tun|host
|
||||
{{ if .IsPrivate }}#{{ end }} - binding: {{- if or .IsFabricRouter .IsPrivate }}transport{{ else }}edge{{ end }}
|
||||
{{ if .IsPrivate }}#{{ end }} address: {{if .WssEnabled}}ws{{else}}tls{{end}}:0.0.0.0:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
{{ if .IsPrivate }}#{{ end }} options:
|
||||
{{ if .IsPrivate }}#{{ end }} advertise: {{ .ZitiEdgeRouterHostname }}:{{if .WssEnabled}}3023{{else}}{{ .ZitiEdgeRouterPort }}{{end}}
|
||||
{{ if .IsPrivate }}#{{ end }} connectTimeoutMs: {{ .ConnectTimeoutMs }}
|
||||
{{ if .IsPrivate }}#{{ end }} getSessionTimeout: {{ .GetSessionTimeoutS }}s
|
||||
|
||||
|
||||
{{- if or .IsPrivate .IsFabricRouter }}
|
||||
#edge:
|
||||
@@ -98,39 +68,23 @@ edge:
|
||||
- "127.0.0.1"
|
||||
{{ end }}
|
||||
|
||||
{{- if .WssEnabled }}
|
||||
transport:
|
||||
ws:
|
||||
writeTimeout: 10
|
||||
readTimeout: 5
|
||||
idleTimeout: 5
|
||||
pongTimeout: 60
|
||||
pingInterval: 54
|
||||
handshakeTimeout: 10
|
||||
readBufferSize: 4096
|
||||
writeBufferSize: 4096
|
||||
enableCompression: true
|
||||
server_cert: {{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .RouterName }}-router-server.cert
|
||||
key: {{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/keys/{{ .RouterName }}-router-server.key
|
||||
{{- else if or .IsPrivate .IsFabricRouter }}
|
||||
#transport:
|
||||
# ws:
|
||||
# writeTimeout: 10
|
||||
# readTimeout: 5
|
||||
# idleTimeout: 5
|
||||
# pongTimeout: 60
|
||||
# pingInterval: 54
|
||||
# handshakeTimeout: 10
|
||||
# readBufferSize: 4096
|
||||
# writeBufferSize: 4096
|
||||
# enableCompression: true
|
||||
# server_cert: {{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/certs/{{ .RouterName }}-router-server.cert
|
||||
# key: {{ .ZitiPKI }}/{{ .ZitiCtrlIntermediateName }}/keys/{{ .RouterName }}-router-server.key
|
||||
{{- end }}
|
||||
{{ if not .WssEnabled }}#{{ end }}transport:
|
||||
{{ if not .WssEnabled }}#{{ end }} ws:
|
||||
{{ if not .WssEnabled }}#{{ end }} writeTimeout: {{ .WssWriteTimeout }}
|
||||
{{ if not .WssEnabled }}#{{ end }} readTimeout: {{ .WssReadTimeout }}
|
||||
{{ if not .WssEnabled }}#{{ end }} idleTimeout: {{ .WssIdleTimeout }}
|
||||
{{ if not .WssEnabled }}#{{ end }} pongTimeout: {{ .WssPongTimeout }}
|
||||
{{ if not .WssEnabled }}#{{ end }} pingInterval: {{ .WssPingInterval }}
|
||||
{{ if not .WssEnabled }}#{{ end }} handshakeTimeout: {{ .WssHandshakeTimeout }}
|
||||
{{ if not .WssEnabled }}#{{ end }} readBufferSize: {{ .WssReadBufferSize }}
|
||||
{{ if not .WssEnabled }}#{{ end }} writeBufferSize: {{ .WssWriteBufferSize }}
|
||||
{{ if not .WssEnabled }}#{{ end }} enableCompression: true
|
||||
{{ if not .WssEnabled }}#{{ end }} server_cert: {{ .ZitiPKI }}/certs/{{ .RouterName }}-router-server.cert
|
||||
{{ if not .WssEnabled }}#{{ end }} key: {{ .ZitiPKI }}/keys/{{ .RouterName }}-router-server.key
|
||||
|
||||
forwarder:
|
||||
latencyProbeInterval: 1000
|
||||
xgressDialQueueLength: 1000
|
||||
xgressDialWorkerCount: 128
|
||||
linkDialQueueLength: 1000
|
||||
linkDialWorkerCount: 10
|
||||
latencyProbeInterval: {{ .LatencyProbeInterval }}
|
||||
xgressDialQueueLength: {{ .XgressDialQueueLength }}
|
||||
xgressDialWorkerCount: {{ .XgressDialWorkerCount }}
|
||||
linkDialQueueLength: {{ .LinkDialQueueLength }}
|
||||
linkDialWorkerCount: {{ .LinkDialWorkerCount }}
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
|
||||
cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory"
|
||||
cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers"
|
||||
"github.com/openziti/ziti/ziti/cmd/ziti/constants"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"io"
|
||||
@@ -33,6 +34,8 @@ const (
|
||||
optionOutput = "output"
|
||||
defaultOutput = "stdout"
|
||||
outputDescription = "designated output destination for config, use \"stdout\" or a filepath."
|
||||
optionPKI = "pkiPath"
|
||||
pkiDescription = "Location of the public key infrastructure"
|
||||
)
|
||||
|
||||
// CreateConfigOptions the options for the create config command
|
||||
@@ -41,6 +44,7 @@ type CreateConfigOptions struct {
|
||||
|
||||
Output string
|
||||
DatabaseFile string
|
||||
PKIPath string
|
||||
}
|
||||
|
||||
type ConfigTemplateValues struct {
|
||||
@@ -70,6 +74,45 @@ type ConfigTemplateValues struct {
|
||||
WssEnabled bool
|
||||
IsPrivate bool
|
||||
IsFabricRouter bool
|
||||
|
||||
// Default values
|
||||
ListenerBindPort int
|
||||
OutQueueSize int
|
||||
EdgeAPISessionTimeoutMinutes int
|
||||
WebListenerIdleTimeoutMS int
|
||||
WebListenerReadTimeoutMS int
|
||||
WebListenerWriteTimeoutMS int
|
||||
WebListenerMinTLSVersion string
|
||||
WebListenerMaxTLSVersion string
|
||||
WssWriteTimeout int
|
||||
WssReadTimeout int
|
||||
WssIdleTimeout int
|
||||
WssPongTimeout int
|
||||
WssPingInterval int
|
||||
WssHandshakeTimeout int
|
||||
WssReadBufferSize int
|
||||
WssWriteBufferSize int
|
||||
LatencyProbeInterval int
|
||||
XgressDialQueueLength int
|
||||
XgressDialWorkerCount int
|
||||
LinkDialQueueLength int
|
||||
LinkDialWorkerCount int
|
||||
ConnectTimeoutMs int
|
||||
GetSessionTimeoutS int
|
||||
}
|
||||
|
||||
type ControllerConfigValues struct {
|
||||
CtrlListener string
|
||||
MgmtListener string
|
||||
ZitiHome string
|
||||
Hostname string
|
||||
ZitiFabMgmtPort string
|
||||
ZitiEdgeCtrlAPI string
|
||||
ZitiSigningIntermediateName string
|
||||
ZitiEdgeCtrlPort string
|
||||
ZitiCtrlRawname string
|
||||
ZitiEdgeCtrlIntermediateName string
|
||||
ZitiEdgeCtrlHostname string
|
||||
}
|
||||
|
||||
// NewCmdCreateConfig creates a command object for the "config" command
|
||||
@@ -86,6 +129,7 @@ func NewCmdCreateConfig(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cob
|
||||
// Get env variable data global to all config files
|
||||
templateData := &ConfigTemplateValues{}
|
||||
templateData.populateEnvVars()
|
||||
templateData.populateDefaults()
|
||||
|
||||
cmd.AddCommand(NewCmdCreateConfigController(templateData))
|
||||
cmd.AddCommand(NewCmdCreateEnvironment(f, out, errOut))
|
||||
@@ -96,8 +140,13 @@ func NewCmdCreateConfig(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cob
|
||||
|
||||
// Add flags that are global to all "create config" commands
|
||||
func (options *CreateConfigOptions) addCreateFlags(cmd *cobra.Command) {
|
||||
// Obtain the default PKI location which may be different if the env variable was set
|
||||
defaultPKI, err := cmdhelper.GetZitiPKI()
|
||||
handleVariableError(err, cmdhelper.ZitiPKIVarName)
|
||||
|
||||
cmd.PersistentFlags().BoolVarP(&options.Verbose, optionVerbose, "v", defaultVerbose, verboseDescription)
|
||||
cmd.PersistentFlags().StringVarP(&options.Output, optionOutput, "o", defaultOutput, outputDescription)
|
||||
cmd.PersistentFlags().StringVarP(&options.PKIPath, optionPKI, "", defaultPKI, pkiDescription)
|
||||
}
|
||||
|
||||
func (data *ConfigTemplateValues) populateEnvVars() {
|
||||
@@ -179,6 +228,32 @@ func (data *ConfigTemplateValues) populateEnvVars() {
|
||||
data.ZitiEdgeRouterPort = zitiEdgeRouterPort
|
||||
}
|
||||
|
||||
func (data *ConfigTemplateValues) populateDefaults() {
|
||||
data.ListenerBindPort = constants.DefaultListenerBindPort
|
||||
data.OutQueueSize = constants.DefaultOutQueueSize
|
||||
data.EdgeAPISessionTimeoutMinutes = constants.DefaultEdgeAPISessionTimeoutMinutes
|
||||
data.WebListenerIdleTimeoutMS = constants.DefaultWebListenerIdleTimeoutMs
|
||||
data.WebListenerReadTimeoutMS = constants.DefaultWebListenerReadTimeoutMs
|
||||
data.WebListenerWriteTimeoutMS = constants.DefaultWebListenerWriteTimeoutMs
|
||||
data.WebListenerMinTLSVersion = constants.DefaultWebListenerMinTLSVersion
|
||||
data.WebListenerMaxTLSVersion = constants.DefaultWebListenerMaxTLSVersion
|
||||
data.WssWriteTimeout = constants.DefaultWSSWriteTimeout
|
||||
data.WssReadTimeout = constants.DefaultWSSReadTimeout
|
||||
data.WssIdleTimeout = constants.DefaultWSSIdleTimeout
|
||||
data.WssPongTimeout = constants.DefaultWSSPongTimeout
|
||||
data.WssPingInterval = constants.DefaultWSSPingInterval
|
||||
data.WssHandshakeTimeout = constants.DefaultWSSHandshakeTimeout
|
||||
data.WssReadBufferSize = constants.DefaultWSSReadBufferSize
|
||||
data.WssWriteBufferSize = constants.DefaultWSSWriteBufferSize
|
||||
data.LatencyProbeInterval = constants.DefaultLatencyProbeInterval
|
||||
data.XgressDialQueueLength = constants.DefaultXgressDialQueueLength
|
||||
data.XgressDialWorkerCount = constants.DefaultXgressDialWorkerCount
|
||||
data.LinkDialQueueLength = constants.DefaultLinkDialQueueLength
|
||||
data.LinkDialWorkerCount = constants.DefaultLinkDialWorkerCount
|
||||
data.ConnectTimeoutMs = constants.DefaultConnectTimeoutMs
|
||||
data.GetSessionTimeoutS = constants.DefaultGetSessionTimeoutS
|
||||
}
|
||||
|
||||
func handleVariableError(err error, varName string) {
|
||||
if err != nil {
|
||||
logrus.Errorf("Unable to get %s", varName)
|
||||
|
||||
@@ -30,9 +30,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
optionCtrlListener = "ctrlListener"
|
||||
optionMgmtListener = "mgmtListener"
|
||||
optionsDatabaseFile = "databaseFile"
|
||||
optionCtrlListener = "ctrlListener"
|
||||
optionMgmtListener = "mgmtListener"
|
||||
optionDatabaseFile = "databaseFile"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -64,16 +64,13 @@ type CreateConfigControllerOptions struct {
|
||||
|
||||
CtrlListener string
|
||||
MgmtListener string
|
||||
PKIPath string
|
||||
}
|
||||
|
||||
// NewCmdCreateConfigController creates a command object for the "create" command
|
||||
func NewCmdCreateConfigController(data *ConfigTemplateValues) *cobra.Command {
|
||||
controllerOptions := &CreateConfigControllerOptions{}
|
||||
|
||||
// controllerOptions := &CreateConfigControllerOptions{
|
||||
// CreateConfigOptions: configOptions,
|
||||
// }
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "controller",
|
||||
Short: "Create a controller config",
|
||||
@@ -97,6 +94,7 @@ func NewCmdCreateConfigController(data *ConfigTemplateValues) *cobra.Command {
|
||||
// Update controller specific values with configOptions passed in
|
||||
data.CtrlListener = controllerOptions.CtrlListener
|
||||
data.MgmtListener = controllerOptions.MgmtListener
|
||||
data.ZitiPKI = controllerOptions.PKIPath
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
controllerOptions.Cmd = cmd
|
||||
@@ -117,7 +115,7 @@ func NewCmdCreateConfigController(data *ConfigTemplateValues) *cobra.Command {
|
||||
|
||||
func (options *CreateConfigControllerOptions) addFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVar(&options.CtrlListener, optionCtrlListener, "", "address of the config controller listener")
|
||||
cmd.Flags().StringVar(&options.DatabaseFile, optionsDatabaseFile, "ctrl.db", "location of the database file")
|
||||
cmd.Flags().StringVar(&options.DatabaseFile, optionDatabaseFile, "ctrl.db", "location of the database file")
|
||||
cmd.Flags().StringVar(&options.MgmtListener, optionMgmtListener, "", "address of the config management listener")
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,10 @@ func NewCmdCreateConfigRouter(data *ConfigTemplateValues) *cobra.Command {
|
||||
}
|
||||
logrus.SetOutput(logOut)
|
||||
}
|
||||
|
||||
// Update router data with options passed in
|
||||
data.RouterName = options.RouterName
|
||||
data.ZitiPKI = options.PKIPath
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmdhelper.CheckErr(cmd.Help())
|
||||
|
||||
@@ -85,7 +85,6 @@ func NewCmdCreateConfigRouterEdge(data *ConfigTemplateValues) *cobra.Command {
|
||||
}
|
||||
|
||||
// Update edge router specific values with options passed in
|
||||
data.RouterName = options.RouterName
|
||||
data.WssEnabled = options.WssEnabled
|
||||
data.IsPrivate = options.IsPrivate
|
||||
},
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"github.com/openziti/ziti/ziti/cmd/ziti/constants"
|
||||
"github.com/pkg/errors"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -132,7 +134,7 @@ func GetZitiEdgeCtrlHostname() (string, error) {
|
||||
}
|
||||
|
||||
func GetZitiEdgeCtrlPort() (string, error) {
|
||||
return getOrSetEnvVar(ZitiEdgeCtrlPortVarName, "1280")
|
||||
return getOrSetEnvVar(ZitiEdgeCtrlPortVarName, strconv.Itoa(constants.DefaultZitiEdgeControllerPort))
|
||||
}
|
||||
|
||||
func GetZitiEdgeControllerAPI() (string, error) {
|
||||
@@ -180,7 +182,7 @@ func GetZitiSigningIntermediateName() (string, error) {
|
||||
}
|
||||
|
||||
func GetZitiFabCtrlPort() (string, error) {
|
||||
return getOrSetEnvVar(ZitiFabCtrlPortVarName, "6262")
|
||||
return getOrSetEnvVar(ZitiFabCtrlPortVarName, strconv.Itoa(constants.DefaultZitiFabricControllerPort))
|
||||
}
|
||||
|
||||
func GetZitiCtrlHostname() (string, error) {
|
||||
@@ -221,7 +223,7 @@ func GetZitiNetwork() (string, error) {
|
||||
}
|
||||
|
||||
func GetZitiFabMgmtPort() (string, error) {
|
||||
return getOrSetEnvVar(ZitiFabMgmtPortVarName, "10000")
|
||||
return getOrSetEnvVar(ZitiFabMgmtPortVarName, strconv.Itoa(constants.DefaultZitiFabricManagementPort))
|
||||
}
|
||||
|
||||
func GetZitiEdgeCtrlIntermediateName() (string, error) {
|
||||
@@ -248,7 +250,7 @@ func GetZitiEdgeRouterHostname() (string, error) {
|
||||
}
|
||||
|
||||
func GetZitiEdgeRouterPort() (string, error) {
|
||||
return getOrSetEnvVar(ZitiEdgeRouterPortVarName, "3022")
|
||||
return getOrSetEnvVar(ZitiEdgeRouterPortVarName, constants.DefaultZitiEdgeRouterPort)
|
||||
}
|
||||
|
||||
func getOrSetEnvVar(envVarName string, defaultValue string) (string, error) {
|
||||
|
||||
@@ -32,3 +32,42 @@ const (
|
||||
|
||||
CONFIGFILENAME = "config"
|
||||
)
|
||||
|
||||
// Config Template Constants
|
||||
const (
|
||||
DefaultListenerBindPort = 10080
|
||||
DefaultOutQueueSize = 16
|
||||
DefaultConnectTimeoutMs = 5000
|
||||
DefaultGetSessionTimeoutS = 60
|
||||
|
||||
// Router defaults
|
||||
DefaultZitiEdgeRouterPort = "3022"
|
||||
|
||||
// Controller defaults
|
||||
DefaultEdgeAPISessionTimeoutMinutes = 30
|
||||
DefaultWebListenerIdleTimeoutMs = 5000
|
||||
DefaultWebListenerReadTimeoutMs = 5000
|
||||
DefaultWebListenerWriteTimeoutMs = 100000
|
||||
DefaultWebListenerMinTLSVersion = "TLS1.2"
|
||||
DefaultWebListenerMaxTLSVersion = "TLS1.3"
|
||||
DefaultZitiEdgeControllerPort = 1280
|
||||
DefaultZitiFabricControllerPort = 6262
|
||||
DefaultZitiFabricManagementPort = 10000
|
||||
|
||||
// WSS defaults
|
||||
DefaultWSSWriteTimeout = 10
|
||||
DefaultWSSReadTimeout = 5
|
||||
DefaultWSSIdleTimeout = 5
|
||||
DefaultWSSPongTimeout = 60
|
||||
DefaultWSSPingInterval = 54
|
||||
DefaultWSSHandshakeTimeout = 10
|
||||
DefaultWSSReadBufferSize = 4096
|
||||
DefaultWSSWriteBufferSize = 4096
|
||||
|
||||
// Forwarder defaults
|
||||
DefaultLatencyProbeInterval = 1000
|
||||
DefaultXgressDialQueueLength = 1000
|
||||
DefaultXgressDialWorkerCount = 128
|
||||
DefaultLinkDialQueueLength = 1000
|
||||
DefaultLinkDialWorkerCount = 10
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user