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

feat(ctf): store solves walkthrough #167

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

Conversation

k4rt0fl3r
Copy link

@k4rt0fl3r k4rt0fl3r commented Jul 23, 2021

Feature build upon the !ctf archive functionality.
When issuing the command !ctf archive, all pins from challenges will be uploaded to the GitHub repository defined through the config values.

More specifically, all pinned text messages will be written, in chronological order (oldest to newest), in a Markdown file and in case a pinned message contains has any files attached (or is just a file), the exact file will be uploaded separately and a reference to it will be added in the Markdown file. All files will be stored in the repo following this file structure: {ctf-name}/{challenge-name}/

@k4rt0fl3r k4rt0fl3r force-pushed the feat/ctf/store-solves-walkthrough branch from fa032c4 to f475d33 Compare July 24, 2021 05:13
ovisbot/extensions/ctf/ctf.py Outdated Show resolved Hide resolved
ovisbot/extensions/ctf/ctf.py Show resolved Hide resolved
ovisbot/extensions/ctf/ctf.py Outdated Show resolved Hide resolved
Pipfile Outdated Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
ovisbot/extensions/ctf/ctf.py Outdated Show resolved Hide resolved
ovisbot/extensions/ctf/ctf.py Outdated Show resolved Hide resolved
@apogiatzis
Copy link
Member

@eioake01 Thanks for your valuable contributions!! Just a minor suggestion, can you please rename methods/vars to snake case such that they conform to PEP-8?

Finally, make sure that you run the code through the black formatter before pushing to keep a consistent style within the codebase.

@kgeorgiou kgeorgiou changed the title Feat/ctf/store solves walkthrough feat(ctf): store solves walkthrough Jul 24, 2021
@k4rt0fl3r
Copy link
Author

@eioake01 Thanks for your valuable contributions!! Just a minor suggestion, can you please rename methods/vars to snake case such that they conform to PEP-8?

Finally, make sure that you run the code through the black formatter before pushing to keep a consistent style within the codebase.

Hello @apogiatzis , regarding black formatter, I just used the default formatting style, with the command black .
Is there something more specific I should do?

@k4rt0fl3r
Copy link
Author

With the latest commit (468cee5), I made some changes as for the GitHub Requests when uploading the files to not stall. To do that, I used the asyncio lib and specifically the ensure_future functionality.

There is a slight improvment between using asyncio and not, which I believe will be more noticable with big CTFs and lots of pins.

For 2 test cases, 15 requests each (5 markdown (270 bytes each), 5 images (107KB each), 5 py files (12 bytes each ))
Without asyncio: 47s and 44s
With asyncio: 39s and 41s

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.

3 participants