Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
0617371
Delete 'backend' app
jerbob Jun 9, 2021
379cb07
Rename 'backend' app to 'core'
jerbob Jun 9, 2021
6c84349
Update Makefile
jerbob Jun 9, 2021
9e11e8d
Update Makefile
jerbob Jun 9, 2021
8fb4100
Update workflows to use 'core' app
jerbob Jun 9, 2021
d438610
Update 'publish documentation' workflow
jerbob Jun 9, 2021
ca78680
Merge 'announcements' app with 'sockets'
jerbob Jun 10, 2021
b342de7
Filter out ABC DeprecationWarnings
jerbob Jun 10, 2021
fefdb53
Update warning filters
jerbob Jun 10, 2021
ca62c47
Move commands and checks from ractf app into core app
Jun 10, 2021
6a9e7d7
move self check to core app
Jun 11, 2021
a9eaa32
Merge branch 'master' into feature/app-restructure
Jun 11, 2021
b1d7347
fix docker compose and add new make targets
Jun 11, 2021
d5e0353
move plugins into core app, restructure core tests
Jun 11, 2021
a539082
Test AdminOrReadOnlyVisible
Jun 11, 2021
a86a38a
Test AdminOrReadOnly
Jun 11, 2021
6f7193d
Fix tests for AdminOrReadOnly
Jun 11, 2021
498eb85
Test AdminOrAnonymousReadOnly
Jun 11, 2021
dcdf3ef
Test IsBot
Jun 11, 2021
3403171
Consistent type hinting
Jun 11, 2021
b61d77e
Reorder permission tests
Jun 11, 2021
121008b
Test IsSudo
Jun 11, 2021
3cd303f
Add DJANGO_LOG_LEVEL env var for logging level
jerbob Jun 11, 2021
ea40515
Change plugin loader back to using logger.info
Jun 11, 2021
13ab0ce
experiments -> core
Jun 11, 2021
4692a64
add flake8-docstrings
Jun 11, 2021
8dcfe56
docstring stats urls
Jun 11, 2021
8902f58
docstring stat tests
Jun 11, 2021
4d58b6a
docstring stats app
Jun 11, 2021
ebcc349
add full stops
Jun 11, 2021
a6d541c
add blank line
Jun 11, 2021
8dba15d
add full stops
Jun 11, 2021
ee86a7c
add docstrings to stats views
Jun 11, 2021
2eb59b5
add docstrings to stats signal handlers
Jun 11, 2021
4c82c1e
add docstrings to andromeda urls
Jun 11, 2021
2040bf0
add docstrings to andromeda api client
Jun 11, 2021
60e010d
add docstrings to andromeda api client
Jun 11, 2021
da4708d
delete andromeda/models.py
Jun 11, 2021
28f4d95
delete andromeda/tests.py
Jun 11, 2021
44dbd87
andromeda integration app docstrings
Jun 11, 2021
8ea5bb6
andromeda integration app docstrings
Jun 11, 2021
b44d09d
andromeda api docstrings.
Jun 11, 2021
0ff06d0
andromeda serializer docstrings.
Jun 11, 2021
ea68271
andromeda serializer docstrings.
Jun 11, 2021
a97752a
challenge test mixin docstringas.
Jun 11, 2021
52c0ad6
challenge util test docstringas.
Jun 11, 2021
bfe3a8f
challenge util test docstringas.
Jun 11, 2021
1790fec
challenge view test docstrings.
Jun 11, 2021
7b08638
challenge url docstrings.
Jun 11, 2021
42d42b3
challenge sql docstrings.
Jun 11, 2021
2b9e3bb
challenge app docstrings.
Jun 11, 2021
7d7adc1
challenge view docstrings.
Jun 11, 2021
98742cb
challenge view docstrings.
Jun 11, 2021
b5333cd
challenge signal docstrings.
Jun 11, 2021
cc6c41b
challenge permission docstrings.
Jun 11, 2021
769c9c9
start challenge serializer docstrings.
Jun 11, 2021
e4f54f3
Update flake8 line-length in line with black configuration
jerbob Jun 11, 2021
c049dc7
Replace all usages of '.id' to '.pk'
jerbob Jun 11, 2021
2402412
Update stats/tests.py
jerbob Jun 11, 2021
57542d7
Refactor challenge models
jerbob Jun 11, 2021
895cc1c
fix aperture's shit code
Jun 11, 2021
bc02c0a
imperative
Jun 11, 2021
5c76d9e
challenge serializer docstrings
Jun 11, 2021
0aca48a
make flake8 happy
Jun 11, 2021
7da4b21
docstrings on challenge models
Jun 11, 2021
ad54fff
docstrings on challenge models
Jun 11, 2021
3fda1e9
docstrings on hint urls
Jun 11, 2021
b561b47
docstrings on hint models
Jun 11, 2021
c0589a6
docstrings on hint app
Jun 11, 2021
42e07ad
docstrings on hint views
Jun 11, 2021
6273373
docstrings on hint tests
Jun 11, 2021
0d282ac
docstrings on hint serializers
Jun 11, 2021
0f848e5
docstrings on hint permissions
Jun 11, 2021
5b103fa
Update linter to flakehell
jerbob Jun 12, 2021
2a6a43a
config url docstrings
Jun 11, 2021
d248c23
config model docstrings
Jun 11, 2021
4a4a2a9
config test docstrings
Jun 11, 2021
5dabf0f
config app docstrings
Jun 11, 2021
db272b4
config view docstrings
Jun 11, 2021
f3bfa87
config backend docstrings
Jun 12, 2021
04053b4
config backend docstrings
Jun 12, 2021
4390e29
config docstrings
Jun 12, 2021
6467547
member url docstrings
Jun 12, 2021
7f77eeb
member models docstrings
Jun 12, 2021
ce8169c
member models docstrings
Jun 12, 2021
fb4881d
member tests docstrings
Jun 12, 2021
311a535
member tests docstrings
Jun 12, 2021
1dd8c25
member apps docstrings
Jun 12, 2021
b217519
member views docstrings
Jun 12, 2021
dfe109c
member views docstrings
Jun 12, 2021
537b47d
member serializers docstrings
Jun 12, 2021
5e3f66e
member serializers docstrings
Jun 12, 2021
890440a
leaderboard url docstrings
Jun 12, 2021
177f3bd
leaderboard models docstrings
Jun 12, 2021
7fa44e3
leaderboard test docstrings
Jun 12, 2021
a750c47
full stop
Jun 12, 2021
7c16e1c
leaderboard test docstrings
Jun 12, 2021
b7b4ca2
leaderboard test docstrings
Jun 12, 2021
13a73de
leaderboard app docstrings
Jun 12, 2021
a9c9643
leaderboard view docstrings
Jun 12, 2021
76f9903
leaderboard serializer docstrings
Jun 12, 2021
7580a7e
team url docstrings
Jun 12, 2021
1fd424e
leaderboard serializer docstrings
Jun 12, 2021
2a86bc9
leaderboard model docstrings
Jun 12, 2021
d5d346a
team app docstrings
Jun 12, 2021
ed12cdc
team test docstrings
Jun 12, 2021
a31771a
team view docstrings
Jun 12, 2021
bfb246f
team serializer docstrings
Jun 12, 2021
8ce7e5e
team permissions docstrings
Jun 12, 2021
3841631
team serializers docstrings
Jun 12, 2021
313c87a
page url docstrings
Jun 12, 2021
8d809ca
page model docstrings
Jun 12, 2021
799171f
page test docstrings
Jun 12, 2021
e2c471f
page app docstrings
Jun 12, 2021
b50019c
page view docstrings
Jun 12, 2021
3465c77
page serializer docstrings
Jun 12, 2021
ccc36bf
base pointplugin docstrings
Jun 12, 2021
71e50ba
basic pointplugin docstrings
Jun 12, 2021
6930ad0
decay pointplugin docstrings
Jun 12, 2021
e1721d2
validator test docstrings
Jun 12, 2021
101cbf9
core view test docstrings
Jun 12, 2021
ad584c6
Add more docstrings to the authentication app
jerbob Jun 13, 2021
e39ece5
Update flakehell configuration
jerbob Jun 13, 2021
b0f0af7
Update user create docstring
jerbob Jun 13, 2021
ba8ca45
Exclude migrations from mypy
jerbob Jun 13, 2021
1ccf3d7
Ignore 'line break before binary operator' flake8 error
jerbob Jun 13, 2021
9f63293
Remove unused imports in authentication/models.py
jerbob Jun 13, 2021
170f36b
Add TODO comment to authentication.providers
jerbob Jun 13, 2021
6802a1d
Add docstrings to authentication.serializers
jerbob Jun 13, 2021
2cbffa5
Update usages of EmailSerializer with ResendEmailSerializer
jerbob Jun 13, 2021
a65882b
Add factory-boy to dev dependencies
jerbob Jun 13, 2021
e93de8e
Refactor authentication tests into distinct modules
jerbob Jun 13, 2021
6035b0a
Refactor authentication tests into distinct modules
jerbob Jun 13, 2021
2089371
Update usage of rest_framework.status
jerbob Jun 13, 2021
6c766b0
add test_permissions docstrings
Jun 13, 2021
33e807e
add test_plugins docstrings
Jun 13, 2021
204e4a7
add lenient docstrings
Jun 13, 2021
6f2eb7b
add regex flag plugin docstrings
Jun 13, 2021
ee63512
add base flag plugin docstrings
Jun 13, 2021
61a57fd
add long text flag plugin docstrings
Jun 13, 2021
db53dd4
add long text flag plugin docstrings
Jun 13, 2021
4f9237c
add plaintext flag plugin docstrings
Jun 13, 2021
4108118
add map flag plugin docstrings
Jun 13, 2021
b8a444b
add hashed flag plugin docstrings
Jun 13, 2021
80c4567
add transfer team docstrings
Jun 13, 2021
55d2106
add unteam docstrings
Jun 13, 2021
157f3fe
add reset scorees docstrings
Jun 13, 2021
fc9aa66
add copy points docstrings
Jun 13, 2021
6442e9e
add getschema docstrings
Jun 13, 2021
1f96b0a
add reset_scores docstrings
Jun 13, 2021
73f61bc
add flush_db docstrings
Jun 13, 2021
caf01ee
add copy_points docstrings
Jun 13, 2021
eacca9e
add settings docstrings
Jun 13, 2021
da3b62a
add pagination docstrings
Jun 13, 2021
3f9e891
add ractftokenauthentication docstrings
Jun 13, 2021
ffd23b4
remove unused and broken validator, docstring the others
Jun 13, 2021
8069b9e
exception_handler docstrings
Jun 13, 2021
b417dfb
plugin base docstrings
Jun 13, 2021
8151254
mixin docstrings
Jun 13, 2021
8a1e37a
core url docstrings
Jun 13, 2021
2ff9b27
Add authentication.tests.factories
jerbob Jun 13, 2021
cc8becb
Add custom decorator for patching config options during tests.
jerbob Jun 13, 2021
2a9af66
Add docstrings to authentication.providers
jerbob Jun 13, 2021
0921688
core renderers docstrings
Jun 13, 2021
0b1eebe
core mail docstrings
Jun 13, 2021
7b31d4d
core response docstrings
Jun 13, 2021
b42a042
core throttle docstrings
Jun 13, 2021
05c002c
core storages docstrings
Jun 13, 2021
11ffa6b
improve exception_handler docstring
Jun 13, 2021
c6c1904
docstring core/apps.py
Jun 13, 2021
890bc1d
docstring core/viewsets.py
Jun 13, 2021
3d32c88
docstring core/views.py
Jun 13, 2021
3766d35
docstring core/signals.py
Jun 13, 2021
d212126
docstring core/backends.py
Jun 13, 2021
06e6467
docstring core/exceptions.py
Jun 13, 2021
306a296
docstring core/plugins.py
Jun 13, 2021
1ca77ba
docstring core/providers.py
Jun 13, 2021
880386d
docstring core/permissions.py
Jun 13, 2021
91acadd
docstring sockets/urls.py
Jun 13, 2021
636806d
docstring sockets/routing.py
Jun 13, 2021
264480d
docstring sockets/models.py
Jun 13, 2021
4020c2e
docstring sockets/apps.py
Jun 13, 2021
ac8735a
docstring sockets/views.py
Jun 13, 2021
12ba644
docstring sockets/signals.py
Jun 13, 2021
f9d0a51
docstring sockets/serializers.py
Jun 13, 2021
c921365
docstring sockets/consumers.py
Jun 13, 2021
5190b56
Add docstrings for authentication/models.py
jerbob Jun 13, 2021
716984d
Add docstring for nested Meta class in authentication/models.py
jerbob Jun 13, 2021
d200ccf
Remove blank line after function docstring
jerbob Jun 13, 2021
e26315e
docstring authentication/tests/test_admin.py
Jun 13, 2021
cdbedd3
docstring authentication/tests/test_password.py
Jun 13, 2021
a23f3e4
docstring authentication/tests/test_login.py
Jun 13, 2021
c3eddba
docstring authentication/tests/test_register.py
Jun 13, 2021
f5341c4
Update migration broken by authentication util changes
jerbob Jun 13, 2021
09beb99
add missing docstring
Jun 13, 2021
c3c60ba
Add blackd dependencies to poetry dev-dependencies
jerbob Jun 13, 2021
65a1077
Add HidePasswordMixin
jerbob Jun 13, 2021
0e60364
Add AuthenticatedUser type for hinting
jerbob Jun 13, 2021
9bf7064
Update all usages of Member property checks
jerbob Jun 13, 2021
c31486b
Add docstrings to authentication.views
jerbob Jun 13, 2021
089d074
Resolve remaining lint errors outside scorerecalculator
jerbob Jun 13, 2021
50a63b8
Update enabled_2fa property
jerbob Jun 13, 2021
67f3ca5
This definitely works
jerbob Jun 13, 2021
e2452ca
Consciousness is a curse.
jerbob Jun 13, 2021
854f7c9
Remove redundant import_module import
jerbob Jun 13, 2021
9d89ebe
Move score recalculator to team viewset
Jun 13, 2021
314559d
Update pyproject.toml settings to support django-stubs
jerbob Jun 15, 2021
06854f3
Update Makefile with PYTHONPATH
jerbob Jun 15, 2021
701d70c
Replace unserializable default functions with utils.py methods
jerbob Jun 15, 2021
d3e9227
Add monkeytype to dev-dependencies
jerbob Jun 15, 2021
b801294
move flag submit
Jun 15, 2021
6842c1d
Merge 'team' and 'member' apps into 'teams'
jerbob Jun 24, 2021
3313ff0
Update usages of rest_framework.status
jerbob Jun 24, 2021
97c2ce5
Remove the 'member' app
jerbob Jun 24, 2021
f7d3a6d
Rename challenge app to 'challenges'
jerbob Jun 24, 2021
c0cbcc0
make admin command
Jun 27, 2021
25003a1
make not admin command
Jun 27, 2021
7535459
Merge branch 'master' into feature/app-restructure
Sep 3, 2021
789c6a5
fix things
Sep 3, 2021
10d0cf5
fuck this, aperture problem
Sep 3, 2021
41b2372
Update lockfile
jerbob Sep 3, 2021
54cfc0d
Update references to renamed apps in migrations
jerbob Sep 3, 2021
0f27e41
Update imports of renamed packages
jerbob Sep 3, 2021
d2a33d0
Remove calls to get_user_model and use refresh_db
Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 3 additions & 38 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,7 @@ jobs:
docs:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: 'backend.settings.test'
REDIS_PORT: 6379
REDIS_CONFIG_DB: 1
REDIS_CACHE_DB: 2
REDIS_HOST: localhost
SQL_PORT: 5432
SQL_USER: ractf
SQL_HOST: localhost
SQL_DATABASE: ractf
SQL_PASSWORD: postgres
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_EXTENSIONS: citext
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: ractf
POSTGRES_USER: ractf
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:5
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
DJANGO_SETTINGS_MODULE: 'core.settings.lint'

