JJ-8 / CTFNote

CTFNote is a collaborative tool aiming to help CTF teams to organise their work. This tool helps making notes during CTFs, so you can track your CTF notes at a later time. This is similar to the CTF pad seen in one of the video's of Liveoverflow.
GNU General Public License v3.0
9 stars 2 forks source link

Different Discord channel handling styles: Categorized, Forum & Threads #85

Closed JJ-8 closed 4 months ago

JJ-8 commented 5 months ago

Currently the Discord channel handling is done in an 'Agile' style: new, started, solved. It is like a small kanban board. This is cool, but not everyone likes it. Therefore, I think it would be cool to have two new different styles for handling Discord channels: Categorized, Forum & Threads.

Categorized

In this style there is one Discord category per common CTF category. Based on the (first matching?) tag, the channel is added to a Discord category. So you have Discord categories with 'Pwn', 'Crypto', etc. each with channels in them. This allows easy muting of Discord channels where you quickly encounter skill issues. If a challenge is solved, a checkmark can be added to the start of the name to indicate the solving state. The channel is therefore not moved.

Forum

For community servers, it is possible to create a forum for each CTF. In this forum you can create a channel per task with all the corresponding tags. The solving state would be indicated by a checkmark in the title, no moving of the channel is done. Benefit here is that Discord supports searching and filtering through forums.

Threads

Very much like Forum but this can be used for non-community servers. The bot should create a new channel and post a message per channel and create the corresponding threads. Benefit of this style is that you have the archive + delete the chats way less often since you almost never hit the channel limit of Discord. Problem here is that as far as I know reading thread messages is not supported currently by bots so how are we going to archive?

I think we should prioritize Categorized since it is quite a useful style which would probably be used way more often than Forum or Threads.

What should be done

The current Discord code is written in a way to only support 1 style. The graphql hooks and Discord commands trigger certain functions that will result in actions taken by the bot. These functions should be generalized and through switch-case like statements choose the correct style to manage the CTF channels. So all the current logic should be moved to a folder agile/ and new implementations of the functions in agile/ should be created in categorized/. Then we could have a single file where we have the 'entry point' of all the events through the Discord commands or graphql hooks and from there we jump to the functions of agile, categorized, forum or threads. I think it is best to let the Discord style be chosen through an environment variable on server level. You don't want to accidentally change this during a CTF, because it will mess up your whole Discord sync state. Therefore you have to fully restart the server in order to change to another implementation.

daanbreur commented 4 months ago

I think forums are basically using Threads. So it might have the same problems for archiving.

JJ-8 commented 4 months ago

See https://github.com/TFNS/CTFNote/issues/239