Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional args to ssh deployment for docker run arguments #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions ctfcli/spec/challenge-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ host: null

# Optional settings

# Specify command-line arguments for deploying the challenge. Currently supports SSH deployments, ie `docker run [deploy_args]`
deploy_args: null

# connection_info is used to provide a link, hostname, or instructions on how to connect to a challenge
connection_info: nc hostname 12345

Expand Down
2 changes: 1 addition & 1 deletion ctfcli/utils/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def ssh(challenge, host, protocol):
[
"ssh",
host.netloc,
f"docker run -d -p{exposed_port}:{exposed_port} --name {image_name} --restart always {image_name}",
f"docker run -d -p{exposed_port}:{exposed_port} --name {image_name} --restart always {image_name} {challenge.get('deploy_args', '')}",
]
)

Expand Down