1
0
Fork 0

Correctly indicate no auth enabled

master
Philip O Toole 9 years ago
parent 4350eaac9c
commit 59cddcc2f7

@ -1,3 +1,6 @@
## 2.2.1 (April 19th 2016)
- [PR #95](https://github.com/otoolep/rqlite/pull/95): Correctly enable HTTP authentication.
## 2.2.0 (April 18th 2016) ## 2.2.0 (April 18th 2016)
- [PR #84](https://github.com/otoolep/rqlite/pull/84): Encrypted API (HTTPS) now supported. - [PR #84](https://github.com/otoolep/rqlite/pull/84): Encrypted API (HTTPS) now supported.
- [PR #85](https://github.com/otoolep/rqlite/pull/85): BasicAuth support. - [PR #85](https://github.com/otoolep/rqlite/pull/85): BasicAuth support.

@ -156,21 +156,22 @@ func main() {
log.Println("successfully joined node at", joinAddr) log.Println("successfully joined node at", joinAddr)
} }
// Load authentication information, if supplied. // Create HTTP server and load authentication information, if supplied.
var credentialStore *auth.CredentialsStore var s *httpd.Service
if authFile != "" { if authFile != "" {
f, err := os.Open(authFile) f, err := os.Open(authFile)
if err != nil { if err != nil {
log.Fatalf("failed to open authentication file %s: %s", authFile, err.Error()) log.Fatalf("failed to open authentication file %s: %s", authFile, err.Error())
} }
credentialStore = auth.NewCredentialsStore() credentialStore := auth.NewCredentialsStore()
if err := credentialStore.Load(f); err != nil { if err := credentialStore.Load(f); err != nil {
log.Fatalf("failed to load authentication file: %s", err.Error()) log.Fatalf("failed to load authentication file: %s", err.Error())
} }
s = httpd.New(httpAddr, store, credentialStore)
} else {
s = httpd.New(httpAddr, store, nil)
} }
// Create the HTTP query server.
s := httpd.New(httpAddr, store, credentialStore)
s.CertFile = x509Cert s.CertFile = x509Cert
s.KeyFile = x509Key s.KeyFile = x509Key
s.DisableRedirect = disRedirect s.DisableRedirect = disRedirect

Loading…
Cancel
Save