Commit Graph

3350 Commits

Author SHA1 Message Date
AlexandruPopovici bf5a74930c HotFix: Default gradient ramp was not getting sent over, messing up the shifted index calculation 2023-01-03 15:21:18 +02:00
Alexandru Popovici 4bce909d19 Fixed #1267 by properly sampling the ramp texels in their centers (#1285) 2023-01-02 16:42:58 +02:00
Alexandru Popovici de2bce89a5 Alex/verbosity and mouse event (#1275)
* Added a verbose flag in the viewer params. Default is false and it's equivalent to the ERROR level

* Piggybacked the original pointer event into the SelectionEvent
2023-01-02 16:23:52 +02:00
Gergő Jedlicska 492afde5f6 gergo/fixBuild (#1277)
* style(server): fix formatting

* fix(preview-service): fix chromium deps in Dockerfile
2022-12-20 12:51:01 +01:00
Dimitrie Stefanescu 3cbd8b4a67 additional null check (#1276)
adds a null check in the traversal func (sketchup hotfix)
2022-12-20 12:02:33 +01: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
Kristaps Fabians Geikins 9245aa6db2 fix(frontend): branch infinite loading (backported from fe2) (#1269) 2022-12-14 17:17:58 +02:00
Kristaps Fabians Geikins 593c63bc43 fix(server): migrating commits, branches, users timestamp precision (#1265)
* fix(server): migrating commits, branches, users timestamp precision

* fix(server): incorrect migration heading
2022-12-13 15:05:19 +02:00
Iain Sproat bcca04c897 If there is no error object, log level should be info not error (#1264) 2022-12-13 12:42:02 +00:00
Iain Sproat 96bed71022 fix(logging): Improves error logging and pretty-prints logs during dev & test (#1255)
* Improves error logging
- use pino error logger correctly by passing in error as first argument

* monitor deployment: Filter logging at INFO level and above
* Use structured logging to create parameters for monitoring results
* Add structured logging to obj fileimport service
* Fileimport service, fix and improve logging
    - use child logger with additional context where possible
    - select appropriate logging level
- fix duplicated context in log statement
* REST endpoints, add context to structured logging and remove same context from message
* Webhook service provides context to bound logger to properly use structured logging
    - Pass bound logger containing context to `makeNetworkRequest`
    - do not log url, as it may contain a secret (like Discord's webhook urls), instead log the webhook Id
     - log error message when network call fails
* upload: make better use of structured logging when recording data
* pino-pretty when in dev or test mode
    - pino-pretty configured to send to stderr
* LOG_PRETTY env var
* Silence structured logging during testing
     - can not rely on determining the port number by reading from stdout/stderr
     - instead we determine which port is free, then create our server on that port
     - we then poll that port until the server is ready before commencing tests
* Allow puppeteer to install chromium
* Do not need to install chromium separately
2022-12-13 09:18:28 +00:00
Jonathon Broughton 14617cd07e Enhancement: Adds Navisworks to the application avatars (#1261)
* Adding Navisworks to the application swatch list

* Short name changed NW to NAVIS
2022-12-12 13:37:32 +01:00
Kristaps Fabians Geikins c095ab4a75 fix(server): access request test flakiness (#1260) 2022-12-09 17:59:07 +02:00
Kristaps Fabians Geikins d0a3f811fe fix(frontend): post-auth redirects fixed (#1259) 2022-12-09 16:12:40 +01:00
Iain Sproat d0828693ff Enable python linting/formatting in pre-commit (#1257)
- fix all the linting/formatting issues
2022-12-09 11:20:45 +00:00
Iain Sproat 0e291bc777 fix(fileimport-service): configure python correctly in distroless fileimport-service (#1258) 2022-12-09 11:03:50 +00:00
Gergő Jedlicska 5626caa30a fix(server): revert distroless for server, it borks intergartion tests for other packages (#1253)
* fix(server): revert distroless for server, it borks intergartion tests for other packages

* style(docker): Iain is pedantic about new lines ()
2022-12-08 12:48:35 +01:00
Iain Sproat d09bce7267 feat(docker images): Distroless (#935)
* Moves speckle-server, webhook-service, fileimport-service, monitoring-deployment, and test-deployment images to Distroless.

Partially addresses https://github.com/specklesystems/speckle-server/issues/883

* preview-service uses similar image for building and production stages
* explicitly include chromium-common dependency to prevent error in preview service
* Bump chromium packages due to package versions not being found
* Handle machine-id in distroless
    - distroless has no shell, so node-machine-id will result in an error
    - this commit introduces error handling and defaults to a uuid v4 in the case of an error
* Update binary location for readiness and liveness checks to match the binary location in Distroless
* Allow node binary path to be set as environment variable in fileimport service
2022-12-07 12:07:42 +00:00
Iain Sproat 28aeb8c442 chore(frontend): bump openresty to 1.21.4.1-4-jammy-amd64 (#1248) 2022-12-06 13:57:01 +00:00
Iain Sproat ee50b32b59 chore(node): upgrades to node 18 (#1189)
* chore(node): upgrades to node 18

Node 16 was out of support (but not security upgrades), so bumping to next stable version.

https://github.com/specklesystems/speckle-server/issues/1187

* Update server liveness and readiness probes for node 18
* Bump web-ifc to 0.0.36
* Apply `--no-experimental-fetch` flag to fileimport-service to prevent issues in web-ifc (via emscripten) with node 18
2022-12-06 12:57:48 +00: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 967329473f '@' shortcut must come after it is configured in bootstrap (#1239) 2022-12-05 15:14:36 +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
Gergő Jedlicska e807ae5fb1 feature(server): bump file size limit to env var 2022-12-02 13:51:27 +01:00
AlexandruPopovici d345b2a2d6 Fixed an issue where the accumulation cycle would not start after toggling orthographic mode due to a dangling flag. Fixed an issue where accumulation would sometimes not start after viewer load 2022-12-02 00:02:25 +02:00
AlexandruPopovici ef7f4b550a Fixed the commnet bubbles issues with orthographic projection, so we can bring it back in the frontend. Also fixed some issues with camera zooming in orthographic mode and the rendering pipeline, and the zoom in animation 2022-11-30 17:03:29 +02:00
AlexandruPopovici cb8815f3e2 Fixed conflicts 2022-11-30 13:16:02 +02:00
AlexandruPopovici 940be3d4c0 Default sandbox stream 2022-11-30 13:09:41 +02:00
AlexandruPopovici 20f9f7dbeb Added outline update on filter end call since geometries can get hidde/shown/ghosted with that action, and the oultines need to reflect that 2022-11-29 23:04:48 +02:00
AlexandruPopovici 8adee87239 Fixed an issue where the section box was not updated after adding a stream 2022-11-29 21:59:49 +02:00
Gergő Jedlicska bc83391c21 fix(fileimports): fix IFC file imports commit message (#1230) 2022-11-29 18:33:54 +01:00
Dimitrie Stefanescu 573a42c16c Merge pull request #1223 from specklesystems/dim/ifc-v2
Improves IFC parsing speed ~30x & captures object psets
2022-11-29 16:47:38 +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
AlexandruPopovici 74d5a84be4 Implemented getting the material used by any triangle index from it's containig batch. This allows us to ignore outlining ghosted/hidden render views when computing the section planes intersection outlines 2022-11-29 15:27:25 +02:00
Alexandru Popovici ddc4e4d17a Added a missing wait in the screenshot generation loop (#1228) 2022-11-29 13:46:18 +02:00
AlexandruPopovici 7fa4ed3fab Added double precision position buffer to the BVH in the most non-invasive way possible. Added RTE to section plane outlines 2022-11-28 23:40:05 +02:00
AlexandruPopovici 6d2664e437 Fixed an issue where the scene bounding box would be incorectly computed because of the BVH helpers and would mess up camera near/far plane 2022-11-28 23:38:30 +02:00
Dimitrie Stefanescu 69c1993f09 feat(ifc): prevents stack overflowing from too many args to array.push 2022-11-27 15:39:58 +00: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
Alexandru Popovici 5ac043ac6a 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) 2022-11-25 16:31:45 +02:00
AlexandruPopovici 664e8dc98a Implemented dynamic resizing of the outline geometry buffers. We start off with a buffer of 10k instances and if that number is exceeded the outline geometry buffers will automatically resize 2022-11-25 15:12:58 +02:00
AlexandruPopovici 6a0b78357e Implemented multi section plane outline generation 2022-11-25 12:42:02 +02:00
Dimitrie Stefanescu 950077dcab Revert "feat(ifc): removes stale comment"
This reverts commit 83d2b2bf25.
2022-11-25 09:05:44 +00:00
Dimitrie Stefanescu 48085bffb4 feat(ifc): some tweaks 2022-11-24 20:10:23 +00:00
AlexandruPopovici 9648514df8 WIP on the capper 2022-11-24 16:41:17 +02:00
Alexandru Popovici 4e23505fed Fixed #1219 (#1221) 2022-11-24 16:33:37 +02:00
Dimitrie Stefanescu 83d2b2bf25 feat(ifc): removes stale comment 2022-11-23 22:25:18 +00:00
Dimitrie Stefanescu 4ca0e19abb feat(ifc): fixes error capture on commit creation 2022-11-23 22:24:15 +00:00