-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-schema.json
278 lines (278 loc) · 8.46 KB
/
config-schema.json
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/runar-rkmedia/skiver/config/config",
"$ref": "#/$defs/Config",
"$defs": {
"ApiConfig": {
"properties": {
"Address": {
"type": "string",
"description": "Address (interface) to listen to",
"default": "0.0.0.0"
},
"RedirectPort": {
"type": "integer"
},
"Port": {
"type": "integer"
},
"CertFile": {
"type": "string"
},
"CertKey": {
"type": "string"
},
"DBLocation": {
"type": "string"
},
"ReadTimeout": {
"$ref": "#/$defs/Duration",
"description": "Timeout used for reads"
},
"WriteTimeout": {
"$ref": "#/$defs/Duration",
"description": "Timeout used for writes"
},
"IdleTimeout": {
"$ref": "#/$defs/Duration",
"description": "Timeout used for idles"
},
"ShutdownTimeout": {
"$ref": "#/$defs/Duration",
"description": "Timeout used for shutdown"
},
"Debug": {
"type": "boolean",
"description": "If set, will register debug-handlers at\n- /debug/vars\n- /debug/vars/\n- /debug/pprof/\n- /debug/pprof/cmdline\n- /debug/pprof/profile\n- /debug/pprof/symbol\n- /debug/pprof/trace"
}
},
"additionalProperties": false,
"type": "object"
},
"AuthConfig": {
"properties": {
"SessionLifeTime": {
"$ref": "#/$defs/Duration",
"description": "Defines how long a Session should be valid for."
}
},
"additionalProperties": false,
"type": "object"
},
"BackupConfig": {
"properties": {
"s3": {
"$ref": "#/$defs/S3BaseConfig"
},
"FetchOnStartup": {
"type": "boolean",
"description": "If no database is available at startup, this source can be used to fetch the database.\nSkiver will then use that as a database.\nThis can be useful in environments where there is no readily available persistant storage."
},
"maxInterval": {
"$ref": "#/$defs/Duration",
"description": "The database can be backed up as often as every write, but can be relaxed with this value.\nDefaults to 10 minutes"
}
},
"additionalProperties": false,
"type": "object"
},
"Config": {
"properties": {
"LogLevel": {
"type": "string",
"enum": [
"trace",
"debug",
"info",
"warn",
"warning",
"error",
"fatal",
"panic"
],
"description": "Level for logging\nEnum: [trace debug info warn warning error panic]"
},
"LogFormat": {
"type": "string",
"enum": [
"human",
"json"
],
"description": "Enum: [human json]"
},
"Api": {
"$ref": "#/$defs/ApiConfig"
},
"SelfCheck": {
"type": "boolean",
"description": "If set, will enable a self-check that monitors the applications resource-usage. Used for debugging, and monitoring outside of any orcestrator like kubernetes"
},
"TranslatorServices": {
"items": {
"$ref": "#/$defs/TranslatorService"
},
"type": "array",
"description": "Global translator-services that should be available"
},
"Authentication": {
"$ref": "#/$defs/AuthConfig",
"description": "Options for Authentication"
},
"Gzip": {
"type": "boolean",
"description": "Set to enable gzip-module for all content served"
},
"Metrics": {
"$ref": "#/$defs/Metrics",
"description": "Enable Metrics (prometheus-compatible)"
},
"UploadSnapShots": {
"patternProperties": {
".*": {
"$ref": "#/$defs/Uploader"
}
},
"type": "object",
"description": "Used to upload files to external targets when creating snapshots."
},
"databaseBackups": {
"patternProperties": {
".*": {
"$ref": "#/$defs/BackupConfig"
}
},
"type": "object",
"description": "Used to upload backups of the database.\nCan optionally also be used as a source to retreve a backup from on startup, if there is no database."
}
},
"additionalProperties": false,
"type": "object"
},
"Duration": {
"type": "string",
"title": "Duration-type",
"description": "Textual representation of a duration%!(EXTRA string=1m30s, string=10s, string=2h30m0s, string=150ms)",
"examples": [
"1m30s",
"10s",
"2h30m0s",
"150ms"
]
},
"Metrics": {
"properties": {
"Enabled": {
"type": "boolean"
},
"Port": {
"type": "integer",
"description": "If set, will be exposed on a different port. if not set, it will be exposed on the same port.\nThis can be useful to not expose the metrics publicly."
}
},
"additionalProperties": false,
"type": "object"
},
"S3BaseConfig": {
"properties": {
"endpoint": {
"type": "string",
"description": "Endpoint for the s3-compatible service"
},
"region": {
"type": "string",
"description": "The region for the service."
},
"bucketID": {
"type": "string",
"description": "Bucket to upload into"
},
"accessKey": {
"type": "string",
"description": "AccessKeyID for the bucket / application"
},
"PrivateKey": {
"type": "string",
"description": "Private key or Secret access key for the bucket / application"
},
"providerName": {
"type": "string",
"description": "Name for provider, used for display-puroposes"
},
"forcePathStyle": {
"type": "boolean",
"description": "If set, will add headers for use with Browser-TTL, CDN-TTL and CloudFlare-TTL"
}
},
"additionalProperties": false,
"type": "object"
},
"S3UploaderConfig": {
"properties": {
"endpoint": {
"type": "string",
"description": "Endpoint for the s3-compatible service"
},
"region": {
"type": "string",
"description": "The region for the service."
},
"bucketID": {
"type": "string",
"description": "Bucket to upload into"
},
"accessKey": {
"type": "string",
"description": "AccessKeyID for the bucket / application"
},
"PrivateKey": {
"type": "string",
"description": "Private key or Secret access key for the bucket / application"
},
"providerName": {
"type": "string",
"description": "Name for provider, used for display-puroposes"
},
"forcePathStyle": {
"type": "boolean",
"description": "If set, will add headers for use with Browser-TTL, CDN-TTL and CloudFlare-TTL"
},
"urlFormat": {
"type": "string",
"description": "Can be used to override the url that is produced.\nGolang-templating is available\nVariables:\n`.Object`: The current Object-id (fileName)\n`.Bucket`: The current Object-id (fileName)\n`.EndpointURL`: net.Url version of the Endpoint\n`.Endpoint`: Endpoint as string\n`.Region`: Region."
},
"CacheControl": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"TranslatorService": {
"properties": {
"Kind": {
"type": "string",
"description": "Enum: [bind libre]"
},
"ApiToken": {
"type": "string"
},
"Endpoint": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"description": "TDB"
},
"Uploader": {
"properties": {
"S3": {
"$ref": "#/$defs/S3UploaderConfig",
"description": "S3-compatible target"
}
},
"additionalProperties": false,
"type": "object"
}
}
}