Commit Graph

4652 Commits

Author SHA1 Message Date
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
Dimitrie Stefanescu c8a629f7cc Merge pull request #1235 from specklesystems/alex/orthographic
Orthographic Mode with working comment bubbles
2022-12-01 15:00:01 +00:00
AlexandruPopovici a5d05faae6 Merge branch 'main' into alex/orthographic 2022-12-01 16:14:22 +02:00
Dimitrie Stefanescu d0acdcb334 Merge pull request #1208 from specklesystems/alex/bvh
BVH Integration and Section Plane Outlines
2022-12-01 14:11:53 +00: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 341c5e2145 Merge branch 'alex/bvh-poche' into alex/bvh 2022-11-30 13:10:08 +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
Iain Sproat 6bfcc35777 ci(circleci config): publishing was broken when main branch was tagged (i.e. for releases) (#1224) 2022-11-24 15:18:18 +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
Dimitrie Stefanescu 82af820a7c feat(ifc): fix file id propagation for ifc parser 2022-11-23 22:14:31 +00:00
Dimitrie Stefanescu d61f566b96 Merge branch 'main' into dim/ifc-v2 2022-11-23 22:00:48 +00:00
Dimitrie Stefanescu ca9d8d8515 feat(IFC): making gitguardian happy, removed my localhost access token 2022-11-23 21:57:20 +00:00
Dimitrie Stefanescu 44f2af2a2e feat(IFC): reverts path to temp output 2022-11-23 21:50:54 +00:00
Dimitrie Stefanescu 2b0e4a7dd5 feat(IFC): adds file id and parsing time to root commit object 2022-11-23 21:26:26 +00:00
Dimitrie Stefanescu 16c989e43c feat(IFC): WIP IFC parser cleanup 2022-11-23 21:00:51 +00:00
Dimitrie Stefanescu 9ac75eecd8 feat(IFC): WIP IFC parser improvements 2022-11-23 19:53:21 +00:00
Dimitrie Stefanescu 1ba31ee372 Revert "feat(IFC): WIP IFC parser improvements"
This reverts commit 093089a2c4.
2022-11-23 19:20:16 +00:00
Dimitrie Stefanescu 093089a2c4 feat(IFC): WIP IFC parser improvements 2022-11-23 18:55:06 +00:00
AlexandruPopovici 19c162fb56 Fixed an issue where outdated outline instances were still rendered from the buffer. Limited the instance count to latest update, and limited the update range of the buffer as well 2022-11-23 12:15:43 +02:00
AlexandruPopovici eb1baf3eca Commented out waiting for progressive AO convergence 2022-11-22 16:48:25 +02:00