fabric8-services / fabric8-jenkins-proxy

Apache License 2.0
1 stars 16 forks source link

Setup Proxy for development #263

Closed kishansagathiya closed 6 years ago

kishansagathiya commented 6 years ago

This could be either SSL support https://github.com/fabric8-services/fabric8-jenkins-proxy/issues/174 Or using dev cluster, Do whatever is required. We shouldn't be needing prod-preview to test our changes

kishansagathiya commented 6 years ago
  1. Add SSL support to your local proxy implementation.I tried this blog

  2. Add your certificate and key in the root of jenkins-proxy directory (something like ~/go/fabric8/src/github.com/fabric8-services/fabric8-jenkins-proxy)

  3. Replace this line https://github.com/fabric8-services/fabric8-jenkins-proxy/blob/563c04673915f119f462dfd1b228183a9349ccb5/cmd/fabric8-jenkins-proxy/main.go#L163 with

            if err := srv.ListenAndServeTLS("server.crt", "server.key"); err != nil {
                log.Errorf("Could not start proxy" + err.Error())

    Of course, you will have to change it back when you push.

  4. For visual entertainment screenshot from 2018-05-11 15-41-35

If you know a better way to run proxy locally, please suggest.

gastaldi commented 6 years ago

Isn't easier to just enable TLS if server.crt and server.key exists in the root? Asking maintainers to change code back before pushing may not be a good idea

kishansagathiya commented 6 years ago

sn't easier to just enable TLS if server.crt and server.key exists in the root?

Didn't know about this. Let me look into it.

sthaha commented 6 years ago

@kishansagathiya I agree with @gastaldi 's idea .

I am not sure if we must enable https automatically if certs are found,I would rather be explicit about this though a flag e.g. JC_DEV_MODE=true or JC_ENABLE_HTTPS=true. The /scripts/setupLocalProxy.sh can generate the certs if missing and the env method can set the enable-https flag.