-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.schema.json
More file actions
146 lines (146 loc) · 4.57 KB
/
config.schema.json
File metadata and controls
146 lines (146 loc) · 4.57 KB
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "config.schema.json",
"title": "NoCloud CFX Config",
"description": "Configuration schema for no-cloud-cfx",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference"
},
"client_identifier_extractor": {
"type": "string",
"description": "Client identifier extractor method used in rate limiting and metadata attachments. (ip, license, steam etc or combination like ip:license)",
"default": "ip:license",
"pattern": "^(ip|steam|discord|license|license2|fivem|xbl|live)(:(ip|steam|discord|license|license2|fivem|xbl|live))*$"
},
"logging": {
"type": "object",
"description": "Logging configuration",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether logging is enabled",
"default": true
},
"level": {
"type": "string",
"description": "Log level",
"enum": ["debug", "info", "warn", "error"],
"default": "info"
}
},
"required": ["enabled", "level"],
"additionalProperties": false
},
"storage": {
"type": "object",
"description": "Storage configuration",
"properties": {
"metadata_attachments": {
"type": "object",
"description": "Metadata attachment configuration",
"properties": {
"masked_identifiers": {
"type": "array",
"description": "List of client identifiers to mask in metadata (ip is always masked, identifier will be retrieved based on client_identifier_extractor)",
"items": {
"type": "string",
"enum": [
"ip",
"steam",
"discord",
"license",
"license2",
"fivem",
"xbl",
"live"
]
},
"default": ["ip"]
},
"resource": {
"type": "boolean",
"description": "Whether to attach resource name to file metadata",
"default": true
},
"player": {
"type": "boolean",
"description": "Whether to attach player identifier to file metadata",
"default": true
}
},
"required": ["masked_identifiers", "resource", "player"],
"additionalProperties": false
},
"enable_client_uploads": {
"type": "boolean",
"description": "Whether client uploads are enabled",
"default": true
},
"max_file_size_mb": {
"type": "number",
"description": "Maximum upload file size in megabytes",
"minimum": 1,
"default": 50
},
"allowed_file_types": {
"type": "array",
"description": "List of allowed MIME types for uploads",
"items": {
"type": "string",
"pattern": "^[a-z]+/[a-z0-9.+-]+$"
},
"default": [
"text/plain",
"image/jpeg",
"image/png",
"image/gif",
"image/webp",
"image/svg+xml",
"video/mp4",
"video/webm",
"audio/mpeg",
"audio/wav"
]
},
"rate_limit": {
"type": "object",
"description": "Rate limiting configuration",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether rate limiting is enabled",
"default": true
},
"window_ms": {
"type": "integer",
"description": "Maximum number of uploads per minute per client",
"minimum": 1000,
"default": 60000
},
"max_requests": {
"type": "integer",
"description": "Maximum number of uploads per minute per client",
"minimum": 1,
"default": 15
}
},
"required": ["enabled", "window_ms", "max_requests"],
"additionalProperties": false
}
},
"required": [
"metadata_attachments",
"enable_client_uploads",
"max_file_size_mb",
"allowed_file_types",
"rate_limit"
],
"additionalProperties": false
}
},
"required": ["client_identifier_extractor", "logging", "storage"],
"additionalProperties": false
}