Commit Graph

1130 Commits

Author SHA1 Message Date
Ife Lawal
c31916057f Confirmed REST API does delete directories in s3 bucket. The local filesystem didn't though and that was updated. Closes #1758 (#1876)
- Deleting uploads under the Filesystem upload provider will now delete the parent folder as well as the target file
- Closes #1758
2021-06-06 23:21:38 -04:00
Kevin Chung
1195454258 Handle edge case where users have a null password (#1902)
* Handle an edge case where users try to login but were logged in through an authentication provider
2021-06-01 12:46:54 -04:00
Kevin Chung
20460c861d Widen the challenge creation form to make it easier to show longer challenge types (#1901) 2021-06-01 08:58:23 -04:00
Kevin Chung
bdc58ef911 Beta challenge sorting interface (#1900)
* Add a beta way to sort challenges in the core theme through `window.BETA_sortChallenges()`
2021-05-30 17:47:25 -04:00
Mike Merrill
8646f2384c Update geoip.py (#1896)
Added error handling in case `IP_ADDR_LOOKUP.get(addr)` fails.
2021-05-28 11:03:56 -04:00
Ife Lawal
f00e69d619 Ctftime test context #928 (#1866)
Works on #928
2021-04-26 14:31:19 -04:00
Ife Lawal
03e546e9f0 Pydantic documentation Fixes #1829 (#1871)
- Improved the `sqlalchemy_to_pydantic` function to accept additional schema fields on top of the SQLAlchemy model fields
- Added the solves and solved_by_me fields to the Swagger documentation (Closes #1829)
2021-04-26 14:00:04 -04:00
Kevin Chung
21af356642 Bump pybluemonday version (#1869)
* Bump version of pybluemonday
2021-04-20 12:54:31 -04:00
Frank
345706d762 ping database with python instead of mysql client (#1862)
* Replaces `mysqladmin ping` with a custom script
* Closes #725
2021-04-17 21:29:15 -04:00
Frank
5976830957 use different directories for different tests (#1864) 2021-04-12 17:33:46 -04:00
Kevin Chung
87711d7241 Put up a fix for challenges whose requirements were deleted (#1861)
* Works on #1860 
* Don't consider deleted challenges when evaluating challenge prereqs
2021-04-06 16:17:18 -04:00
Kevin Chung
26dbbbeacc Ignore node_modules in any subdirectory for Docker (#1857)
- Make `node_modules` in `.dockerignore` recursive to not add any `node_modules` folders into the build context
2021-04-01 15:46:11 -04:00
Ben Woo
3edb4c343b Fix wrong date for v3.3.0 changelog. (#1856)
It's 2021 now, time flies haha
2021-04-01 15:25:55 -04:00
Kevin Chung
d23f59dbd5 Fix issue where admins couldn't see some challenges in the add requirements interface (#1853)
- Fix an issue where admins couldn't see challenges which had requirements in the add requirements interface
2021-03-27 19:59:10 -04:00
Kevin Chung
a33a31b1f8 Update CHANGELOG and add release date (#1852)
# 3.3.0 / 2020-03-26

**General**

- Don't require a team for viewing challenges if Challenge visibility is set to public
- Add a `THEME_FALLBACK` config to help develop themes. See **Themes** section for details.

**API**

- Implement a faster `/api/v1/scoreboard` endpoint in Teams Mode
- Add the `solves` item to both `/api/v1/challenges` and `/api/v1/challenges/[challenge_id]` to more easily determine how many solves a challenge has
- Add the `solved_by_me` item to both `/api/v1/challenges` and `/api/v1/challenges/[challenge_id]` to more easily determine if the current account has solved the challenge
- Prevent admins from deleting themselves through `DELETE /api/v1/users/[user_id]`
- Add length checking to some sensitive fields in the Pages and Challenges schemas
- Fix issue where `PATCH /api/v1/users[user_id]` returned a list instead of a dict
- Fix exception that occured on demoting admins through `PATCH /api/v1/users[user_id]`
- Add `team_id` to `GET /api/v1/users` to determine if a user is already in a team
- Provide a more useful error message when using an expired token

**Themes**

- Add a `THEME_FALLBACK` config to help develop themes.
  - `THEME_FALLBACK` will configure CTFd to try to find missing theme files in the default built-in `core` theme.
  - This makes it easier to develop themes or use incomplete themes.
- Allow for one theme to reference and inherit from another theme through approaches like `{% extends "core/page.html" %}`
- Allow for the automatic date rendering format to be overridden by specifying a `data-time-format` attribute.
- Add styling for the `<blockquote>` element.
- Change `users/private.html`, `users/public.html` to show awards before a user gets a solve
- Change `teams/private.html`, `teams/public.html` to show awards before a team gets a solve
- Change `colorHash` function to use HSL color values to avoid generating too light/dark colors
- Fix an issue where hidden users couldn't see their graphing data on their private user page (`/user`)
- Fix scoreboard table identifier to switch between User/Team depending on configured user mode
- Switch the challenges page in core to use the new API information in `/api/v1/challenges` to mark solves and display solve counts
- Switch to using Bootstrap's scss in `core/main.scss` to allow using Bootstrap variables
- Consolidate Jinja error handlers into a single function and better handle issues where error templates can't be found

**Plugins**

- Set plugin migration version after successful migrations
- Fix issue where Page URLs injected into the navbar were relative instead of absolute

**Admin Panel**

- Add User standings as well as Teams standings to the admin scoreboard when in Teams Mode
- Add a UI for adding members to a team from the team's admin page
- Add ability for admins to disable public team creation
- Link directly to users who submitted something in the submissions page if the CTF is in Teams Mode
- Fix Challenge Requirements interface in Admin Panel to not allow empty/null requirements to be added
- Fixed an issue where config times (start, end, freeze times) could not be removed
- Fix an exception that occurred when demoting an Admin user
- Adds a temporary hack for re-enabling Javascript snippets in Flag editor templates. (See #1779)

**Deployment**

- Fix boolean configs from the `config.ini` optional section
- Install `python3-dev` instead of `python-dev` in apt
- Require `pybluemonday` as pip dependency
- Remove `lxml` and `html5lib` from pip dependencies
- Bump `Jinja2` to 2.11.3
- Bump `pip-tools` to 5.4.0

**Miscellaneous**

- Rewrite the HTML santiziation feature (controlled by `HTML_SANITIZATION`) to use the `pybluemonday` library instead of `lxml`/`html5lib`
  - Note that this feature is still in beta
- Cache Docker builds more by copying and installing Python dependencies before copying CTFd
- Change the default emails slightly and rework confirmation email page to make some recommendations clearer
- Use `examplectf.com` as testing/development domain instead of `ctfd.io`
- Fix issue where user's name and email would not appear in logs properly
- Add more linting by also linting with `flake8-comprehensions` and `flake8-bugbear`
- Add `.pyc` files and `__pycache__` to `.dockerignore`
2021-03-27 02:08:20 -04:00
Kevin Chung
88c53f3510 Make expired token error message more useful (#1851)
* Make expired token error message more useful
2021-03-25 11:59:59 -04:00
Kevin Chung
ca2ab13f0d Add files and to (#1850)
- Add `.pyc` files and `__pycache__` to `.dockerignore`
2021-03-25 04:01:28 -04:00
Kevin Chung
c63c93b30a Fix user profiles not showing awards before an account gets a solve (#1848)
- Change users/private.html, users/public.html to show awards before a user gets a solve
- Change teams/private.html, teams/public.html to show awards before a team gets a solve
2021-03-24 21:14:11 -04:00
dependabot[bot]
cd9ff1ec32 Bump jinja2 from 2.11.2 to 2.11.3 (#1838)
* Bump jinja2 from 2.11.2 to 2.11.3

Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

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

* Run pip-compile our way

* Add newline

* Update CHANGELOG

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Chung <kchung@nyu.edu>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
2021-03-24 15:42:28 -04:00
Kevin Chung
7fa9f2f56e fix: Ensure hidden users see their own solves (#1840) (#1846)
* Closes #1839

Co-authored-by: maybe-sybr <58414429+maybe-sybr@users.noreply.github.com>
2021-03-24 13:24:28 -04:00
Kevin Chung
d0c92073c3 Fix for hidden users seeing their graphing data (#1845)
* Fix an issue where hidden users couldn't see their graphing data on their private user page (i.e. `/user`)
2021-03-23 00:38:55 -04:00
Kevin Chung
0fdb038c6c Use new properties in /api/v1/challenges (#1844)
- Switch the challenges page in core to use the new API information in `/api/v1/challenges` to mark solves and display solve counts
- Closes #1811
2021-03-22 20:32:37 -04:00
Kevin Chung
b07ba13a12 Change colorHash function to use HSL values (#1843)
* Change `colorHash` function to use HSL values to avoid too dark/light colors
* Closes #1842
2021-03-22 19:51:18 -04:00
Kevin Chung
a045114251 Use pybluemonday instead of lxml for html sanitization (#1837)
* Use `pybluemonday` instead of `lxml` for html sanitization
* Fix boolean optional configs in `config.py`
* Closes #1835
2021-03-19 01:29:49 -04:00
Kevin Chung
8de9819bd4 3.3.0 (#1833)
# 3.3.0 / UNRELEASED

**General**

- Don't require a team for viewing challenges if Challenge visibility is set to public
- Add a `THEME_FALLBACK` config to help develop themes. See **Themes** section for details.

**API**

- Implement a faster `/api/v1/scoreboard` endpoint in Teams Mode
- Add the `solves` item to both `/api/v1/challenges` and `/api/v1/challenges/[challenge_id]` to more easily determine how many solves a challenge has
- Add the `solved_by_me` item to both `/api/v1/challenges` and `/api/v1/challenges/[challenge_id]` to more easily determine if the current account has solved the challenge
- Prevent admins from deleting themselves through `DELETE /api/v1/users/[user_id]`
- Add length checking to some sensitive fields in the Pages and Challenges schemas
- Fix issue where `PATCH /api/v1/users[user_id]` returned a list instead of a dict
- Fix exception that occured on demoting admins through `PATCH /api/v1/users[user_id]`
- Add `team_id` to `GET /api/v1/users` to determine if a user is already in a team

**Themes**

- Add a `THEME_FALLBACK` config to help develop themes.
  - `THEME_FALLBACK` will configure CTFd to try to find missing theme files in the default built-in `core` theme.
  - This makes it easier to develop themes or use incomplete themes.
- Allow for one theme to reference and inherit from another theme through approaches like `{% extends "core/page.html" %}`
- Allow for the automatic date rendering format to be overridden by specifying a `data-time-format` attribute.
- Add styling for the `<blockquote>` element.
- Fix scoreboard table identifier to switch between User/Team depending on configured user mode
- Switch to using Bootstrap's scss in `core/main.scss` to allow using Bootstrap variables
- Consolidate Jinja error handlers into a single function and better handle issues where error templates can't be found

**Plugins**

- Set plugin migration version after successful migrations
- Fix issue where Page URLs injected into the navbar were relative instead of absolute

**Admin Panel**

- Add User standings as well as Teams standings to the admin scoreboard when in Teams Mode
- Add a UI for adding members to a team from the team's admin page
- Add ability for admins to disable public team creation
- Link directly to users who submitted something in the submissions page if the CTF is in Teams Mode
- Fix Challenge Requirements interface in Admin Panel to not allow empty/null requirements to be added
- Fixed an issue where config times (start, end, freeze times) could not be removed
- Fix an exception that occurred when demoting an Admin user
- Adds a temporary hack for re-enabling Javascript snippets in Flag editor templates. (See #1779)

**Deployment**

- Install `python3-dev` instead of `python-dev` in apt
- Bump lxml to 4.6.2
- Bump pip-compile to 5.4.0

**Miscellaneous**

- Cache Docker builds more by copying and installing Python dependencies before copying CTFd
- Change the default emails slightly and rework confirmation email page to make some recommendations clearer
- Use `examplectf.com` as testing/development domain instead of `ctfd.io`
- Fixes issue where user's name and email would not appear in logs properly
- Add more linting by also linting with `flake8-comprehensions` and `flake8-bugbear`
2021-03-18 18:08:46 -04:00
Kevin Chung
8a70d9527f Relax team requirement when challenges are publicly visible (#1832)
* Don't require a team for viewing challenges if Challenge visibility is set to public
* Closes #1831
2021-03-18 02:35:03 -04:00
Kevin Chung
e5dbd62a66 Fix frontend UI where empty/null requirements could be added (#1824)
* Fix Challenge Requirements interface in Admin Panel to not allow empty/null requirements to be added
* Closes #1809
2021-03-16 19:03:55 -04:00
Kevin Chung
b74b91774c Set plugin migration version after a successful migration (#1827)
* Set plugin migration version after successful migrations
* Closes #1763
2021-03-16 18:48:18 -04:00
Kevin Chung
f8552b8403 Add styling for blockquotes. Switch to using Bootstrap's scss for main.scss. (#1826)
* Add styling for blockquotes. Closes #1814 
* Switch to using Bootstrap's scss in main.scss to allow using Bootstrap variables
2021-03-16 16:31:54 -04:00
Kevin Chung
a3dbecdd18 Link directly to users from the submissions page in teams mode (#1823)
* Links directly to users who submitted something in the submissions page if the CTF is in teams mode. 
* Closes #1813
2021-03-16 15:32:38 -04:00
Kevin Chung
1e0b196189 Fix some template issues reported by curlylint (#1822)
* Fixes some issues reported by [curlylint](https://github.com/thibaudcolas/curlylint).
2021-03-16 12:46:16 -04:00
dependabot[bot]
6b05c03968 Bump elliptic from 6.5.3 to 6.5.4 (#1818)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-11 00:56:02 -05:00
Alper Berber
4125e7c00c Fixed registration and confirmation logs (#1734)
* Fixes issue where user's name and email would not appear in logs properly
* Closes #1706
2021-03-06 15:56:12 -05:00
Kevin Chung
843546bfa8 Switch default testing/development domain name to examplectf.com (#1807)
* Use `examplectf.com` as testing/development domain instead of `ctfd.io`
2021-02-20 15:11:22 -05:00
Kevin Chung
5611c47487 1002 improve email content (#1804)
* Change the default emails slightly and rework confirmation email page to make some recommendations clearer
* Works a little more on #1002
2021-02-18 16:09:10 -05:00
Kevin Chung
a09e2201ee Fix default team_creation representation value in the config page (#1803)
* Fix default team_creation representation value in the config page
2021-02-16 13:21:32 -05:00
Kevin Chung
5c9b3e7070 Add team creation disable configuration (#1802)
* Add ability for admins to disable public team creation
* Closes #1364
2021-02-12 18:26:03 -05:00
Kevin Chung
abdc366bb7 Fix scoreboard identifier to switch between User/Team depending on mode (#1800)
* Fix scoreboard table identifier to switch between User/Team depending on mode
* Closes #1777
2021-02-11 01:11:50 -05:00
Kevin Chung
213c6641d5 Allow time format to be overriden by data attribute (#1801)
* Allow for the `data-time` format to be overridden by `data-time-format` attribute.
* Closes #1776
2021-02-11 00:54:43 -05:00
Kevin Chung
fa7316722e Fix exception occuring on Admin demotion (#1799)
* Fix an exception that occurred when demoting an Admin user
* Fix the response from the above request from returning a list instead of a dict
* Closes #1794
2021-02-09 04:03:04 -05:00
Kevin Chung
0a5a886ac6 Fix issue where page URLs were relative (#1798)
* Fix issue where Page URLs were relative in the navbar
* Closes #1797
2021-02-09 03:03:17 -05:00
Kevin Chung
657bafd9ce Fix typo in FlagEditForm.vue (#1793)
Fix typo in FlagEditForm.vue
Related to #1779
2021-02-04 22:35:03 -05:00
Kevin Chung
3af0b68164 Fix incorrect schema validator (#1790)
* Use right length in Page title validator
2021-01-29 18:48:07 -05:00
Frank
7fe32d7a5d field based schema validation (#1789)
* Clean up Page and Challenges schema validation
2021-01-29 15:09:09 -05:00
Kevin Chung
7f115bf458 Add length error content that is too long (#1787)
* Add length checking to some sensitive fields in Pages and Challenges.
* Works on #1786

This is enough to fix most of the issues but this is really a systemic problem for most of the API endpoints. We should have something that verifies data consistency. Marshmallow is not good enough at this. Pydantic seems like it would be superior here.
2021-01-28 16:55:15 -05:00
Kevin Chung
2e6ce0f695 Add a temporary fix/hack for running scripts in flag editor templates (#1783)
* Works on #1779 
* Adds a temporary hack for re-enabling Javascript snippets in Flag editor templates. 
    * In the future this will probably be separated out into a separate scripts file or something like using web components
2021-01-27 02:58:23 -05:00
dependabot[bot]
566c16a9df Bump highlight.js from 10.3.1 to 10.4.1 (#1753)
* Bump highlight.js from 10.3.1 to 10.4.1

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 10.3.1 to 10.4.1.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/master/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/10.3.1...10.4.1)

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

* Run yarn build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
Co-authored-by: Kevin Chung <kchung@nyu.edu>
2021-01-27 01:21:08 -05:00
dependabot[bot]
cd248dcf4e Bump ini from 1.3.5 to 1.3.7 (#1761)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

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-01-27 00:12:42 -05:00
Kevin Chung
d3b8d49de8 Bump some Python dependencies (#1784)
* Bump lxml to 4.6.2
* Bump pip-compile to 5.4.0
2021-01-26 23:55:08 -05:00
Khiem Doan
ba0afb5396 Update docker (#1773)
* Install `python3-dev` dependency instead of `python-dev`
2021-01-14 15:48:17 -05:00