From 1c11ea642da07fb95260edf3974566f69d37a97f Mon Sep 17 00:00:00 2001 From: Tom Plant <21111317+pl4nty@users.noreply.github.com> Date: Fri, 28 Jul 2023 06:01:04 +1000 Subject: [PATCH] Allow provided `connection_info` in `deploy` (#121) * feat: allow provided `connection_info` in `deploy` * Add some logging information to show that we will use hardcoded connection_info * Fixes #120 --------- Co-authored-by: Kevin Chung --- ctfcli/cli/challenges.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ctfcli/cli/challenges.py b/ctfcli/cli/challenges.py index 2a30d58..b672a58 100644 --- a/ctfcli/cli/challenges.py +++ b/ctfcli/cli/challenges.py @@ -339,7 +339,15 @@ def deploy(self, challenge, host=None, protocol=None): challenge=challenge, host=target_host, protocol=protocol, ) - challenge["connection_info"] = connect_info + # Use hardcoded connection_info if specified + connection_info = connect_info + if challenge.get("connection_info"): + click.secho( + "Using connection_info hardcoded in challenge.yml", fg="yellow", + ) + connect_info = challenge.get("connection_info") + + challenge["connection_info"] = connection_info if status: # Search for challenge