Граф коммитов

283 Коммитов

Автор SHA1 Сообщение Дата
Iain Sproat fad395a292
fix(docker compose): set minimum compose version as '3' (#1677)
- matches the minimum version for our dependencies file ('3')
- healthcheck was introduced in 2.1, and healthcheck.start_period in 2.3, so >=2.3 was minimum
2023-07-10 10:29:10 +01:00
Iain Sproat a0a39bd711
fix(healthcheck): Add a 2 second timeout to the healthchecks (#1674)
* fix(healthcheck): Add a 2 second timeout to the healthcheck http request
* Ensure all error types are caught and the non-zero failure exit code is always 1
2023-07-07 16:22:15 +01:00
Iain Sproat fa36e9e40c
feat(docker compose): healthcheck for speckle-server (#1651)
* feat(docker compose): healthcheck for speckle-server
- if speckle server pod becomes unresponsive (but has not yet exited with a non-zero exit code), it will be automatically restarted after 30s.

* feat(1click): add healthcheck to speckle-server container running in DigitalOcean 1click

* fix(1click): remove command statements
- the docker image is responsible for providing these
2023-06-29 15:55:40 +02:00
Dimitrie Stefanescu 802f3c9924 fix(fe2): newsletter changes 2023-06-22 16:35:49 +01:00
Dimitrie Stefanescu 7962d56530 Merge branch 'main' into dim/fe2/newsletter-registration 2023-06-22 15:42:21 +01:00
Iain Sproat be4e840a80
feat(helm): mailchimp is disabled by default 2023-06-19 10:12:58 +01:00
Dimitrie Stefanescu d98f0fa9f9 feat(server): mailchimp helm chart updates 2023-06-16 15:26:32 +01:00
Iain Sproat 5f6a696def
fix(helm): the ingress should support the maximum file size (#1638) 2023-06-16 12:08:14 +01:00
dependabot[bot] c878cddee2
build(deps): bump requests in /utils/test-deployment (#1588)
Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 11:47:46 +01:00
Iain Sproat ef41620850
feat(helm chart): allow NODE_TLS_REJECT_UNAUTHORIZED to be configured (#1621) 2023-06-13 11:46:13 +01:00
Iain Sproat 811cc3ef9d
feat(helm): allow email from address to be configured via helm chart (#1623) - reported by John Shiangoli 2023-06-13 11:45:30 +01:00
dependabot[bot] 2dd79d52a7
build(deps-dev): bump vite from 3.1.0 to 4.x (#1610)
* build(deps-dev): bump vite from 3.1.0 to 4.x

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 3.1.0 to 3.2.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v3.2.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v3.2.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixing deps

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2023-06-12 16:18:54 +03:00
Dimitrie Stefanescu 7b037352df
Dim/fe2/view changes (#1608)
* Fixed an issue with curves doubling up on geometry and also not being selectable after the last filtering changes. Added the options to make lines transparent. Added lines to diffing

* Points now are diff-able and support proper visual diff-ing. Visual diff filters are now chosen internally by the Differ. Fixed an issue with LineBatch and transparency

* Implemented PLAIN visual diff mode, where all objects keep their original materil, but opacity is manipulated via the diff time. Added API member function to switch between the PLAIN and COLORED visual diff modes

* feat(fe2): diffs wip

* Diffing fixes for instances and blocks. Things seem to be working fine, but there are some caveats. Additionally, some older issues were fixed and diffing now works better on all the rest of the streams

* feat(fe2): de-dupes diff results

* feat(fe2): wip diffs

* feat(fe2): diff transparency goes from 0 to 1

* feat(fe2): diff results display work

* feat(fe2): diff results display work

* feat(fe2): diff panel work

* feat(fe2): diff work: various display changes, coloring toggle, selection logic, selection object display wip

* feat(fe2): diff work: cleaned up old/new version, fixed minor bug in viewer diff time when swapping color mode

* feat(fe2): diff work: implements custom selection logic and selection display for modified objects (they come in pairs now)

* feat(fe2): diff minor fix in selected object display

* feat(fe2): wip; trying to fix diff order to be consistent (ordered by date)

* feat(fe2): wip, broken state right now

* feat(fe2): fixes scrollbars in viewer

* feat(fe2): fixes slider sync with diff time

* feat(fe2): WIP syncs of diffs (threads, refreshes, etc.)

* feat(fe2): diffing polish

* speckle shared fix

* speckle shared fix

* more bugfixes

* linter fixess

* more CI fixes

* fix viewerState serialization

* more linting fixess

* template fixes

* moving tailwind classes to theme package

* migrated away from diffString + simplified postSetup

* moved diff new/old version resolution to use state.resources

* cleanup

* updating url threadId & diff command correctly

* minor improvements to diff state

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2023-06-08 11:26:19 +03:00
Iain Sproat 5361d64e99
Revert "fix(server helm / dockerfile): remove entrypoint from dockerfile (#1605)" (#1606)
This reverts commit bcea709712.
2023-06-02 16:33:26 +01:00
Gergő Jedlicska bcea709712
fix(server helm / dockerfile): remove entrypoint from dockerfile (#1605)
the server helm deployment only overrides if inspect is needed
2023-06-02 16:01:01 +02:00
Iain Sproat e71f382e6a
feat(helm): configure inspect flag for server via helm chart (#1593) 2023-06-01 21:43:22 +01:00
Kristaps Fabians Geikins 2eb5f51af3
feat: dui3 package (#1585) 2023-05-19 16:57:28 +03:00
Iain Sproat b1cbd05683
feat(circleci): adds a new step to ensure Helm Chart documentation is kept in line with Helm Chart (#1574)
* fix(helm): update documentation to match helm chart
* fix(helm): update documentation should not update README in helm repository
* fix(helm): should ensure output schema conforms to prettier requirements
* feat(pre-commit): update helm documentation as part of pre-commit
* feat(circleci): update Helm README when publishing new Helm chart
* fix(pre-commit): need to npm install before using readme generator
2023-05-12 13:26:28 +01:00
Iain Sproat 93179e163b
fix(helm): selector labels for frontend cannot be changed automatically by helm (#1569) 2023-05-08 11:14:12 +02:00
Kristaps Fabians Geikins b02a07e2b6
feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03:00
Gergő Jedlicska 89dccd8495
feat(server): add speckle automate as a configurable default app (#1540)
* feat(server): add speckle automate as a configurable default app

* feat(server): add default automate url, and helm values

* fix default app tests reporting the old number
2023-04-19 12:59:59 +02:00
Andrew Gartrell 0b10fc3a07
Update values.yaml (#1536)
* updated tag to current tag
* dropped "v" prefix which hasn't been used since 2.3.3
2023-04-19 12:57:23 +02:00
Iain Sproat 1515e2fee6
revert(ratelimit): defaults should remain as was prior to `2a35fe6` (#1528)
* Revert "fix(ratelimit): reduce /graphql limit based on incident (#1505)"
This reverts commit 2a35fe6178.
* Revert helm chart defaults to value in code
- fix typo
2023-04-13 15:24:51 +01:00
Iain Sproat 59c0b7ada0
feat(helm): rate limits are configurable via helm chart (#1507)
* feat(helm): rate limits are configurable via helm chart
* Document server.monitoring.mp
* Update schema.json
2023-04-07 15:17:03 +01:00
Iain Sproat aee6de9ee0
fix(helm): network policy should allow egress to analytics.speckle.sy… (#1494)
* fix(helm): network policy should allow egress to analytics.speckle.systems
- previously only allowed DNS lookup

* matchName not matchPattern on analytics.speckle.systems
2023-03-30 14:52:02 +02:00
Iain Sproat ca0c0437f1
Fix network policies (#1491)
* fix(helm): fix logic in networkpolicies to check for existence of object
- object must exist before we can query its parameters
- if the 'mp' object is set and it is explicitly set to 'false' then the endpoint is blocked, otherwise it is allowed.

* fix(helm chart): accessing an unset object in the second part of an and statement breaks helm

* fix(helm): cilium network policy updated to put mp within monitoring object
2023-03-30 11:23:29 +01:00
Iain Sproat 03bc5a4ead
fix(helm): fix logic in networkpolicies to check for existence of object (#1490)
- object must exist before we can query its parameters
- if the 'mp' object is set and it is explicitly set to 'false' then the endpoint is blocked, otherwise it is allowed.
2023-03-30 10:52:03 +01:00
Kristaps Fabians Geikins 5d0fceaaf3
feat: proper sign up tracking (#1489)
* feat: register flag passed to fe

* feat: mixpanel tracking for all sign ups

* feat: utm first touch & last touch tracking

* feat(helm): Allows Environment Variable for MP to be configured
- default is enabled
- renames environment variable to ENABLE_MP

* feat(helm network policy): allowlist analytics.speckle.systems

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-03-30 12:21:59 +03:00
Iain Sproat c461397aa2
fix(helm): schema.json now matches values file (#1445)
- small typo fix to values.yaml documentation
2023-03-10 10:39:26 +00:00
Iain Sproat d3b4310672
docs(helm): schematic diagram in mermaid format (#1358)
* docs(helm): schematic diagram in mermaid format
* Clarifies that dependencies can be external or internal to cluster
* Explicitly show namespace containing secrets
2023-02-22 09:40:30 +00:00
Gergő Jedlicska 40a6701799
feat(server): add switchable admin authz override (#1378)
* feat(server): add switchable admin authz override

* fix(server): make sure tests work with the new admin override

* feat(server authz): make sure to add all requested roles to server admins in admin override mode
2023-02-17 16:31:06 +01:00
Iain Sproat dcf8bcc607
fix(monitor): logging should produce a msg field containing the message (#1363)
python logging produces an event field with the message, but all other loggers produce a msg field.
2023-02-08 15:35:43 +00:00
Iain Sproat 68fd86b754
chore(frontend): use bitnami/openresty as base image for frontend Dockerfile (#1335)
* chore(frontend): use bitnami/openresty as base image for frontend Dockerfile

openresty/openresty was not being patched as frequently as we would like, resulting in numerous
vulnerabilities without resolution. bitnami/openresty is being patched more frequently.

Some additional changes were necessary when porting our frontend between these distributions:
- html files are in /app
- nginx.conf is in /opt/bitnami/openresty/nginx/conf/nginx.conf
- envsubst is not available by default in bitnami/openresty and needs to be copied in
- Nginx.conf - we wrap the server block in http block and overwrite root nginx.conf
    - using the existing bitnami/openresty nginx.conf as a server block alone causes issues with bitnami/openresty, as bitnami/openresty provides a root nginx.conf which conflicts with directives in Speckle's server block
- we copy the directives from openresty/openresty (which are known to work with Speckle's server block), and apply them alongside Speckle's server block. This creates a new root nginx.conf which we can overwrite the default on the image.
- nginx should use a port available to non sudo/root user, we have selected 8080 instead of previous 80
- need to explicitly output nginx logs to stderr / stdout

Created a readonly root file system on Kubernetes. This requires the following changes:
- emptyDir volumes are mounted in kubernetes to allow bitnami/openresty to write to specific locations
- explicitly include and copy mime.types file to nginx configuration directory

Due to the change to non-privileged port number (8080), the following subsequent changes were required:
- Update 1-click deployment script to match frontend at port 8080
- Updates docker-compose-speckle.yaml file

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2023-01-25 19:06:48 +00:00
spgoad 38720cecdc
Feature: Add OpenID Connect Generic Authentication Strategy (#1283)
* feat(server): add OIDC auth strategy

Add an OpenID Connect Authentication Strategy for Speckle Server. Enables configuration of
authentication against an OIDC standard compliant identity provider endpoint.

closes specklesystems#1270

Co-authored-by: spencer.goad <spencer.goad@disney.com>
2023-01-09 13:41:50 +00:00
Gergő Jedlicska e6484f6360
gergo/helmDisableFileUpload (#1281)
* style(server): fix formatting

* fix(preview-service): fix chromium deps in Dockerfile

* feat(helm chart): expose file uploads disable flag in the helm chart

* fix(helm chart): value name fix

* fix(helm): its values

* fix(helm chart): fix always disabled file uploads
2022-12-23 15:42:24 +01:00
Gergő Jedlicska 42ce09e651
gergo/helmDisableFileUpload (#1280)
* style(server): fix formatting

* fix(preview-service): fix chromium deps in Dockerfile

* feat(helm chart): expose file uploads disable flag in the helm chart

* fix(helm chart): value name fix

* fix(helm): its values
2022-12-23 14:59:27 +01:00
Gergő Jedlicska cd61b5b40e
gergo/helmDisableFileUpload (#1279)
* style(server): fix formatting

* fix(preview-service): fix chromium deps in Dockerfile

* feat(helm chart): expose file uploads disable flag in the helm chart

* fix(helm chart): value name fix
2022-12-23 14:55:06 +01:00
Gergő Jedlicska 848d65b0a0
gergo/helmDisableFileUpload (#1278)
* style(server): fix formatting

* fix(preview-service): fix chromium deps in Dockerfile

* feat(helm chart): expose file uploads disable flag in the helm chart
2022-12-23 14:50:46 +01:00
Iain Sproat 170e52cf95
fix(helm chart): liveness probe on webhook and fileimport use distroless node path (#1271) 2022-12-14 19:42:05 +00:00
Iain Sproat 2852789df1
Use estimate instead of count when getting number of rows in table (#1266) 2022-12-13 16:25:13 +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
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 d1494996a1
fix(server:helm chart): fixes readiness probe for server helm chart, path to node was broken (#1254) 2022-12-08 12:19:57 +00: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 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 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 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
Iain Sproat de9beccd22
Helm test is deployed as a job (#1174)
- this allows it to be identified in alerting more easily
2022-11-02 17:16:53 +00:00
Iain Sproat df250d616d
Fixes broken helm template by adding quotation marks around liveness probe command (#1171) 2022-11-02 10:40:03 +00:00
Iain Sproat 0c99573bc6
Fixes liveness and readiness checks to prevent CSRF error message (#1169)
- provides content-type header
- check that status code is 200
2022-11-02 10:01:19 +00:00
Iain Sproat 3d4b3b6979
Pin python requirements and bump to latest versions (#1140)
* Pin python requirements and bump to latest versions
* fix(fileimports): add exception printing to file imports

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-11-01 11:17:03 +00:00
Iain Sproat d755136f19
Upgrade postgres in DO 1click template to 14.5 (#1090) 2022-10-21 09:51:50 +01:00
Iain Sproat c59084f4fd
Upgrades redis to 7.0.5 in circleci & DO 1click configuration (#1087)
* Upgrades redis to 7.0.5 in docker-compose & circleci

* Upgrade redis on minikube to 7.0
2022-10-20 12:53:12 +01:00
Iain Sproat 07f7572c9d
fix(helm chart): fileimport should be deployed if s3 configmap is used (#1129)
Fixes bug where fileimport-service was not deployed if an s3 configmap was used, instead of defining
s3 endpoint etc. in helm chart values
2022-10-19 16:43:12 +01:00
Iain Sproat ba71184421
upgrade development contexts to use postgres 14.5 (#1089)
* Upgrade CircleCI configuration to postgres 14.5

* docker-compose-deps upgraded to postgres 14.5

* Upgrade minikube to use postgres 14.5
2022-10-10 12:04:15 +01:00
Iain Sproat df8c6ccc4f
fix(helm chart): networkPolicy supports distinct namespaces for prometheus pod & servicemonitor (#1086)
* fix(helm chart): networkPolicy supports distinct namespaces for prometheus pod & servicemonitor

Network policy did not allow ingress from prometheus if it was deployed in a different namespace
from the servicemonitor. This PR allows the ingress to be configured to match the operator's
requirements.

addresses https://github.com/specklesystems/gitOps/issues/68

* provides additional validation and error output when getting secrets
* Fix for kubernetes network policies using s3 details from ConfigMap
* Remove blocking of 10.0.0.0/8 range as this also prevents access to cloud provider private IPs
* Update values.schema.json
2022-10-07 11:39:50 +01:00
Kristaps Fabians Geikins 029aabf432
chore: getting rid of unnecessary deployment test (#1083) 2022-10-06 11:45:44 +03:00
Gergő Jedlicska 2aefbd27e1
fix(test-deployment container): fix frontend readiness tests with new vite bundling changes (#1078) 2022-10-05 17:11:13 +02:00
Gergő Jedlicska 393a192940
gergo/emailDigestFixes (#1074)
* feat(server task scheduler): sketch out core task scheduler implementation

* feat(server weekly activity digests): add function lock duration to the weekly digest execution

* feat(server scheduled tasks): add scheduled tasks type definition, db schema and migration

* feat(server scheduled tasks): add scheduled tasks repository

* feat(server task scheduler): add task scheduler service implementation

* chore(server deps): add mocha type definitions

* refactor(server scheduled tasks): refactor scheduled tasks migration

* refactor(server scheduled tasks): refactor scheduled task db schema and type definitions

* feat(server scheduled tasks): implement db side lock acquire

* refactor(server scheduled tasks): refactor task scheduler with lock on query mechanism

* test(server scheduled tasks): add tests for scheduled tasks implementation

* refactor(server weekly activity digests): refactor to new task scheduler implementation

* feat(server weekly activity digest): switch to a 1000 seconds trigger period for testing purposes

* fix(server task scheduler): fix not catching lock acquire function errors

* feat(server weekly digest): switch weekly digest cron trigger to the prod ready value

* fix(nginx configs): fix missing static route proxy to backend

* fix(server email template): fix footer anchor tags not pointing to the right places
2022-10-05 10:09:24 +02:00
Iain Sproat ee7c9f0a0c
feat(helm): s3 configuration can be loaded from configmap (#1048)
* feat(helm): s3 configuration can be loaded from configmap
- Variables for s3's configuration can now be read in from a configmap in the cluster. This allows
deployment tooling, such as Terraform or CloudFormation, to dynamically create an s3 bucket and
create a configmap with the necessary values. This decouples the cluster deployment from the helm
release.
* Update values.schema.json for helm chart
- also include changes from a previous commit that had not been included previously
2022-09-30 10:34:08 +01:00
Iain Sproat 77678ecaa8
feat(helm chart): secrets can be referenced from different kubernetes Secret resources (#1005)
* feat(helm chart): secrets can be referenced from different kubernetes Secret resources

Currently secrets have to be referenced from a single kubernetes Secret resource (default name
'server-vars').  This PR allows each secret to be loaded from a separate kubernetes Secret.  If
values for individual secrets are not provided, it defaults to the previous single kubernetes
resource.  This single kubernetes secret should now be considered deprecated in favour of individual
references.

* Fix error in Redis key

* Fix DNS egress for Redis in CiliumNetworkPolicy

- only give access to optional secrets if the component is enabled

* Values should be empty by default to allow for backwards compatibility
2022-09-21 16:27:05 +02:00
Iain Sproat 9f9f1c381f
Only create configmap for DB certificate if certificate is provided in helm chart (#999)
- otherwise, we should expect the configmap to already be in the namespace
2022-09-09 11:10:46 +01:00
Iain Sproat 23bc801eb0
fix(helm chart): allow egress to auth providers (#970)
* fix(helm chart): allow egress to auth providers
* Increase Azure AD allowlist to match https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-safelist-urls?tabs=public-cloud
* Allows customisation of azure AD domains
2022-08-29 12:10:37 +01:00
Iain Sproat 278da16e53
fix(helm chart server kubernetes network policy): update CIDR for Apollo (#968)
Apollo responded to our support question, they confirmed that 34.120.83.176/32 is sufficient for
egress to usage-reporting.api.apollographql.com
2022-08-26 17:05:32 +01:00
Iain Sproat 5aa00784a6
fix(helm chart): allow egress from server to email server (#966)
Network Policies omitted to allow egress to email.  This commit allows egress to email.
2022-08-25 16:00:34 +01:00
Iain Sproat ab0c60ec57
Helm Chart: Network Policies allow server egress to apollo (#965)
* fix(helm chart): allow egress in server Network Policies to Apollo

The Cilium and Kubernetes network policies currently do not allow egress from the server to Apollo
for graphql monitoring.

Kubernetes Network Policies don't allow domain names.  We have an open support ticket with Apollo
Studio to request which CIDR to limit egress to.  Until then, we will need to open egress to
everywhere if a Kubernetes Network Policy is used.
2022-08-25 15:08:25 +01:00
Iain Sproat d6f6a64630
fix(helm chart): remove unnecessary values from helm chart (#964)
* fix(helm chart): remove unused values from helm chart

Previous commit introduced two additional values that are not being used for s3.  This commit
removes them.

* Looks up domain or IP from secret for redis and postgres

- undertakes a kubectl get on the secret.  The user or service account that deploys helm must have permissions to view the secret.
- fix: matchName for domain instead of matchPattern
- fix: typo in protocol

* Only allow monitoring ingress if monitoring is enabled

* Port can be determine from the provided secret
 - updates values.yaml to only require port for postgres and redis for inCluster endpoints
2022-08-25 10:36:15 +02:00
Iain Sproat b61f0ffabe
Cilium network policies (#954)
* feat(helm chart): deployes Cilium Network Policies when configured

Cilium Network Policies provide more features over regular Kubernetes Network Policies, but Cilium
is not available everywhere.  When selected by an operator, Cilium Network Policies will be deployed
instead of Kubernetes Network Policies.

Fixes https://github.com/specklesystems/speckle-server/issues/913

* Cilium Network Policy for fileimport service.
* tested only for external host.
* Still to test internal pod and external IP.

* Cilium network policy for file import service restricts DNS

* allows egress to service instead of endpoint
* file import service uses service url of speckle-server
* helper functions for server and dns

* DRY the prometheus selector

* CiliumNetworkPolicy for frontend

* CiliumNetworkPolicy for monitoring service

* CiliumNetworkPolicy for preview service

* CiliumNetworkPolicy for test

* CiliumNetworkPolicy for webhook_service

* CiliumNetworkPolicy for Server

* Test should egress to domain, not internally

* Test should be in tests directory to match Helm convention for tests
* Test should explicitly deny ingress from everywhere

* Server needs to egress to canonical domain (i.e. itself)

- DNS and egress for canonical domain added to Server
- As Test also egresses via canonical domain to access Server, we do not require the intra-cluster ingress to the server from the test pod
- Explicitly deny all egress from frontend

* WIP update to schema.json

* Breaking Change: inCluster network policies supported for cilium

* Breaking change: kubernetes network policy podSelector and namespaceSelector are now at a different level
* Updates schema.json

* add notes to remove egress once bug is fixed
2022-08-24 17:25:08 +02:00
Iain Sproat 56d0d54bca
refactor(helm chart): explicitly define the deployment rollout strategy (#963)
Partially addresses https://github.com/specklesystems/speckle-server/issues/925
2022-08-24 17:21:01 +02:00
Iain Sproat 44bd5919f8
Revert "perf(Docker images): production images are based on distroless (#899)" (#934)
This reverts commit 7fe41b1fb2.
2022-08-16 16:42:59 +01:00
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
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
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
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
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
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
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
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
Iain Sproat 81bed0c760
style: at newlines at end of files (#893) 2022-08-08 11:06:56 +02:00
Iain Sproat 3eaf72f830
refactor(helm chart): DRY common labels (#884)
* refactor(helm chart): dRY for some labels

* Metadata for Chart.yaml

* refactor(helm chart): dRY using common selector labels

Able to remove `app` and `project` labels from each template and incorporate into definitions
2022-08-08 11:05:22 +02:00
Iain Sproat 80d9aa0e9f
refactor(helm chart): use named ports where possible (#898) 2022-08-08 11:03:57 +02:00
Iain Sproat a0fe0b8f8a
feat(helm chart): use standard helm labels on all pods and services (#882)
Helm best practices recommend use of standard labels
https://helm.sh/docs/chart_best_practices/labels/#standard-labels

fix https://github.com/specklesystems/speckle-server/issues/864
2022-08-04 14:34:20 +01:00
Iain Sproat 2821f4f243
Helm refactor deployments to separate directories (#877)
* refactor(helm chart): separate each service into a directory
2022-08-04 10:15:10 +01:00
Iain Sproat 57eb9c21f6
Configurable `imagePullPolicy` (#875)
* style(helm chart): define named ports on pods and target them in Services

Named ports improve flexibility and reduce configuration errors

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

* feat(helm): enables imagePullPolicy to be configured by operator

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

* Fix indentation

* Fix broken merge from main
2022-08-04 11:08:17 +02:00
Iain Sproat fd9c891c74
style(helm chart): define named ports on pods and target them in Services (#873)
Named ports improve flexibility and reduce configuration errors

Fix https://github.com/specklesystems/speckle-server/issues/868
2022-08-04 10:53:38 +02:00
Iain Sproat d2a1bf210a
docs(helm chart): include logo 2022-08-03 18:54:09 +01:00
Gergő Jedlicska 8f922dbd62
fix(helm chart): fix not quoted config value (#840) 2022-07-29 12:22:42 +02:00
Iain Sproat 90847e422d
Feat: configurable file limits (#835)
* Feat: configurable file limits

* ci(circleci): container build speed imporvements

* feat(frontend nginx): add file size limit configurability to frontend nginx

* feat(server blobstorage): use the new file size limit customization value

* feat(helm chart): implement the file size configuration in the helm chart

* fix(frontend docker): fix entrypoint script

* fix(server blobstorage): fix env var parsing NaN

* feat(fileimport-service): add customizable import timeout

* feat(helm chart): add fileimport service timeout value to helm chart

* feat(blobstorage): add server side blob storage size limits

* feat(docker-compose): add blob size limit env var to  docker-compose files

* refactor(frontend file uploads): refactor file uploads to use `useQuery`

* refactor(server env helper): move env helper to shared module

* refactor(blobstorage): use env helper for file size limit

* refactor(frontend file uploads): use generated query document

* fix(server blob sotrage): fix file size limit function call

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-07-29 12:00:29 +02:00
Kristaps Fabians Geikins 86c63c29db
feat: adding extra apollo studio env vars to helm chart (#830)
* feat: adding extra apollo studio env vars to helm chart

* made apollo read version from SPECKLE_SERVER_VERSION

* moved from graph_ref to graph_id

* changing up some values
2022-07-19 16:36:16 +02:00
Kristaps Fabians Geikins f046df86ca
feat: helm chart support for apollo studio reporting (#829) 2022-07-18 14:38:16 +02:00
Gergő Jedlicska c894f40f83
minor updates (#817)
* feat(server): add server authz pipeline rework first sketch

* feat(server authz): add new server authz middleware poc implementation

* test(server authz): add unittests for the new server authz workflow

* feat(wip rework of fileuploads vs blob storage): add basim impl of separate blob storage service

* feat(fileimport service): refactored file import service to utilize the new asssetstorage service

* refactor(server errors): refactor server errors to use the shared module definitions

Now all the errors inherit from BaseError

* refactor(fileimport service): cleanup after refactor

* feat(frontend fileimports): use the new blob storage for downloading the original file

* refactor(server fileimports): clean up the remnants of S3 storage from file imports

* refactor(server authz): centralize generic authz pipeline configs

* refactor(server blob storage): refactor / rename everything to use the `blob-storage` name

* ci(circleci): add s3 objectstorage environment variables

* ci(circleci): fix missing env variables

* ci(circleci): add minio test container

* ci(circleci): fix minio app startup

* ci(circleci): enable circleci remote docker

* ci(circleci): fix minio startup

* ci(cirleci): detach and wait properly for minio to start

* ci(circleci): revert to additional minio img config, it only fails when the container is stopped ?!

* ci(circleci): disable file uploads

* fix(fileimports): update with blob storage refactor leftovers

* feat(server blob storage): add blob storage graphql api

* refactor(server errors): merge new errors to shared module

* fix(server comments rte): fix import for RTE error

* chore(fileimports): remove node-fetch from dependency

* chore(server): remove body parser dependency

* fix(server blob storage): fix gql api

* fix(frontend): fix fileupload item not loading the new upload status, cause of premature event fire

* feat(server blob storage): fix file size limit and allow for public streams

* Update packages/server/modules/blobstorage/graph/schemas/blobstorage.graphql

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

* chore(blobstorage): fix PR review issues

* fix(server): fix import bugs

* test(server): blob storage first test

* test(server blob services): add tests for blob storage services

* test(server blob storage): add service and rest api tests

* test(server blob storage): add server blob storage graphql api tests

* feat(server blob storage): store and make available blob fileHash attribute

* feat(server authz): add fatal failure option to server authz pipeline

* test(server authz): add optional stream context checks with tests

* feat(monitor deployment): add shutdown signal handling to monitor deployment container

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-07-04 19:29:45 +02:00
Gergő Jedlicska 1194d4a5b6 fix(helm chart): quote integer value in chart 2022-06-17 09:26:56 +02:00
Gergő Jedlicska d817e6dd0a
gergo/pgTimeout (#805)
* feat(server): add server authz pipeline rework first sketch

* feat(server authz): add new server authz middleware poc implementation

* test(server authz): add unittests for the new server authz workflow

* feat(wip rework of fileuploads vs blob storage): add basim impl of separate blob storage service

* feat(fileimport service): refactored file import service to utilize the new asssetstorage service

* refactor(server errors): refactor server errors to use the shared module definitions

Now all the errors inherit from BaseError

* refactor(fileimport service): cleanup after refactor

* feat(frontend fileimports): use the new blob storage for downloading the original file

* refactor(server fileimports): clean up the remnants of S3 storage from file imports

* refactor(server authz): centralize generic authz pipeline configs

* refactor(server blob storage): refactor / rename everything to use the `blob-storage` name

* ci(circleci): add s3 objectstorage environment variables

* ci(circleci): fix missing env variables

* ci(circleci): add minio test container

* ci(circleci): fix minio app startup

* ci(circleci): enable circleci remote docker

* ci(circleci): fix minio startup

* ci(cirleci): detach and wait properly for minio to start

* ci(circleci): revert to additional minio img config, it only fails when the container is stopped ?!

* ci(circleci): disable file uploads

* fix(fileimports): update with blob storage refactor leftovers

* feat(server blob storage): add blob storage graphql api

* refactor(server errors): merge new errors to shared module

* fix(server comments rte): fix import for RTE error

* chore(fileimports): remove node-fetch from dependency

* chore(server): remove body parser dependency

* fix(server blob storage): fix gql api

* fix(frontend): fix fileupload item not loading the new upload status, cause of premature event fire

* feat(server blob storage): fix file size limit and allow for public streams

* Update packages/server/modules/blobstorage/graph/schemas/blobstorage.graphql

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

* chore(blobstorage): fix PR review issues

* fix(server): fix import bugs

* chore(docker): ignore python venv data for docker build context

* feat(knex): update knex configuration with min max connections and application_name

* feat(helm chart): configure postgres max connections for server in the helm chart

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-06-17 08:38:34 +02:00
Gergő Jedlicska 142219dc4c fix(helm chart): default create namespace to false, it interferes with our deployment setup 2022-05-31 10:24:39 +02:00
Gergő Jedlicska 1c234a86b2
gergo/hotfixes (#785)
* ci(circleci): publish npm packages with the implicit default `latest` tag

* feat(helm chart): add a conditional flag for creating k8s namespace in the helm chart

* fix(server package.json): fix cross-env variable string naming

fix #780
2022-05-30 19:40:20 +02:00
Gergő Jedlicska a4a7cb35b9
feat(fileimports): update container timeout
update timeout in helm chart
2022-05-24 19:14:11 +02:00
Gergő Jedlicska 7d7427671c
feat(helm chart): make sure the helm chart includes the required namespace for the app (#765) 2022-05-24 11:31:39 +02:00
Cristian Balas ebe1571488
deployment monitor fix (#744) 2022-05-06 12:59:54 +03:00
cristi8 0a0fe3cb77 monitoring microservices; new container for overall monitoring of a deployment; helm update; helm local testing 2022-05-05 02:01:00 +03:00
luz paz 915cb0afaf Fix various typos
Found via `codespell -q 3 -S CHANGELOG.md -L doesnt,optio,promisses,tread,usera`
2022-04-15 13:49:46 -04:00
Cristian Balas 5a0632b7a3
auth fixes, k8s fixes (#696) 2022-04-13 17:11:11 +03:00
Fabians abe6d5e086 chore: re-formatted everything with prettier 2022-03-30 12:54:24 +03:00
Cristian Balas 4fdd8457ee
fixed the fileimport service in helm chart (#587) 2022-02-09 13:09:39 +02:00
Gergő Jedlicska 8f07fb6c8b test(helm test, ci): undo the demo damage 2022-01-14 16:08:14 +01:00
Gergő Jedlicska c6f8ea773b test(helm test): borked test again 2022-01-14 15:23:54 +01:00
Gergő Jedlicska cc80ceb53d Merge branch 'main' of github.com:specklesystems/speckle-server into gergo/helmChartTest 2022-01-14 14:29:39 +01:00
Gergő Jedlicska 2b891b96a0 test(helm test): fix intentionally failing helm test 2022-01-14 14:25:21 +01:00
Gergő Jedlicska 622b6f3052 test(helm test): fail again for testing purposes 2022-01-14 14:04:10 +01:00
Gergő Jedlicska 13f065f526 test(helm test): fix helm chart test value reference 2022-01-14 12:38:50 +01:00
Gergő Jedlicska 011e9d52f8 test(helm test): another failing test 2022-01-14 11:39:46 +01:00
Gergő Jedlicska 78c534d6d6 test(helm test deployment): fake test failure 2022-01-14 11:17:08 +01:00
Gergő Jedlicska b037a65aa9 refactor(test-deployment): dockerfile and test script cleanup 2022-01-14 11:07:35 +01:00
Gergő Jedlicska aeadade302 fix(helm chart): fix test pod labels 2022-01-13 22:32:39 +01:00
Gergő Jedlicska fbb42eec38 feat(helm chart): add helm test container to the chart 2022-01-13 22:18:31 +01:00
Gergő Jedlicska 1f52fd2f8a fix test-deplyoment container build context 2022-01-13 20:04:45 +01:00
Gergő Jedlicska 12fcf99425 build(test-deployment): add Dockerfile and CI to test deployment script
For Helm test operations, a test container is needed, this add a container definition and ci steps
2022-01-13 19:44:25 +01:00
Cristian Balas 019b7ac495
Service health (#516)
* health checks, sigterm handling for all services
2022-01-12 15:18:32 +02:00
Cristian Balas 6db0219d91
Helm chart 2021-12-06 14:42:26 +02:00
cristi8 e840060d8a Added FileImport Service to DigitalOcean 1click image 2021-11-05 12:33:09 +02:00
Cristian Balas 0723e70edc
DO 1click: Fix setup.py executable delay at first boot 2021-10-20 13:54:48 +03:00
Cristian Balas 1d6fc56052
DO OneClickImage - added webhook service (#358) 2021-07-27 12:46:39 +03:00
Cristian Balas 37f18be68d
Added memory limits to previewservice (#349) 2021-07-21 10:39:16 +03:00
Cristian Balas 3b227713da
[nginx] disabled request buffering and set max-body-size at the server level (#332) 2021-07-13 11:40:41 +03:00
Cristian Balas 3840068cad
diff endpoints + added version in ServerInfo (#235) 2021-05-11 20:23:42 +03:00
Cristian Balas 2172a06e4f
Scripts for DigitalOcean oneclick image (#209) 2021-05-03 15:21:37 +03:00