Commit Graph

300 Commits

Author SHA1 Message Date
Aurora Lahtela
776fa3327f Fixed issues with peak player count query optimization 2023-02-13 18:23:38 +02:00
Aurora Lahtela
226bc20e3f Speed up /v1/network/servers by 66%
Benchmark: endpoint (fetchPeakPlayerCount is the highest contributor)
- Before: 10 seconds (1s * server count)
- Before: 3 seconds (332ms * server count)
2023-02-12 10:37:52 +02:00
Aurora Lahtela
09279cbb66
React html customization / public_html folder (#2862)
* Add public_html folder, configuration and access methods to it
* Make Frontend BETA static resource resolution prefer public_html
* Add resolver for getting any file in public_html from webserver
* Test customized bundle loading from public_html
* Update gradle wrapper to 7.6
* Wrote scripts to React build or run dev server through gradle
* Disable cyclomatic-complexity check on PublicHtmlResolver
* Throw bad request exception on IllegalPathException
* Throw bad request exception on bad chars in URI query
2023-02-05 12:08:29 +02:00
Aurora Lahtela
63350a4fea Fix PlayerTableRowPatch is applied check 2023-01-22 14:31:10 +02:00
Aurora Lahtela
88b4191f6b
Implement http caching (#2840)
* Implement first response parts of http caching
* Implement cached response for static resources
* Implement HTTP caching for json responses
* Fix last seen value for online players
* Implement http caching for pages (.html)
* Use placeholder cache even with async requests.

Affects issues:
- Close #2813
2023-01-22 10:18:14 +02:00
Aurora Lahtela
0bce7880cd Add support for getting last modified date to Resource
- Use AssetVersions.yml for jar files
- Use File#lastModified for regular files
2023-01-21 15:03:29 +02:00
Aurora Lahtela
d3be0e9f89 Optimized server latest join addresses query
Original benchmark: 19 seconds
Improved benchmark: 150 milliseconds
-> 120x faster
2023-01-21 12:47:13 +02:00
Aurora Lahtela
dda7199a1a Fix more sonar smells 2023-01-20 22:54:54 +02:00
Aurora Lahtela
9e11d9f484 Removed untrusted data from exception messages in case they end up on the webpage 2023-01-15 10:04:10 +02:00
Aurora Lahtela
f20a04809c Test against and identify path traversal vulnerability in other methods 2023-01-15 09:30:30 +02:00
Aurora Lahtela
38785a9505 Added Untrusted-annotation to be more careful around user given data
- Fixed SQL-injection vulnerability in an endpoint
- Fixed XSS on Whitelist deny 403 page
- Fixed XSS on Internal Error 500 page if untrusted data ends up in exception message
2023-01-14 23:25:35 +02:00
Aurora Lahtela
bd85f10c55 Fix customized resource lookup Path Traversal vulnerability
Affects issues:
- Fixed #2830
2023-01-13 23:23:12 +02:00
Aurora Lahtela
5ba6e0dc9f Fix concurrency issues with json cache and database 2023-01-07 11:45:58 +02:00
Aurora Lahtela
9622f6a614
Disable BadAFKThresholdValuePatch 2023-01-06 23:06:17 +02:00
AuroraLS3
8e88b3a9a6 Make undefined join address id guesstimate based on existing data 2022-12-30 13:26:53 +02:00
AuroraLS3
a8dbc3288e Fix checkstyle 2022-12-29 21:06:52 +02:00
AuroraLS3
bf63b29f72 Set bad join address ids as unknown 2022-12-29 20:54:23 +02:00
AuroraLS3
d0030fc6e3 Fix BadJoinAddressDataCorrectionPatch 2022-12-29 20:31:23 +02:00
Aurora Lahtela
626d63a87d Optimized BadJoinAddressDataCorrectionPatch using INSTR 2022-12-20 19:32:09 +02:00
Aurora Lahtela
0fdd12e61f Patch bad join address data if it is in database 2022-12-18 21:32:08 +02:00
Aurora Lahtela
9e44000d21 Fix setting boolean parameters dynamically
Affects issues:
- Fixed #2784
2022-12-14 19:33:44 +02:00
Aurora Lahtela
f6d8b618eb Fix checkstyle 2022-11-25 16:01:03 +02:00
Aurora Lahtela
022a690446 Implemented parameterized array Sql generation
This bit of code allows passing lists of data in parameterized queries,
which is useful for defining WHERE x IN (?,?,?,?) in a dynamic way.

- Adds AccessControlTest cases for a valid /v1/query call
2022-11-23 17:31:04 +02:00
Aurora Lahtela
ce3f2cde6d Fix SQLITE_CONSTRAINT_NOTNULL when request uri is null 2022-11-21 12:19:02 +02:00
Aurora Lahtela
e7afb243f9 Changed "Database can't keep up with transactions" to less dire message 2022-11-20 20:01:04 +02:00
Aurora Lahtela
bacde53781 Fix RemoveUsernameFromAccessLogPatch applying every time 2022-11-20 19:56:32 +02:00
Aurora Lahtela
a4a1001a8d Display new player name as light green in kills tables
Affects issues:
- Close #1262
2022-11-13 15:49:32 +02:00
Aurora Lahtela
1ec6fc913a Add top_player_kills_{n} and _value placeholders
top_player_kills_day_{n}
top_player_kills_day_{n}_value
top_player_kills_month_{n}
top_player_kills_month_{n}_value
top_player_kills_total_{n}
top_player_kills_total_{n}_value
top_player_kills_week_{n}
top_player_kills_week_{n}_value

Affects issues:
- Close #2697
2022-11-13 15:00:46 +02:00
Aurora Lahtela
38774867f7 Made query page display some results
Fixed Activity group filter
2022-11-12 10:39:20 +02:00
Henri Schubin
2ac2cb89c3
Fix scope of mixin, exclude junit provided by json-simple, correct dependency download failure logging (#2695) 2022-10-30 12:02:29 +02:00
Henri Schubin
96a14a24f5
Component DataExtension API (#2686)
* Component DataExtension API

* Finish up component extension data, add react-mcjsonchat library to the react dashboard in preparation for the rewrite

* Update Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionComponentData.java

* Update Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/ExtensionsDatabaseTest.java

* Update Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/providers/gathering/DataValueGatherer.java

Co-authored-by: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com>
2022-10-29 08:23:16 +03:00
Aurora Lahtela
d3a8176e72 Fix strict group by issues in PlayerCountQueries 2022-10-22 14:26:51 +03:00
Aurora Lahtela
428a0c5fde Began work on Query page
- Implemented the view time range selector input fields
- Fixed geolocation filter query returning more options than supposed to
2022-10-15 15:41:57 +03:00
Aurora Lahtela
ccc6861df6 Fix typo in extension tab icon query
Affects issues:
- Fixed #2608
2022-09-25 11:21:44 +03:00
Aurora Lahtela
0a14d17d7a Fixed issues related to MySQL ONLY_FULL_GROUP_BY
MySQL breaks GROUP BY syntax of standard SQL, and allows arbitrary columns with aggregate functions.
The ONLY_FULL_GROUP_BY stops this, instead raising an error. Since the SQL was originally designed
with this mode on, restricting the SQL broke the code in a few places.

Adding the extra group by clauses solves the issue without effecting query results.

These issues will be caught by MySQLTest in the future, since the issues could be reproduced by
enabling ONLY_FULL_GROUP_BY mode.

Affects issues:
- Fixed #2619
2022-09-25 10:30:13 +03:00
Aurora Lahtela
b68e41bbbe
Bugfixes to build 1951 (#2607)
* Remove SecuredRedirectHandler from Jetty

* Fixed extension values not updating on PLAYER_LEAVE

* Fix Join Address data-truncation errors

Affects issues:
- Fixed #2606

* Tests for join address truncation
2022-09-13 08:52:46 +03:00
Aurora Lahtela
1e1687d83c Retry when failing to store join address in storeAllSessionsWithKillAndWorldData
Another transaction may have run before this transaction that stored the same join address.

Affects issues:
- Possibly fixed #2601
2022-09-12 07:55:34 +03:00
Aurora Lahtela
7a51633690 Implemented network page join address tab
- Made it possible to toggle stack/side-by-side join addresses
2022-09-10 10:45:03 +03:00
Aurora Lahtela
ead1b401bc Created a benchmark utility 2022-09-07 15:49:53 +03:00
Aurora Lahtela
cb21c45ea9 Visualize join address / day in React server page
Join addresses were missing

- Implemented new group visualizer that allows viewing group data as column/bar/pie/table
- Implemented latest join address pie on server page (was missing)
- Implemented join addresses per day graph on new Join addresses tab
- Made playerbase overview use the group visualizer

Affects issues:
- Close #2362
2022-09-05 16:56:59 +03:00
Aurora Lahtela
2c233a0d21 Fix typo in previous commit 2022-09-04 19:23:33 +03:00
Aurora Lahtela
30c1a860e3 Log warning if driver download fails
Affects issues:
- Close #2592
2022-09-04 19:21:30 +03:00
Aurora Lahtela
4c2bf7bd52 Tests for join address case preservation
- Fixed one issue where player page showed out of date join address
2022-09-04 19:06:19 +03:00
Aurora Lahtela
813abd040a Add 'Data_gathering.Preserve_join_address_case' setting (default false)
- Allows preserving case information of gathered join addresses
- Only affects future data
2022-09-03 12:15:54 +03:00
Aurora Lahtela
cbc880c1d3 Improve database error messages
- Don't log "database is closed" when query tries to execute after database close
- Log better error help when mysql fails to connect

Affects issues:
- Fixed #2499
2022-09-02 18:49:36 +03:00
Aurora Lahtela
aaec5eda8b Add since tags and remove some internal deprecated code 2022-08-31 12:48:20 +03:00
Aurora Lahtela
fd6f96be89 Remove usernames from access log table
This is a GDPR liability since the usernames could be linked to the players.
2022-08-28 19:11:51 +03:00
Aurora Lahtela
3eff46523d Test and fix user move and combination transactions 2022-08-27 15:20:23 +03:00
Aurora Lahtela
7b41165af5 Add /plan db migrate_to_online_uuids command 2022-08-21 12:19:52 +03:00
Aurora Lahtela
e41af49544 Add id primary key field to any tables that are missing one
No retrofitting.

Affects issues:
- Fixed #2495
2022-08-16 20:28:27 +03:00