Commit Graph

650 Commits (b8d0f80d0124ce74dec704eb3be8fed6db821357)

Author SHA1 Message Date
Kevin Chung a3bc7b3917
1.2.0 -> 2.0.0 migration script (#745)
* Upgrade 1.2.0 migration script to properly import plugin tables
2018-11-22 15:24:34 -05:00
Kevin Chung 4fde0368db
2.0.0 Supplementary Changes (#744)
* Clean up models a little
* Add 1.2.0 migration script
* Add 2.0.0 CHANGELOG
* Fix S3 uploader
* Update config.py to grab S3 settings from envvars
2018-11-22 11:05:47 -05:00
Kevin Chung c8031b38c2
2.0.0 (#741)
* Fix user and admin panel user/team graphs
* Closes #682
* Unify login and logout under specific functions
* Closes #659
* Rename Challenges.hidden to Challenges.state
* Start to clean up API and front end integration starting with profile updating
* Slightly cleaner code
* Clean API to respond with success, data, and status codes
* Simpler COUNTRIES_LIST and update profile to use COUNTRIES_LIST
* Lookup country code in users page. Update front end calls to get API data properly
* Fix some API endpoints and fix JS to process new responses
* Update config.py to support new values
* Closes #635
* Update some code to handle user types, add email domain whitelisting
* Write a logging wrapper
* Use logging wrapper for submissions
* Close #656
* Break up config.html to make it easier to maintain
* Fix logging, domain_whitelist, and config
* Improving views.py, starting to add Announcements
* Starting announcements front end
* Make it easier to see large images, clean up some more REST API differences
* Closes #668
* Update Proxyfix config to REVERSE_PROXY
* Add announcements front end
* Move creation/edit modals into seperate files. Start moving user updating into their admin profile pages.
* Update font-awesome to 5.4.1
* Switch to user-edit icon
* Update the update_check function to send up more anonymous data for statistics purposes.
* Start work on #640
* Add the user action modals and update API to fix responses
* Fix admin teams page
* Add challenge requirements
* Implement anonymous locked challenges
* Team editting from admin panel
* Switch from simple cache to filesystem cache
* Implements a Cache backed server side session (#658) and fixes Users editting endpoint
* Add our messaging for docs
* Closes #700
* Remove invalid import
* Move challenge enditting around a whole lot and probably break a bunch of things
* Show challenge names in prerequisites instead of challenge IDs
* Closes #661
* Change user templates to use url_for
* Remove extra function
* Rewrite admin panel to use url_for
* Fix events to work under subdirectories
* Start cleaning up config panel
* Fix filesystem uploader; deprecate view_challenges_unregistered, view_scoreboard_if_authed, prevent_registration, view_after_ctf; implement new visibility decorators
* Remove workshop mode, fix some glitches with the new visibility settings
* Fix ctf_logo on core theme
* Fix setup errors
* Removing default from get_config b/c of memoization issues and getting some tests working
* Relax email regex validation rule (#693)
* Update to pycodestyle and fix new lint errors
* Add a ctf_id to update_check
* Change challenge plugin layout. Rename mailgun configs to be more descriptive (Closes #702)
* Detect if people try to set routes with '/' to simplify #690
* Closes #690
* Clean up some code
* Clean up challenge submit to rate limit
* Fix js version compatability issue
* Close some TODOs
* Hide challenges if not authenticated
* Make set_config reset the cache for those config values
* Return 404 on empty challenges for /api/v1/<challenge_id>/solves
* Fix setting boolean configs
* Properly change account config settings
* Move datetimes to isoformat (Closes #703)
* Remove all .isoformat() calls because it isn't UTC aware (ends in Z). Switch to isoformat function & filter
* Make /v1/submissions endpoint work for admin submission creation
* Make oauth_id unique for Users and Teams
* Move challenge submission endpoint and implement mark solved. Fix some isoformat issues.
* Only show team's missing challenges if in team mode
* Adding support for Hints & Unlocks
* Update challenge submission url
* Fix encoding functions in Python3
* Fix hexencode in Python3
* Added functional tests for challenges API for non-admin users (#705)
* Set hint default type to be standard
* Fix some JS issues. Closes #704
* Implement session.regenerate on top of the CachingSessionInterface
* Challenge challenge attempt responses from numbers to strings
* Fix password updating for UserSchema
* Remove leftover challenge submission code
* Remove old migrations :(, resolve challenge requirements not loading correctly, move migration functions
*  Added functional tests for challenges/hints/admin API (#710)
* Fix helpers and re-add JSONLite
* Install MySQL 5.7
* Try more mysql
* Update password for mysql
* Fixing issuse in Users.get_solves
* Add new import/export code
* Switch to CTFdSerializer for Python 3
* Re-implement import exports and add a very flaky test
* Redesign submissions API response
* Get export to roundtrip in tests
* Int score b/c Decimal is not JSON serializeable
* Remove unused route methods
* Fix POST /api/v1/configs and start adding admin tests
* Add user_id and team_id to top/10
* Fix admin creating Teams
* Fix Team website validation
* Change admins_only to reply with a 403 if the request is JSON
* Organize admin tests and fix authed_only to return 403 on unauthed
* Adding check_account_visibility, check_score_visibility for /api/v1/teams/<team_id>/(solves|awards|fails)
* Fix teams/me endpoints again
* Fix users/me endpoints to return 403 if unauthed
* Fix Python 3 config API
* Add fetch and promise polyfills. (#712)
* Add exec to docker-entrypoint.sh (#713)
* Display import_ctf Exceptions via repr (#651)
- Wraps exceptions on `/admin/import` returned to users in a `repr()`, making debugging easier.
* Add error messages to the admin panel, fix schemas for users, start working on UI for imports/exports
* Make unauthed challenge submission attempt return 403 instead of 302, Fix user deletion, fix associated tests, remove TODOs
* Remove old means of creating solves
* Remove most of the content from teams.js and users.js
* Remove extra code from /challenges.js
* Fix POST'ing & PATCH'ing pages
* Make (users|teams)/fails return only count to users. Fix public score graphs to factor in awards
* Fix admin side scoregraphs. Fix Awardschemas for admins
* Add requirements to db migration
* Adding some team decorators
* Fix require_team_mode decorator
* Make verified emails decorator return 403 on JSON requests
* Redo initial revision
* Add SQLiteJSON back
* Adding ratelimit to /redirect and removing POST from /oauth
* Fix PATCH tags
* Actually fix PATCH tags
* Simplify 500.html
* Added tests for challenges, awards, files, flags, hints ... (#723)
* Added tests for challenges, awards, files, flags, hints, notifications, pages, submissions, tags
* Fix user data validation functions, Fix hidden challenges and include test
* Add a locked state to attempt
* OAuth teams get verified, use logging functions in redirect route
* Removing extra print call
* Update requirements.txt
* Fix possible AttributeError
* Start work on #716
* Closes #717
* Fix issue patching teams
* Rename .j2 to .html, implement preview for challenges if admin
* Move admin/challenge.html to admin/challenges/challenge.html
* Remove old modals
* Add Reset CTF button (#639)
* Add Reset link to config.html
* Delete Tracking
* files handler should return a 404 on files it cant find
* Denote official teams (#729), make scoregraph fill to zero
* Remove old javascript files, make some challenge elements refresh by reloading
* Fix team editting modals to work more reliably
* Fix rendering of CTF paused
* Remove hide_scores funtion and roll it into scores visibility
* Log to stdout/stderr by default (#719)
* Fix user searching
* Remove searching for users/teams by country
* Add badges to admin team and user pages, implement user banning (#643)
* Remove shell.py, clean up admin team.html, add tests for banned users, teams
* Start cleaning up dynamic_challenges to meet new challenge type plugin format
* Remove POST method from teams.public
* Add credentials: 'same-origin' to all fetch calls (#734)
* Add challenge preview, add challenge deletion, fix file deletions when deleting challenges
* Fix imports UI (#735)
* Show prerequisites before adding a blank one (#738), Refresh all challenges after a submission (#739)
* Admins can see hidden challenges
* Fix some UI elements, fix loading location hash, set version to be 2.0.0
* Clean up some challenge plugin pages
* Add default for flag type
* Fix Python3 bytes/str issues
* Add in MLC urls and support user mode for oauth
* Fix seeing user graphs when scores are hidden, clean up setup.html, add links to MLC oauth
* Add state parameter support
* Use URLSafeTimedSerializer wrapper for sending token based emails
* setting APPLICATION_ROOT from env var (#732)
* Rearrange config.py and update README
* Updating README
2018-11-19 23:16:14 -05:00
Benno Evers 41933cc367 Fix access to unreleased challenges through /chals/<id> endpoint (#689) 2018-10-06 04:29:30 -04:00
Kevin Chung 14ea952a2a
Update LICENSE 2018-07-29 03:16:54 -04:00
Cliffe 3676d4dbd5 Vagrant uses mariadb database rather than sqlite - Fixes #648 (#649) 2018-07-29 00:08:05 -07:00
Kevin Chung 36dadcf1d5
Initialize database in docker-entrypoint.sh to reduce likelihood of missing tables (#642) 2018-06-17 21:51:34 -04:00
Kevin Chung 38416ce5c6
Fix load_location_hash when there are spaces in the challenge name (#634) 2018-05-20 00:25:17 -04:00
Kevin Chung 4d6bf811ed
Fix banned users not being able to see their own solves (#633)
* Fix banned users not being able to see their own solves
2018-05-19 19:18:35 -04:00
Kevin Chung 9cedf456b5
Marking 1.2.0 (#628)
* Mark 1.2.0.
* Update CHANGELOG.
* Add `window.challenge.data` object. 
* Don't raise a 500 when an endpoint can't be found but was POST'ed too. Mostly from scanners...
    * Add test for not found endpoints.
* Fixing issue with clearing logo on config update.
* Truncate scoreboard team name to 50 characters.
2018-05-04 17:24:02 -04:00
Kevin Chung 36c83b59bc
1.2.0 (#627)
* Changing to a new plugin oriented challenge type plugin and fixing extra width on admin chal description

* Add window.challenge.submit, renderSubmissionResponse, and csrf_nonce

* Update admin side renderer calls

* Updating to Flask 1.0 and adding files for flask run

* Adding a preliminary case-insensitive key

* Adding case insensitive keys

* Adding CTF Logo

* Reducing the amount of team information shown on the main page

* Add better base64 helpers

* Switch from button to badge

* Rudimentary solve checking from admin panel

* Refine admin chals solves view & fix PEP8

* Compare base64 encoded data with bytestring

* Removing need to urlencode/urldecode in base64 wrappers

* Adding decorator documentation

* Randomly order tests & add test for case_insensitive flags

* Add regex flag case_insensitive test

* Add tests for /admin/chal/1/solves and ctf_logo
2018-05-03 18:04:39 -04:00
Kevin Chung 9c812ad52e
Truncating team names properly when scores arent hidden (#617) 2018-04-16 00:54:53 -04:00
Kevin Chung 51d098080f
Merge Dev into Master (#591)
* Chals endpoint seperation (#572)

* Separate the logic of ctftime and email confirmations and admin checking into decorators
* Separate the chals endpoint into /chals and /chals/:id. Closes #552, #435.
* Challenges are now loaded directly from the server before being displayed to the user. 
* Challenge modals now use `{{ description }}` instead of `{{ desc }}`.
* 403 is now a more common status code and can indicate that a CTF has not begun or that you are not logged in. This is in addition to CSRF failures. 
* Update tests to new behavior

* Fixing glitch if an entry chal or team id isn't defined

* Markdown it (#574)

* Replace Marked with Markdown-It

* Update modal change (#576)

* Switch update modals to use nunjucks instead of JS to load in data. 
* Fix previewing challenges after hitting the challenge update button.
* Fix edit-files issue with an unnecessary request.

* Fix solves button

* Closes #592
2018-04-16 00:24:04 -04:00
Kevin Chung d17e599193
Closes #613 (#614) 2018-04-15 17:01:48 -04:00
Kevin Chung 5cc89e47bb Fix argv mistake 2018-04-15 16:18:16 -04:00
Olivier Bilodeau f4d89e25ab import.py: Proper check for second argument (#612) 2018-04-15 16:05:45 -04:00
Kevin Chung 8c4f915cb4
Fix imports issue (#611)
* Add fix for zip issue
* Properly restrict by MAX_CONTENT_LENGTH
2018-04-14 13:46:35 -04:00
Kevin Chung 995cf6a920
Add ezpg and jquery PATCH wrapper (#609) 2018-04-13 14:52:18 -04:00
Kevin Chung 96a3d2c9bd
Marking 1.1.4 (#605)
* Marking 1.1.4
2018-04-05 14:24:27 -04:00
Kevin Chung 25fb6d3df5
Remove svg based fontawesome in favor of webfont based fontawesome (#604) 2018-04-05 13:33:59 -04:00
Kevin Chung f8674f40ec
Fix deleting chals when they have a hint (#601) 2018-04-02 11:06:11 -04:00
Kevin Chung 0efda80006
Marking 1.1.3 (#599)
* Version 1.1.3
2018-03-27 12:20:58 -04:00
Kevin Chung b78589d20d
Update docker files (#598)
* Add redis to docker-compose, bump worker count to 4
* Add workers & missing SECRET_KEY error
* Remove uwsgi specific files
* Parse database host in `docker-entrypoint.sh`. Closes #587
2018-03-25 04:25:33 -04:00
Kevin Chung aedd753f4e
Bypass csrf plugins (#597)
* Add bypass_csrf_protection decorator
* Add beta notice
* Add test_bypass_csrf_protection
2018-03-24 22:54:12 -04:00
Kevin Chung c0e418d900
Remove static_html template code (#596) 2018-03-21 18:50:59 -04:00
Kevin Chung 0022b6978a
Force update checks on startup (#595) 2018-03-21 18:03:01 -04:00
Kevin Chung 352e2503a6
Reset flag modal when the modal is loaded (#594) 2018-03-21 17:35:50 -04:00
Kevin Chung 6a9f217cd5
Closes #592 (#593) 2018-03-21 17:05:01 -04:00
Nick Gonella 6eebd5d220 Don't display team rank in workshop mode (#590)
* Don't display team rank in workshop mode
2018-03-20 00:48:14 -04:00
balthasar-m 935e214a09 Prevent scrollbar showing on pages that are smaller than the screen size (#589)
* added one pixel distance from footer to bottom to prevent scrollbar showing
2018-03-20 00:22:52 -04:00
Kevin Chung 4dd828a3f2 Update scoreboard image (Closes #573) 2018-02-24 15:38:25 -05:00
krzys_h 62f6e6ff84 Fix scoreboard tie resolving with 0-point chals (#577) (#578)
* Fix scoreboard tie resolving with 0-point chals
* Closes #577
2018-02-19 20:26:06 -05:00
Victor "Nate" Graf 54d12460d5 Improve the flexibility and ease-of-use for docker-compose deployment (#560)
* docker-compose improvements
    * Use gevent gunicorn workers
    * Makes logs easier to access
* Customization of the logs location
* Improve secret key generation & only generate secret keys if one isn't defined (Closes #123)
* Install requirements required by plugins
2018-02-11 03:52:21 -05:00
Kevin Chung 0aefdcc162
Update requirements.txt and fix docker-compose mariadb issue (#566)
* Update dependencies in requirements.txt 
* Fix issue where mariadb would remove gunicorn database connections in docker-compose
2018-02-09 01:56:35 -05:00
Kevin Chung 643378bee9
Marking 1.1.2 (#559)
**General**

* Fixed page links on subdirectory deployments
* Fixed challenge updating on subdirectory deployments
* Fixed broken icon buttons on Safari

**Themes**

* Upgraded to Bootstrap 4.0.0
* Upgraded to jQuery 3.3.1
* Upgraded to FontAwesome 5.0.4
2018-01-23 10:19:17 -05:00
Kevin Chung 98fbad40a2
Bootstrap v4 (#558)
* Updating to Bootstrap v4
* Update jQuery to 3.3.1
* Update FontAwesome to 5.0.4 and fix icon click handlers in Safari
* Closes #555, #556
2018-01-22 06:11:52 -05:00
Kevin Chung accb561e27
Fixing issue with linking to pages in subdirectory deployments (#550) 2018-01-10 20:43:26 -05:00
Kevin Chung 01c334056b
Fix challenge updating on subdirectory deployments (#546) 2018-01-09 22:25:07 -05:00
Kevin Chung 2e2d458f36
Mark 1.1.1 (#544)
* Marking 1.1.1
2018-01-08 01:56:06 -05:00
Kevin Chung fe4ea56e92
Bootstrap beta 3, Regression fixes, bugfixes (#543)
* Upgrade to Bootstrap v4 beta 3

* Fix incorrect FontAwesome5 icon

* Fixing regressions & code quality issues. Files, Tags & Hints now appear in the admin challenge preview. Fixed color issues with file buttons and badges. Pass script_root into challenge type plugin.

* Fixing incorrect FontAwesome5 icon

* Fix test for /admin/chals/<chalid>

* Expand test to include tags, hints, files
2018-01-07 20:50:01 -05:00
Kevin Chung d25a5d529f Fix issue with making admins & verification 2018-01-06 00:24:59 -05:00
Kevin Chung 6153cc30b4 Replace load_location_hash with a callback 2018-01-04 22:50:14 -05:00
Kevin Chung 282acb4e63 Center frozen text in team page 2018-01-02 05:54:46 -05:00
Kevin Chung a87f4f962e
Fix publishing after a user saves the document by populating the ID that the page received (#540) 2017-12-30 02:44:43 -05:00
Kevin Chung d861b70603 Fixing page previews 2017-12-28 04:09:42 -05:00
Kevin Chung 20a7d6a769
Remove unnecessary data from standard-challenge-update.js (#539) 2017-12-24 17:01:47 -05:00
Kevin Chung fa9cb2498b
Guarantee ctf version (#538)
* Make sure ctf_version is set correctly
2017-12-22 16:22:31 -05:00
Kevin Chung 7e5e18fd6e
Only prompt for upgrades if there's a TTY & mark 1.1.0 (#537) 2017-12-22 13:10:40 -05:00
Kevin Chung f11b5985d3 Choose segments with import.py 2017-12-21 23:34:27 -05:00
Kevin Chung 6381a86d64 Update hint button width to fill the container 2017-12-21 23:05:18 -05:00