forked from sahib/brig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults_v0.go
171 lines (169 loc) · 4.58 KB
/
defaults_v0.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package defaults
import (
"github.com/sahib/config"
)
// DefaultsV0 is the default config validation for brig
var DefaultsV0 = config.DefaultMapping{
"daemon": config.DefaultMapping{
"port": config.DefaultEntry{
Default: 6666,
NeedsRestart: true,
Docs: "Port of the daemon process",
Validator: config.IntRangeValidator(1, 655356),
},
},
"gateway": config.DefaultMapping{
"enabled": config.DefaultEntry{
Default: false,
NeedsRestart: false,
Docs: "Wether the gateway should be running",
},
"port": config.DefaultEntry{
Default: 5000,
NeedsRestart: false,
Docs: "On what port the gateway runs on",
},
"folders": config.DefaultEntry{
Default: []string{"/"},
NeedsRestart: false,
Docs: "What folders may be accessed by the gateway",
},
"cert": config.DefaultMapping{
"certfile": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "Path to an existing certificate file",
},
"keyfile": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "Path to an existing key file",
},
"domain": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "What domain to use for getting a certificate from LetsEncrypt",
},
"redirect": config.DefaultMapping{
"enabled": config.DefaultEntry{
Default: true,
NeedsRestart: false,
Docs: "Wether http request should be forwarded to https",
},
"http_port": config.DefaultEntry{
Default: 5001,
NeedsRestart: false,
Docs: "What port the http redirect server should run on",
},
},
},
"auth": config.DefaultMapping{
"enabled": config.DefaultEntry{
Default: false,
NeedsRestart: false,
Docs: "Wether the gateway should be running",
},
"user": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "User used for basic HTTP auth",
},
"pass": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "Password used for basic HTTP auth",
},
},
},
"fs": config.DefaultMapping{
"sync": config.DefaultMapping{
"ignore_removed": config.DefaultEntry{
Default: false,
NeedsRestart: false,
Docs: "Do not remove what the remote removed",
},
"ignore_moved": config.DefaultEntry{
Default: false,
NeedsRestart: false,
Docs: "Do not move what the remote moved",
},
"conflict_strategy": config.DefaultEntry{
Default: "marker",
NeedsRestart: false,
Validator: config.EnumValidator(
"marker", "ignore",
),
},
},
"compress": config.DefaultMapping{
"default_algo": config.DefaultEntry{
Default: "snappy",
NeedsRestart: false,
Docs: "What compression algorithm to use by default",
Validator: config.EnumValidator(
"snappy", "lz4", "none",
),
},
},
"pre_cache": config.DefaultMapping{
"enabled": config.DefaultEntry{
Default: true,
NeedsRestart: false,
Docs: "pre-cache pinned files",
},
},
"autocommit": config.DefaultMapping{
"enabled": config.DefaultEntry{
Default: true,
NeedsRestart: false,
Docs: "Enable the autocommit logic",
},
"interval": config.DefaultEntry{
Default: "5m",
NeedsRestart: false,
Docs: "In what interval to make automatic commits",
Validator: config.DurationValidator(),
},
},
},
"repo": config.DefaultMapping{
"current_user": config.DefaultEntry{
Default: "",
NeedsRestart: true,
Docs: "The repository owner that is published to the outside",
},
"password_command": config.DefaultEntry{
Default: "",
NeedsRestart: false,
Docs: "If set, the repo password is taken from stdout of this command",
},
},
"mounts": config.DefaultMapping{
"__many__": config.DefaultMapping{
"path": config.DefaultEntry{
Default: "",
NeedsRestart: true,
Docs: "The place where the mount path can be found",
},
"read_only": config.DefaultEntry{
Default: false,
NeedsRestart: true,
Docs: "Wether this mount should be done read-only",
},
"root": config.DefaultEntry{
Default: "/",
NeedsRestart: true,
Docs: "The root of the mount",
},
},
},
"data": config.DefaultMapping{
"ipfs": config.DefaultMapping{
"path": config.DefaultEntry{
Default: "",
NeedsRestart: true,
Docs: "Root directory of the ipfs repository",
},
},
},
}