Commit Graph

2521 Commits

Author SHA1 Message Date
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 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
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
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
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
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 6d9086bfd9 build: Images should be built on every branch & commit with a PR (#856)
* allow images to be built on every branch & commit
* use scripts to determine whether to build and whether to publish
* all commits to `main`, `^hotfix.*`, and `^alpha.*` branches are published
* semver tags are published
* include instructions on publishing and releasing speckle-server
2022-08-09 11:23:12 +01:00
Iain Sproat df79267fdf Update .github etc. from latest template (#901)
* Initial commit

* Create CODE_OF_CONDUCT.md

* Create CONTRIBUTING.MD

* Update CODE_OF_CONDUCT.md

adds authoritative source notice to this repo

* Create ISSUE_TEMPLATE.md

* Update CODE_OF_CONDUCT.md

* Update and rename CONTRIBUTING.MD to CONTRIBUTING.md

* Update README.md

adds basic default social badges - discourse and twitter

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create LICENSE

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

fixes link

* Update CODE_OF_CONDUCT.md

* docs: add slack link and badge

* Update README.md

* fix: link and typos

* fix: more links

* refactor: moved files to .github/ folder

* feat: added PR template

Updated docs to reflect it.

* fix: updated old link

* fix: added yaml frontmatter block to issue template

* docs: removes links to slack

* docs: adds link to docs

* Update README.md

* Create open-issue.yml

* Create close-issue.yml

* Fixes: PR template updated to provide detailed instructions

* Add link to speckle-server contribution guide

* Fix link to relative to the repo pull requests

* Feature: separates issue template into bugs and feature requests

* Provides checklist for both issue templates
* Hides instructions in comments

* Add link to contribution guidelines

* Retain some sections from previous issue template

* checklist is clearer

* style: tidy newlines and other small formatting

* Retain previous README

* Capitalise README to match upstream template (and prevent future git conflicts)

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: izzy lyseggen <izzy.lyseggen@gmail.com>
Co-authored-by: Matteo Cominetti <matteo@cominetti.org>
Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Alan Rynne <alan@rynne.es>
Co-authored-by: Matteo Cominetti <matteo@speckle.systems>
2022-08-08 11:12:10 +02: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
Fabians abe160cc8d fix(viewer): build shouldnt clear dist in between both ESM & CJS builds 2022-08-05 13:58:37 +03:00
Kristaps Fabians Geikins 0cc69fece8 fix(frontend): workaround for @speckle/viewer not found error when running dev server (#892) 2022-08-05 13:08:39 +03:00
Iain Sproat 9c2959cf19 build(circleci): Run pre-commit within CircleCI (#890)
* Add CircleCI job to run pre-commit on every commit
  * Install pre-commit on cimg/python:node image
  * caches installed packages and pre-commit hooks
* build(circleci): validate circleci configurations via yarn
2022-08-05 10:51:31 +01:00
Gergő Jedlicska 39ff677e10 fix(server dockerfile): fix wait not available in the final runtime image 2022-08-05 10:45:06 +02:00
Dimitrie Stefanescu 7862dce1c1 Merge pull request #891 from specklesystems/fabians/821-viewer-embed-cleanup
fix(frontend): wraping fix in comment slideshow
2022-08-04 21:13:26 +01:00
Dimitrie Stefanescu 83464b5505 fix(frontend): wraping fix in comment slideshow 2022-08-04 23:12:45 +03:00
Dimitrie Stefanescu 76954315dc Merge pull request #885 from specklesystems/fabians/821-viewer-embed-cleanup
feat(frontend): viewer help styling
2022-08-04 15:31:59 +01:00
Dimitrie Stefanescu bfcd8a3297 feat(frontend): viewer help styling 2022-08-04 17:30:30 +03:00
Dimitrie Stefanescu 5d178f270a Merge pull request #878 from specklesystems/fabians/821-viewer-embed-cleanup
Embed Extras
2022-08-04 14:42:41 +01: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
Dimitrie Stefanescu 92dba76b88 feat(frontend): removes stale code 2022-08-04 16:02:11 +03:00
Dimitrie Stefanescu 4acd10eb39 feat(frontend): refactors nextComment 2022-08-04 16:00:44 +03:00
Kristaps Fabians Geikins b966f20fdb refactor(server): typescript support (#874)
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-08-04 14:21:39 +02:00
Kristaps Fabians Geikins d27e7fb671 fix(frontend): various minor FE fixes + gitguardian config (#879)
* fixed delayed pwd too weak error + gitguardian config

* registration btn disabled when loading
2022-08-04 12:37:22 +02:00
pre-commit-ci[bot] 5544de023f [pre-commit.ci] pre-commit autoupdate (#818)
updates:
- [github.com/pre-commit/mirrors-eslint: v8.15.0 → v8.19.0](https://github.com/pre-commit/mirrors-eslint/compare/v8.15.0...v8.19.0)
- [github.com/pre-commit/mirrors-prettier: v2.6.2 → v2.7.1](https://github.com/pre-commit/mirrors-prettier/compare/v2.6.2...v2.7.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-04 12:01:18 +02:00
Gergő Jedlicska 214db9a9bb fix(frontend container): add default value for FILE_SIZE_LIMIT_MB (#880)
this prevents breaking the existing deployments which do not provide this env variable
2022-08-04 11:59:57 +02: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
Dimitrie Stefanescu 085370e8c6 feat(frontend): review changes 2022-08-04 11:55:09 +03: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 9227fd7a1b Merge pull request #876 from specklesystems/helm-add-icon
docs(helm chart): include logo
2022-08-04 09:42:57 +01:00
Iain Sproat 00dc614fea Merge pull request #872 from specklesystems/vscode-workspace-add-helm
docs(vscode workspace): adds Helm as a top-level to VSCode workspace
2022-08-04 09:42:28 +01:00
Dimitrie Stefanescu 186f193186 fix(frontend): review changes 2022-08-04 11:38:24 +03:00
Dimitrie Stefanescu 729b4fe777 feat(frontend): adds extra embed options + refactors layout (expansion panels) 2022-08-04 11:34:35 +03:00
Dimitrie Stefanescu e7c203f130 feat(frontend): centered next & prev buttons for comment slideshow 2022-08-04 10:52:51 +03:00
Dimitrie Stefanescu 2a07733b77 feat(frontend): various
adds basic "help" for the 3d viewer, parametrizes extra stuff, adds comment slideshow mode, fixes
transparency, etc.
2022-08-04 10:14:08 +03:00
Iain Sproat d2a1bf210a docs(helm chart): include logo 2022-08-03 18:54:09 +01:00
Iain Sproat bca44af676 docs(vscode workspace): adds Helm as a top-level to VSCode workspace 2022-08-03 15:23:39 +01:00
Gergő Jedlicska 855dd348b5 feat(circleci): use bot account ssh key for commits (#871) 2022-08-03 15:25:24 +02:00
Gergő Jedlicska 71a2d89483 fixFrontendNginxPipefail (#870)
* fix(frontend nginx): fix pipefail not found in prod base image

* fix(frontend nginx entrypoint): add pipefail to entrypoint script
2022-08-03 10:02:09 +02:00
Dimitrie Stefanescu a463403f3f feat(frontend): extra transparency fixes, added reply in speckle button for embedded comment threads, etc. 2022-08-03 10:25:15 +03:00