Commit Graph

19 Commits

Author SHA1 Message Date
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 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 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 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 8f239b010c
Add Swagger & Swagger UI (#2470)
* Adds swagger dependencies and annotations for json endpoints for documentation
* Add swagger ui to react project
* Access control to swagger endpoints
* Include swagger.json in jars using custom configuration

Also:
* Reworked project shadow configurations to avoid shadowing shadow versions of modules

Why: Extra dependencies were being included when using shadow scope

What:
- modules no longer depend on shadow configurations,
  which speeds up IDEA indexing after build considerably
  (No need to index *-all.jars)
- 'shadow' scope is now used for artifacts that need to be included
- 'shadow' scope is also 'api' so that modules that depend on common
  can import the libraries. This may cause issues in projects
  depending on Plan so this may need to be reconsidered
- Relocations and exclusions were moved to plugin module
  org.slf4j is now included in 2 locations which may cause issues.
  Needs testing with servers
- Found out that all Extension dependencies include junit as compile
  scope which caused it to be included.

Affects issues:
- Close #1890
2022-07-13 21:21:20 +03:00
Risto Lahtela 13823c044a
Network performance tab (#2009)
* Fixed disk medium threshold not showing color
* Added 'serverName' and 'serverUUID' to optimizedPerformance endpoint
* Added /v1/network/listServers endpoint
* Added /v1/network/performanceOverview?servers endpoint
* Hide negative values from performance graphs
* Allow json cache bypass by not providing timestamp parameter in URIQuery
* Ignore negative values in low tps spike count
* Added (Unavailable with Export) to exported network html performance tab title

Affects issues:
- Close #1693
2021-07-17 12:19:33 +03:00
Risto Lahtela 2bc15db6d0 Sort out player join address things
Applied some thought to how this stuff should work.
- nulls now possible in the column when value is not available
- Called "Join addresses" instead of hostnames
- Remove bogus data with a patch

- Proper hostname method for spigot
- Removed method calls from nukkit since there was nothing that sounded
  proper

Affects:
- Close #1798 (Copied all code over)
2021-03-17 11:31:27 +02:00
Risto Lahtela f1cb5ed071 Added hostname pie to server pages 2021-03-15 17:29:10 +02:00
Risto Lahtela 8f85c23c2f Refactoring: ActiveSession, FinishedSession and ServerUUID
- Split Session into ActiveSession and FinishedSession, replaced their usage
- Replaced UUID with ServerUUID when the data type

Affects issues:
- Close #1746
2021-03-12 18:03:12 +02:00
Risto Lahtela 4da7497d82
Player Hostname PieChart Added (#1679 #1786)
Affects issues:
- Close #783

Co-authored-by: Arnold Hamstra <youtube@minecraftercity.com>
Co-authored-by: Arnold <a_hamstra@hotmail.com>
2021-03-09 10:01:09 +02:00
Rsl1122 94c9dd3f95 Username change Rsl1122 -> AuroraLS3 2021-02-13 15:16:03 +02:00
Risto Lahtela 36ff87abf2 Made UnitSemaphoreAccessLock use a while loop to check condition 2021-02-12 09:39:29 +02:00
Risto Lahtela b5365d2321 Cache graph responses 2021-02-10 13:11:14 +02:00
Risto Lahtela ccd492c052 Reduced the performance graph size
Reduced resolution of data:
- Last 30 days: Full resolution (1 per minute)
- Last 60 - 30 days: 1 per 5 minutes
- 60+ days old: 1 per 20 minutes
Effect:
- Reduced /v1/graphs?type=performance size from 21 MB to 9.15 MB (126k rows in database)

Added new endpoint /v1/graphs?type=optimizedPerformance that doesn't parse series separately
- Sends a single array of arrays instead of one array for each series
  - Added a parseDataSeries to graphs.js that translates the data
Effect:
- Reduced from 9.15 MB to 3.35 MB
- Moved some workload to the browser

Affects issues:
- Fixed #1622
2021-01-24 17:40:30 +02:00
Risto Lahtela a6c286b0f2 Prevented a future accidental XSS vulnerability in Graph type selection
The type parameter was passed to an exception that is currently turned into
json, but in the future the way this exception is handled could have changed.
2021-01-24 11:15:37 +02:00
Risto Lahtela fb2bf97cc6 Implemented a Hour by Hour graph
- Unique players, New players per hour

Affects issues:
- #1232
2020-05-15 21:48:35 +03:00
Risto Lahtela 68be3117b1 Moved BadRequestException to API
Changed Bad Request response to JSON:
{
    "status": 400,
    "error": "message",
    "target": "/requested/target"
}
2020-03-14 12:40:21 +02:00
Risto Lahtela c204ce9b1b Fixed some code smells & bugs 2020-03-14 12:40:19 +02:00
Rsl1122 b5d07de18b Removed unused code 2020-03-14 12:39:55 +02:00