Commit Graph

4652 Commits

Author SHA1 Message Date
Iain Sproat 7fe41b1fb2 perf(Docker images): production images are based on distroless (#899)
- perf(server, webhook-service): production images are based on distroless

Reduces image file size by >40% for images which can use distroless base image.  As
well as improving boot-up & restart time (via smaller download & load size), Distroless reduces the
attack surface area by removing almost all binaries & packages (e.g. shell, chown) that are not
necessary to run node.

- ensures distroless node images run tini
- removes fonts-dejavu-core and fontconfig from speckle-server
- Remove man and doc files if they exist
- args hoisted to top of Dockerfile and consolidated
- env vars consolidated to prevent additional layers

address https://github.com/specklesystems/speckle-server/issues/883
2022-08-16 16:17:07 +01:00
AlexandruPopovici eb87ef8509 Another husky test 2022-08-16 17:38:29 +03:00
AlexandruPopovici 2b4b898f73 Merge branch 'main' into viewer-redux-integration 2022-08-16 17:37:47 +03:00
AlexandruPopovici 17a018559f Test husky 2022-08-16 17:35:27 +03:00
AlexandruPopovici 8a5611434a Forgot to add the RTL uniforms to the colored material 2022-08-16 17:02:05 +03:00
Iain Sproat 49fdd818ce docs(helm chart): values.yaml is documented and json.schema provided (#932)
* docs(helm chart): values.yaml is documented and json.schema provided

Helm Chart values.yaml file is documented with inline comments.  These have been used to generate a
README (in the helm repo) and a values.json.schema file.

fixes https://github.com/specklesystems/speckle-server/issues/887
fixes https://github.com/specklesystems/speckle-server/issues/867
2022-08-16 14:41:34 +01:00
Gergő Jedlicska 259e8ec829 fix formatting caused by accepting changes on the github UI 2022-08-16 14:59:25 +02:00
AlexandruPopovici 813cd51788 Fixed conflicts, fixed an issue with updating materials for RTL 2022-08-16 15:49:30 +03:00
Gergő Jedlicska 43596e4509 refactor(server authz): refactor authz module to TypeScript (#907)
* refactor(server authz): refactor authz module to TypeScript

* improved roles types

* Update packages/server/modules/shared/errors/base.ts

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>

* refactor(server authz): fix PR comments

Co-authored-by: Fabians <fabis94@live.com>
2022-08-16 14:45:13 +02:00
Fabians 09564e6473 made viewer not reactive 2022-08-16 14:20:33 +03:00
Dimitrie Stefanescu d53fe6b930 WIP: debugging commit for fabians 2022-08-16 13:21:00 +03:00
Dimitrie Stefanescu 39cc8ac382 feat(viewer): viewer intergration 2022-08-16 11:36:34 +03:00
Dimitrie Stefanescu c88488c326 feat(viewer): integration work (very WIP) 2022-08-16 11:36:11 +03:00
Dimitrie Stefanescu ec91f36cfc feat(viewer): integration work (very WIP) 2022-08-16 10:30:54 +03:00
Dimitrie Stefanescu 1badaa9177 feat(viewer): integration work (very WIP) 2022-08-16 09:51:12 +03:00
Iain Sproat ca1a612a29 feat(helm chart): serviceAccounts are provided for each service (#922)
ServiceAccounts for each service do not mount service account token (which allows access to the
kubernetes API), and limit the secrets each user of the service account has access to.

Fixes https://github.com/specklesystems/speckle-server/issues/859
2022-08-15 16:24:34 +01:00
Iain Sproat 35e2652714 feat(helm chart): node affinities, tolerations etc. are configurable (#926)
* feat(helm chart): node affinities, tolerations etc. are configurable

Kubernetes operators should be able to configure Speckle to be deployed on certain nodes based on
rules they provide.  This commit allows affinity, nodeSelector, tolerations, and
topologySpreadConstrains to be provided by the operator.

fixes https://github.com/specklesystems/speckle-server/issues/861
2022-08-15 16:04:50 +01:00
Iain Sproat da7dafe819 fix(fileimport service): s3 is not required by fileimport service (#924)
Fileimport service retreives blobs via the server storage API, and not directly from s3.  Fileimport
service no longer requires information or credentials about s3.
2022-08-15 15:49:10 +01:00
AlexandruPopovici 8b2559759f Removed log 2022-08-15 17:31:38 +03:00
AlexandruPopovici 023a26c6a0 Fixed conflicts 2022-08-15 17:11:57 +03:00
Iain Sproat 19b59fa4d8 fix(frontend): frontend revert security context to prior permissions (#929)
Frontend could not chown within a rw emptyDir
2022-08-15 14:56:26 +01:00
AlexandruPopovici 52d37a3b83 Merged 2022-08-15 16:13:53 +03:00
Iain Sproat 5972e6b42a fix(frontend): frontend currently cannot run as non-root (#928)
Nginx needs to bind to port 80 which requires root permissions
2022-08-15 15:13:44 +02:00
AlexandruPopovici d35e321c15 Forgot to muliply with the batch's world transformation in the rte shadow matrix 2022-08-15 16:11:21 +03:00
Peter Grainger 72d27b9a7c Allow save object to S3 in different region (#910)
* Allow save object to S3 in different region

* feat(helm & docker-compose): adds S3_REGION to helm chart & docker-compose

Explicitly adding the environment variable to deployment configuration files provides system operators with documentation of its existence.

Set to empty by default, which will result in the default value being used.

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2022-08-15 14:24:30 +02:00
Iain Sproat 0084102d0d feat(helm chart): network policies are provided for all services (#909)
* feat(helm chart): network policies are provided for all services

Network policies are used to deny arbitrary egress and ingress to a pod, providing more security
hardening.

Fix https://github.com/specklesystems/speckle-server/issues/860

* NetworkPolicies for remaining services

* Network policies are configurable but enabled by default

* fix to naming

* Use named port

* Helper function for defining redis egress

* Network policy is more tightly defined to port for service if fqdn

* if an IP is provided for redis, postgres, or blob storage, egress is limited to that IP

* Note about limitations

* Simplifies networkpolicy logic by requiring variables to be provided in values.yaml

* default disable networkpolicy, otherwise end users will have to provide all the additional values and that could become confusing
* supports dependencies being deployed within the same cluster

* Disable network policies by default

* Ensure the host name does not contain a port

* Exclude (likely) kubernetes IP ranges from allowed egress

* Add explicit ingress to the server from fileimport and test

* disable test networkpolicy if test is disabled

* Allow egress to sentry
* remove access to s3 from preview service
* remove access to redis from fileimport service

* Allow prometheus ingress to metrics endpoints

* tightens ingress by restricting to the prometheus pod in a single namespace

* Limit ingress on the server to the nginx ingress controller and prometheus

* Limit ingress to frontend to just the nginx ingress controller

* Fileimport does not require s3
2022-08-15 14:23:14 +02:00
Iain Sproat fb5631bd32 feat(helm chart): prometheus monitoring namespace and release name should be configurable (#914)
* feat(helm chart): prometheus monitoring namespace and release name should be configurable

Currently Speckle assumes prometheus is deployed in the 'speckle' namespace and is deployed as a
release named 'kube-prometheus-stack'.  This commit introduces non-breaking changes that allow
custom values for these to be provided, defaulting to the current assumed values if they are not
provided.

fixes https://github.com/specklesystems/speckle-server/issues/863

* Fix serviceMonitor so that it can find services in a different namespace

* Namespace selector is not required if the default namespace is being used
2022-08-15 14:21:01 +02:00
Iain Sproat 65a00dca2e feat(helm chart): add SecurityContext to pods and containers (#917)
* feat(helm chart): add SecurityContext to pods and containers

Speckle pods should run with minimal privileges and capabilities to function.

Fix https://github.com/specklesystems/speckle-server/issues/857

* Update securityContext for all pods

* frontend runs as nonroot and readonly root filesystem

- set fsgroup for all pods with volumes

* Frontend requires write directory at /etc/nginx/conf.d

* Allow openresty log directory to be writable

* feat(helm local test): add test container into the make script

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-08-15 14:20:19 +02:00
AlexandruPopovici f43f8d7174 #827 Fixed the issue with shadows and distant objects 2022-08-15 15:17:28 +03:00
Iain Sproat 6cbe32d8cd GitHub template update (#921)
* fix(pull request template): pR template should be the default and not an option
  - PR template was in a directory which allows selection using queries.  The PR template should be
provided by default so should be renamed and placed in the .github directory.
  - Remove obsolete template
2022-08-15 10:33:27 +01:00
Dimitrie Stefanescu e15d53a7c4 hack(viewer): allow for loading assets load with data urls (data:img/png...) 2022-08-15 08:56:44 +03:00
Dimitrie Stefanescu a300ac4385 Merge branch 'alex/viewer-redux' into dim/viewer-redux 2022-08-14 10:55:42 +03:00
Dimitrie Stefanescu ff37cf8e1d Merge branch 'alex/viewer-redux' into dim/viewer-redux 2022-08-14 10:52:35 +03:00
AlexandruPopovici 7ebd96fe44 Fixed an issue where filtered objects were incorrectly ignored by the section planes 2022-08-12 17:15:08 +03:00
AlexandruPopovici 28989a622c #Integration: Added OVERLAY filter material type. Changed the SELECT filter material color to speckle blue. Fixed amn issue where some materal colors weren't linear 2022-08-12 17:07:47 +03:00
AlexandruPopovici 66cd68077d #Integration: Implemented getViews and setViews at viewer API level. They still use the old 'way of working' but changing that will be trivial, since views are now part of the world tree liek everything else. Implemented canonical views, implemented screenshot. All of these are controllable from the sandbox for testing 2022-08-12 16:34:04 +03:00
AlexandruPopovici 3e194deb15 #Integration Added view3D parsing to the world tree and render tree 2022-08-12 15:07:37 +03:00
Dimitrie Stefanescu e8891a8d2e feat(viewer): wip FE<>Viewer 2022-08-12 14:32:25 +03:00
AlexandruPopovici 98c02f7f5f Worked on making shadows work properly with RTE. More complicated than originally thougth 2022-08-12 14:32:11 +03:00
Dimitrie Stefanescu e360d8f61d feat(viewer): wip first pass at integrating FE & viewer. 2022-08-12 11:15:48 +03:00
Gergő Jedlicska 5535197a48 gergo/pre commit (#906)
* Adds hadolint as pre-commit

* Addresses all hadolint comments

* Hadolint docker works when entrypoint explicitly provided

* Use noninteractive apt-get frontend and clean after install

* build(circleci): filters for pre-commit should be same as for test-server

* remove cache prefix as not currently necessary due to pre-commit-config.yaml changing

* build(circleci): enable remote docker for pre-commit

* build(circleci): use speckle pre-commit runner with built-in hadolint

* build(server): dockerfile RUN statements are consolidated

Each RUN statement in a Dockerfile creates a new layer.  Hadolint rule DL3059 suggests they should
be consolidated.

* build(server): dockerfile RUN statements are consolidated

Each RUN statement in a Dockerfile creates a new layer.  Hadolint rule DL3059 suggests they should
be consolidated.

* Improve husky bash script to catch errors

* Integrates pre-commit with husky

* pre-commit should now be run by husky on every commit
* pre-commit which requires additional installed dependencies is moved to separate file

* Update README for revised developer instructions

* Updates pre-commit yarn script

* refactor(pre-commit): make everyone happy with loosly integrating husky and pre-commit scripts

* chore(clean up pre-commit configs): clean some more pre-commit mess

* chore(pre-commit): run pre-commit in ci too

* fix(husky pre-commit): fix ci build husky invocation, the script is not commited to git

* fix(circleci config): install yarn packages for linting in pre-commit

* fix(pre-commit): fix shellcheck disable comment placement

* fix(pre-commit): add shellcheck ignore

* fix(pre-commit husyk): fix shellcheck ignore version

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2022-08-11 13:49:47 +02:00
Dimitrie Stefanescu 76e179ab08 Merge branch 'main' into dim/viewer-redux 2022-08-11 13:50:44 +03:00
Dimitrie Stefanescu ac0339871d Merge branch 'main' into dim/viewer-redux 2022-08-11 12:12:15 +03:00
Kristaps Fabians Geikins 0427f5cfd1 feat(server): new base email template + implementation for invites emails (#903)
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2022-08-11 11:00:01 +03:00
AlexandruPopovici 03defca1a8 827 Added RTE to points and point clouds. Fixed an issue with point coulds where if the object had a render material with a black diffuse color it would make all the point cloud black, regardless of the vertex colors. 2022-08-10 14:33:20 +03:00
Iain Sproat 8585347a6f fix(circleci): branch names should be sanitised (#908)
Branch names are being used for docker tags.  Docker tags only accept ascii letters and digits,
underscore, period and dash.  This changes sanitised branch names to conform to this.
2022-08-10 10:38:15 +02:00
Iain Sproat c4394ddab9 Chore(pre-commit): Adds helm lint to pre-commit hook (#852) 2022-08-09 15:19:45 +01:00
Iain Sproat 427050a15d chore(pre-commit): Add shellcheck to pre-commit hook (#850)
* chore(pre-commit): adds shellcheck
* Resolves shellcheck linting issues in existing files
2022-08-09 15:00:51 +01:00
AlexandruPopovici 24a2f20973 A small improvement to the line width marching part of the line shader. This helps a bit with situations where we have to draw 0.00Xmm width lines 2022-08-09 16:26:05 +03:00
Iain Sproat 1c5964fc41 Add Hadolint to pre-commit (#848)
* Adds hadolint as pre-commit step
* Addresses all hadolint comments
  * Use noninteractive apt-get frontend and clean after install
  * dockerfile RUN statements are consolidated to prevent additional layers
  * installed packages have pinned versions
* build(circleci): use speckle pre-commit runner with built-in hadolint
* Integrate pre-commit with husky bash script for git pre-commit hooks
  * catches errors in bash
  * if pre-commit is installed, it is run
  * if optional additional binaries are installed, further pre-commit steps are run
* Update README with revised developer instructions
* Adds a pre-commit yarn script
2022-08-09 13:47:02 +01:00