Skip to content

Commit

Permalink
server: require web login if an env var is set
Browse files Browse the repository at this point in the history
Release note (admin ui change): require web login if the environment
variable COCKROACH_REQUIRE_WEB_LOGIN is set to true.
  • Loading branch information
Pete Vilter committed Apr 25, 2018
1 parent c54d0b9 commit a35b8d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ const (
TempDirPrefix = "cockroach-temp"
// TempDirsRecordFilename is the filename for the record file
// that keeps track of the paths of the temporary directories created.
TempDirsRecordFilename = "temp-dirs-record.txt"
defaultEventLogEnabled = true
defaultEnableWebSessionAuthentication = false
TempDirsRecordFilename = "temp-dirs-record.txt"
defaultEventLogEnabled = true

maximumMaxClockOffset = 5 * time.Second

Expand Down Expand Up @@ -376,6 +375,8 @@ func MakeConfig(ctx context.Context, st *cluster.Settings) Config {
panic(err)
}

requireWebLogin := envutil.EnvOrDefaultBool("COCKROACH_EXPERIMENTAL_REQUIRE_WEB_LOGIN", false)

cfg := Config{
Config: new(base.Config),
MaxOffset: MaxOffsetType(base.DefaultMaxClockOffset),
Expand All @@ -386,7 +387,7 @@ func MakeConfig(ctx context.Context, st *cluster.Settings) Config {
ScanInterval: defaultScanInterval,
ScanMaxIdleTime: defaultScanMaxIdleTime,
EventLogEnabled: defaultEventLogEnabled,
EnableWebSessionAuthentication: defaultEnableWebSessionAuthentication,
EnableWebSessionAuthentication: requireWebLogin,
Stores: base.StoreSpecList{
Specs: []base.StoreSpec{storeSpec},
},
Expand Down

0 comments on commit a35b8d3

Please sign in to comment.