Skip to content

Commit a3f5cba

Browse files
authored
Merge pull request #39 from nsec/readme
Added README to a newly created track. Modified README file structure.
2 parents eef9c38 + 6f8512e commit a3f5cba

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ my-ctf/
3535
│ │ ├── track.yaml # Main file that describes the track
3636
│ │ ├── files/ # Directory that contains all the files available for download in the track
3737
│ │ │ ├── somefile.zip
38+
│ │ │ ├── askgod/
39+
│ │ │ │ ├── gifs/ # GIF directory for askgod fireworks.
40+
│ │ │ │ │ └── my-gif.gif
41+
│ │ │ │ ├── sounds/ # Sound directory for askgod fireworks.
42+
│ │ │ │ │ └── my-sound.mp3
3843
│ │ ├── ansible/ # Directory containing Ansible playbooks to configure the track
44+
│ │ │ ├── build.yaml # Optional: Playbook when a build container is needed
3945
│ │ │ ├── deploy.yaml # Main playbook to deploy the track
4046
│ │ │ └── inventory # Inventory file for Ansible
4147
│ │ ├── terraform/ # Directory containing OpenTofu (terraform fork) files to describe the infrastructure

ctf/new.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ def new(
135135

136136
LOG.debug(msg=f"Wrote {p}.")
137137

138+
readme_template = env.get_template(name=os.path.join("common", "README.md.j2"))
139+
render = readme_template.render(data={"name": name})
140+
with open(
141+
file=(p := os.path.join(new_challenge_directory, "README.md")),
142+
mode="w",
143+
encoding="utf-8",
144+
) as f:
145+
f.write(render)
146+
147+
LOG.debug(msg=f"Wrote {p}.")
148+
138149
posts_directory = os.path.join(new_challenge_directory, "posts")
139150

140151
os.mkdir(path=posts_directory)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# {{ data.name }}
2+
3+
## Description
4+
5+
TODO CHANGE_ME: This track ....
6+
7+
## Theme
8+
9+
TODO CHANGE_ME: This track incorporates as the control center of a satelite moving around the Earth. It is asked of the participant to take control of it...
10+
11+
## Solutions
12+
13+
### Flag 1
14+
15+
TODO CHANGE_ME: This is a walkthrough of how to get the first flag.

0 commit comments

Comments
 (0)