Repository navigation
Add feature for storing flag in database - #23
Merged
Merged
Conversation
added 3 commits
March 10, 2021 22:49
After a task is marked as "Solved", the user is asked to enter the flag. The flag will be stored in the database and the user can open it using the context menu. If no flag is provided, nothing will be overwritten. Therefore, it is possible to solve and unsolve a task multiple times without overwriting the current flag. A global option "store-flag" is added to enable/disable this feature. Default is true. An API is introduced to query non-private settings, so it will also work for non-admin users. The "store-flag" setting can also be overwritten by the environment variable CTFNOTE_STORE_FLAG.
The environment variables did not use the new private column, which caused an exception. Now, a new argument is introduced to toggle this option. Also, the INSERT INTO query is removed in order to let the PersistentConfiguration.setIfNotSet decide whether to use the env variables (with default values if not set) or the current stored database option.
The button is not useful if there is no flag yet, so now we hide the button until a flag is stored. After that, the button will stay there forever, because it can not be set to null again. Therefore, you also know when a flag was submitted in the past but was overwritten with something else if the button is there but the flag is not.
Collaborator
Author
|
Either this PR or #20 should be updated to fix any merge conflicts.
|
Member
|
I think I am going to process #20 first ( |
Member
|
LGTM for now. Maybe we will add more fancy display for the flag in the UI. Merge into dev :) |
JJ-8
referenced
this pull request
Mar 23, 2021
JJ-8
added a commit
to woutvanderploeg/CTFNote
that referenced
this pull request
Jun 17, 2023
0 upstream ical link fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a task is marked as "Solved", the user is asked to enter the flag. The flag will be stored in the database and the user can open it using the context menu. If no flag is provided, nothing will be overwritten. Therefore, it is possible to solve and unsolve a task multiple times without overwriting the current flag.
A global option "store-flag" is added to enable/disable this feature. The default is true.
An API is introduced to query non-private settings, so it will also work for non-admin users.
The "store-flag" setting can also be overwritten by the environment variable CTFNOTE_STORE_FLAG.
For some more context:
We added this feature, because sometimes it is required to create a writeup with flags in order to claim a spot on the scoreboard. However, we sometimes forget to store the flags and when the challenge servers closes, we are in big trouble...
Therefore, we wanted to force our teammates to enter the flag when they mark it as solved so we will have the flag stored at least.