Skip to content

Conversation

@whoo
Copy link

@whoo whoo commented Jul 28, 2020

Due to changes regarding api in ctfd

Due to changes regarding api in ctfd
@ColdHeat
Copy link
Member

Hmmm is this actually the case?

If you look at the demo CTFd instance (admittedly not updated to the current latest version), it refers to challenge_id.
https://demo.ctfd.io/api/v1/hints (might need to login with admin and password)

@whoo
Copy link
Author

whoo commented Jul 29, 2020

Hi Guys,

Thanks for your work... (I didn't find other tool to configure ctfd via API like yours).

I've got an issue with
-- ctfd commit dc3a4d275bc3b60cf2a5a92364af76da9e1c4931
This patch fix my issue, If it's not relevant please delete.

Regards.

ctf challenge sync Shell/Samba/challenge.yml
Found Shell/Samba/challenge.yml
Loaded Ca bouge
Syncing Ca bouge
Traceback (most recent call last):
  File "/home/domi/.local/bin/ctf", line 8, in <module>
    sys.exit(main())
  File "/home/domi/.local/lib64/python3.6/site-packages/ctfcli/__main__.py", line 74, in main
    fire.Fire(CTFCLI)
  File "/home/domi/.local/lib64/python3.6/site-packages/fire/core.py", line 138, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/domi/.local/lib64/python3.6/site-packages/fire/core.py", line 471, in _Fire
    target=component.__name__)
  File "/home/domi/.local/lib64/python3.6/site-packages/fire/core.py", line 675, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/home/domi/.local/lib64/python3.6/site-packages/ctfcli/cli/challenges.py", line 134, in sync
    sync_challenge(challenge=challenge)
  File "/home/domi/.local/lib64/python3.6/site-packages/ctfcli/utils/challenge.py", line 105, in sync_challenge
    if hint["challenge_id"] == challenge_id:
KeyError: 'challenge_id'

@adam-lebon
Copy link

It should be great to accept this PR since the latest update now refers to challenge.
https://demo.ctfd.io/api/v1/hints :

{"success": true, "data": [{"challenge": 4, "id": 1, "cost": 5, "type": "standard"}]}

I am facing this issue for several weeks.

Thanks in advance

@ColdHeat
Copy link
Member

ColdHeat commented Aug 6, 2020

This should not have changed and it's really indicative of some other issue. I don't think merging this is the right idea. I think this is a CTFd issue.

@ColdHeat
Copy link
Member

ColdHeat commented Aug 6, 2020

Actually I'm not so sure? I'm digging into this now and will push out a fix to the right area once I figure out what's going on.

@ColdHeat
Copy link
Member

ColdHeat commented Aug 6, 2020

I see that this issue was introduced b/c of CTFd/CTFd@ded612d.

This looks to be some more nonsense that Marshmallow injects into the API. I'm going to push this as a fix in CTFd.

ColdHeat added a commit to CTFd/CTFd that referenced this pull request Aug 6, 2020
ColdHeat added a commit to CTFd/CTFd that referenced this pull request Aug 6, 2020
* Fix regression for creating hints via ctfcli

See #1582 for details. 
Closes CTFd/ctfcli#20.
@ColdHeat
Copy link
Member

ColdHeat commented Aug 6, 2020

@whoo @adam-lebon, please update your CTFd to latest master and it should resolve this issue. Merging this would be the wrong idea because it's actually challenge that shouldn't be there.

@whoo
Copy link
Author

whoo commented Aug 6, 2020

you're right this temporary fix shouldn't be used anymore.

thomaspreece pushed a commit to thomaspreece/rd-ctf-2020 that referenced this pull request Nov 24, 2020
…TFd/ctfcli#20 (#1583)

* Fix regression for creating hints via ctfcli

See #1582 for details. 
Closes CTFd/ctfcli#20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants