Fixed password change bug
This commit is contained in:
@@ -2,7 +2,7 @@ module shuffle
|
||||
|
||||
go 1.13
|
||||
|
||||
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
|
||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||
|
||||
@@ -24,7 +24,7 @@ require (
|
||||
github.com/elastic/go-elasticsearch/v7 v7.12.0 // indirect
|
||||
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb // indirect
|
||||
github.com/frikky/kin-openapi v0.39.0
|
||||
github.com/frikky/shuffle-shared v0.0.50
|
||||
github.com/frikky/shuffle-shared v0.0.51
|
||||
github.com/fsouza/go-dockerclient v1.7.2 // indirect
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/go-git/go-billy/v5 v5.0.0
|
||||
|
||||
@@ -159,6 +159,8 @@ github.com/frikky/shuffle-shared v0.0.49 h1:fChF0Nh/bMuXZg67Pt9XXn9+mH4IlKgB3dAz
|
||||
github.com/frikky/shuffle-shared v0.0.49/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/frikky/shuffle-shared v0.0.50 h1:dQIXf4mwUHuEVsXiMtZaSznz6vWt+C0KjyTAsAgMs3s=
|
||||
github.com/frikky/shuffle-shared v0.0.50/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/frikky/shuffle-shared v0.0.51 h1:JrCGoRNj/LkAvSlkyx7tLv7ToNtJDIAqKqiA/poO+G4=
|
||||
github.com/frikky/shuffle-shared v0.0.51/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
|
||||
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
|
||||
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
||||
|
||||
+28
-9
@@ -15,6 +15,7 @@ import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -4240,7 +4241,7 @@ func runInitEs(ctx context.Context) {
|
||||
cloneOptions.ReferenceName = plumbing.ReferenceName(branch)
|
||||
}
|
||||
|
||||
log.Printf("Getting apps from %s", url)
|
||||
log.Printf("[DEBUG] Getting apps from %s", url)
|
||||
|
||||
r, err := git.Clone(storer, fs, cloneOptions)
|
||||
|
||||
@@ -5649,7 +5650,7 @@ func initHandlers() {
|
||||
//requestCache = cache.New(5*time.Minute, 10*time.Minute)
|
||||
dbclient, err = datastore.NewClient(ctx, gceProject, option.WithGRPCDialOption(grpc.WithNoProxy()))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("[DEBUG] Database client error during init: %s", err))
|
||||
log.Fatalf("[DEBUG] Database client error during init: %s", err)
|
||||
}
|
||||
|
||||
esUrl := os.Getenv("SHUFFLE_OPENSEARCH_URL")
|
||||
@@ -5657,15 +5658,33 @@ func initHandlers() {
|
||||
esUrl = "http://shuffle-opensearch:9200"
|
||||
}
|
||||
|
||||
es, err := elasticsearch.NewClient(
|
||||
elasticsearch.Config{
|
||||
Addresses: []string{esUrl},
|
||||
Username: os.Getenv("SHUFFLE_OPENSEARCH_USERNAME"),
|
||||
Password: os.Getenv("SHUFFLE_OPENSEARCH_PASSWORD"),
|
||||
config := elasticsearch.Config{
|
||||
Addresses: []string{esUrl},
|
||||
Username: os.Getenv("SHUFFLE_OPENSEARCH_USERNAME"),
|
||||
Password: os.Getenv("SHUFFLE_OPENSEARCH_PASSWORD"),
|
||||
Transport: &http.Transport{
|
||||
MaxIdleConnsPerHost: 100,
|
||||
ResponseHeaderTimeout: time.Second,
|
||||
TLSClientConfig: &tls.Config{
|
||||
MinVersion: tls.VersionTLS11,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
certificateLocation := os.Getenv("SHUFFLE_OPENSEARCH_CERTIFICATE_FILE")
|
||||
if len(certificateLocation) > 0 {
|
||||
cert, err := ioutil.ReadFile(certificateLocation)
|
||||
if err != nil {
|
||||
log.Fatalf("[WARNING] Failed configuring certificates: %s not found", err)
|
||||
} else {
|
||||
config.CACert = cert
|
||||
}
|
||||
log.Printf("[INFO] Added certificate %#v elastic client.", certificateLocation)
|
||||
}
|
||||
|
||||
es, err := elasticsearch.NewClient(config)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("[DEBUG] Database client for ELASTICSEARCH error during init: %s", err))
|
||||
log.Fatalf("[DEBUG] Database client for ELASTICSEARCH error during init (fatal): %s", err)
|
||||
}
|
||||
|
||||
elasticConfig := "elasticsearch"
|
||||
|
||||
@@ -3421,7 +3421,7 @@ func iterateOpenApiGithub(fs billy.Filesystem, dir []os.FileInfo, extra string,
|
||||
//log.Printf("%s", string(readFile))
|
||||
swagger, err := openapi3.NewSwaggerLoader().LoadSwaggerFromData([]byte(parsedOpenApi.Body))
|
||||
if err != nil {
|
||||
log.Printf("Swagger validation error in loop (%s): %s", filename, err)
|
||||
log.Printf("[WARNING] Swagger validation error in loop (%s): %s. Continuing.", filename, err)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -3432,7 +3432,7 @@ func iterateOpenApiGithub(fs billy.Filesystem, dir []os.FileInfo, extra string,
|
||||
//log.Printf("Should generate yaml")
|
||||
swagger, api, _, err := shuffle.GenerateYaml(swagger, parsedOpenApi.ID)
|
||||
if err != nil {
|
||||
log.Printf("Failed building and generating yaml in loop (%s): %s", filename, err)
|
||||
log.Printf("Failed building and generating yaml in loop (2) (%s): %s. Continuing.", filename, err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user