-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdefault.go
48 lines (45 loc) · 1.63 KB
/
default.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package config
import (
"encoding/hex"
)
var DefaultLocalBSPath = "~/.jiaozifs/blockstore"
var defaultCfg = Config{
Path: "~/.jiaozifs/config.toml",
Log: LogConfig{
Level: "INFO",
},
API: APIConfig{
Listen: "http://127.0.0.1:34913",
},
Blockstore: BlockStoreConfig{
Type: "local",
Local: (*struct {
Path string `mapstructure:"path" json:"path"`
ImportEnabled bool `mapstructure:"import_enabled" json:"import_enabled"`
ImportHidden bool `mapstructure:"import_hidden" json:"import_hidden"`
AllowedExternalPrefixes []string `mapstructure:"allowed_external_prefixes" json:"allowed_external_prefixes"`
})(&struct {
Path string
ImportEnabled bool
ImportHidden bool
AllowedExternalPrefixes []string
}{Path: DefaultLocalBSPath, ImportEnabled: false, ImportHidden: false, AllowedExternalPrefixes: nil}),
},
Auth: AuthConfig{
SecretKey: hex.EncodeToString([]byte("THIS_MUST_BE_CHANGED_IN_PRODUCTION")),
UIConfig: struct {
RBAC string `mapstructure:"rbac"`
LoginURL string `mapstructure:"login_url"`
LoginFailedMessage string `mapstructure:"login_failed_message"`
FallbackLoginURL *string `mapstructure:"fallback_login_url"`
FallbackLoginLabel *string `mapstructure:"fallback_login_label"`
LoginCookieNames []string `mapstructure:"login_cookie_names"`
LogoutURL string `mapstructure:"logout_url"`
}{RBAC: AuthRBACSimplified,
LoginURL: "api/v1/auth/login",
LoginFailedMessage: "",
LoginCookieNames: nil,
LogoutURL: "auth/logout",
},
},
}