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

Added next and anonymize in requirements #169

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

herosi
Copy link

@herosi herosi commented Jan 28, 2025

No description provided.

- Added support for anonymize flag in requirements
- Added data in flags with static type in challenge-example.yml to avoid
  verify command fails
- Added sort for requirements because it seems CTFd does not accept
  prerequisites if they are not sorted.
- Applied black to challenge.py to avoid Linting error.
@ColdHeat
Copy link
Member

I'm not sure if the anonymize feature should be shown as require_anonymize. Could it possibly be a sub section of requirements?

It would be better if next_id was just next so that the user could specify a name. ctfcli tries to stay away from direct IDs because it's not portable between CTFd instances.

@herosi
Copy link
Author

herosi commented Jan 28, 2025

Of course, I know anonymize should be under requirements. But I didn't do that because the change will break the current format of challenge.yml. We could not reuse challenges created in the past if the change was applied. I want to avoid that.

  • Current PR
- requirements
  - "Challenge A"
  - "Challenge B"
- require_anonymize: False

  • The change
- requirements
  - prerequisites
    - "Challenge A"
    - "Challenge B"
  - anonymize: False

I chose next_id because CTFd uses the name. But it is OK to change.
And the reason why I accept integer in it is that requirements also accept integer.

@herosi
Copy link
Author

herosi commented Jan 29, 2025

I changed next_id to next.

@herosi
Copy link
Author

herosi commented Jan 31, 2025

I omit anonymize_require and ctfcli now accepts both styles like below and anonymize flag is a sub section of requirements.

requirements:
    - "Warmup"
    - "Are you alive"
requirements:
    prerequisites:
        - "Warmup"
        - "Are you alive"
    anonymize: true

@ColdHeat
Copy link
Member

I will try to update to the v4 upload action. Last time I tried it, I failed at migrating away from v3 but maybe it got better.

@herosi
Copy link
Author

herosi commented Jan 31, 2025

I bet it's successful!

@herosi
Copy link
Author

herosi commented Jan 31, 2025

I think you already know, but just in case...,

You might pay attention to this.

https://github.com/actions/upload-artifact?tab=readme-ov-file#breaking-changes

Uploading to the same named Artifact multiple times.

Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. Otherwise you will encounter an error.

It seems you have already used ctfcli-0.1.3.tar.gz. So you might need to bump the version number to 0.1.4 or something like that.

@herosi herosi changed the title Added next_id and anonymize in requirements Added next and anonymize in requirements Jan 31, 2025
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.

2 participants