Commit Graph

38 Commits

Author SHA1 Message Date
Kristaps Fabians Geikins a9266333b4 fix(fe2): preview images being cached for too long (#2399)
* fix(fe2): preview images being cached for too long

* allowing caching of error previews

* updating cachebust value earlier
2024-06-19 16:26:35 +02:00
Kristaps Fabians Geikins c7fdc6acc2 chore: updating ws everywhere to resolve SNYK-JS-WS-7266574 (#2385)
* chore: updating ws in various ways

* puppeteer upgrade

* updating codegen deps

* workspaces cmd update

* various extra fixes

* minor preview-service troubleshooting improvements

* dockerfile fixes

* hopefully fixing docker build fe2

* try again

* try large again
2024-06-18 13:26:01 +03:00
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00
Kristaps Fabians Geikins 19fcdfcdf6 feat(fe2): optimizing preview image loading for a better LCP score (#2178)
* feat(fe2): optimizing preview image loading for better LCP

* added requestIdleCallback polyfill

* feat(fe2): load previews directly w/o blob urls

* enabling direct previews & improving image caching/preloading

* minor extra optimization

* hydration mismatch fix
2024-04-01 15:03:28 +03:00
Kristaps Fabians Geikins 37d51072fb feat(server): resource limits on app tokens (#1959)
* WIP new mutation arg

* limited resource token creation done

* token resource rule creation validation

* updated authorizeResolver implementation

* introduced resource access rule checks in authorizeResolver everywhere

* more checks added

* updated projects resolvers

* updated stream resolvers

* more checks added

* error page theme resolution fix

* WIP testss

* more tests

* implemented checks in REST auth pipeline

* REST API coverage & tests

* some tests fixed

* test fixess

* added tests

* feat(server): new automation result reporting scope (#1976)

* feat(server): new automation result reporting scope

* tests fix
2024-01-19 18:14:49 +01:00
Gergő Jedlicska c2085d6b13 Hotfix/2.17 (#1955)
* gergo/apolloQueryDuration (#1949)

* add apollo query duration

* feat: add more details to apollo query logging

* fix: pr review

* feat: format log messages as clef (#1950)

* fix(logging): pinoClef log levels must be a string

* chore(fe2): reducing log level for some spammy req logs

* minor adjustment

* more robust path resolution

* better req log text

* feat(fe2): improved and more thorough logging to help with observability (#1948)

* better req log text

* minor improvements to server logging

* WIP FE2 req logging

* FE2 apollo operation logging

* undid apolloPlugin changes due to Gergos PR

* seq message templates introduced

* fix: request logs (#1964)

* fix: request logs

* chore: remove comments

* feat: add graphql subscription metrics (#1970)

* optimized preview msg resultListener

* fix(server): locking to avoid postgres notification listeners processing the same message multiple times (#1972)

* fix(server): locking to avoid postgres notification listeners processing the same message multiple times

* optimized locking

* minor cleanup

* msg update

* log level adjustments

* reduce failsafe expiry

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems>
2024-01-17 16:39:33 +01:00
Gergő Jedlicska 8f6ec4a025 refactor(server scopes): use constants for stream reviewer role 2023-07-26 14:14:17 +02:00
Gergő Jedlicska bb5778bf2d refactor(server scopes): use constants for streams read scopes 2023-07-26 13:09:34 +02:00
Kristaps Fabians Geikins b02a07e2b6 feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03:00
Iain Sproat 0652af4033 fix(server): preview REST endpoint shall return 403 not 500 if no permissions (#1443) 2023-03-09 12:11:40 +00:00
Iain Sproat 6bc6446170 fix(logs): previews not found is a warning, not an error (#1371)
- the preview service may not yet have generated the preview as this takes some time
2023-02-15 12:21:28 +00:00
Kristaps Fabians Geikins d9b1fce95e fix(server): preview endpoint OPTIONS CORS settings not being set (#1274) 2022-12-15 11:31:13 +02:00
Kristaps Fabians Geikins c19815f914 feat(server): permissive CORS settings for preview service endpoints (#1273) 2022-12-15 10:25:31 +02:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat a537d34dcc Rate limit all endpoints (#1213)
* Demonstration of bug to test when middleware added
- Adding middleware, even no-op, causes test to fail

* Make middleware async, but introduce delay.
Revert test back to original.

* Revert tests

* Add a 1ms sleep to the test to reduce likelihood of flakiness

* Rate limiting on all express endpoints using middleware

* Adds all configuration for existing rate limited endpoints

* It is helpful to add the package to yarn first

* Implements respectsLimits using Redis rate limiter

* Fix for test `Should rate-limit user creation`
- if rate limit error, post to `/auth/local/register` will return a 429 status code

* All rate limiting provided by new ratelimiter.ts

* Consolidate typescript interfaces

* Amend signature of function to require source to be passed in, and not try to guess it from the request

* Rename respectsLimits to isWithinRateLimits

* Throw within catch of Promise

* Replace rejectsRequestWithRatelimitStatusIfNeeded throughout code

* Sending rate limit response should deal with other types of error
- Sentry notified of the error

* Express middleware rate limits by a 3 second burst or a daily rate
- Provide action when generating 429 response

* Prevent DOS of Redis

* Add 'Retry-After' for all cases when responding with 429 status code
- default of 1 day, but dynamic based on available information

* Generate rate limiters once, on init
- Improved and consistent handling of exit from functions
- fixed environment variable names

* WIP Refactor rate limiting setup

Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>

* WIP: fixed references, now runs but tests fail

* Use getSourceFromRequest where possible

* WIP: unit tests for rate limiter

* Unit tests for ratelimiter

* feat(IFC): WIP IFC parser improvements

* Revert "feat(IFC): WIP IFC parser improvements"

This reverts commit 093089a2c4.

* refactor authz, rate limiting middleware to global

Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>

* invites tests fix

* fix(server ratelimiter): export public interfaces

* Unit test for rate limiter use in memory rate limiter
- in memory rate limiter is configured with zero limit by default

* Fixed #1219 (#1221)

* WIP: improve auth test for rate limiting user creation

* ci(circleci config): publishing was broken when main branch was tagged (i.e. for releases) (#1224)

* Gitignore CPU profiles

* All tests are  now passing locally

* Fixed an issue in the frontend which was causing the views not to work. Fixed an issue with object selection camera animation where the dolly lerp factor was much too high for smooth animation (#1225)

* feat(structured logging): implements structured logging for backend (#1217)

* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others

* Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)

This reverts commit 84cb74e8b3.

* Move error to core/errors
- augmented typescript types moved to type-augmentations

* Added a missing wait in the screenshot generation loop (#1228)

* refactor(server rest api): remove duplicate rate limit requests

* feat(server rate limits): increase rate limits for the upload endpoints

* chore(server rate limits): final cleanup

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Iain Sproat <iainsproat@users.noreply.github.com>
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
Co-authored-by: Alexandru Popovici <alexandrupopoviciioan@gmail.com>
2022-11-29 17:06:11 +01:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00
Gergő Jedlicska 908bbfb937 Gergo/file imports hotfix (#1025)
* fix(server): fix 'speckle:error(s)' mismatching naming

* fix(frontend): add mtl as documented file import format, fix missing computed prop

* fix(fileimports): specklepy operations.send shouldn't use local cache for sending

fixes #1017

* obj import skip using default cache
2022-09-23 13:20:53 +02:00
Kristaps Fabians Geikins b966f20fdb refactor(server): typescript support (#874)
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-08-04 14:21:39 +02:00
Dimitrie Stefanescu 404eea12e9 fix(server): removes console.logs 2022-05-25 15:17:25 +01:00
Dimitrie Stefanescu 174ce64004 feat(frontend): animated preview images
changes:
- preview service generates full 360 images now
- preview image component loads on hover
- preview image component backwards compat with non-360 image angles
- adds optional angle arguments in all preview routes & removes superflous route
2022-05-22 11:50:07 +01:00
Gergő Jedlicska bd543ed38e refactor(server): completely remove app-root-path package 2022-05-03 15:36:18 +02:00
Gergő Jedlicska 0ac118e05c (refactor) server for less app-root-path 2022-05-03 13:10:00 +02:00
Matteo Cominetti 8b7f539427 feat: removes matomo & changes some CI/CD settings (#670) 2022-04-06 15:58:05 +03:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Gergő Jedlicska d53df11f77 style(server): fix all eslint errors and break the tests 2022-03-31 14:18:44 +02:00
Gergő Jedlicska 569b4688fa style(all): reformat with print width 88 2022-03-29 19:46:49 +02:00
Fabians aa5e94d640 chore: reformatting everything with prettier 2022-03-29 17:12:31 +03:00
Cristian Balas a77d1a052b previews cache control (#579) 2022-02-07 14:52:18 +02:00
Cristian Balas 7cfa85a627 other lgtm fixes (#571) 2022-02-02 15:30:25 +02:00
Cristian Balas 80a74503e5 updating deps and fixes (#498) 2021-12-14 11:49:19 +02:00
Cristian Balas 0b439d1b16 preview images: detailed errors (#375) 2021-08-11 01:25:54 +03:00
Cristian Balas 330389b3b2 stream previews ignore globals branch, og overlay fixed (#345) 2021-07-19 17:50:48 +03:00
Cristian Balas 0fb22deda9 previewService detect browser page crash, added postprocessing option in server preview endpoint (#344) 2021-07-19 12:19:35 +03:00
Cristian Balas 0768e172cf new preview endpoints (#323) 2021-06-30 11:44:20 +03:00
Cristian Balas 93edc65f66 Object Preview service 2021-04-29 15:11:22 +03:00