fix: flow order - wireguard proxy goes first

This commit is contained in:
braginini
2021-04-15 16:25:25 +02:00
parent 2cfafe9392
commit d3454eb0f9
6 changed files with 64 additions and 52 deletions

View File

@@ -42,6 +42,5 @@ var (
)
func init() {
//upCmd.PersistentFlags().IntVar(&port, "port", 10000, "Server port to listen on (e.g. 10000)")
upCmd.PersistentFlags().IntVar(&port, "port", 10000, "Server port to listen on (e.g. 10000)")
}

View File

@@ -25,17 +25,8 @@ var (
Use: "up",
Short: "start wiretrustee",
Run: func(cmd *cobra.Command, args []string) {
/*config, err := ReadConfig("config.yml")
if err != nil {
log.Fatal("failed to load config")
os.Exit(ExitSetupFailed)
}*/
log.SetLevel(log.DebugLevel)
//c := defaultConfig()
//todo print config
//todo connect to signal
ctx := context.Background()
signalClient, err := sig.NewClient(config.SignalAddr, ctx)
if err != nil {
@@ -73,8 +64,8 @@ func init() {
upCmd.PersistentFlags().StringVar(&config.WgIface, "interface", "wiretrustee0", "Wireguard interface name")
upCmd.PersistentFlags().StringVar(&config.StunURL, "stun", "stun:stun.wiretrustee.com:3468", "A comma separated list of STUN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.TurnURL, "turn", "turn:stun.wiretrustee.com:3468", "A comma separated list of TURN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.TurnPwd, "turnUser", "wiretrustee", "A comma separated list of TURN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.TurnUser, "turnPwd", "wt2021hello@", "A comma separated list of TURN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.TurnUser, "turnUser", "wiretrustee", "A comma separated list of TURN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.TurnPwd, "turnPwd", "wt2021hello@", "A comma separated list of TURN servers including protocol (e.g. stun:stun.wiretrustee.com:3468")
upCmd.PersistentFlags().StringVar(&config.SignalAddr, "signal", "signal.wiretrustee.com:10000", "Signal server URL (e.g. signal.wiretrustee.com:10000")
//upCmd.MarkPersistentFlagRequired("config")
fmt.Printf("")