Commit graph

1071 commits

Author SHA1 Message Date
Miodec
b8cc17a12b chore: upgrade typescript version 2024-01-31 12:36:13 +01:00
Jack
0751375ab6
refactor: shared types (miodec) (#4978)
* rework shared types

* revert one small change
2024-01-29 15:53:42 +01:00
Jack
ee629db5b5
build: enable noUncheckedIndexedAccess compiler rule (Miodec) (#4958)
* added rule to backend and fixed all the errors

* setup frontend and start fixing some warnings

* more fixes

* fixes

* fixes

* fixes

* more refactoring

* fixes

* pain

* more pain

* ouch

* mooore

* 10 hours later

* ugghhh

* another one

* last element can be undefined duh

* smol one

* absolute typescript gigachad

* moooore fixes

* chart stuff

* almost done

* its... done

* remove console log

* use for of instead
2024-01-29 13:27:36 +01:00
Miodec
f099ccfe3b fix: email enumeration vulnerability 2024-01-24 13:09:45 +01:00
Miodec
6ef1d165fd chore: fix tests being broken because of the new lint rules 2024-01-22 15:07:00 +01:00
Miodec
33d0812019 build(backend): enable more ts flags 2024-01-18 23:33:50 +01:00
Miodec
abbe77b01b build(backend): enable noPropertyAccessFromIndexSignature flag 2024-01-18 23:24:33 +01:00
Miodec
e1dcd29419 build: add ts compiler flag 2024-01-18 23:20:44 +01:00
Miodec
a41e241297 fix: removed non profane word 2023-12-18 12:13:30 +01:00
Christian Fehmer
b3ae78f413
perf: improve leaderboard aggregation (fehmer) (#4841)
* perf: improve leaderboard aggregation

Update the leaderboard and public speedStats directly in mongodb without importing the data in the nodejs process first

* Replace type on public collection with magic ids
2023-12-06 16:03:44 +00:00
Christian Fehmer
9e991f3641
test(leaderboard): add test coverage for leaderboard update (#4840) 2023-12-05 14:40:34 +00:00
Wisam Abbadi
962fbc8ae1
impr: remove non-profane word (#4828) 2023-12-05 13:43:31 +00:00
Christian Fehmer
050cb7ab8a
perf(leaderboards): better index and aggregation code (fehmer) (#4836)
* perf: Improve leaderboard performance by adding better index

* review comments

* Allow aggregation to use disk if needed
2023-12-05 13:42:14 +00:00
Christian Fehmer
84dfa7aca9
impr(server): add header validation, allow validation to accept unknown fields (fehmer) (#4824)
* impr: Add header validation, allow validation to accept unknown fields

* review comments
2023-12-04 13:30:13 +00:00
Miodec
fb1ea6c8be refactor: use for instead of forEach 2023-11-30 14:22:23 +00:00
Miodec
a129c98323 chore: testing swapped order 2023-11-30 13:47:36 +00:00
Miodec
6c3cfe0ff4 impr: keep a list of ips that accessed the account
part of #4490
2023-11-30 13:04:36 +00:00
Miodec
25b1ecbe15 impr: reduce number of db calls by adding a caching parameter 2023-11-30 13:04:36 +00:00
Christian Fehmer
3adbdf2cdb
impr: replace body based authorization in dev mode (fehmer) (#4821)
* impr: add authorization header Uid in favour of authorization on with body on dev (fehmer)

* refactor dev mode detection
2023-11-30 12:58:28 +00:00
Christian Fehmer
e426cb3fc2
fix: leaderboards missing raw and consistency (fehmer) (#4822) 2023-11-30 12:13:26 +00:00
Miodec
6f7900a868 refactor: remake aggregate to allow for an index to be added in the future 2023-11-29 16:07:49 +00:00
Miodec
d6f7f77feb refactor: agent log ips can no longer be an array 2023-11-28 15:02:21 +00:00
Miodec
022e8d843f chore: remove more possible false positives 2023-11-27 16:49:53 +00:00
Miodec
924472f77c impr: remove word which isnt really a profanity 2023-11-23 16:47:18 +00:00
Christian Fehmer
1d4d7dab87
feat: Allow more results for premium users (fehmer, Miodec) (#4778)
* feat: Unlimited history for premium users UI

* disable button while loading, show spinner

* optional chaining

* add isPremium to /users, remove check from frontend

* add /results max batch size to configuration

* result batching ui v1

* rename variables, update button based on state, update text

* Return allowed results in /results if limit is partly overshooting the max limit

* use br instead of margin

* let result batches code handle button disabling

* hide title

* limit max width

* hide section when below batch size

* update limit color based on the % of limit used

* bring back loaded bar

* remove unused css

* fix alignemtn

* remove text for now

* add result getting log

* always hiding for non premium users for now

* Add server configuration users.premium.enabled, throw error on /results if premium user exceeds regular limit and premium is globally disabled

* Disable premium feature globally by default

* cleanup open todos

* Don't use premium user max limit on /results if premium feature is disabled on server

* fix merge issue

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-11-20 16:17:20 +00:00
Christian Fehmer
4b3059bdc7
refactor: Import shared types back into MonkeyTypes namespace (fehmer) (#4800)
* impr: Import shared types back into MonkeyTypes namespace, partially reverts #4769

* down to 6 errors

* fixes

* cleanup
2023-11-20 14:56:28 +00:00
Christian Fehmer
e5e03b603f
feat: Allow more results for premium users (fehmer) (#4767)
* wip: More results and filters for premium users

* use offset+limit instead of beforeTimestamp, add configuration for max results for regular/premium users

* add isPremium to /users response

* cleanup

* review comments

* review comments

* update base config

* update premium data type

* add undefined check

* interface name

* add start timestamp

* refactor

* move function to util, rename params, use isFinite

* merge fix

* fixed tests

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-11-10 13:55:35 +00:00
Bruce Berrios
e84f9ec5b7
refactor: add shared types (Bruception) (#4769)
* sharing is caring?

* replace 5 year old package with a more modern one

* ignore firebase config

* update import/resolver settings so that we no longer have to ignore @backend imports

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-11-09 14:03:56 +00:00
Christina Hanson
6b77f81201
feat(funbox): add mode that doubles each letter (LyricLy) (#4771)
* feat: add mode that doubles each letter to funbox

* increase difficulty

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-11-09 13:56:37 +00:00
Miodec
9b8c452064 impr: remove words which might trigger false positives for profanity 2023-11-08 14:37:48 +00:00
Miodec
52ea0a6cbd impr: add local api server configuration cache 2023-11-07 16:34:05 +00:00
Miodec
daaab016e2 impr(account page): add button which hides results on the account graph
when results are hidden, accuracy scale will be maximised to fit the graph height
2023-11-06 15:08:48 +00:00
Christian Fehmer
5ce886677b
docs: fix swagger documentation (fehmer) (#4766) 2023-11-06 13:05:45 +00:00
Christian Fehmer
66417190a4
test(auth): add tests for authentication on public endpoints (fehmer) (#4757)
* chore: add tests for authentication on public endpoints

* add tests for apeKeys
2023-11-03 13:11:44 +00:00
Miodec
78ecdcf91e impr(quick restart): add "enter" as an option to quick restart 2023-11-02 14:07:54 +00:00
Miodec
155537db4b test: lowering this because build is failing at 37.99 😠 2023-10-27 15:47:08 +01:00
Miodec
8942ee2813 refactor: add firebase 500 handling 2023-10-27 14:46:32 +01:00
Miodec
47c8668069 impr: allow low accuracy scores to be submitted if opted out of leaderboards 2023-10-27 14:17:20 +01:00
Miodec
e3ce7b2458 refactor: allow apekeys if endpoint is public
This partially reverts 923f69ab55.
This is because we sometimes still need the decoded token in public endpoints.

If an endpoint doesnt accept ape keys BUT its public, we dont return a 401 error.
2023-10-25 16:00:03 +01:00
Miodec
3f855ae3d1 test: add test for isNameAvailable 2023-10-25 14:33:42 +01:00
Miodec
d5c8f0dafd impr(server): remove discord roles on account reset
closes #4730
2023-10-20 12:38:00 +01:00
Miodec
205b0f8f90 chore: bump nodemon 2023-10-17 12:56:11 +01:00
Miodec
289c81e9fa chore: bump firebase-admin version 2023-10-17 12:53:41 +01:00
Aaron
3a4d8effdb
fix(server): rework 'revoke all tokens' flow (hattorius) (#4717)
* Remove tokens from cache

* Async method not necessary

* Whoops

* Better naming

* smol name change

* uncomment settings section

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-10-16 16:57:14 +01:00
Christian Fehmer
0f6884a5be
impr: detect development mode based on config instead of window.location (fehmer) (#4703)
* impr: detect development mode based on config instead of window.location

* Allow access to /configure on the backend using non-local ip

* Use webpack define plugin

* take BACKEND_URL from env
2023-10-09 18:46:40 +01:00
Miodec
0c3b6e4d8c impr(funbox): rework backwards funbox
closes #4711
2023-10-09 18:07:07 +01:00
Miodec
8e2dff43be chore: add alternative config schema for the transition period 2023-10-02 17:48:37 +01:00
W0LFB0MB
fa01558876
impr(sound): add support for various error sounds (W0LFB0MB) (#4679)
* Add files via upload

* Delete frontend/static/sound/error/triangle.wav

* Delete frontend/static/sound/error/damage.wav

* modified error sound code to support multiple sound options and added two error sound alternatives

* added compatability for previous users of the error sound, converts legacy true/false config values to 1 or off

* fixed opiton names and values in commandline

* fix: auto switch theme behavior & footer theme indicator (#4677)

* fix: auto switch theme behavior & footer indicator

Changing manually to a preset or custom theme now
turns auto switch theme mode off with a notification.
And now the auto switch mode does override the custom
theme as well (statement in settings also updated) if it
is the later one set.
Fixes #4659, that is the footer theme is now correctly
displayed with auto switch themes as well.

* removed unnecessary function

---------

Co-authored-by: Miodec <jack@monkeytype.com>

* fixed off config value

* moved compatibilty code to replaceLegacyValues

---------

Co-authored-by: Sanidhya Singh <sanidhyas3s@gmail.com>
Co-authored-by: Miodec <jack@monkeytype.com>
2023-10-02 16:09:30 +01:00
Miodec
923f69ab55 impr(server): don't return errors for public endpoints when providing authorization 2023-09-26 14:44:45 +01:00
Miodec
89e8fef2b3 feat(funbox): add backwards funbox
closes #4661
2023-09-26 14:36:51 +01:00