mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
# 3.1.0 / 2020-09-08 **General** - Loosen team password confirmation in team settings to also accept the team captain's password to make it easier to change the team password - Adds the ability to add custom user and team fields for registration/profile settings. - Improve Notifications pubsub events system to use a subscriber per server instead of a subscriber per browser. This should improve the reliability of CTFd at higher load and make it easier to deploy the Notifications system **Admin Panel** - Add a comments functionality for admins to discuss challenges, users, teams, pages - Adds a legal section in Configs where users can add a terms of service and privacy policy - Add a Custom Fields section in Configs where admins can add/edit custom user/team fields - Move user graphs into a modal for Admin Panel **API** - Add `/api/v1/comments` to manipulate and create comments **Themes** - Make scoreboard caching only cache the score table instead of the entire page. This is done by caching the specific template section. Refer to #1586, specifically the changes in `scoreboard.html`. - Add rel=noopener to external links to prevent tab napping attacks - Change the registration page to reference links to Terms of Service and Privacy Policy if specified in configuration **Miscellaneous** - Make team settings modal larger in the core theme - Update tests in Github Actions to properly test under MySQL and Postgres - Make gevent default in serve.py and add a `--disable-gevent` switch in serve.py - Add `tenacity` library for retrying logic - Add `pytest-sugar` for slightly prettier pytest output - Add a `listen()` method to `CTFd.utils.events.EventManager` and `CTFd.utils.events.RedisEventManager`. - This method should implement subscription for a CTFd worker to whatever underlying notification system there is. This should be implemented with gevent or a background thread. - The `subscribe()` method (which used to implement the functionality of the new `listen()` function) now only handles passing notifications from CTFd to the browser. This should also be implemented with gevent or a background thread.
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
"""Add table for comments
|
|
|
|
Revision ID: 0366ba6575ca
|
|
Revises: 1093835a1051
|
|
Create Date: 2020-08-14 00:46:54.161120
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "0366ba6575ca"
|
|
down_revision = "1093835a1051"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"comments",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("type", sa.String(length=80), nullable=True),
|
|
sa.Column("content", sa.Text(), nullable=True),
|
|
sa.Column("date", sa.DateTime(), nullable=True),
|
|
sa.Column("author_id", sa.Integer(), nullable=True),
|
|
sa.Column("challenge_id", sa.Integer(), nullable=True),
|
|
sa.Column("user_id", sa.Integer(), nullable=True),
|
|
sa.Column("team_id", sa.Integer(), nullable=True),
|
|
sa.Column("page_id", sa.Integer(), nullable=True),
|
|
sa.ForeignKeyConstraint(["author_id"], ["users.id"], ondelete="CASCADE"),
|
|
sa.ForeignKeyConstraint(
|
|
["challenge_id"], ["challenges.id"], ondelete="CASCADE"
|
|
),
|
|
sa.ForeignKeyConstraint(["page_id"], ["pages.id"], ondelete="CASCADE"),
|
|
sa.ForeignKeyConstraint(["team_id"], ["teams.id"], ondelete="CASCADE"),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table("comments")
|
|
# ### end Alembic commands ###
|