You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Challenge configuration is expected to be at `<category>/<name>/challenge.yaml`.
8
8
9
+
There are some examples available on the [challenge quickstart guide](/guides/challenge-quickstart#examples).
10
+
11
+
Available fields:
12
+
9
13
[[toc]]
10
14
11
-
## `name`
15
+
`*` denotes required fields.
16
+
17
+
## `name`*
18
+
19
+
- type: `string`
20
+
- no default
12
21
13
22
The name of the challenge, as shown to players in the frontend UI.
14
23
@@ -19,7 +28,10 @@ name: notsh
19
28
name: Revenge of the FIPS
20
29
```
21
30
22
-
## `author`
31
+
## `author`*
32
+
33
+
- type: `string`
34
+
- no default
23
35
24
36
Author or authors of the challenge, as shown to players in the frontend UI. If there are multiple authors, specify them as one string.
25
37
@@ -30,7 +42,10 @@ author: John Author
30
42
author: Alice, Bob, and others
31
43
```
32
44
33
-
## `description`
45
+
## `description`*
46
+
47
+
- type: `string`
48
+
- no default
34
49
35
50
Description and flavortext for the challenge, as shown to players in the frontend UI. Supports templating to include information about the challenge, such as the link or command to connect.
36
51
@@ -58,6 +73,9 @@ description: |
58
73
59
74
## `category`
60
75
76
+
- type: `string`
77
+
- default: from folder structure
78
+
61
79
The category for the challenge, parsed from the directory structure.
62
80
63
81
::: warning
@@ -66,6 +84,9 @@ This is automatically set from the expected directory structure of `<category>/<
66
84
67
85
## `difficulty`
68
86
87
+
- type: `integer`
88
+
- no default
89
+
69
90
::: info
70
91
Not implemented yet, does nothing
71
92
:::
@@ -76,7 +97,10 @@ The difficulty from the challenge, used to set point values. Values correspond t
76
97
difficulty: 1# the current default
77
98
```
78
99
79
-
## `flag`
100
+
## `flag`*
101
+
102
+
- type: `string`| `dict`
103
+
- no default
80
104
81
105
Where to find the flag for the challenge. The flag can be in a file, a regex, or a direct string.
82
106
@@ -99,6 +123,9 @@ Regex flags are not implemented yet and setting one does nothing
99
123
100
124
## `provide`
101
125
126
+
- type: list of `string`/`dict`
127
+
- default: `[]`(no files)
128
+
102
129
List of files to provide to the players on the frontend UI. These files can be from the challenge directory or from a container image built for a [challenge pod](#pods), and uploaded individually or zipped together.
103
130
104
131
If there are no files to upload for this challenge, this can be omitted or set to an empty array.
@@ -152,6 +179,9 @@ provide: []
152
179
153
180
### `.include`
154
181
182
+
- type: list of `string`
183
+
- no default
184
+
155
185
File or list of files to upload individually, or include in a zip if `as` is set.
156
186
157
187
When uploading, only the basename is used and the path to the file is discarded.
@@ -160,16 +190,25 @@ If a provide item is specified as a single string, it is interpreted as an `incl
160
190
161
191
### `.as`
162
192
193
+
- type: `string`
194
+
- no default
195
+
163
196
If `.include` is a single file, rename to this name while uploading.
164
197
165
198
If multiple files, zip them together into the given zip file.
166
199
167
200
### `.from`
168
201
202
+
- type: `string`
203
+
- no default
204
+
169
205
Fetch these files from the corresponding [challenge pod](#pods) image.
170
206
171
207
## `pods`
172
208
209
+
- type: list of `dict`
210
+
- default: `[]` (no pods)
211
+
173
212
Defines how to build and deploy any services needed for the challenge.
174
213
175
214
Challenge pods can be built from a local Dockerfile in the challenge folder or use an upstream image directly.
@@ -199,12 +238,18 @@ pods: []
199
238
200
239
### `.name`
201
240
241
+
- type: `string`
242
+
- no default
243
+
202
244
Name of the pod, used to refer to this container as [a source for `provide` files](#provide) and for generated resource names.
203
245
204
246
Cannot contain spaces or punctuation, only alphanumeric and `-`.
205
247
206
248
### `.build`
207
249
250
+
- type: `string` | `dict`
251
+
- no default
252
+
208
253
Build the container image for this pod from a local `Dockerfile`. Supports a subset of the [docker-compose build spec](https://docs.docker.com/reference/compose-file/build/#illustrative-example),
209
254
either:
210
255
- a string path to the build context folder
@@ -235,12 +280,18 @@ Conflicts with [`image`](#image).
235
280
236
281
### `.image`
237
282
283
+
- type: `string`
284
+
- no default
285
+
238
286
Use an available container image for the pod instead of building one from source.
239
287
240
288
Conflicts with [`build`](#build).
241
289
242
290
### `.env`
243
291
292
+
- type: `dict`
293
+
- default: `{}`(no envvars)
294
+
244
295
Any environment variables to set for the running pod. Specify as `name: value`.
245
296
246
297
```yaml
@@ -250,21 +301,38 @@ env:
250
301
251
302
### `.architecture`
252
303
253
-
Set the desired CPU architecture to run this pod on.
304
+
- type: `string`
305
+
- default: `"amd64"`
306
+
307
+
Set the desired CPU architecture to run this pod on. Kubernetes uses GOARCH architecture names.
254
308
255
309
```yaml
256
-
architecture: amd64 # AKA x86_64; the default
257
-
architecture: arm64 # for ARM
310
+
architecture: amd64
311
+
architecture: arm64
258
312
```
259
313
260
314
### `.resources`
261
315
262
-
The resource usage request and limits for the pod. Kubernetes will make sure the requested resources will be available for this pod to use, and will also restart the pod if it goes over these limits.
316
+
- type: `dict`
317
+
- default: global default from `rcds.yaml`
318
+
319
+
The CPU and memory resources that will be reserved for this pod. Kubernetes will make sure the requested amounts will be available for this pod to use, and will also restart the pod if it goes over these limits.
320
+
321
+
Uses the [Kubernetes resource units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes).
263
322
264
323
If not set, the default set in [`rcds.yaml`](rcds-yaml-reference#resources) is used.
265
324
325
+
```yaml
326
+
resources:
327
+
cpu: 1
328
+
memory: 512Mi
329
+
```
330
+
266
331
### `.replicas`
267
332
333
+
- type: `number`
334
+
- default: `2`
335
+
268
336
How many instances of the pod to run. Traffic is load-balanced between instances.
269
337
270
338
Default is 2 and this is probably fine unless the challenge is very resource intensive.
@@ -275,14 +343,68 @@ replicas: 2 # the default
275
343
276
344
### `.ports`
277
345
278
-
Specfies how to expose this pod to players, either as a raw TCP port or HTTP at a specific domain.
346
+
- type: list of `dict`
347
+
- default: `[]`
348
+
349
+
List of ports to expose to players.
350
+
351
+
#### `.ports[].internal`
279
352
280
-
#### `.ports.internal`
353
+
- type: `number`
354
+
- no default
281
355
282
-
The port the container is listening on; i.e. `xinetd` or `nginx`etc.
356
+
The port that the challenge container (i.e. `xinetd`/`nginx`/etc inside) is listening on.
283
357
284
-
#### `.ports.expose`
358
+
#### `.ports[].expose`
285
359
286
-
How to expose the internal container port
360
+
- type: `dict`
361
+
- no default
362
+
363
+
How to expose the internal container port to players -- either as a TCP port or a subdirectory for web challenges. Must be one of the following:
364
+
365
+
**`.ports[].expose.tcp`**
366
+
367
+
- type: `number`
368
+
- no default
369
+
370
+
The port to expose the challenge over raw TCP at on the challenge subdomain. Must be unique across all other exposed TCP challenges.
371
+
372
+
```yaml [For TCP challenges] {8-10}
373
+
pods:
374
+
- #...
375
+
ports:
376
+
- internal: 31337 # the port the container listens on
377
+
expose:
378
+
tcp: 30124 # exposed at <challenges-domain>:30124
379
+
```
380
+
381
+
**`.ports[].expose.http`**
382
+
383
+
- type: `string`
384
+
- no default
385
+
386
+
The subdomain to expose the challenge at as a website (port 80/443). This is prepended to the global challenge subdomain. The cluster will provision an SSL certificate for the site.
387
+
388
+
Must be a valid DNS domain name (alphanumeric, `_`, `-`).
389
+
390
+
```yaml [For web challenges] {8-10}
391
+
pods:
392
+
- name: main
393
+
build:
394
+
context: .
395
+
dockerfile: Dockerfile
396
+
replicas: 2
397
+
ports:
398
+
- internal: 31337 # the port the container listens on
399
+
expose:
400
+
http: my-chal # exposed at https://my-chal.<challenges-domain>
0 commit comments