-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.json
352 lines (352 loc) · 13.3 KB
/
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
{
"$id": "https://schema.zeabur.app/template.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Zeabur Template Resource",
"description": "The Zeabur Template resource is a resource that defines a template that can be used to create a new Zeabur resource like GIT or PREBUILT service. It should be formed in YAML.",
"type": "object",
"properties": {
"apiVersion": {
"title": "Resource version",
"description": "The version of the resource. It should be `zeabur.com/v1`.",
"type": "string",
"enum": [
"zeabur.com/v1"
]
},
"kind": {
"title": "Resource kind",
"description": "The kind of the resource. It should be `Template`.",
"type": "string",
"enum": [
"Template"
]
},
"metadata": {
"title": "Resource metadata",
"description": "The metadata of the resource.",
"type": "object",
"properties": {
"name": {
"title": "Resource name",
"description": "The name of the resource. It is usually as same as the template name.",
"examples": [
"Lobe Chat",
"PostgreSQL"
],
"type": "string"
}
},
"required": [
"name"
],
"additionalProperties": false
},
"spec": {
"title": "Template specification",
"description": "The specification of the template.",
"type": "object",
"properties": {
"description": {
"title": "Template description",
"description": "The description of the template.",
"type": ["string", "null"]
},
"coverImage": {
"title": "Template cover image",
"description": "The cover image of the template. It should be a URL link to the image. It can be SVG, PNG, WebP…",
"oneOf": [
{ "$ref": "#/definitions/Picture" },
{ "type": "null" }
]
},
"icon": {
"title": "Template icon",
"description": "The icon of the template. It should be a URL link to the image. It can be SVG, PNG, WebP…",
"oneOf": [
{ "$ref": "#/definitions/Picture" },
{ "type": "null" }
]
},
"variables": {
"title": "Template fillable variables",
"description": "The variables that users need to fill in to create a new template.",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"title": "Variable key",
"description": "The key of the variable.",
"examples": [
"SITE_NAME",
"SITE_DOMAIN"
],
"type": "string"
},
"type": {
"title": "Variable type",
"description": "The type of the variable. String for the normal text-based variables, such as passwords or site names. Domain is the domain name that Zeabur can instruct users to generate a zeabur.app domain.",
"type": "string",
"enum": [
"STRING",
"DOMAIN"
]
},
"name": {
"title": "Variable descriptive name",
"description": "The name of the variable that will be showed to the user.",
"examples": [
"Site Name",
"Site domain"
],
"type": "string"
},
"description": {
"title": "Variable description",
"description": "The description of the variable that will be showed to the user.",
"examples": [
"The name that will be showed as the title of your website"
],
"type": "string"
}
},
"required": [
"key",
"type",
"name",
"description"
],
"additionalProperties": false
}
},
"tags": {
"title": "Template tags",
"description": "The tag of the template. It is useful for users to find the suitable template.",
"examples": [
["Website", "Tool"],
["Database"]
],
"type": "array",
"items": {
"title": "Tag",
"type": "string"
}
},
"readme": {
"title": "Template README",
"description": "The README content of the Template. It will be showed in the description section in Template. It should be in Markdown.",
"type": ["string", "null"],
"examples": [
"# PostgreSQL\nPostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance."
]
},
"services": {
"title": "Template services",
"description": "The services that will be created when the resource is created.",
"type": "array",
"items": {
"title": "Template service definition",
"description": "The service that will be created when the resource is created.",
"type": "object",
"properties": {
"name": {
"title": "Service name",
"description": "The name of the service.",
"examples": [
"Lobe Chat",
"PostgreSQL"
],
"type": "string",
"pattern": "^[a-zA-Z][ -~]*$"
},
"icon": {
"title": "Service icon",
"description": "The icon of the service. It should be a URL link to the image. It can be SVG, PNG, WebP…",
"oneOf": [
{ "$ref": "#/definitions/Picture" },
{ "type": "null" }
]
},
"dependencies": {
"title": "Service dependencies",
"description": "The dependencies of the service. It should be the name of the services that this service depends on.",
"type": ["array", "null"],
"items": {
"title": "Dependency",
"description": "The name of the service that this service depends on.",
"type": "string"
}
},
"template": {
"title": "Service type",
"description": "The type of the service. It can be `GIT`, `PREBUILT` and `PREBUILT_V2`. `PREBUILT` is the alias of `PREBUILT_V2`.",
"type": "string",
"enum": ["GIT", "PREBUILT", "PREBUILT_V2"]
},
"spec": {
"title": "Service specification",
"description": "The specification of the service.",
"type": "object",
"properties": {
"source": {
"title": "Source (Git Repo/Docker Image)",
"description": "The source of the service. It can be a Git(Hub) repository or a Docker image.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/Source"
},
"ports": {
"title": "Ports",
"description": "The ports that will be exposed by the service.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/Ports"
},
"volumes": {
"title": "Volumes",
"description": "The persistence volumes (storage) for the service.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/Volumes"
},
"instructions": {
"title": "Connection instructions",
"description": "The instructions that will be showed to the user for knowing how to connect to the service.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/ConnectionInstructions"
},
"env": {
"title": "Environment Variables",
"description": "The environment variables that will be set for the service or exposed in the project.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/Envs"
},
"init": {
"title": "Initialization Rules",
"description": "The commands that will be executed when the service is initialized.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/InitRules"
},
"configs": {
"title": "Configs",
"description": "The configurations that will be set or declared for the service.",
"$ref": "https://schema.zeabur.app/prebuilt.json#/definitions/Configs"
}
},
"required": [
"source"
]
},
"domainKey": {
"title": "Domain key",
"description": "The variable with the domain name that is used for binding to this service. If this service contains only one domain key, it will be automatically bound to the domain. If there are multiple domain keys, you should specify it with array.",
"examples": [
"SITE_DOMAIN",
[
{
"port": "web",
"variable": "SITE_DOMAIN"
},
{
"port": "console",
"variable": "CONSOLE_DOMAIN"
}
]
],
"oneOf": [
{ "type": "null" },
{ "type": "string" },
{
"type": "array",
"items": {
"title": "Domain key binding",
"description": "The map-binding of the domain key and the port.",
"type": "object",
"properties": {
"port": {
"type": "string",
"description": "The port name that the domain will be bound to."
},
"variable": {
"type": "string",
"description": "The variable containing the domain that will be bound to the port."
}
}
}
}
]
}
},
"required": [
"name",
"template",
"spec"
]
}
}
},
"required": [
"services"
]
},
"localization": {
"title": "Resource localization",
"description": "The localization of the resource.",
"type": "object",
"propertyNames": {
"title": "Locale key",
"description": "The key of the locale that [Zeabur supports](https://github.com/zeabur/zeabur/tree/main/dashboard/locales).",
"type": "string"
},
"additionalProperties": {
"title": "Localizable Template Specification",
"description": "The localizable specification of the template.",
"type": "object",
"properties": {
"description": {
"$ref": "#/properties/spec/properties/description"
},
"coverImage": {
"$ref": "#/properties/spec/properties/coverImage"
},
"variables": {
"$ref": "#/properties/spec/properties/variables"
},
"readme": {
"$ref": "#/properties/spec/properties/readme"
}
}
},
"examples": [
{
"zh-TW": {
"description": "LobeChat 是一個開æºçš„高效能èŠå¤©æ©Ÿå™¨äººæ¡†æž¶ã€‚",
"variables": [
{
"key": "SITE_NAME",
"type": "STRING",
"name": "網站å稱",
"description": "這個å稱將會顯示在您的網站標題上。"
},
{
"key": "SITE_DOMAIN",
"type": "DOMAIN",
"name": "網站網域",
"description": "這個網域將會是您的網站的網å€ã€‚"
}
]
}
}
]
}
},
"definitions": {
"Picture": {
"title": "The picture URL",
"description": "It should be a URL link to the image. It can be SVG, PNG, WebP…",
"type": "string",
"examples": [
"https://www.postgresql.org/media/img/about/press/elephant.png"
],
"format": "uri"
}
},
"required": [
"apiVersion",
"kind",
"metadata",
"spec"
],
"additionalProperties": false
}