1264 Commits

Author SHA1 Message Date
Kevin Chung
eb8461cf2f Add code to support integration with a Vite build system for JS/CSS (#2051)
* Adds the `Assets` constant to access front end assets from Jinja templates
* Adds a `views.themes_beta` route to avoid the `.dev`/`.min` extension being added automatically to frontend asset urls
* Add `count` meta field to `/api/v1/users/me/solves`, `/api/v1/users/me/fails`, `/api/v1/users/me/awards`, `/api/v1/users/[user_id]/solves`, `/api/v1/users/[user_id]/fails`, `/api/v1/users/[user_id]/awards`

* Works on #2049
2022-04-04 22:59:13 -04:00
Kevin Chung
a2e7a32754 Fix issue where current theme cannot be found in list of themes (#2079)
* Fix issue where current theme cannot be found in list of themes
2022-03-30 12:16:34 -04:00
Kevin Chung
00bb891457 Add code to check for the potential of session ID duplication during ID generation (#2075)
* Add code to check for the potential of session ID duplication during ID generation
2022-03-29 17:17:59 -04:00
Kevin Chung
fc7516c91f Show admins the email server error message when email sending fails (#2073)
* Show admins the email server error message when email sending fails
2022-03-24 14:14:55 -04:00
Kevin Chung
d29102dae8 Add meta and count field to teams endpoints to make it easier to show graphs (#2072)
* Add meta and count field to teams endpoints to make it easier to show graphs
2022-03-21 19:46:11 -04:00
Kevin Chung
f39043427b Fix CSV export columns for team & user fields on scoreboard CSV (#2069)
* Fix issue where custom field entries for Users and Teams would be misaligned in the scoreboard CSV export
2022-03-19 14:34:31 -04:00
Kevin Chung
c0f171f6bc Fix importing backups that contain challenge topics and custom fields (#2070)
* Fix issues with importing backups that contain Challenge Topics and Custom Fields
2022-03-19 11:32:17 -04:00
Kevin Chung
de9f2311eb Add client side vaildation for checking if users upload files that are probably too large (#2067)
* Add client side vaildation for checking if users upload files that are probably too large
* Closes #1972
2022-03-11 04:24:59 -05:00
Kevin Chung
262d896a0e Mark 3.4.3 (#2063)
# 3.4.3 / 2022-03-07

**Security**

- Bump cmarkgfm to 0.8.0 to resolve CVE-2022-24724. Copied entry from 3.4.2 since 3.4.2 introduced a bug that prevented writing raw HTML.

**General**

- Fix issue where raw HTML would not be rendered in markdown
2022-03-07 19:00:52 -05:00
Kevin Chung
7aea1ce347 Mark 3.4.2 (#2062)
# 3.4.2 / 2022-03-07

**Security**

- Bump cmarkgfm to 0.8.0 to resolve CVE-2022-24724

**General**

- Fix issue where unauthed users couldn't download challenge files after CTF end but viewing after CTF was enabled
2022-03-07 15:03:13 -05:00
Allen Guan
a868faffb5 Fix download with auth token fail after ctf (458ce2e) (#2011)
* Fix issue where unauthed users couldn't download challenge files after CTF end but viewing after CTF was enabled
2022-03-06 21:25:46 -05:00
Kevin Chung
de6f8e059b Migrate to self hosted mailing list (#2059)
* Migrate to self hosted mailing list
2022-03-06 01:29:36 -05:00
Kevin Chung
a8a6db1aeb Bump cmarkgfm to 0.8.0 (#2058)
* Bump cmarkgfm to 0.8.0
2022-03-05 20:27:09 -05:00
Kevin Chung
d9813a601f Mark 3.4.1 (#2055)
# 3.4.1 / 2022-02-19

**General**

- Make session cookies persist in the browser after close
- Fix issue where all-numeric registration codes wouldn't work
- Fix issue where a user's session isn't cleared properly after they are deleted by an admin
- Fix issue where CTF end time couldn't be set during setup

**API**

- Improved speed of the `/api/v1/challenges/[challenge_id]/solves` endpoint
- Document API authentication and `Content-Type` header requirement
- Add nested `UserSchema` and `TeamSchema` to `SubmissionSchema` for easier access to account name

**Admin Panel**

- Improve CSV import error reporting and validation
- Fix non-clickable checkbox label in user creation form in Admin Panel
- Allow submissions per minute ratelimit to be configurable in Admin Panel
- Add a link in the Pages Editor to the [Page Variables documentation page](https://docs.ctfd.io/docs/pages/variables/)

**Themes**

- Fix issue where invalid `theme_settings` can cause broken frontend
- Replace `node-sass` with `sass` and upgrade `sass-loader`

**Deployment**

- Serve all assets from CTFd regardless of internet availability (i.e. fonts and font-awesome)
- Fix regression in `REVERSE_PROXY` to allow comma seperated integers
- Bump `flask-restx` to 0.5.1
- Bump `pybluemonday` to 0.0.9
- Added support for S3 signature version 4 authentication to support alternative S3 buckets (Google Cloud Storage, DigitalOcean Spaces, etc)

**Miscellaneous**

- Add a Github Actions job to publish Docker images to Dockerhub and ghcr
2022-02-19 02:36:35 -05:00
Kevin Chung
54f0c46662 Bump pybluemonday to 0.0.9 (#2054)
* Bump pybluemonday to 0.0.9
* Bump python-geoacumen-city
* Use Python 3.7 in testing as Python 3.6 is EOL
2022-02-18 21:47:56 -05:00
Kevin Chung
69cfc77e94 Have fonts and fontawesome be loaded locally (#2050)
* Serve all assets from CTFd regardless of internet availability
* Closes #2048
2022-02-18 18:35:54 -05:00
Kevin Chung
03d65bf542 Have profile notify user to join/create a team (#2053)
* Have profile notify user to join/create a team (Closes #2013)
2022-02-18 18:02:41 -05:00
Kevin Chung
52d41bac61 Fix issue where end time couldn't be set during setup (#2052)
* Fix issue where end time couldn't be set during setup (Closes #2045)
2022-02-18 17:19:20 -05:00
Kevin Chung
27e77368c8 Improve speed of the ChallengeSolves API endpoint (#2046)
* Improve speed of the ChallengeSolves API (`/api/v1/challenges/[challenge_id]/solves`) endpoint
2022-02-09 21:03:44 -05:00
Kevin Chung
f89fcea1e2 Fix boto3 s3 signature (#2041) 2022-01-13 14:27:33 -05:00
Kevin Chung
c1a27176b6 Fix edge case where invalid theme_settings cause broken frontend (#2034)
* Fix edge case where invalid `theme_settings` cause broken frontend
2021-12-08 15:47:00 -05:00
nopresearcher
d79f24b2e5 added support for S3 signature version 4 authentication (#1882)
* added support for S3 signature version 4 authentication
2021-12-02 22:51:52 -05:00
Maxime P
3550aaf4ea Fixing challenge-desc content overflow (#1994)
* 🐛 fixing challenge-desc content overflow

Co-authored-by: Kevin Chung <kchung@ctfd.io>
Co-authored-by: Kevin Chung <kchung@nyu.edu>
2021-11-30 21:38:59 -05:00
Kevin Chung
5599e25fc9 Add nested UserSchema and TeamSchema to SubmissionSchema (#2030)
* Add nested UserSchema and TeamSchema to SubmissionSchema to allow easier access to a user/team name without issuing another query/API call
* Closes #2005
2021-11-22 23:28:58 -05:00
Kevin Chung
8e96344817 Fix issue with clearing user's session after deletion (#2029)
* Fix an issue where a user's session isn't cleared properly after they are deleted by an admin
* Closes #1996
2021-11-22 22:36:35 -05:00
Kevin Chung
3cbe463dae Change Github Action to run on release (#2028)
* Change Docker image release script to run on release
2021-11-22 21:11:00 -05:00
Kevin Chung
a9aa0cab61 Add a Github Actions job to publish Docker images to Dockerhub and ghcr (#2027)
* Add a Github Actions job to publish Docker images to Dockerhub and ghcr
* Closes #1982
2021-11-22 19:27:26 -05:00
Kevin Chung
cf743a2778 Add a link to page variables documentation (#2026)
* Adds a link in the Pages Editor to the Page Variables documentation page at https://docs.ctfd.io/docs/pages/variables/
* Closes #1983
2021-11-22 19:03:28 -05:00
Kevin Chung
4aa258e290 Fix sass dependencies to fix js build (#2025)
* Replace `node-sass` with `sass` and upgrade `sass-loader`
* Closes #2023
2021-11-22 18:26:49 -05:00
Kevin Chung
afb1a54e9b Add a way to configure challenge attempt ratelimiting (#2024)
* Allow submissions per minute ratelimit to be configurable
* Closes #2014
2021-11-22 17:16:21 -05:00
Nikita Stupin
a0783c334c Document API authentication (#2021)
* Document API authentication and Content-Type header requirement
2021-11-22 05:38:19 -05:00
dependabot[bot]
7fc05bd4e3 Bump pybluemonday from 0.0.7 to 0.0.8 (#2009)
Bumps [pybluemonday](https://github.com/ColdHeat/pybluemonday) from 0.0.7 to 0.0.8.
- [Release notes](https://github.com/ColdHeat/pybluemonday/releases)
- [Changelog](https://github.com/ColdHeat/pybluemonday/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ColdHeat/pybluemonday/compare/0.0.7...0.0.8)

---
updated-dependencies:
- dependency-name: pybluemonday
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
2021-10-23 03:25:00 -04:00
cpeter
c9ae55a219 Fixed documentation links in README.md (#2010)
Co-authored-by: Csaba Peter <cpeter@atlassian.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
2021-10-23 03:06:28 -04:00
Kevin Chung
d2755faba0 Attempt to fix builds (#2012)
* Update pipdeptree version to 2.2.0
2021-10-23 00:30:37 -04:00
tom
78b324e577 fix regression in REVERSE_PROXY to allow comma seperated integers (#1999)
Co-authored-by: Kevin Chung <kchung@ctfd.io>

* Fix issue with REVERSE_PROXY comma separated string configuration
* Closes #1993
2021-10-11 15:33:08 -04:00
Connor Tumbleson
3e6f635b7b #2003 - All numeric registration codes (#2004)
* fix: cast registration_code to string during register

* test: add test to confirm numeric registration codes
2021-10-11 00:33:06 -04:00
dependabot[bot]
514ab2c8bd Bump path-parse from 1.0.6 to 1.0.7 (#1977)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
2021-09-22 02:42:55 -04:00
dependabot[bot]
6666248b2a Bump flask-restx from 0.2.0 to 0.5.1 (#1984)
Bumps [flask-restx](https://github.com/python-restx/flask-restx) from 0.2.0 to 0.5.1.
- [Release notes](https://github.com/python-restx/flask-restx/releases)
- [Changelog](https://github.com/python-restx/flask-restx/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/python-restx/flask-restx/compare/0.2.0...0.5.1)

---
updated-dependencies:
- dependency-name: flask-restx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
2021-09-22 02:06:11 -04:00
Nick Frost
7d39539883 Make login sessions permanent (#1991)
* Closes #1990 
* Make session cookies persist in the browser after close
2021-09-22 01:20:28 -04:00
SpeedX
d03692d002 Fix non-clickable checkbox label in user creation form in Admin side (#1986)
Co-authored-by: SpeedX <>
2021-09-13 03:54:21 -04:00
Kevin Chung
2d2674acee Improve validation and error reporting during CSV import (#1979)
* Improve validation during CSV import process by using existing Marshmallow Schemas
* Return CSV import errors from import functions to render out to the user
* Ignore invalid fields that we can't use in Challenge CSV import
2021-08-17 15:18:51 -04:00
Kevin Chung
7d56e59e1a Mark v3.4.0 (#1976)
# 3.4.0 / 2021-08-11

**General**

- Added the ability to have Challenge Topics
  - Challenge Topics are small topic strings which are only visible to Admins
  - They should denote what topics a given challenge involves
- Added `connection_info` to Challenges to allow Admins to more easily specify the connection info for a challenge
- Added ability to import CSVs of users, teams, and challenges
- Added ability to limit the total number of teams
- Pages now have access to variables `ctf_name`, `ctf_description`, `ctf_start`, `ctf_end`, `ctf_freeze`. (e.g. `{{ ctf_name }}`)
- IP Addresses in the Admin Panel will now show the city of the IP address as well as the country
- Make User Mode it's own dedicated tab in the setup flow and more clearly explain what each user mode does
- Added the ability to have a registration password
  - Does not currently apply to SSO/auth provider or API based account creation
- Prevent users from participating with challenges if their profile is not complete (i.e. haven't filled out all required custom fields)
- Fixed an issue where admins couldn't see some challenges in the add requirements interface
- Fixed an issue where a challenge couldn't be accessed beacuse it had prerequisites on a deleted challenge
- Fixed an issue where User profiles could not be loaded in the Admin Panel due to missing/invalid Tracking IP addresses
- Fixed an issue where users with authentication provider accoutns would get an error when attempting to login
- Fixed an issue where MajorLeagueCyber config from config.ini was not being respected

**API**

- Added `connection_info` field to `/api/v1/challenges/[challenge_id]`
- Added `/api/v1/topics` for admins to create/delete topics
- Added `/api/v1/challenges/[challenge_id]/topics` for admins to list the topics on a challenge
- `/api/v1/challenges` will now sort by ID as value to better standardize API output with different databases
- `/api/v1/configs` will now provide an error message when provided Config values are too long
- `PATCH /api/v1/teams/[team_id]` will now only let team members be team captain
  - No security issues here, it would just be invalid data.

**Themes**

- CTFd now has the `THEME_FALLBACK` option enabled by default. This allows users to provide incomplete themes. Missing theme files will be provided from the built-in core theme
- CTFd will now pass the title of a Page over to the template when rendering
- No longer show the token type in user settings
- Added `window.BETA_sortChallenges` to `/challenges` so that theme code can more easily define how to sort challenges
  - Note that this functionality is beta because we expect to revamp the entire themes system
- Added `window.updateChallengeBoard` to `/challenges` so that theme code can more easily define when to update challenges
  - Note that this functionality is beta because we expect to revamp the entire themes system
- Added `window.updateScoreboard` to `/scoreboard` so that theme code can more easily define when to update the scoreboard
  - Note that this functionality is beta because we expect to revamp the entire themes system

**Plugins**

- Added `Challenges.plugin_class` to the Challenges model to access the challenge type plugin class from the Model
  - Allows templates to access the plugin class more easily
  - Allows plugins to access the plugin class without having to load the class explicitly

**Admin Panel**

- Reworked the Challenge Requirements UI
  - Officially support the concept of anonymized challenges if prerequisites aren't met
- Added ability for Pages to be written in direct HTML instead of Markdown
- Pages now have access to variables `ctf_name`, `ctf_description`, `ctf_start`, `ctf_end`, `ctf_freeze`
  - `ctf_start`, `ctf_end`, `ctf_freeze` are represented as ISO8601 timestamps
- Make it easier to change the user mode without having to delete all accounts. Instead we will only delete all submissions.
- When in team mode, user pages will now show their team's score instead of their own personal score
- Show a team member's individual score on their team's page
- Made the challenge creation form wider

**Deployment**

- The `THEME_FALLBACK` config is now set to true by default
- Replace installation and usage of `mysqladmin` (specifically `mysqladmin ping`) with a custom Python script
- Bump version of `pybluemonday` to 0.0.7 (fixes HTML sanitization bypasses and allows comments in HTML)
- Bump `pydantic` from 1.5.1 to 1.6.2

**Miscellaneous**

- Make `.dockerignore` ignore `node_modules` in any subdirectory
- Added `solves` and `solved_by_me` fields to the Swagger documentation for Challenges
- Dynamic challenges will now take their initial valuation from the `inital` keyword instead of the previous `value` keyword.
  - This allows ctfcli to manage dynamic challenges. See https://github.com/CTFd/CTFd/issues/1875
- Added a timestamp to a CTFd export's filename
- Deleting uploads under the Filesystem upload provider will now delete the parent folder as well as the target file
2021-08-11 12:57:56 -04:00
Kevin Chung
c903fc4fe1 Add guidance for CSV imports (#1975) 2021-08-10 17:50:21 -04:00
Jordan Bertasso
406c8c076c Fix typo under Admin Config > Accounts > Team Disbanding (#1973)
Changed `capatins` to `captains`
2021-08-08 01:03:48 -04:00
Kevin Chung
94c4441aae Set THEME_FALLBACK to default to true (#1971)
* CTFd now has the `THEME_FALLBACK` option enabled by default. This allows users to provide incomplete themes. Missing theme files will be provided from the built-in core theme
* Closes #1967
2021-08-05 01:04:05 -04:00
Kevin Chung
e4e511fa6f Simplify view.html in provided challenge types to support core-beta (#1969)
* Simplify view.html in the provided challenge plugins to better support the eventual core-beta theme
2021-08-03 12:06:59 -04:00
Kevin Chung
630fbe4dab Add 3.4.0 CHANGELOG as unreleased (#1970) 2021-08-02 15:08:50 -04:00
Kevin Chung
c77a1c2d1f Add connection_info to Challenges model (#1965)
* Closes #1964 
* Adds connection_info to Challenges
2021-07-30 13:13:16 -04:00
Kevin Chung
27d862ab29 Challenge Topics (#1966)
* Closes #1897 
* Adds Topics to Challenges where Topics are admin-only visible tags about challenges
* Adds `/api/v1/topics` and `/api/v1/challenges/[challenge_id]/topics` to API 
* Challenge comments have been moved into a modal
2021-07-30 00:03:16 -04:00
Kevin Chung
22a0c0b007 Add a decorator for redirecting users if their profile isn't complete (#1933)
* Redirect users and teams whose profiles are incomplete to complete their profile
* Closes #1926
2021-07-29 02:11:54 -04:00