steps:
- name: Checkout repository
Expand Down Expand Up @@ -89,11 +55,10 @@ jobs:
PIP_CACHE_DIR: ~/.pip

- name: Run Migrations
run: ./manage.py migrate
working-directory: ./src
run: make migrate

- name: Generate OpenAPI schema
run: set -eo pipefail && ./src/manage.py getschema | tee openapi-schema.yml
run: set -eo pipefail && python src/manage.py getschema | tee openapi-schema.yml

- name: Publish API documentation to GitHub
uses: actions/upload-artifact@v2
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on: push
jobs:
test:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: 'backend.settings.lint'

steps:
- name: Checkout repository
Expand Down
23 changes: 17 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.EXPORT_ALL_VARIABLES:
BETTER_EXCEPTIONS=1
DJANGO_SETTINGS_MODULE?=backend.settings.lint
PYTHONPATH=$(shell pwd)/src
DJANGO_SETTINGS_MODULE?=core.settings.lint

migrate:
python src/manage.py migrate
Expand All @@ -9,33 +10,43 @@ migrations:
python src/manage.py makemigrations

test: migrate
pytest --testmon src || \
pytest --testmon || \
if [ $$? = 5 ]; \
then exit 0; \
else exit $$?; \
fi

coverage: migrate
pytest --cov=. --cov-report=xml src && \
pytest --cov=. --cov-report=xml && \
coverage html && \
which xdg-open && \
[ "$$CI" != "true" ] && \
xdg-open htmlcov/index.html || true

format:
isort src && \
black src

lint:
flake8 && \
lint: migrate
flakehell lint src && \
isort --check-only src

dev-server:
docker-compose build && \
docker-compose up -d

dev-server-attach:
docker-compose build && \
docker-compose up

dev-test: dev-server
docker-compose exec backend pytest --cov=src src

dev-server-logs: dev-server
docker-compose logs -f

dev-server-down:
docker-compose down

fake-data:
python -m scripts.fake generate $(ARGS)

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
- DOMAIN=localhost
- FRONTEND_URL=http://localhost:8000/
- SECRET_KEY=CorrectHorseBatteryStaple
- DJANGO_SETTINGS_MODULE=backend.settings.local
- DJANGO_SETTINGS_MODULE=core.settings.local

- ANDROMEDA_IP=andromeda
- ANDROMEDA_URL=http://andromeda:6000
Expand All @@ -58,7 +58,7 @@ services:
sockets:
<<: *backend
entrypoint: /app/entrypoints/sockets.sh
command: gunicorn -w 12 -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker backend.asgi:application
command: gunicorn -w 1 -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker core.asgi:application --chdir src
depends_on:
- backend
working_dir: /app/src/
Expand Down
Loading