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
Allow {{url_for}} and {{lookup}} templates in Description
The values of these templates can be determined as soon as a build of a
challenge has been created, and differ from connection-related templates
like {{port}} which require a running instance to have meaningful
values.
The advantage of allowing these tags in the Description section is that
for on-demand challenges containing both artifacts and a server
component (for example, binary exploitation challenges that provide both
a source file and a remote server containing the flag), players no
longer need to start an instances just to gain access to the artifact
downloads and begin working on the challenge. This way, they do not need
to start an instance of the challenge until they have developed an
exploit locally and are ready to test it against the remote server.
This is both more convenient for players, who historically have been
confused as to why they need to start an instance just to download
artifacts, and also reduces load on the Docker server.
This change does mean that the Description field loses the initially
intended property of being truly static across all challenge instances.
In theory, it might be cleaner to instead separate descriptions into
three sections: static, build-level templatable, and instance-level
templatable. However, this is a much less intrusive change.
Note that technically {{server}} could also be resolved by clients while
only having build-level information available. However, I can't think of
any situation where it is useful on its own without {{port}}, and it
would be confusing to split the permitted connection-related templates
between the two sections.
Copy file name to clipboardexpand all lines: examples/markdown_challenges.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,23 @@
9
9
10
10
## Description
11
11
12
-
This is a static description of the challenge that is intended to be shown to
13
-
the user and will be the same across all instances of the challenge.
12
+
This portion of the challenge description is displayed to users regardless of whether an instance of the challenge is currently running. It may include static text, as well as the following templates:
13
+
14
+
-`{{url_for("file", "display text")}}` (link to an artifact file published in a build)
15
+
-`{{lookup("key")}}` ("key" must have been published in `metadata.json` when creating a build)
14
16
15
17
## Details
16
18
17
-
This is templated information for the challenge that can use additional
18
-
build-specific information to present information. In particular, the following
19
-
templates are allowed (anything else is invalid):
20
-
-`{{url_for("file", "display text")}}`
19
+
This portion of the challenge description is displayed to users when an instance of a challenge is
20
+
running. It may include any content permitted in the "Description" section, as well as the following
21
+
instance-specific templates:
22
+
21
23
-`{{http_base("port_name")}}` (URL prefix for HTTP requests to the named port)
24
+
-`{{server("port_name")}}` (hostname which hosts for connecting to the
25
+
associated port for the challenge)
22
26
-`{{port("port_name")}}` (The specific port number competitors will see which
23
27
may not be the same number as exposed by Docker if the front-end is proxying
24
28
connections.)
25
-
-`{{server("port_name")}}` (hostname which hosts for connecting to the
26
-
associated port for the challenge)
27
-
-`{{lookup("key")}}` ("key" must have been published in `metadata.json` when creating a build)
28
29
-`{{link("port_name", "/url/in/challenge")}}` (convenience wrapper for generating an HTML link)
0 commit comments