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

CTFNote v3 #237

Merged
merged 471 commits into from
Apr 28, 2024
Merged

CTFNote v3 #237

merged 471 commits into from
Apr 28, 2024

Conversation

JJ-8
Copy link
Collaborator

@JJ-8 JJ-8 commented Apr 25, 2024

Release notes

Please note that when pulling from an old version, you may be forced to revert/remove the .env file. Backup your secrets before doing so to save yourself some time.

What is new

  • CTFNote now supports Discord integration through a bot. For each task, channels are created, access is synced and participants can start/stop working on a challenge and hand in the flag through Discord. Channels can be archived and deleted when the CTF is over. Check the README for more explanation!
  • The UI has been redesigned to be more clear and intuitive. This includes:
    • Better mobile support.
    • New 'tabledense' layout.
    • Improved search UI.
  • 'On it' history to see who worked on a challenge after stopping working on it. Hold down the 'on it' button to fully remove your name.
  • Last visit time is now tracked in the database to keep an overview of inactive accounts (to cleanup big profile tables). This last visit time is not realtime and only visible to the administrator.
  • Better ctrl+k search hotkey support (now works inside Hedgedoc too).
  • ctrl+s hotkey to quickly solve a task when a task is open.
  • Calendar can now be subscribed to with iCal.

What is fixed

  • Dependencies are upgraded and stored with Yarn in the repo itself.
  • Security updates within CTFNote.
  • Hedgedoc is upgraded.
  • Upload limit is increased to allow high resolution screenshots.
  • Many small improvements.

JJ-8 and others added 30 commits July 5, 2023 13:55
Now it correctly scales for both desktop and mobile.
The table is difficult to see on mobile but very useful on desktop,
so we change the default values depending on the platform.
Task list improvements on mobile devices
The actual .env should not be part of the repository to prevent any
secrets to be stored in git.
Remove dotenv file from git
Pinning to the channel is not silent and we don't want that.
So instead we now save the task link in the topic using the delimiter /-/
Change pin behavior and resolve channel names in archive
It is mandatory to create an archive first before deleting the CTF.
This prevents data loss and the resulting task can always be deleted manually.
The archive command will now not delete the channels anymore.

Finishing of the commands will now be reflected in the bot reply.
Add `/delete` to delete Discord CTF integration
Now they will be properly rendered by Hedgedoc
When the note content is too big, it will be split in multiple pads.
But these pads won't be visible in the export.
This is now fixed by recursively fetch all tasks by matching the pad url.
Discord archive: image handling and recursive pad export
Otherwise this will result in errors.
Subtask export: cyclic references and uploads exclusion
In the end, it was not used but still a good feature to have for this component.
Now all the capabilities and limitations of the bot are documented in the README.
Discord: privilege change sync and better documentation
Copy of 8efa9ba
but this one is upstream included in TFNS#217.
Remove GHCR authentication notice in README
JJ-8 and others added 24 commits April 16, 2024 09:25
This corresponds to the outer-nginx and may also need to be set
before the change will actually be effective.
With this it will apply to all requests done, so also the /uploads endpoint
and not only the endpoint for Hedgedoc.
When a sync has been performed, the old implementation causes a release of the database PoolClient, causing any future database operation to fail.
This is due to the event sync code being triggered from the context of GraphQL queries instead of a separate context when an incoming event from Discord is processed.

The code has now been rewritten to take the context.pgClient database client which is the current GraphQL pgClient.
This client is used in all database operations and not released so it can be used in the future.
This will stop the hanging of the server when a Discord event link sync is done.

This issue was only reliable reproducible with quite some members interested in an event. I tested this with 13 people interested.

In the future we should rewrite this code to always take a pgClient in the database code and create a new pgClient at a higher level when not available and otherwise always use the context.pgClient.
At lower levels we should not be caring about releasing or not because this can only cause issues.
Added ctrl + s shortcut to submit flag on task pages
This is useful for testing if a branch builds.
@JJ-8 JJ-8 marked this pull request as ready for review April 28, 2024 14:09
@JJ-8 JJ-8 merged commit 885871c into TFNS:main Apr 28, 2024
@JJ-8 JJ-8 deleted the ctfnote-v3 branch April 28, 2024 14:29
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.

5 participants