CTFd / ctfcli

ctfcli is a tool to manage Capture The Flag events and challenges
https://ctfd.io/
Apache License 2.0
174 stars 74 forks source link

add challenge mirror, verify, format functionality #134

Closed MilyMilo closed 1 year ago

MilyMilo commented 1 year ago

Adds ctf challenge mirror <challenge> and ctf challenge verify <challenge> adapted from #106

Originally, this functionality was called pull and verify - however, push is already used to push challenge changes to the git repository. I think mirror is a better name, as ctfcli will attempt to mirror / copy the remote state from ctfd. This way pull stays in its current git-like form, for git-related operations.

More additions:

Thanks to @reteps for the initial contribution!

Closes: #101 #106

MilyMilo commented 1 year ago

Also I think we'll want to add mirror after performing the deploy, so that we can get the updated connection_info, or even simply update the local challenge with connection_info, and use the new implemented challenge.save() method.

reteps commented 1 year ago

Hi there,

I no longer have time to land this PR, but I have some additional changes on my fork you may want to port over after a lot of testing with my college club. Good luck landing this!

ColdHeat commented 1 year ago

I like the choice of subcommands here. mirror and verify make sense.

In terms of the deploy I think if we can mirror just the connection_info it would be best.

ColdHeat commented 1 year ago

@MilyMilo This seems good to go. Is this still WIP or ready to merge?

MilyMilo commented 1 year ago

Yeah let's add the mirror after sync, I'll do that now.

MilyMilo commented 1 year ago

Okay so some more changes: