mirror of
				https://github.com/zitadel/zitadel.git
				synced 2025-11-04 06:38:48 +00:00 
			
		
		
		
	* fix(cli): possibility to overwrite setup steps * chore: update cockroach version in go-dep * fix(cli): init masterkey flags once Co-authored-by: Livio Amstutz <livio.a@gmail.com>
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
package start
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/spf13/cobra"
 | 
						|
	"github.com/spf13/viper"
 | 
						|
 | 
						|
	"github.com/caos/zitadel/cmd/admin/key"
 | 
						|
)
 | 
						|
 | 
						|
func startFlags(cmd *cobra.Command) {
 | 
						|
	bindUint16Flag(cmd, "port", "port to run ZITADEL on")
 | 
						|
	bindStringFlag(cmd, "externalDomain", "domain ZITADEL will be exposed on")
 | 
						|
	bindStringFlag(cmd, "externalPort", "port ZITADEL will be exposed on")
 | 
						|
	bindBoolFlag(cmd, "externalSecure", "if ZITADEL will be served on HTTPS")
 | 
						|
 | 
						|
	key.AddMasterKeyFlag(cmd)
 | 
						|
}
 | 
						|
 | 
						|
func bindStringFlag(cmd *cobra.Command, name, description string) {
 | 
						|
	cmd.PersistentFlags().String(name, viper.GetString(name), description)
 | 
						|
	viper.BindPFlag(name, cmd.PersistentFlags().Lookup(name))
 | 
						|
}
 | 
						|
 | 
						|
func bindUint16Flag(cmd *cobra.Command, name, description string) {
 | 
						|
	cmd.PersistentFlags().Uint16(name, uint16(viper.GetUint(name)), description)
 | 
						|
	viper.BindPFlag(name, cmd.PersistentFlags().Lookup(name))
 | 
						|
}
 | 
						|
 | 
						|
func bindBoolFlag(cmd *cobra.Command, name, description string) {
 | 
						|
	cmd.PersistentFlags().Bool(name, viper.GetBool(name), description)
 | 
						|
	viper.BindPFlag(name, cmd.PersistentFlags().Lookup(name))
 | 
						|
}
 |