add disableTunneler flag

This commit is contained in:
dovholuknf
2022-10-14 20:54:59 -04:00
committed by gberl002
parent 6b95ce9527
commit ce79612e08
4 changed files with 10 additions and 6 deletions
@@ -33,9 +33,9 @@ link:
{{ if .Router.IsFabric }}#{{ end }} advertise: {{ .Router.Edge.Hostname }}:{{ if .Router.IsWss }}3023{{ else }}{{ .Router.Edge.Port }}{{ end }}
{{ if .Router.IsFabric }}#{{ end }} connectTimeoutMs: {{ .Router.Listener.ConnectTimeout.Milliseconds }}
{{ if .Router.IsFabric }}#{{ end }} getSessionTimeout: {{ .Router.Listener.GetSessionTimeout.Seconds }}s
{{ if .Router.IsFabric }}#{{ end }} - binding: tunnel
{{ if .Router.IsFabric }}#{{ end }} options:
{{ if .Router.IsFabric }}#{{ end }} mode: host #tproxy|host
{{ if .Router.IsFabric }}#{{ end }}{{ if .Router.TunnelerDisabled }}#{{ end }} - binding: tunnel
{{ if .Router.IsFabric }}#{{ end }}{{ if .Router.TunnelerDisabled }}#{{ end }} options:
{{ if .Router.IsFabric }}#{{ end }}{{ if .Router.TunnelerDisabled }}#{{ end }} mode: host #tproxy|host
{{ if or .Router.IsFabric }}
csr:
+1
View File
@@ -119,6 +119,7 @@ type RouterTemplateValues struct {
IsPrivate bool
IsFabric bool
IsWss bool
TunnelerDisabled bool
IdentityCert string
IdentityServerCert string
IdentityKey string
+4 -3
View File
@@ -33,9 +33,10 @@ const (
type CreateConfigRouterOptions struct {
CreateConfigOptions
RouterName string
WssEnabled bool
IsPrivate bool
RouterName string
WssEnabled bool
IsPrivate bool
TunnelerDisabled bool
}
var routerOptions = CreateConfigRouterOptions{}
@@ -64,6 +64,7 @@ func NewCmdCreateConfigRouterEdge() *cobra.Command {
PreRun: func(cmd *cobra.Command, args []string) {
data.Router.IsWss = routerOptions.WssEnabled
data.Router.IsPrivate = routerOptions.IsPrivate
data.Router.TunnelerDisabled = routerOptions.TunnelerDisabled
},
Run: func(cmd *cobra.Command, args []string) {
routerOptions.Cmd = cmd
@@ -82,6 +83,7 @@ func NewCmdCreateConfigRouterEdge() *cobra.Command {
func (options *CreateConfigRouterOptions) addEdgeFlags(cmd *cobra.Command) {
cmd.Flags().BoolVar(&options.WssEnabled, optionWSS, defaultWSS, wssDescription)
cmd.Flags().BoolVar(&options.IsPrivate, optionPrivate, defaultPrivate, privateDescription)
cmd.PersistentFlags().BoolVarP(&options.TunnelerDisabled, "disableTunneler", "t", false, "whether the router has tunneling disabled")
cmd.PersistentFlags().StringVarP(&options.RouterName, optionRouterName, "n", "", "name of the router")
err := cmd.MarkPersistentFlagRequired(optionRouterName)
if err != nil {