Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions challenges/mock-track-apache-php/track.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: mock-track-apache-php
description: "The hackiest hackers hacking hackily ever after"
integrated_with_scenario: false
open_source_after_ctf: true
contacts:
dev:
- user_dev
Expand Down
1 change: 1 addition & 0 deletions challenges/mock-track-files-only/track.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: mock-track-files-only
description: "The hackiest hackers hacking hackily ever after"
integrated_with_scenario: false
open_source_after_ctf: true
contacts:
dev:
- user_dev
Expand Down
1 change: 1 addition & 0 deletions challenges/mock-track-python-service/track.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: mock-track-python-service
description: "The hackiest hackers hacking hackily ever after"
integrated_with_scenario: false
open_source_after_ctf: false
contacts:
dev:
- user_dev
Expand Down
1 change: 1 addition & 0 deletions challenges/mock-track-with-build/track.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: mock-track-with-build
description: "Mock track with a build container"
integrated_with_scenario: false
open_source_after_ctf: true
contacts:
dev:
- user_dev
Expand Down
9 changes: 9 additions & 0 deletions ctf/commands/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ def new(
help="If a virtual machine is required.",
),
] = False,
open_source_after_ctf: Annotated[
bool,
typer.Option(
"--no-open-source/--open-source",
help="Whether the track should be open-sourced after the CTF.",
prompt="Open-source this track after the CTF?",
),
] = True,
) -> None:
LOG.info(f"Creating a new track: {name}")
if not re.match(pattern=r"^[a-z][a-z0-9\-]{0,61}[a-z0-9]$", string=name):
Expand Down Expand Up @@ -134,6 +142,7 @@ def new(
"template": template.value,
"with_build": with_build_container,
"with_virtual_machine": with_virtual_machine,
"open_source_after_ctf": open_source_after_ctf,
}
)
with (p := new_challenge_directory / "track.yaml").open(
Expand Down
1 change: 1 addition & 0 deletions ctf/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class TrackYaml(BaseModel):
name: str
description: str
integrated_with_scenario: bool
open_source_after_ctf: bool = True
contacts: TrackContacts
instances: TrackInstances | None = None
flags: list[TrackFlag]
Expand Down
5 changes: 5 additions & 0 deletions ctf/templates/init/schemas/track.yaml.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"type": "boolean",
"description": "Set to true only if the track has been integrated with the CTF scenario. This means that Eric Boivin wrote/modified the posts."
},
"open_source_after_ctf": {
"type": "boolean",
"description": "Whether the track source code will be published/open-sourced after the CTF ends. Defaults to true."
},
"contacts": {
"description": "Handles or real names. Ex: Émilio Gonzalez or Res260",
"type": "object",
Expand Down Expand Up @@ -274,6 +278,7 @@
"name",
"description",
"integrated_with_scenario",
"open_source_after_ctf",
"contacts",
"flags"
]
Expand Down
2 changes: 2 additions & 0 deletions ctf/templates/new/common/track.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: {{ data.name }}
description: "CHANGE_ME The hackiest hackers hacking hackily ever after"
# Set to true when the person responsible of the theme has fully integrated the track with the scenario, which implies he wrote the discourse posts.
integrated_with_scenario: false
# Set to false if this track should NOT be published/open-sourced after the CTF ends.
open_source_after_ctf: {{ data.open_source_after_ctf | lower }}

contacts:
# Who created the challenges. Use either handles or real names.
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"typer==0.24.1",
"pydantic",
]
version = "5.6.0"
version = "6.0.0"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading