Commit Graph

28 Commits

Author SHA1 Message Date
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 8dccb060c0 Skip javascript translation on React bundle files
Affects issues:
- Fixed #2799
2023-01-22 14:50:42 +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 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 aa897fe8de Implemented support for reverse-proxy subdirectory addresses
Reverse proxied version of React website now works
when subdirectory address is used (eg. /plan/...)

The functionality was unit tested to ensure things work
2023-01-06 14:24:18 +02: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
Aurora Lahtela 3822155b40
Frontend BETA: Rewrite Player page with React (#2312)
* Add extension data to /v1/player endpoint
* Use node gradle plugin for building with yarn
* Add /v1/whoami endpoint
* Add back button to sidebar
* Selenium Tests for locale related js errors
* Convert locale system to use YAML-based storage
* Added a conversion process that runs on startup
* Replace cravatar.eu with crafatar.com for skins (more reliable)
* Add the Header made by Kopo to React

Co-authored-by: Antti Koponen <koponen942@outlook.com>

Affected issues:
- Resolve #1733
- Fixed #1092
- Resolve #1895
- Resolve #1965
- Partial #2260 
- Partial #2099
2022-04-06 17:37:23 +03:00
Risto Lahtela cd5590bb32 Added /errors page for reading error logs 2021-06-13 11:25:15 +03: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
Rsl1122 94c9dd3f95 Username change Rsl1122 -> AuroraLS3 2021-02-13 15:16:03 +02:00
Risto Lahtela 6ff2d68b99 Added a /query page
What currently works:
- Adding filters dynamically
2021-01-29 11:02:33 +02:00
Risto Lahtela 5c49e95c7d Fixed XSS in Internal Error page
Adding a </pre><xss> to an URL that triggered an internal error could be used
to facilitate an XSS attack
2021-01-24 11:15:37 +02:00
FluxCapacitor 01217e43ea
Disallow robots on Plan pages by FluxCapacitor2 (#1601)
Add robots.txt, X-Robots-Tag header, and <meta> tags disallowing spiders from indexing Plan pages.

Affects issues:
- Close #1575
2020-10-12 19:51:25 +03:00
Risto Lahtela ca9a5cee93 Implemented IP Whitelist
Whitelist allows limiting which IP addresses can view the page.

Affects issues:
- Close #1405
2020-06-19 17:25:02 +03:00
Karlatemp f6e6cfcb98
Locale patches by Karlatemp (#1468)
* Fix links getting translated.
* Updated translation of CN locale
* Fix translation of `Plan Wiki, Tutorials & Documentation` not working
* Update contributors
* Nothing wrong?

Affects issues:
- Fixed #1463
2020-05-29 20:39:57 +03:00
Risto Lahtela 3903a266a3
Added Login & Registration pages (#1422)
- Added login.html and register.html
- Added .bg-gradient
- Added logonsine.js for a decoration.
- Added /login, /register, /auth/login, /auth/logout and /auth/register endpoints
- Redirects to /login if cookie not present with auth enabled.
- Basic login functionality using cookies
- Registration page allows new kind of registration that doesn't log passwords on console.
- Fixes a bug with stippets that blocked any cross-plugin modifications (PageExtension API)
- Fixes a typo with css snippet code that made the css not apply (PageExtension API)
2020-05-02 23:31:29 +03:00
Risto Lahtela 90064d3f33 Stop brute force counter increase on no user/pass
Also removed RequestInternal from use.

Affects issues:
- Fixed #1393
- Fixes random issue where 403 is shown after
  one bad password input and successful login.
2020-04-13 17:53:30 +03:00
Risto Lahtela 38bb2ce61c Added ResponseBuilder#setContent(WebResource) 2020-03-20 22:26:03 +02:00
Risto Lahtela 4fd19bbc5e Removed PlanFiles#getCustomizableResourceOrDefault 2020-03-20 22:26:03 +02:00
Risto Lahtela aca9d22e1f Applied theme to pages properly
New utility UnaryChain:
- Allows writing nested modifications as a chain
2020-03-14 12:40:23 +02:00
Risto Lahtela 77d33c991a Moved NotFoundException to API 2020-03-14 12:40:22 +02: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 a8126f6669 Rename VersionCheckSystem -> VersionChecker 2020-03-14 12:39:56 +02:00
Rsl1122 b5d07de18b Removed unused code 2020-03-14 12:39:55 +02:00