Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joe/speedrunning #86

Closed
wants to merge 130 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
6842de5
Start linking to keycloak
JacobWrenn Jun 23, 2024
70177e1
Handle roles
JacobWrenn Jun 24, 2024
6989fcc
Authenticate against auth.durhack.com
JacobWrenn Aug 3, 2024
f07a1f0
Add socket.io to server side
JacobWrenn Aug 7, 2024
36b9d18
Start to use socket.io on the client
JacobWrenn Aug 10, 2024
16ff1b3
Upgrade tokenvault version
JacobWrenn Aug 10, 2024
23b1223
initialize Prisma
SatapasT Aug 11, 2024
a7b1017
migrating the database to Prisma
SatapasT Aug 11, 2024
2865c13
add keycloak integration into branch
SatapasT Aug 11, 2024
19dd285
Created a baseline migration
SatapasT Aug 11, 2024
1c393ce
adjusted createdAt and updatedAt field
SatapasT Aug 11, 2024
5902ce3
Install Prisma Client
SatapasT Aug 13, 2024
1ceda6d
Instantitate PrismaClient Instance
SatapasT Aug 13, 2024
24eccf1
Added prisma modules export and routing to user_handler
SatapasT Aug 13, 2024
32bc4bd
working version of getUser point retrieval
SatapasT Aug 13, 2024
5976a4a
reinitialize Prisma database to correct format
SatapasT Aug 13, 2024
7de7c95
fixing the database forgien key missmatch
SatapasT Aug 21, 2024
a210b60
migrate getUser request
SatapasT Aug 21, 2024
306e9ec
created a decorator for getTotalPoint
SatapasT Aug 21, 2024
8273c90
added prisma extension for getTotalPoint function
SatapasT Aug 21, 2024
53b1345
migrate the getTeam api route to Prisma
SatapasT Aug 26, 2024
bb473a2
migrate joinTeam API to prisma
SatapasT Aug 26, 2024
d561f24
migrate leaveTeam to Prisma
SatapasT Aug 26, 2024
1b8c2d6
change behaviour of getTotalPoint, and cleans up code in User Handle
SatapasT Aug 29, 2024
27226d4
switch prisma over to postgres
Lordfirespeed Aug 29, 2024
250b63d
replace eslint/prettier with Biome
Lordfirespeed Aug 29, 2024
7bd4695
use `pnpm`
Lordfirespeed Aug 29, 2024
e8071eb
create dummy `request`, `response` files
Lordfirespeed Aug 29, 2024
f737747
create `middleware` type
Lordfirespeed Aug 29, 2024
b4d4b94
create 'types' index
Lordfirespeed Aug 29, 2024
1bc8c33
use middleware factory pattern for user handlers
Lordfirespeed Aug 29, 2024
8acbf11
tidy up user handlers a little
Lordfirespeed Aug 29, 2024
34c367e
remove `workspace.xml` from VCS
Lordfirespeed Aug 29, 2024
028f251
remove `.name` from VCS
Lordfirespeed Aug 29, 2024
4e379b7
disable `noNonNullAssertion` rule
Lordfirespeed Aug 29, 2024
00afc5f
fix timestamps for postgres
Lordfirespeed Aug 29, 2024
1eb0529
chore(deps): bump typescript
Lordfirespeed Aug 29, 2024
51da411
refactor: disable experimental decorators & pull decorators from durh…
Lordfirespeed Aug 29, 2024
ab0c27f
refactor: area routes for new decorator format
Lordfirespeed Aug 30, 2024
4ae26c3
refactor: auth handlers, new decorator format
Lordfirespeed Aug 30, 2024
cc16d9d
refactor: discord handlers, new decorator format
Lordfirespeed Aug 30, 2024
7ca693d
refactor: megateams handlers, new decorator format
Lordfirespeed Aug 30, 2024
498f644
refactor: points handlers, new decorator format
Lordfirespeed Aug 30, 2024
f8b7665
refactor: qr codes handlers, new decorator format
Lordfirespeed Aug 30, 2024
61c1cda
refactor: teams handlers, new decorator format
Lordfirespeed Aug 30, 2024
19b9e55
refactor: user handlers, new decorator format
Lordfirespeed Aug 30, 2024
1df590f
partial refactor: users routes/handlers
Lordfirespeed Aug 30, 2024
1d40767
chore(deps): remove unused `crypto-js`
Lordfirespeed Aug 30, 2024
fdc7868
refactor: users routes new decorator format
Lordfirespeed Aug 30, 2024
6625bd2
style: fix format/lint errors in users handlers
Lordfirespeed Aug 30, 2024
c9c26ef
style: prefer named exports and camel case variable names
Lordfirespeed Aug 30, 2024
db68a72
style: use `type` for type imports, use `node:` import prefix
Lordfirespeed Aug 30, 2024
472d407
rename `model_enums` to `model-enums`
Lordfirespeed Aug 30, 2024
2448b2e
begin migration from `config` to `zod-config`
Lordfirespeed Aug 30, 2024
0704f14
replace all usages of `config` with `@server/config`
Lordfirespeed Aug 30, 2024
1e6c76d
delete sequelize :smiling_imp:
Lordfirespeed Aug 30, 2024
91cb090
remove `.env` file
Lordfirespeed Aug 30, 2024
60c4578
clean up database schema & re-initialize database
Lordfirespeed Aug 30, 2024
6c39fa2
move `@server/database/prisma` to `@server/database`
Lordfirespeed Aug 30, 2024
6d486d6
use inverted `.gitignore` for `server`
Lordfirespeed Aug 30, 2024
ad43bed
rename `QrCode.user` to `QrCode.creator`
Lordfirespeed Aug 30, 2024
49e0bc7
rename some relation names; re-initialize database migrations
Lordfirespeed Aug 30, 2024
624b901
add `unique` constraint to qrcode payload column
Lordfirespeed Aug 30, 2024
cbde5f4
we do some :sparkles:prisma migration:sparkles:
Lordfirespeed Aug 30, 2024
3768924
chore(deps): bump prisma
Lordfirespeed Aug 31, 2024
67a45d6
fix some inconsistencies in prisma schema
Lordfirespeed Aug 31, 2024
f595fda
we perhaps migrate the team routes to prisma
Lordfirespeed Aug 31, 2024
c9717ab
rename `megateam.area` -> `megateam.areas`
Lordfirespeed Aug 31, 2024
0976abe
rename "point.point_id" to "point.pointId"
Lordfirespeed Aug 31, 2024
53dffc1
correctly map `megateam.megateamName`
Lordfirespeed Aug 31, 2024
8a3d3aa
chore(deps): bump `tsx`
Lordfirespeed Aug 31, 2024
a81c37a
we migrate *everything* to prisma (with some todos ...)
Lordfirespeed Aug 31, 2024
1ea8977
remove extensionless from `start` command
Lordfirespeed Aug 31, 2024
1f039b6
prefer otterhttp to express
Lordfirespeed Sep 1, 2024
08aa72a
swap out `127.0.0.1` for `localhost`
Lordfirespeed Sep 1, 2024
3f7f115
configure top-level `App` instance to trust proxies on localhost
Lordfirespeed Sep 1, 2024
0eee48a
chore(deps): remove unused
Lordfirespeed Sep 1, 2024
8e799c9
style: run `check:fix`
Lordfirespeed Sep 1, 2024
7e8fb14
chore(deps): add `@keycloak/keycloak-admin-client`
Lordfirespeed Sep 1, 2024
4654d3c
start working through todos
Lordfirespeed Sep 1, 2024
d33bb15
fix: trust `loopback`, not `localhost`
Lordfirespeed Sep 1, 2024
1c26177
add `request.userTokenSet` and `request.userProfile`
Lordfirespeed Sep 1, 2024
5363dd6
require `refresh` query parameter to force a team name refresh
Lordfirespeed Sep 1, 2024
9fd8965
slightly monster refactor for the client side
Lordfirespeed Sep 1, 2024
6a07c7c
use pnpm for client package
Lordfirespeed Sep 1, 2024
06bd55a
don't set query param to empty value
Lordfirespeed Sep 1, 2024
683b1a6
fix: check `!=`, not `==`
Lordfirespeed Sep 1, 2024
0d61651
re-implement the auth decorators
Lordfirespeed Sep 2, 2024
f87ba2a
handle failed auth on `GET /points`
Lordfirespeed Sep 2, 2024
7624953
tweak `UserRole` definition to match keycloak group paths
Lordfirespeed Sep 2, 2024
f301627
don't use `select` and `include` in the same prisma query
Lordfirespeed Sep 2, 2024
06ee9d5
appropriately redirect to `/volunteer` on login
Lordfirespeed Sep 2, 2024
4bd3173
use uuid v7
Lordfirespeed Sep 2, 2024
ccb8f20
chore: remove completed todo
Lordfirespeed Sep 2, 2024
9e8aded
implement some keycloak data-fetching stuff
Lordfirespeed Sep 2, 2024
4fb243d
fix: reject users that are not hackers or volunteers
Lordfirespeed Sep 2, 2024
883ae77
fix: allow 0 for 'first' query param
Lordfirespeed Sep 2, 2024
0e905b3
feat: properly paginate the user list
Lordfirespeed Sep 2, 2024
321943a
fix: don't validate csrf tokens for new sessions
Lordfirespeed Sep 2, 2024
8e08382
add index on `userId` to `TokenSet`
Lordfirespeed Sep 2, 2024
15af3e3
map `areaId` to `area_id`
Lordfirespeed Sep 2, 2024
94e405f
tidy up migrations
Lordfirespeed Sep 2, 2024
21278f6
add `SessionRecord` model
Lordfirespeed Sep 2, 2024
a6775c5
change `sessionRecordId` to `String` type
Lordfirespeed Sep 2, 2024
6cd7115
make `SessionRecord.expiresAt` nullable
Lordfirespeed Sep 2, 2024
54d6c22
chore(deps): bump `@otterhttp/session`
Lordfirespeed Sep 2, 2024
46b0bce
implement production-ready session store
Lordfirespeed Sep 2, 2024
137eb6b
fix join codes; fix team member names on team page
Lordfirespeed Sep 3, 2024
08145ad
add `assert()` and a todo
Lordfirespeed Sep 3, 2024
5984688
style: `check:fix`
Lordfirespeed Sep 3, 2024
b2ea637
prefer consistent `data` to resource-specific key
Lordfirespeed Sep 3, 2024
6be00ba
implement `useMegateamsContext()`
Lordfirespeed Sep 3, 2024
2b8d8cf
rename `DurhackSessionRecord` -> `MegateamsSessionRecord`
Lordfirespeed Sep 3, 2024
b9ed873
fix: type `SessionData` more strictly for `set`
Lordfirespeed Sep 3, 2024
9fa9531
fix indent
Lordfirespeed Sep 3, 2024
b446934
remove hardcoded url
Lordfirespeed Sep 3, 2024
97b0e14
remove comment from next.js docs
Lordfirespeed Sep 3, 2024
ea9fc40
Fix sign out logo import
JacobWrenn Sep 3, 2024
dfb1940
Merge branch 'joe/speedrunning' of github.com:ducompsoc/durhack-megat…
JacobWrenn Sep 3, 2024
6c51645
use site config for API url
Lordfirespeed Sep 3, 2024
65c61b9
chore(deps): bump `next`
Lordfirespeed Sep 4, 2024
3bed21f
prefer `next/constants` to `node:process`
Lordfirespeed Sep 4, 2024
b3ea0d1
chore(deps): bump @types/node
Lordfirespeed Sep 4, 2024
eef2861
style: re-group imports
Lordfirespeed Sep 4, 2024
298ab43
remove @ts-expect-error DefinitelyTyped/DefinitelyTyped#70289
Lordfirespeed Sep 4, 2024
2c2824a
Fix teams page
JacobWrenn Sep 4, 2024
78a109e
apply configuration changes from keycloak & some production defaults
Lordfirespeed Sep 23, 2024
92c49c5
fix reference to renamed `hostname` config key
Lordfirespeed Sep 23, 2024
725526f
add `access via` to startup message
Lordfirespeed Sep 23, 2024
29fd588
Update default.ts
Lordfirespeed Sep 23, 2024
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
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,21 @@ server {
proxy_set_header Connection "upgrade";
}

location /socket.io {
proxy_pass http://127.0.0.1:3101$request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location / {
proxy_pass http://127.0.0.1:3100$request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
Expand Down
Loading
Loading