summaryrefslogtreecommitdiff
path: root/internal/config/server.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2021-10-21 21:28:49 +0300
committerPaul Buetow <pbuetow@mimecast.com>2021-10-21 21:28:49 +0300
commitf4207a55f71bfbcfdc532d5cdd3befaa3474a157 (patch)
treeea5e4a2d2a67035f645bdee496ae55a52034178a /internal/config/server.go
parentd80d6070557e3a800e3a54967af9eced518f116b (diff)
parent739205206d63bf42f4e843b39d04d4c8cd8207c3 (diff)
merge develop
Diffstat (limited to 'internal/config/server.go')
-rw-r--r--internal/config/server.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/config/server.go b/internal/config/server.go
index dc0d587..254ea0c 100644
--- a/internal/config/server.go
+++ b/internal/config/server.go
@@ -4,8 +4,8 @@ import (
"errors"
)
-// Permissions map. Each SSH user has a list of permissions which
-// log files it is allowed to follow and which ones not.
+// Permissions map. Each SSH user has a list of permissions which log files it
+// is allowed to follow and which ones not.
type Permissions struct {
// The default user permissions.
Default []string
@@ -47,7 +47,7 @@ type ServerConfig struct {
MaxConcurrentCats int
// The max amount of concurrent tails per server.
MaxConcurrentTails int
- // The user permissions.
+ // The user permissions. TODO: Add to JSON schema
Permissions Permissions `json:",omitempty"`
// The mapr log format
MapreduceLogFormat string `json:",omitempty"`
@@ -68,7 +68,6 @@ var ServerRelaxedAuthEnable bool
func newDefaultServerConfig() *ServerConfig {
defaultPermissions := []string{"^/.*"}
defaultBindAddress := "0.0.0.0"
-
return &ServerConfig{
SSHBindAddress: defaultBindAddress,
MaxConnections: 10,
@@ -76,6 +75,7 @@ func newDefaultServerConfig() *ServerConfig {
MaxConcurrentTails: 50,
HostKeyFile: "./cache/ssh_host_key",
HostKeyBits: 4096,
+ MapreduceLogFormat: "default",
Permissions: Permissions{
Default: defaultPermissions,
},
@@ -88,10 +88,8 @@ func ServerUserPermissions(userName string) (permissions []string, err error) {
if p, ok := Server.Permissions.Users[userName]; ok {
permissions = p
}
-
if len(permissions) == 0 {
err = errors.New("Empty set of permission, user won't be able to open any files")
}
-
return
}