Skip to content

Releases: jdabtieu/CTFOJ

v1.0.0

08 Dec 19:59
ce6add8
Compare
Choose a tag to compare

Database Warning

In this release, the database format was changed significantly. If you are currently using v0.0.1-pre, please run $ python3 migrate.py to migrate to the latest database format. Also, if you are running a scheduled task on daily-tasks.py, please note that the file is now called daily_tasks.py.

Changes in this version

  • Full Markdown support
  • Major database changes
    • Problem descriptions, hints, editorials, announcements, and contest descriptions are now stored in the filesystem instead of in the database
  • Application logs are now automatically generated at logs/application.log
  • Enable CSRF protection using anti-CSRF tokens
  • jQuery & other large resources no longer served from CDNs (due to browser partitioning)
  • Rename daily-tasks.py to daily_tasks.py for PEP8 compliance
  • Small code cleanup
  • Various bug fixes

Troubleshooting

If you don't already have a logs/application.log file, you will have to create it. $ mkdir logs; touch logs/application.log
If you don't have Flask-WTF already installed, you will have to install it. You can do this by running $ pip3 install -r requirements.txt
If there is an issue with the configuration, edit settings.py and add the following to the end of the file:

CLUB_NAME = "YOUR CLUB NAME HERE"
LOGGING_FILE_LOCATION = 'logs/application.log'
SESSION_COOKIE_SAMESITE = 'Lax'

Development pre-release

07 Dec 16:22
fc8988e
Compare
Choose a tag to compare
Pre-release

Starting from the next release, all releases containing database changes will contain a migration script to automatically migrate data.

If your database format does not currently match the current database format, please rebuild your database. Alternatively, if your database schema looks similar enough to the current format and you feel comfortable manually making changes, you can do that as well. To verify, run SELECT sql FROM sqlite_master in sqlite and compare your output to the following:

CREATE TABLE 'submissions' ('sub_id' integer PRIMARY KEY NOT NULL, 'date' datetime NOT NULL, 'user_id' integer NOT NULL, 'problem_id' varchar(32) NOT NULL, 'contest_id' varchar(32), 'correct'  boolean NOT NULL)
CREATE TABLE 'contests' ('id' varchar(32) NOT NULL, 'name' varchar(256) NOT NULL, 'start' datetime NOT NULL, 'end' datetime NOT NULL, 'description' text, 'scoreboard_visible'  boolean NOT NULL DEFAULT (1))
CREATE TABLE 'problems_master' ('user_id' integer NOT NULL, [list of problems in the form 'problem id' boolean NOT NULL DEFAULT(0)])
CREATE TABLE '[some contest id]info' ('id' varchar(32) NOT NULL, 'name' varchar(256) NOT NULL, 'category' varchar(32) NOT NULL, 'flag' varchar(256) NOT NULL,'point_value' INTEGER NOT NULL DEFAULT (0)  , 'description' varchar(16384), 'hints' varchar(16384), 'draft' boolean NOT NULL DEFAULT(0))
CREATE TABLE 'users' ('id' integer PRIMARY KEY NOT NULL, 'username' varchar(20) NOT NULL, 'password' varchar(64) NOT NULL, 'email' varchar(128), 'join_date'  datetime NOT NULL DEFAULT (0), 'admin'  boolean NOT NULL DEFAULT (0), 'banned'  boolean NOT NULL DEFAULT (0)  , 'verified' boolean NOT NULL DEFAULT(0))
CREATE TABLE 'announcements' ('id' integer PRIMARY KEY NOT NULL, 'name' varchar(256) NOT NULL, 'date' datetime NOT NULL, 'description' varchar(16384) NOT NULL)
CREATE TABLE '[some contest id]' ('user_id' integer NOT NULL,'points' INTEGER NOT NULL DEFAULT (0), 'lastAC' datetime, [list of problems in the form 'problem id' boolean NOT NULL DEFAULT(0)])
CREATE TABLE "problems" ('id' varchar(64) NOT NULL, 'name' varchar(256) NOT NULL, 'point_value' integer NOT NULL DEFAULT (0), 'category' varchar(64), 'flag' varchar(256) NOT NULL, 'draft' boolean NOT NULL DEFAULT(0))