Commit Graph

59 Commits

Author SHA1 Message Date
Aurora Lahtela 8116063e62
Whitelist bounce gathering (#3511)
* Store bounced whitelist logins

* Add allowlist bounce endpoint

* Restore locale file indent from master branch

* Add UI for allowlist

* Update locale

* Fix sonar detected bug and implement database tests

Affects issues:
- Close #2233
2024-03-10 10:25:42 +02:00
Aurora Lahtela 2daf3943b7 Make call-site for SQLite JVM wait more accurate
Affects issues:
- #3436
2024-02-17 09:06:45 +02:00
Aurora Lahtela e041e193fc Close transaction queue after connection wait on SQLite
Affects issues:
- #3436
2024-02-11 15:47:39 +02:00
Aurora Lahtela 5061439d14
1623/access control (#3173)
* Add web authorization permission based on groups
  * Access and parts of website are limited by permissions
* Add group management in /manage page
  * Higher level permissions grant lower level permissions similar to Sponge
* Add command /plan setgroup, which uses plan.setgroup.other permission
* Add command /plan groups, which uses plan.setgroup.other permission
* Add more navigation based on permissions
* API modifications
  * User#hasPermission now returns true if user has parent permission in the tree
  * ResolverService#registerPermissions and ResolverService#registerPermission methods for adding new permissions
* Update locale with new lines
* Various unrelated fixes to CSS and code

Affects issues:
- Close #1623
2023-08-20 11:56:13 +03:00
Aurora Lahtela 2d739572ab Fix Repository URLs used for SQL driver downloads 2023-05-06 10:38:12 +03:00
Aurora Lahtela 720cf4374e Correct MySQL charset and collation encoding if they're wrong
Affects issues:
- Close #2293
2023-04-06 18:58:42 +03:00
Aurora Lahtela 9622f6a614
Disable BadAFKThresholdValuePatch 2023-01-06 23:06:17 +02:00
AuroraLS3 bf63b29f72 Set bad join address ids as unknown 2022-12-29 20:54:23 +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 e7afb243f9 Changed "Database can't keep up with transactions" to less dire message 2022-11-20 20:01:04 +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 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 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 b646e18c68
Fix fabric join address gathering (#2546)
- Refactored player online listeners to move common. often changed logic to common package
- Changed method fabric uses to get join address to use the client handshake packet which has the address
- Added command `/plan db removejoinaddresses {server}` to allow removing invalid join address data
- Changed build pipeline to always build jars even if tests fail
- Disabled one flaky test

Affects issues:
- Closed #817
- Fixed  #2526
2022-08-14 20:35:32 +03:00
Aurora Lahtela 92910d647a Revert API jar to Java 8 and update to Java 11 APIs 2022-06-18 11:31:53 +03:00
Aurora Lahtela 0538cea8be Fix issue where Plan holds server enable if database is slow
Affects issues:
- Fixed #2356
2022-05-26 09:44:55 +03:00
Aurora Lahtela 24e955e428 Drop ThrowawayTransactions if database queues over 500 transactions.
This should reduce the likelihood of out of memory crashes due to slow database write performance.

Affects issues:
- Close #1963
2022-05-26 08:40:01 +03:00
Aurora Lahtela 62f06b4901 Prevent further transactions from executing if FatalDBException occurs
Affects issues:
- Fixed #2365
2022-05-21 09:58:07 +03:00
Aurora Lahtela 52b8afe6cb Store join addresses separately and link to plan_sessions table for time data.
Affects issues:
- #2362
2022-05-20 19:32:00 +03:00
Aurora Lahtela 8bbbde4556 Fix registering plan_user row if missing when required
There was one error code for MySQL that used wrong message context to detect the missing user_id properly.

Wrote tests for all the extra functionality ensuring no exceptions occur.

Affects issues:
- Fixed #2361
- Fixed #2343
2022-05-14 11:00:34 +03:00
Aurora Lahtela c1c2814971 Remove dangling user and server data when patching database to prevent errors
Affects issues:
- Fixed #2335
- Fixed #2333
2022-04-17 09:28:26 +03:00
Aurora Lahtela 69c54fb5cb Fix some issues with data registering for new users 2022-04-11 19:08:05 +03:00
Aurora Lahtela b74e338721
Query optimizations (#2320)
* Optimized network ping table query
* Removed icon id selection subqueries

- Take the icon ID into memory when the icons are stored

* Fix typos in the optimized ping table query
* Optimize server ping table query
* Attempt to optimize /v1/servers tps data query
* Optimize ping and geolocations tables uuid -> user_id foreign key
* Prevent Plan from crashing if patching takes too long

- HikariCP auto commit was true for some reason even though all transactions have commit mechanism built-in.
- The setting was reset during connection recreation and that could cause an index out of bounds error.

* Reduce try-nesting in ExecStatement
* Use user_id and server_id instead of uuid for plan_world_times table
* Use user_id and server_id instead of uuid for plan_sessions and plan_user_info table
* Fix more issues and test queries used by Query Filters
* Use deferRender for data tables to load data into the table faster
* Swap uuids to user ids for query page filters

Fixes an issue where SQL is too big to execute

Affects issues:
- #2196
2022-04-09 20:52:29 +03:00
Aurora Lahtela 604bfd9e67 Add Plan version to /plan servers
Affects issues:
- Resolve #2245
2022-04-07 18:24:40 +03:00
Risto Lahtela 856d5f57e7 Don't close driver class loader during disable
Affects issues:
- Fixed #2274
2022-02-12 22:59:14 +02:00
Risto Lahtela a8e6ef2944 Add support for table row formats and hex color codes
- Table rows are now formatted with chat colors by default if § character is in them.
- Hex color codes §x§f§f§f§f§f§f are now supported by chat color to html translator.

Affects issues:
- Fix #2220
2022-02-02 17:36:20 +02:00
Risto Lahtela a7478645bd Reduce the amount of tasks used for upkeep
- Ping gathering now uses a map of timestamps
  - Removes a task that waited for ping data to be reliable (one task / join)
- Cookie expiration now uses a map of timestamps
  - Removes a task that waited for cookie to expire (one task / login cookie)

Affects issues:
- Possibly fixed #1984
2022-01-06 15:43:48 +02:00
Henri S efd3b75a29
Database Driver downloading (#2144)
Affects issues:
- Fixed #1944
2021-10-31 13:16:47 +02:00
Risto Lahtela 322ec3c57c Solved some issues with Tebex extension
- Sorting of values
- Sorted out package names being weird
- Make sortable over 10 entries
2021-04-27 18:32:32 +03:00
Risto Lahtela ad85679899 Fixed reserved keyword being used for a column name
row_number is apparently a function in MySQL.
2021-04-23 15:33:54 +03:00
Risto Lahtela 9ccbda0ebd Use exceptionally instead of handle in SQLDB
The wrong method was in use for error handling completable future
2021-04-23 09:01:59 +03:00
Risto Lahtela 1a19ec85f6 Hide player tables from server page with a special field
- values_for differentiates between different table server and player tables
  It is an INT field because Groups might get their tables at some point.

  0 for player
  1 for server
  (2 for group)

Affects issues:
- Fixed #1722
2021-04-20 10:34:10 +03:00
Risto Lahtela a8716e533e Rewrote transactions for storing extension table data
Affects issues:
- Possibly fixed #1522
- Possibly fixed #1838
2021-04-16 16:28:03 +03:00
Risto Lahtela 2c8bbc80d8 Added a wait for SQLite to finish queries before closing the connection
Also:
- Transactions now execute as much as possible on the same connection instead
  of getting a new connection
- More shutdown messages when waiting for things (Like SQLite queries, or db transactions).

Affects issues:
- Possibly fixed #1814
2021-03-24 14:00:08 +02: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 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 e1bffbcc1f
Swap Abstract Plugin Framework for Platform Abstraction Layer library (#1787)
Replaced Abstract Plugin Framework with Platform Abstraction Layer

Large amount of changes due to removal of features from the library,
and change of the way the abstraction is achieved.
Removes features from Plan:

    Removed debug logging (Considered useless when debugging issues)
    Removed /debug page (Considered useless when debugging issues)
    Removed enable timing (Benchmarking utility was removed from the library)
2021-03-09 11:36:07 +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 9b692480da Patch proxy server detection
- Added a field is_proxy to plan_servers
  - Patch to populate the new field
  - Field is set to true when proxy enables to fix any broken data
  - Allows any name for a proxy
- Updated server save queries
- Changed isProxy method in Server.java to match the change
- Changed query for fetching the proxy server

Affects issues:
- Close #1678
2021-01-01 11:26:07 +02:00
Risto Lahtela 7420e46df2 Fixed SonarCloud code smells
- Redundancies:
  - MySQLDB: Removed null check
  - DeathEventListener: Removed warning suppression
  - several Test classes: Removed public class identifier
  - Unused private fields
- Constructors of abstract classes should be protected x31
- Added missing Parameterized types x2
- "throws" declerations for runtime EnableException
- Prevented Boxed Boolean from causing NPE in the future x15
- Renamed lesser scope variables that were hiding variables x12

- Some smaller ones that I was too tired to write down
2020-11-05 23:16:01 +02:00
Risto Lahtela d21fd5e813 Fixed a backup related database exception
- Backup closed database before the database executed index creation
  leading to an error
2020-10-06 10:59:52 +03:00
Risto Lahtela 460a0e110f Attempt to reduce load when lock wait timeout is exceeded
- Delay is dynamically adjusted if the exception occurs again
- The transaction is attempted again

Affects issues:
- Possibly fixed #1546
2020-08-12 14:07:45 +03:00
Risto Lahtela fef717cd33 Database open failure now disables the plugin
Affects issues:
- Fixed #1394
2020-08-12 13:27:42 +03:00
Risto Lahtela 93dc1bbb9e
Added more context to errors (#1450)
* Improved Extension errors
* Removed scary reflective operation exception
* Additional context to SQL Exceptions
* Added error context to Listeners
* Added error context to most error logging places
* Ignore cyclomatic complexity of DBOpException

Adds context to almost all error logging situations, except those where it is unknown, or to commands that are being refactored on another branch.

Close #1245
2020-05-15 12:20:29 +03:00
Risto Lahtela e53b9f1602 Replace ErrorHandler usage with ErrorLogger
This was done to get deprecation to show up where context is not
given to the error logger.
2020-05-14 16:57:29 +03:00
Risto Lahtela 6b4db32244 Fixed issues in Litebans extension
- Fixed softdepend on Spigot
- Fixed #1355, did not prevent further mistakes like this.
2020-05-07 10:58:45 +03:00
Risto Lahtela ea2ae5d3e1 Linked web users to players or console
PageExtension API:
- Added WebUser#getUsername
- Changed WebUser#getName to return player's name or 'console'
- API version 5.1-R0.4
2020-05-03 23:26:01 +03:00