Commit Graph

211 Commits

Author SHA1 Message Date
Alessandro Magionami bb73ecbe3c feat(workspaces): list workspace join requests for admin 2025-01-14 12:02:57 +01:00
Kristaps Fabians Geikins 0b81f9979e chore(server): event bus refactor - access req emitter - batch #3 2025-01-13 11:03:58 +02:00
Kristaps Fabians Geikins dab0a23c33 chore(server): event bus refactor - version emitter - batch #2 2025-01-13 11:03:34 +02:00
Kristaps Fabians Geikins f403d51330 replaced user event bus 2025-01-07 11:24:07 +02:00
Kristaps Fabians Geikins 7ce306569f got rid of projects emitter + added tests 2025-01-06 17:42:24 +02:00
Kristaps Fabians Geikins 13e75a98f0 got rid of models emitter + added tests 2025-01-06 15:55:50 +02:00
Iain Sproat 457c532b2b feat(server): allow ratelimiting to be explicitly disabled (#3757)
* feat(server): allow ratelimiting to be explicitly disabled
- allows rate limiter to be enabled or disabled explicitly
- example .env file for testing now explicitly disables it
- disables rate limiter in CI tests, except where explicitly testing the rate limiter
2025-01-03 08:24:28 +00:00
Iain Sproat 1f7620a281 chore(logging): log migration of databases (#3700)
- tidy up Database error handling context data
2024-12-16 13:40:29 +00:00
Iain Sproat c4def81ae2 feat(server options): allow connection timeouts to be configured (#3701)
* feat(server options): allow connection timeouts to be configured

* feat(postgres config): allow connection parameters to be configured
2024-12-16 13:39:40 +00:00
Iain Sproat 6d3ba0de22 chore(server): errors for database append additional context (#3698)
* chore(server): errors for database append additional context

* Refactor
2024-12-16 10:13:20 +00:00
Gergő Jedlicska 229a19c981 gergo/workspaceAdmin (#3677)
* feat(workspaces): add unified paginated items service

* feat(workspaces): admin update workspace plan
2024-12-11 18:54:24 +01:00
Gergő Jedlicska 2a72631e8b feat(gatekeeper): expire trail workspace plans (#3669) 2024-12-11 17:22:04 +01:00
Kristaps Fabians Geikins 4b6e7af19d feat(fe2): scope comment mentions to parent project collaborators (#3635)
* backend done

* get rid of email mention

* project scoped mentions work

* lint fix

* better user sanitization safety

* tests fix
2024-12-05 13:33:05 +02:00
Iain Sproat cdf9c4858a refactor(env vars): rename AUTOMATE_ENCRTYPTION_KEYS_PATH with ENCRYPTION_KEYS_PATH (#3616) 2024-12-04 10:29:35 +00:00
Kristaps Fabians Geikins 51579b76ef fix(server): various fixes related to subs + further improved utils + way quicker tests (#3573)
* fixed test util throwing + added new tests

* more tests

* more tests

* various model tests

* version tests

* removed shitty old tests

* lint fix

* workspaceProjectsUpdated test

* workspace updated on invite

* workspace subs support team changes

* tests fix

* test fix hopefully?
2024-12-02 13:30:24 +02:00
Chuck Driesler fd5f316af0 fix(automate): automate module multi region (#3531)
* refactor(automate): logs api can get the projectId from the path

* fix(automate): multiregion gql resolvers

* fix(automate): multiregion event listeners

* fix(automate): drop automationCount

* fix(automate): multiregion run status

* fix(automate): correctness

* fix(automate): actually finish event listeners

* chore(automate): fix tests fix tests

* fix(automate): fix tests but make it multiregion flavor

* fix(automate): logs endpoint

* chore(automate): globalDb to db

* fix(automate): inject projectid correctly

* fix(automate): debug log fetch failure

* chore(automate): fix tests for new message

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-11-27 15:26:09 +00:00
Kristaps Fabians Geikins 1800dbbdbd feat(server): improved subscription testing DX + tests for common subs + new subs (#3554)
* userProjectsUpdated.added test

* multi region support

* userStreamAdded

* commit subs tested

* fix for proj workspace assignment

* undo commitHelper main changes

* disable all ffs mode

* createTestWorkspace support when workspaces arent enabled

* project create fix

* workspace projects updated subscription

* WIP new workspace sub

* updated workspaceCreated

* updated workspaceUpdated

* BE for workspace updated sub

* workspace updated sub

* ts err fix
2024-11-27 15:41:04 +02:00
Gergő Jedlicska f381dc3d9d gergo/workspaceDefaultPlan (#3561)
* feat(gatekeeper): create workspaces with trial plan by default

* feat(gatekeeper): default to starter trial plan

* fix(eventBus): fix tests
2024-11-27 09:51:32 +01:00
Gergő Jedlicska 01b222ced8 gergo/web 2155 gendo module multi region (#3528)
* fix(workspaces): allow workspace delete for paid workspaces

* feat(gendo): multi region gendo with new api integration and limits

* feat(gendo): user credits

* feat: adds limits to gendo panel, and terms and conditions link

* fix: reworks setting back camera view

* feat(gendo): webhook signature verification

* fix(gendo): nullability

* test(blobstorage): fix test dependency injection

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2024-11-22 16:43:31 +01:00
Iain Sproat a1ee8a89a7 chore(server): graceful shutdown (#3125)
* chore(server): graceful shutdown
- stop() on the apollo server should be called

* chore(server): gracefully drain apollo server

* Allow grace period to be configured

* Terminus manages the readiness and liveness endpoints

* terminus is responsible for stopping the graphql server

* remove logging on shutdown

* Remove redundant parameter

* move healthchecks out of business modules to top-level directory
- terminus can only handle readiness check, not liveness
- app needs to return readiness handler, so that server terminus can use it

* fix tests

* Fix broken merge

* fix broken merge

* incorporate review comments

* fix invalid merge

* fix readinesscheck not being passed as parameter
2024-11-19 11:08:38 +01:00
Iain Sproat 4e7a00250c chore(error): improve error log message for not found project id (#3507) 2024-11-18 16:29:04 +00:00
Kristaps Fabians Geikins f961a6da81 chore(server): various useful multiregion changes from comments pr (#3499)
* chore(server): various useful multiregion changes from comments pr

* hopefully fixing CI?

* test fix

* more test fixes??

* more test fixes..

* plz work ;((((

* revert multiregion on by default
2024-11-15 15:49:34 +02:00
Kristaps Fabians Geikins 37824bb845 Merge branch 'main' into fabians/multiregion-testing3 2024-11-12 09:59:58 +02:00
Kristaps Fabians Geikins 2643d32d0a Merge branch 'main' into fabians/multiregion-testing3 2024-11-11 14:53:53 +02:00
Gergő Jedlicska 50a76315ef Merge branch 'main' of github.com:specklesystems/speckle-server into alessandro/web-2138-models-resolvers 2024-11-11 06:15:31 +01:00
Gergő Jedlicska 1c19f67dd2 feat(models): support streamId, branchId in models 2024-11-11 06:09:53 +01:00
Gergő Jedlicska b77d70585e fix(redis): make redis client singleton from a module (#3469)
* fix(redis): make redis client singleton from a module

* fix(projectDownload): pass region key properly
2024-11-08 17:18:28 +01:00
Kristaps Fabians Geikins ee16b083ba feat(server): run tests in multiregion mode if RUN_TESTS_IN_MULTIREGION_MODE=true 2024-11-08 18:03:13 +02:00
Iain Sproat de4235a9d0 chore(healthchecks): refactor out of modules (#3465) 2024-11-08 13:36:02 +00:00
Kristaps Fabians Geikins 69ff3864af feat(server): multi region support in dataloaders 2024-11-07 09:57:43 +02:00
Chuck Driesler b195df37d6 feat(sso): active user sso information (#3432)
* feat(workspaces): add workspace sso feature flag

* feat(workspaceSso): wip validate sso

* feat(workspaces): validate and add sso provider to the workspace with user sso sessions

* feat(workspaces): validate and add sso provider to the workspace with user sso sessions

* WIP

* fix(sso): restructure to handle all branches at end of flow

* fix(sso): add and validate emails used for sso

* fix(sso): park progress

* chore(workspaces): review sso login/valdate

* fix(sso): adjust validate url

* chore(sso): auth header puzzle

* fix(sso): happy-path config

* chore(gql): gqlgen

* fix(sso): almost almost

* fix(sso): auth endpoint

* a lil more terse

* fix(sso): light at the end of the tunnel

* fix(sso): improve catch block error messages

* fix(sso): session lifespan => validUntil

* fix(sso): I think we've got it

* feat(sso): limited workspace values for public sso login

* fix(sso): use factory functions

* fix(sso): til decrypt is single-use

* fix(sso): correct usage of access codes

* fix(sso): use finalize middleware in all routes

* chore(sso): cheeky tweak

* fix(sso): move some types around

* fix(sso): stencil final shape I'm sleepy

* fix(sso): more factories more factories

* fix(sso): on to final boss of factories

* fix(sso): needs a haircut but she works

* fix(sso): init rest w function, not side-effects

* fix(sso): /authn => /sso

* chore(sso): errors

* chore(sso): test test test

* chore(sso): test all the corners

* feat(sso): list workspace sso memberships

* chore(sso): tests, expose in rest

* fix(sso): sketch active user auth

* fix(sso): expose search via gql

* fix(sso): active user session information

* chore(sso): sso session test utils

* chore(sso): test sso session repo/services

* chore(sso): gqlgen

* fix(sso): simplify gql resolver structure

* chore(sso): gqlgen

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-11-05 12:27:46 +00:00
Kristaps Fabians Geikins 5df716bf1c feat: add & list server regions (#3423)
* WIP create modal

* babababa

* create dialog looks ok

* FE largely there

* workss

* cleanup

* fixed up test plumbing to avoid deadlocks and simplify GQL calls

* test fix

* added all tests

* CI fix
2024-10-31 16:08:50 +01:00
Chuck Driesler 52bb1116ed SSO (#3376)
* feat(workspaces): add workspace sso feature flag

* feat(workspaceSso): wip validate sso

* feat(workspaces): validate and add sso provider to the workspace with user sso sessions

* feat(workspaces): validate and add sso provider to the workspace with user sso sessions

* WIP

* fix(sso): restructure to handle all branches at end of flow

* fix(sso): add and validate emails used for sso

* fix(sso): park progress

* chore(workspaces): review sso login/valdate

* fix(sso): adjust validate url

* chore(sso): auth header puzzle

* fix(sso): happy-path config

* chore(gql): gqlgen

* fix(sso): almost almost

* fix(sso): auth endpoint

* a lil more terse

* fix(sso): light at the end of the tunnel

* fix(sso): improve catch block error messages

* fix(sso): session lifespan => validUntil

* fix(sso): I think we've got it

* feat(sso): limited workspace values for public sso login

* fix(sso): use factory functions

* fix(sso): til decrypt is single-use

* fix(sso): correct usage of access codes

* fix(sso): use finalize middleware in all routes

* chore(sso): cheeky tweak

* fix(sso): move some types around

* fix(sso): stencil final shape I'm sleepy

* fix(sso): more factories more factories

* fix(sso): on to final boss of factories

* fix(sso): needs a haircut but she works

* fix(sso): init rest w function, not side-effects

* fix(sso): /authn => /sso

* chore(sso): errors

* chore(sso): test test test

* chore(sso): test all the corners

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-10-31 13:20:53 +01:00
Gergő Jedlicska da7f0dda0e gergo/web 2047 user joins the workspace event (#3412)
* feat(gatekeeper): add gatekeeper module feature flag

* feat(gatekeeper): add workspace pricing table domain

* feat(gatekeeper): add checkout session creation

* feat(gatekeeper): verify stripe signature

* wip(gatekeeper): checkout callbacks

* feat(gatekeeper): add unlimited and academia plan types

* refactor(envHelper): getStringFromEnv helper

* chore(gatekeeper): add future todos

* feat(gatekeeper): add productId to the subscription domain

* feat(gatekeeper): add in memory repositories

* feat(gatekeeper): add more errors

* feat(gatekeeper): complete checkout session service

* feat(gatekeeper): add stripe client implementation

* feat(gatekeeper): add checkout session completion webhook callback path

* feat(gendo): fix not needing env vars if gendo module is not enabled

* feat(gatekeeper): require a license for billing

* chore(gatekeeper): cleanup before testing

* feat(gatekeeper): subscriptionData parsing model

* ci: add billing integration and gatekeeper modules to test config

* test(gatekeeper): add checkout service tests

* feat(gatekeeper): make completeCheckout callback idempotent properly

* feat(gatekeeper): move to knex based repositories

* test(gatekeeper): billing repository tests

* feat(gatekeeper): add yearly billing cycle toggle

* feat(ci): add stripe integration context to test job

* feat(billingPage): conditionally render the checkout CTAs

* fix(gatekeeper): remove flaky test condition

* feat(helm): add billing integration feature flag

* WIP billing gql api

* feat(gatekeeper): cancel checkout session api

* feat(gatekeeper): handle existing checkout sessions, when trying to create a new one

* feat(gatekeeper): add workspace plans gql api

* feat(gatekeeper): handle cancelation and subscription updates

* fix(gatekeeper): scope initialization

* fix(gatekeeper): eliminate stripe client import sideeffect

* fix(gatekeeper): eliminate stripe client import sideeffect 2

* feat(gatekeeper): upsize subscription on workspace role change

* feat(shared): add command pattern implementation

* refactor(eventBus): remove return capabilities from the event bus

* refactor(workspaces): use new commandFactory in workspace resolver

* feat(core): facelift taskLock

* feat(gatekeeper): shedule subscription downscale

* feat(gatekeeper): manage subscription downscale

* feat(gatekeeper): get workspace subscriptions, that are about to expire

* feat(gatekeeper): manage subscription downscale

* fix(gatekeeper): do not update subscription to canceled subs

* ci: bump postgres and max connections

* feat(workspaces): fix command factory event bugs
2024-10-30 15:51:40 +01:00
Iain Sproat 8ea43d7b98 feat(server/multi region config): mount file and read config from file (#3407)
* feat(multi region config): mount file and read config from file
* feat(helm): allow multi region config to be mounted from a secret
* Allow the file name to be amended
2024-10-30 10:59:03 +00:00
Kristaps Fabians Geikins 9783537ea9 Merge branch 'main' into fabians/quick-js-to-ts-4 2024-10-25 15:19:29 +03:00
Kristaps Fabians Geikins 6cf31becad commitDeleted 2024-10-25 15:16:31 +03:00
Kristaps Fabians Geikins cbbf9b6ad4 commitUpdated 2024-10-25 15:03:15 +03:00
Kristaps Fabians Geikins a3604331c4 commitCreated 2024-10-25 14:21:58 +03:00
Kristaps Fabians Geikins f690f1016a branchDeleted 2024-10-25 13:57:58 +03:00
Kristaps Fabians Geikins 64d2888506 branchUpdated sub 2024-10-25 13:55:26 +03:00
Kristaps Fabians Geikins cedc1beb6c branchCreated sub 2024-10-25 13:50:01 +03:00
Kristaps Fabians Geikins ca61e4f4a1 ip.ts 2024-10-25 10:51:48 +03:00
Kristaps Fabians Geikins 5c30d4a5ab Merge pull request #3351 from specklesystems/fabians/sign-up-event-improvements
fix(server): more resilient sign up tracking
2024-10-23 10:16:26 +01:00
Iain Sproat 0ec4a87c7c fix(file import): server port was broken when localhost was canonical url (#3360)
* fix(file import): server port was broken when localhost was canonical url
- use getServerOrigin() instead of directly calling process.env.CANONICAL_URL
- where server is calling itself, use 127.0.0.1 instead of CANONICAL_URL.
- where server is calling itself (i.e. 127.0.0.1, use the server's listening port and not default for protocol http/80, https/443
- tidy some areas where process.env was called directly; should use envHelper.

* fix tests
2024-10-22 21:12:18 +02:00
Adam Hathcock 89882c4fd6 Add otel tracing (#3294)
* add OpenTelemetry

* fix local tracing and add pino

* fix otel as seperate file

* Rework provider initialization

* Use env vars

* review comments

* lock update

* updates to env var handling

* Helm chart for opentelemetry environment variables
- also adds try/catch when detecting if environment variable exists

* review fixes

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2024-10-22 15:23:39 +01:00
Kristaps Fabians Geikins e2c886f27e fix(server): more resilient sign up tracking 2024-10-21 16:20:48 +03:00
Gergő Jedlicska 8cba7eb6f7 gergo/web 1968 add features list (#3332)
* feat(gatekeeper): add gatekeeper module feature flag

* feat(gatekeeper): add workspace pricing table domain

* feat(gatekeeper): add checkout session creation

* feat(gatekeeper): verify stripe signature

* wip(gatekeeper): checkout callbacks

* feat(gatekeeper): add unlimited and academia plan types

* refactor(envHelper): getStringFromEnv helper

* chore(gatekeeper): add future todos

* feat(gatekeeper): add productId to the subscription domain

* feat(gatekeeper): add in memory repositories

* feat(gatekeeper): add more errors

* feat(gatekeeper): complete checkout session service

* feat(gatekeeper): add stripe client implementation

* feat(gatekeeper): add checkout session completion webhook callback path

* feat(gendo): fix not needing env vars if gendo module is not enabled

* feat(gatekeeper): require a license for billing

* chore(gatekeeper): cleanup before testing

* feat(gatekeeper): subscriptionData parsing model

* ci: add billing integration and gatekeeper modules to test config

* test(gatekeeper): add checkout service tests

* feat(gatekeeper): make completeCheckout callback idempotent properly

* feat(gatekeeper): move to knex based repositories

* test(gatekeeper): billing repository tests

* feat(gatekeeper): add yearly billing cycle toggle

* feat(ci): add stripe integration context to test job

* feat(billingPage): conditionally render the checkout CTAs

* fix(gatekeeper): remove flaky test condition

* feat(helm): add billing integration feature flag
2024-10-20 15:40:31 +02:00
Kristaps Fabians Geikins fe1997b86d chore(server): core IoC #76 - validateTokenFactory 2024-10-16 17:43:26 +03:00
Kristaps Fabians Geikins 1cb27e6fdd chore(server): core IoC #51 - getUser(s)Factory 2024-10-14 17:24:11 +03:00