Skip to content

Commit

Permalink
chore: Configure webpack dev server to proxy using HTTPS (argoproj#2812)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Apr 24, 2020
1 parent cc136f9 commit bac339a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/argo/commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ See %s`, help.ArgoSever),
// InsecureSkipVerify will not impact the TLS listener. It is needed for the server to speak to itself for GRPC.
tlsConfig = &tls.Config{Certificates: []tls.Certificate{cer}, InsecureSkipVerify: true}
} else {
log.Warn("You are running in insecure mode. How enable transport security: https://github.com/argoproj/argo/blob/master/docs/tls.md")
log.Warn("You are running in insecure mode. Learn how to enable transport layer security: https://github.com/argoproj/argo/blob/master/docs/tls.md")
}

opts := apiserver.ArgoServerOpts{
Expand Down
9 changes: 6 additions & 3 deletions server/apiserver/argoserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st
go func() { as.checkServeErr("grpcServer", grpcServer.Serve(grpcL)) }()
go func() { as.checkServeErr("httpServer", httpServer.Serve(httpL)) }()
go func() { as.checkServeErr("tcpm", tcpm.Serve()) }()
log.Infof("Argo Server started successfully on address %s", address)

browserOpenFunc("http:https://localhost" + address)
url := "http:https://localhost" + address
if as.tlsConfig != nil {
url = "https://localhost" + address
}
log.Infof("Argo Server started successfully on %s", url)
browserOpenFunc(url)

<-as.stopCh
}
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ const config = {
},
proxy: {
'/api': {
'target': isProd ? '' : 'http:https://localhost:2746',
'target': isProd ? '' : 'https:https://localhost:2746',
'secure': false,
},
'/artifacts': {
'target': isProd ? '' : 'http:https://localhost:2746',
'target': isProd ? '' : 'https:https://localhost:2746',
'secure': false,
},
'/artifacts-by-uid': {
'target': isProd ? '' : 'http:https://localhost:2746',
'target': isProd ? '' : 'https:https://localhost:2746',
'secure': false,
}
}
Expand Down

0 comments on commit bac339a

Please sign in to comment.