Commit Graph

138 Commits

Author SHA1 Message Date
Kevin Chung
8ab99dc577 Remove commented HTML 2020-04-23 13:34:38 -04:00
Kevin Chung
89a266cf2c Run yarn build 2020-04-23 08:52:29 -04:00
Kevin Chung
0bb1a5d0bd Run make format 2020-04-23 02:28:05 -04:00
Kevin Chung
d8e766734a Add bulk buttons 2020-04-22 20:32:10 -04:00
Kevin Chung
d5fd2f8f2a Setup bulk deletion buttons 2020-04-22 18:49:57 -04:00
Kevin Chung
5f4af2a3f2 Fix tables 2020-04-22 17:24:33 -04:00
Kevin Chung
be643dee90 Run prettier 2020-04-22 15:26:08 -04:00
Kevin Chung
7b9cd1df25 Consolidate buttons 2020-04-22 15:20:27 -04:00
Kevin Chung
3d058bce05 Switch to using outline button 2020-04-22 14:57:37 -04:00
Kevin Chung
3a15c155c7 Make it easier to click checkbox 2020-04-21 22:38:46 -04:00
Kevin Chung
052911f930 Add a construct for sortable columns 2020-04-21 15:39:14 -04:00
Kevin Chung
24c3520685 Change challenge visibility badge on challenge update (#1331)
* Refresh challenge visibility badge after challenge update. A stopgap solution until a better state based UI is implemented. 
* Closes #1267
2020-04-18 03:43:30 -04:00
Kevin Chung
cd6439f2eb Add a bell curve graph and total points calculation (#1325)
* Add a bell curve graph and total points calculation to admin panel statistics
* Closes #608
2020-04-17 03:10:55 -04:00
Kevin Chung
e113b2d627 Fix Admin Panel link from deprecating session type 2020-04-15 03:38:25 -04:00
Kevin Chung
05e5730c54 Fix media library refresh on upload (#1319) 2020-04-14 12:42:15 -04:00
Kevin Chung
1249229faf Closes #1305 (#1309)
* Makes `Account Visibility` subtext clearer by explaining the `Private` setting
2020-04-10 02:51:49 -04:00
淡水
a854bfc50f Fix scoreboard top 10 graph's title (#1296)
* Scoreboard graph title properly shows Users or Teams
2020-03-31 16:18:27 -04:00
Kevin Chung
e5f128ec9d Fix awards in teams mode (#1289)
* Fix awards not being properly assigned to teams in `TEAMS_MODE`
2020-03-14 15:36:44 -04:00
Kevin Chung
64aa55366f Fix changing profile settings from admin and user settings pages (#1290)
* Fixes users/admins being able to remove profile settings
2020-03-14 12:15:11 -04:00
Kevin Chung
464f7bde58 Use authed function to check if user is authed in base.html (#1283)
* Use `authed` function to check if user is authed in `base.html`
2020-03-08 19:45:24 -04:00
Kevin Chung
348fe5504e Fix modal-body parameters in ezq.js and fix the progress bar for certain cases in ezProgressBar (#1278)
* Fix `modal-body` parameters in ezq.js for `ezAlert` and `ezQuery` and fix the progress bar for certain cases in `ezProgressBar`
* Mostly copied from #1275
2020-03-04 19:51:01 -05:00
Kevin Chung
e764bb16b8 Fix custom theme color setting in config panel (#1268)
* Properly update the theme header with custom theme color values 
* Closes #1263
2020-02-29 16:56:05 -05:00
Kevin Chung
2f46f61ed0 Fix ezq toast timeout and fix yarn build command for Python 3 (#1266)
* Fix `ezToast()` timeout
* Force `yarn build` to use Python 3
* Closes #1265
2020-02-29 15:21:22 -05:00
Kevin Chung
7ee47b0abe Add setting to allow MLC registration only (#1259)
* Adds a setting to registration visibility to allow for MLC registration while registration is disabled
2020-02-23 23:33:34 -05:00
Kevin Chung
22c132358e 2.3.0 (#1248)
2.3.0 / 2020-02-17
==================

**General**
* During setup, admins can register their email address with the CTFd LLC newsletter for news and updates
* Fix editting hints from the admin panel
* Allow admins to insert HTML code directly into the header and footer (end of body tag) of pages. This replaces and supercedes the custom CSS feature.
    * The `views.custom_css` route has been removed.
* Admins can now customize the content of outgoing emails and inject certain variables into email content.
* The `manage.py` script can now manipulate the CTFd Configs table via the `get_config` and `set_config` commands. (e.g. `python manage.py get_config ctf_theme` and `python manage.py set_config ctf_theme core`)

**Themes**
* Themes should now reference the `theme_header` and `theme_footer` configs instead of the `views.custom_css` endpoint to allow for user customizations. See the `base.html` file of the core theme.

**Plugins**
* Make `ezq` functions available to `CTFd.js` under `CTFd.ui.ezq`

**Miscellaneous**
* Python imports sorted with `isort` and import order enforced
* Black formatter running on a majority of Python code
2020-02-17 02:17:25 -05:00
Kevin Chung
d37805b6fe Fix timezone loading in time config page (#1211)
* Fix an issue where CTF times could not be displayed in the admin panel because timezones weren't available
2020-01-09 18:41:41 -05:00
Kevin Chung
d30bd182d2 Add jQuery, Moment, nunjucks, and Howl to window globals (#1209)
* Add jQuery, Moment, nunjucks, and Howl to window globals
2020-01-08 18:06:15 -05:00
Kevin Chung
d5128c2fa4 Seperate out admin theme from core more to fix #1200 (#1202)
* Separate out admin theme from core more to fix #1200
2020-01-03 22:18:05 -05:00
Kevin Chung
b8d0f80d01 2.2.0 (#1188)
2.2.0 / 2019-12-22
==================

## Notice
2.2.0 focuses on updating the front end of CTFd to use more modern programming practices and changes some aspects of core CTFd design. If your current installation is using a custom theme or custom plugin with ***any*** kind of JavaScript, it is likely that you will need to upgrade that theme/plugin to be useable with v2.2.0. 

**General**
* Team size limits can now be enforced from the configuration panel
* Access tokens functionality for API usage
* Admins can now choose how to deliver their notifications
    * Toast (new default)
    * Alert
    * Background
    * Sound On / Sound Off
* There is now a notification counter showing how many unread notifications were received
* Setup has been redesigned to have multiple steps
    * Added Description
    * Added Start time and End time,
    * Added MajorLeagueCyber integration
    * Added Theme and color selection
* Fixes issue where updating dynamic challenges could change the value to an incorrect value
* Properly use a less restrictive regex to validate email addresses
* Bump Python dependencies to latest working versions
* Admins can now give awards to team members from the team's admin panel page

**API**
* Team member removals (`DELETE /api/v1/teams/[team_id]/members`) from the admin panel will now delete the removed members's Submissions, Awards, Unlocks

**Admin Panel**
* Admins can now user a color input box to specify a theme color which is injected as part of the CSS configuration. Theme developers can use this CSS value to change colors and styles accordingly.
* Challenge updates will now alert you if the challenge doesn't have a flag
* Challenge entry now allows you to upload files and enter simple flags from the initial challenge creation page

**Themes**
* Significant JavaScript and CSS rewrite to use ES6, Webpack, yarn, and babel
* Theme asset specially generated URLs
    * Static theme assets are now loaded with either .dev.extension or .min.extension depending on production or development (i.e. debug server)
    * Static theme assets are also given a `d` GET parameter that changes per server start. Used to bust browser caches.
* Use `defer` for script tags to not block page rendering
* Only show the MajorLeagueCyber button if configured in configuration
* The admin panel now links to https://help.ctfd.io/ in the top right
* Create an `ezToast()` function to use [Bootstrap's toasts](https://getbootstrap.com/docs/4.3/components/toasts/)
* The user-facing navbar now features icons
* Awards shown on a user's profile can now have award icons
* The default MarkdownIt render created by CTFd will now open links in new tabs
* Country flags can now be shown on the user pages

**Deployment**
* Switch `Dockerfile` from `python:2.7-alpine` to `python:3.7-alpine`
* Add `SERVER_SENT_EVENTS` config value to control whether Notifications are enabled
* Challenge ID is now recorded in the submission log

**Plugins**
* Add an endpoint parameter to `register_plugin_assets_directory()` and `register_plugin_asset()` to control what endpoint Flask uses for the added route

**Miscellaneous**
* `CTFd.utils.email.sendmail()` now allows the caller to specify subject as an argument
    * The subject allows for injecting custom variable via the new `CTFd.utils.formatters.safe_format()` function
* Admin user information is now error checked during setup
* Added yarn to the toolchain and the yarn dev, yarn build, yarn verify, and yarn clean scripts
* Prevent old CTFd imports from being imported
2019-12-22 23:17:34 -05:00
Kevin Chung
75a9a5a697 Rename statistics.js to graphs.js (#1086)
* Rename `statistics.js` to `graphs.js` in the admin panel to avoid getting blocked by ad blockers
2019-08-17 20:06:22 -04:00
Kevin Chung
bef5f1796b Fix broken buttons by not hijacking click event without data-href attribute (#1081)
* Fix broken buttons by not hijacking click event without `data-href` attribute
2019-08-09 00:35:29 -04:00
Kevin Chung
5c4f1d78fa Remove invalid id='submit' on submit buttons and correctly set tabindex to 0 (#1080)
* Remove invalid id='submit' on submit buttons
* Set `tabindex` to 0 since we don't really care for forcing tab order.
2019-08-08 18:27:44 -04:00
Sachin S. Kamath
34bab12a99 Add feature to search users by IP address (#1059)
* Allows admins to search users by IP address
* Closes #1054
2019-07-30 01:09:41 -04:00
Kevin Chung
1c9e36fa8f Show affiliation in user and team pages in the admin panel (#1037)
* Show affiliation in user and team pages in the admin panel and public and private user and team pages. 
* Make user pages show team information (score, place) instead of user information if in team mode. 
* Make `Users.get_place()` and `Teams.get_place()` for return None instead of 0 if the account has no rank. (Closes #1039)
* Make `populate.py` randomly add affiliations and officials
2019-07-12 07:14:08 -04:00
Kevin Chung
97f52756bc Fix scoreboard links created by update() in user mode (#1034)
* Fixes account links on the scoreboard page created by `update()`. They now correctly point to the user instead of undefined when in user mode. 
* Add `account_type` and `account_url` field in `/api/v1/scoreboard`
2019-06-22 16:17:53 -07:00
Kevin Chung
e978867a2f Add UI code to handle team member removal (#1022)
* Change `/api/v1/teams/[team_id]/members` from taking `id` to `user_id`.
    * Not even the admin panel was using this endpoint so doesn't seem that drastic of a change
* Add UI to handle team member removal
2019-06-09 00:27:36 -04:00
Kevin Chung
6f616878b6 Remove data-href from pages.html to fix delete button (#1021)
* Remove `data-href` from `pages.html` to fix the delete button
    * The delete action propagates too much causing issues. This should be re-implemented on page editor rewrite.
2019-06-08 19:57:30 -04:00
Kevin Chung
4983adf78a Challenge team mode improvements (#1013)
* Sort solves in admin challenge view by date
* Link to appropriate user and challenge in team, user, and challenge pages
2019-06-03 22:41:45 -04:00
Stitch (StormCTF)
e6b865b61d Fixed updatescores() (#1000)
* Fixes client side scoreboard updating (Closes #999)
2019-05-19 01:47:46 -04:00
Kevin Chung
6833378c36 Format all the things (#991)
* Format Javascript and CSS files with `prettier`: `prettier --write 'CTFd/themes/**/*'`
* Format Python with `black`: `black CTFd` & `black tests`
* Travis now uses xenial instead of trusty.
2019-05-11 21:09:37 -04:00
Kevin Chung
dc4db6ff1f Fix modal close buttons not working (#980)
* Fixes some modal close buttons not working in the admin panel
2019-05-04 15:47:42 -04:00
Kevin Chung
0fa480bc14 Some 2.1.0a1 bugfixes (#959)
* Fix admin's modifying their own team or own settings
* Fix some links not working in the admin panel
* Fix extensions with an extra space in `populate.py`
2019-04-18 21:55:55 -04:00
Kevin Chung
b1061a3e91 Remove socket.io.min.js from base.html (#958) 2019-04-17 23:15:24 -04:00
Kevin Chung
b6d54b9ee9 2.1.0 (#957)
https://github.com/CTFd/CTFd/milestone/6
2019-04-17 01:36:30 -04:00
Kevin Chung
4f7c4687d7 Reimplement admin send mail to users (#903)
* Reimplement admin send mail to users as `/api/v1/users/<user_id>/email`
* Update form and related Javascript
* Write test for controller
* Closes #897
2019-03-17 18:54:44 -07:00
Kevin Chung
79b7b1dd5c Fix removing profile details (Closes #894) (#899)
* Fix removing profile details (Closes #894)
* Update tests to properly check setting and removing profile values
2019-03-17 09:08:52 -07:00
Kevin Chung
2f252f5240 Fix for overflowing content preventing edit and deletion in admin panel (#891)
* Closes #876
* Fixes overflowing admin panel content by adding the `.text-break` CSS class.
    * This is .text-break cloned from Bootstrap 4.3 with a fix for browsers not supporting break-word. It will be removed from the main CTFd classes when Bootstrap is upgraded internally.
2019-02-28 20:04:21 -08:00
Kevin Chung
6e8c7aaa50 Require CSRF-Token header on state changing API requests, require CSRF nonces on more than just POSTs, replace usage of fetch() with custom CTFd.fetch() implementation (#827)
* Require CSRF-Token header on state changing API requests
* Require CSRF nonces on more than just POSTs, 
* Replace usage of `fetch()` with custom `CTFd.fetch()` implementation
2019-01-10 22:38:37 -05:00
Kevin Chung
9ee743de7e Simplify url_for calls in themes, rework CTFd.js, fix flaky test (#826)
* Simplify url_for calls in themes, rework CTFd.js, fix flaky test
2019-01-10 01:58:39 -05:00
FaultyMach1ine
08c39c01a3 Fix wrong user mode in challenge_solves_box (#812)
* Fix incorrect user/team link in the challenge solves tab
* Change /api/v1/<challenge_id>/solves to also return account_url
2019-01-02 02:22:58 -05:00