Skip to content

Commit 0f11f1e

Browse files
committed
Rename and tweak some more docs stuff
Signed-off-by: Robert Detjens <github@detjens.dev>
1 parent 0a83323 commit 0f11f1e

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

docs/for-authors/challenge-config.md renamed to docs/for-authors/challenge-reference.md

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# `challenge.yaml` Reference
1+
# Challenge Config Reference
2+
3+
Challenge configuration is expected to be at `<category>/<name>/challenge.yaml`.
24

35
[[toc]]
46

@@ -28,14 +30,16 @@ author: Alice, Bob, and others
2830

2931
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.
3032

31-
| Available fields | Description |
32-
| ---------------- | -------------------------------------------------------------------------------------------------------------- |
33-
| `domain` | The domain/hostname the challenge is listening on <br> (`<subdomain>.chals.example.ctf`) |
34-
| `port` | The port that the challenge is listening on |
35-
| `nc` | The `nc` command to connect to TCP challenges, with Markdown backticks <br> (`` `nc {{domain}} {{port}}` ``) |
36-
| `url` | The URL to the exposed web domain for web challenges, plus port if needed <br> (`https://{{domain}}:{{port}}`) |
37-
| `link` | Create a Markdown link to `url` |
38-
| `challenge` | The full challenge.yaml config object for this challenge, with subfields |
33+
Most challenges only need `{{ nc }}` or `{{ link }}`.
34+
35+
| Available fields | Description |
36+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
37+
| `domain` | Full domain the challenge is exposed at, e.g. `<subdomain>.chals.example.ctf` |
38+
| `port` | Port the challenge is listening on |
39+
| `nc` | `nc` command to connect to TCP challenges, with Markdown backticks <br> (equivalent to `` `nc {{domain}} {{port}}` ``) |
40+
| `url` | URL to the exposed web domain for web challenges, plus port if needed <br> (equivalent to `https://{{domain}}:{{port}}`) |
41+
| `link` | Markdown link to `url` |
42+
| `challenge` | The full challenge.yaml config object for this challenge, with subfields |
3943

4044
```yaml
4145
description: |
@@ -44,16 +48,16 @@ description: |
4448
In case you missed it, this was written by {{ challenge.author }}
4549
and is called {{ challenge.name }}.
4650
47-
{{ link }} # -becomes-> [https://somechal.chals.example.ctf](https://somechal.chals.example.ctf)
48-
{{ nc }} # -becomes-> `nc somechal.chals.example.ctf 12345`
51+
{{ nc }} # `nc somechal.chals.example.ctf 12345`
52+
{{ link }} # [https://somechal.chals.example.ctf](https://somechal.chals.example.ctf)
4953
```
5054

5155
## `category`
5256

5357
The category for the challenge.
5458

5559
::: warning
56-
Automatically set! This is set from the expected directory structure of `<category>/<challenge>/challenge.yaml` and overwrites whatever is set in the file.
60+
This is set from the expected directory structure of `<category>/<challenge>/challenge.yaml` and will overwrite whatever is set in the file.
5761
:::
5862

5963
## `difficulty`
@@ -62,7 +66,7 @@ Automatically set! This is set from the expected directory structure of `<catego
6266
Not implemented yet, does nothing
6367
:::
6468

65-
The difficulty from the challenge, used to set point values. Values correspond to entries in the [rcds.yaml difficulty settings](/for-sysadmins/config#difficulty).
69+
The difficulty from the challenge, used to set point values. Values correspond to entries in the [rcds.yaml difficulty settings](../for-sysadmins/config#difficulty).
6670

6771
```yaml
6872
difficulty: 1 # the current default
@@ -73,18 +77,16 @@ difficulty: 1 # the current default
7377
Where to find the flag for the challenge. The flag can be in a file, a regex, or a direct string.
7478

7579
```yaml
76-
# directly set (equivalent)
80+
# directly set
7781
flag: ctf{example-flag}
78-
flag:
79-
string: ctf{example-flag}
8082
8183
# from a file in in the challenge directory
8284
flag:
83-
file: flag
85+
file: ./flag
8486
8587
# regex
8688
flag:
87-
regex: /ctf\{(foo|bar|baz+)\}/
89+
regex: /ctf\{(foo|bar|ba[xyz])\}/
8890
```
8991

9092
::: info
@@ -103,7 +105,12 @@ provide:
103105
- somefile.txt
104106
- otherfile.txt
105107
106-
# rename a really long name as something shorter during upload
108+
# these are all equivalent
109+
- foo.txt
110+
- include: foo.txt
111+
- include: [ foo.txt ]
112+
113+
# rename a really long name as something shorter for upload
107114
- as: short.h
108115
include: some_really_long_name.h
109116
@@ -145,9 +152,12 @@ File or list of files to upload individually, or include in a zip if `as` is set
145152

146153
When uploading, only the basename is used and the path to the file is discarded.
147154

155+
If a provide item is specified as a single string, it is interpreted as an `include:`.
156+
148157
### `.as`
149158

150-
If `include` is a single file, rename to the given name while uploading.
159+
If `.include` is a single file, rename to this name while uploading.
160+
151161
If multiple files, zip them together into the given zip file.
152162

153163
### `.from`
@@ -223,8 +233,8 @@ Conflicts with [`build`](#build).
223233
Any environment variables to set for the running pod. Specify as `name: value`.
224234

225235
```yaml
226-
env:
227-
SOME_ENVVAR: foo bar
236+
env:
237+
SOME_ENVVAR: foo bar
228238
```
229239

230240
### `.architecture`
@@ -240,7 +250,7 @@ Set the desired CPU architecture to run this pod on.
240250

241251
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.
242252

243-
If not set, the default set in [`rcds.yaml`](config#rcds.yaml) is used.
253+
If not set, the default set in [`rcds.yaml`](../for-sysadmins/config#rcds.yaml) is used.
244254

245255
### `.replicas`
246256

@@ -249,7 +259,7 @@ How many instances of the pod to run. Traffic is load-balanced between instances
249259
Default is 2 and this is probably fine unless the challenge is very resource intensive.
250260

251261
```yaml
252-
replicas: 2 # the default
262+
replicas: 2 # the default
253263
```
254264

255265
### `.ports`
@@ -258,7 +268,7 @@ Specfies how to expose this pod to players, either as a raw TCP port or HTTP at
258268

259269
#### `.ports.internal`
260270

261-
What the container itself is listening on
271+
The port the container is listening on; i.e. `xinetd` or `nginx` etc.
262272

263273
#### `.ports.expose`
264274

docs/for-authors/quickstart.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ flag:
5757
5858
Defines how any container images for this challenge are built and deployed.
5959
60-
The pod `name` is also used for extracting files, see [Providing files to
61-
users](<for-challenge-authors#Providing files to users>).
60+
The pod `name` is also used for extracting files, see [Providing files to users](#Providing files to users).
6261

6362
`build` works similar to [Docker Compose](https://docs.docker.com/reference/compose-file/build/#illustrative-example),
6463
either:

0 commit comments

Comments
 (0)