Skip to content

add solution to spec explicitly#199

Open
MilyMilo wants to merge 1 commit intoCTFd:solutions-writeupfrom
MilyMilo:solutions-writeup
Open

add solution to spec explicitly#199
MilyMilo wants to merge 1 commit intoCTFd:solutions-writeupfrom
MilyMilo:solutions-writeup

Conversation

@MilyMilo
Copy link
Contributor

@MilyMilo MilyMilo commented Feb 12, 2026

This builds on #198 by adding solution to the challenge spec.

Solution can either be a string (path to the file), or an object specifying path, as well as visibility (or state, both work - ctfd uses state, but i feel visibility is more user friendly). It will upload images as before, and render snippets. HTML style image includes are ignored on purpose - but that can be changed.

Also correctly syncs the solutions with a patch instead of a post.

Copy link
Member

@ColdHeat ColdHeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code as well should prioritize state as the main field and visibility as an alias

Comment on lines +56 to +58
# path: writeup/WRITEUP.md
# visibility: solved # hidden | visible | solved
solution: writeup/WRITEUP.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prioritize state over visibility. The name is a bit incorrect but state is also used for challenges. We have to reasonably map to the models imo.

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