Commit graph

142 commits

Author SHA1 Message Date
कारतोफ्फेलस्क्रिप्ट™ be373bb859
Revert "feat(core): Read ephemeral license from environment and cleanup ee flags (#5797)" (#5816)
Revert "feat(core): Read ephemeral license from environment and clean up ee flags (#5797)"

This reverts commit a81ca7c19c.
2023-03-29 18:00:29 +02:00
Michael Auerswald a81ca7c19c
feat(core): Read ephemeral license from environment and clean up ee flags (#5797)
* remove enterprise feature schema for license.cert

* bump license sdk version

* Update packages/cli/package.json

Co-authored-by: Cornelius Suermann <cornelius@n8n.io>

---------

Co-authored-by: Cornelius Suermann <cornelius@n8n.io>
2023-03-28 17:21:40 +02:00
Michael Auerswald f15f4bdcf2
feat(core): Convert eventBus controller to decorator style and improve permissions (#5779) 2023-03-27 12:30:03 +02:00
Michael Auerswald 47ee357059
feat(core): Improve ldap/saml toggle and tests (#5771)
* improve ldap/saml toggle and tests

* import cleanup

* reject regular login users when saml is enabled

* lint fix
2023-03-24 17:46:06 +01:00
कारतोफ्फेलस्क्रिप्ट™ 161de110ce
fix(core): Improve community nodes loading (#5608) 2023-03-24 17:04:26 +01:00
Csaba Tuncsik d78a41db54
feat: Execution custom data saving and filtering (#5496)
* wip: workflow execution filtering

* fix: import type failing to build

* fix: remove console.logs

* feat: execution metadata migrations

* fix(editor): Move global executions filter to its own component

* fix(editor): Using the same filter component in workflow level

* fix(editor): a small housekeeping

* checking workflowId in filter applied

* fix(editor): update filter after resolving merge conflicts

* fix(editor): unify empy filter status

* feat(editor): add datetime picker to filter

* feat(editor): add meta fields

* fix: fix button override in datepicker panel

* feat(editor): add filter metadata

* feat(core): add 'startedBefore' execution filter prop

* feat(core): add 'tags' execution query filter

* Revert "feat(core): add 'tags' execution query filter"

This reverts commit a7b968081c.

* feat(editor): add translations and tooltip and counting selected filter props

* fix(editor): fix label layouts

* fix(editor): update custom data docs link

* fix(editor): update custom data tooltip position

* fix(editor): update tooltip text

* refactor: Ignore metadata if not enabled by license

* fix(editor): Add paywall states to advanced execution filter

* refactor: Save custom data also for worker mode

* fix: Remove duplicate migration name from list

* fix(editor): Reducing filter complexity and add debounce to text inputs

* fix(editor): Remove unused import, add comment

* fix(editor): simplify event listener

* fix: Prevent error when there are running executions

* test(editor): Add advanced execution filter basic unit test

* test(editor): Add advanced execution filter state change unit test

* fix: Small lint issue

* feat: Add indices to speed up queries

* feat: add customData limits

* refactor: put metadata save in transaction

* chore: remove unneed comment

* test: add tests for execution metadata

* fix(editor): Fixes after merge conflict

* fix(editor): Remove unused import

* wordings and ui fixes

* fix(editor): type fixes

* feat: add code node autocompletions for customData

* fix: Prevent transaction issues and ambiguous ID in sql clauses

* fix(editor): Suppress requesting current executions if metadata is used in filter (#5739)

* fix(editor): Suppress requesting current executions if metadata is used in filter

* fix(editor): Fix arrows for select in popover

* refactor: Improve performance by correcting database indices

* fix: Lint issue

* test: Fix broken test

* fix: Broken test

* test: add call data check for saveExecutionMetadata test

---------

Co-authored-by: Valya Bullions <valya@n8n.io>
Co-authored-by: Alex Grozav <alex@grozav.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Romain Minaud <romain.minaud@gmail.com>
2023-03-23 18:07:46 +01:00
कारतोफ्फेलस्क्रिप्ट™ 4c583e2be4
ci: Fix saml.api.test.ts (no-changelog) (#5764) 2023-03-23 16:54:35 +01:00
कारतोफ्फेलस्क्रिप्ट™ 6242cac53b
ci: Refactor cli tests to speed up CI (no-changelog) (#5718)
* ci: Refactor cli tests to speed up CI (no-changelog)

* upgrade jest to address memory leaks
2023-03-17 17:24:05 +01:00
Ricardo Espinoza 3718612bd7
test(core): Use instance owner instead of owner shell for SAML tests (no-changelog) (#5706)
Use instance owner instead of owner shell
2023-03-16 15:34:28 +01:00
कारतोफ्फेलस्क्रिप्ट™ 9bd7529193
refactor(core): Use an IoC container to manage singleton classes [Part-2] (no-changelog) (#5690)
* use typedi for UserManagementMailer

* use typedi for SamlService

* fix typos

* use typedi for Queue

* use typedi for License

* convert some more code to use typedi
2023-03-16 15:34:13 +01:00
कारतोफ्फेलस्क्रिप्ट™ b4e60c3b47
refactor: Rewrite workflow public-api tests to avoid timeouts (no-changelog) (#5696) 2023-03-15 14:24:09 +01:00
कारतोफ्फेलस्क्रिप्ट™ 3831201aaf
ci: Setup code-coverage reporting (no-changelog) (#5669) 2023-03-10 16:53:05 +01:00
कारतोफ्फेलस्क्रिप्ट™ 356e916194
refactor(core): Convert more routes to use the decorator pattern (no-changelog) (#5611)
* move nodeTypes api to a controller class
* move tags api to a controller class
* move LDAP routes to a controller class
* move nodes routes to a controller class
2023-03-09 14:42:13 +01:00
Michael Auerswald b5179597f3
feat(core): Limit user changes when saml is enabled (#5577)
* consolidate SSO settings

* update saml settings

* fix type error

* limit user changes when saml is enabled

* add test
2023-03-03 10:05:30 +01:00
Csaba Tuncsik ea2035b510
fix(core): Fix Filtering of Workflow by Tags (#5570) 2023-02-27 12:25:45 +01:00
कारतोफ्फेलस्क्रिप्ट™ 52f740b9e8
refactor(core): Use an IoC container to manage singleton classes [Part-1] (no-changelog) (#5509)
* add typedi

* convert ActiveWorkflowRunner into an injectable service

* convert ExternalHooks into an injectable service

* convert InternalHooks into an injectable service

* convert LoadNodesAndCredentials into an injectable service

* convert NodeTypes and CredentialTypes into an injectable service

* convert ActiveExecutions into an injectable service

* convert WaitTracker into an injectable service

* convert Push into an injectable service

* convert ActiveWebhooks and  TestWebhooks into an injectable services

* handle circular references, and log errors when a circular dependency is found
2023-02-21 19:21:56 +01:00
कारतोफ्फेलस्क्रिप्ट™ 510855d958
fix(core): User update endpoint should only allow updating email, firstName, and lastName (#5526) 2023-02-21 11:22:54 +01:00
कारतोफ्फेलस्क्रिप्ट™ f0f8d59fee
fix(core): Do not allow arbitrary path traversal in the credential-translation endpoint (#5522) 2023-02-21 11:21:04 +01:00
Mutasem Aldmour 26a20ed47e
feat: Support feature flag evaluation server side (#5511)
* feat(editor): roll out schema view

* feat(editor): add posthog tracking

* refactor: use composables

* refactor: clean up console log

* refactor: clean up impl

* chore: clean up impl

* fix: fix demo var

* chore: add comment

* refactor: clean up

* chore: wrap error func

* refactor: clean up import

* refactor: make store

* feat: enable rudderstack usebeacon, move event to unload

* chore: clean up alert

* refactor: move tracking from hooks

* fix: reload flags on login

* fix: add func to setup

* fix: clear duplicate import

* chore: add console to tesT

* chore: add console to tesT

* fix: try reload

* chore: randomize instnace id for testing

* chore: randomize instnace id for testing

* chore: add console logs for testing

* chore: move random id to fe

* chore: use query param for testing

* feat: update PostHog api endpoint

* feat: update rs host

* feat: update rs host

* feat: update rs endpoints

* refactor: use api host for BE events as well

* refactor: refactor out posthog client

* feat: add feature flags to login

* feat: add feature flags to login

* feat: get feature flags to work

* feat: add created at to be events

* chore: add todos

* chore: clean up store

* chore: add created at to identify

* feat: add posthog config to settings

* feat: add bootstrapping

* chore: clean up

* chore: fix build

* fix: get dates to work

* fix: get posthog to recognize dates

* chore: refactor

* fix: update back to number

* fix: update key

* fix: get experiment evals to work

* feat: add posthog to signup router

* feat: add feature flags on sign up

* chore: clean up

* fix: fix import

* chore: clean up loading script

* feat: add timeout, fix: script loader

* fix: test timeout and get working on 8080

* refactor: move out posthog

* feat: add experiment tracking

* fix: clear tracked on reset

* fix: fix signup bug

* fix: handle errors when telmetry is disabled

* refactor: remove redundant await

* fix: add back posthog to telemetry

* test: fix test

* test: fix test

* test: add tests for posthog client

* lint: fix

* fix: fix issue with slow decide endpoint

* lint: fix

* lint: fix

* lint: fix

* lint: fix

* chore: address PR feedback

* chore: address PR feedback

* feat: add onboarding experiment
2023-02-21 11:35:35 +03:00
कारतोफ्फेलस्क्रिप्ट™ 561882f599
refactor(core): Improve instance owner setup and add unit tests (no-changelog) (#5499)
* refactor(core): Avoid fetching all workflows and credentials for the owner setup screen

* refactor(core): Add unit tests for the owner controller
2023-02-17 10:59:09 +01:00
कारतोफ्फेलस्क्रिप्ट™ 12104bc4a3
refactor(core): Delete unused GET /me endpoint (no-changelog) (#5498) 2023-02-17 10:58:48 +01:00
Michael Auerswald d143f3f2ec
feat(core): Add execution runData recovery and status field (#5112)
* adds ExecutionEvents view modal to ExecutionList

* fix time rendering and remove wf column

* checks for unfinished executions and fails them

* prevent re-setting stoppedAt for execution

* some cleanup / manually create rundata after crash

* quicksave

* remove Threads lib, log worker rewrite

* cleanup comment

* fix sentry destination return value

* test for tests...

* run tests with single worker

* fix tests

* remove console log

* add endpoint for execution data recovery

* lint cleanup and some refactoring

* fix accidental recursion

* remove cyclic imports

* add rundata recovery to Workflowrunner

* remove comments

* cleanup and refactor

* adds a status field to executions

* setExecutionStatus on queued worker

* fix onWorkflowPostExecute

* set waiting from worker

* get crashed status into frontend

* remove comment

* merge fix

* cleanup

* catch empty rundata in recovery

* refactor IExecutionsSummary and inject nodeExecution Errors

* reduce default event log size to 10mb from 100mb

* add per node execution status

* lint fix

* merge and lint fix

* phrasing change

* improve preview rendering and messaging

* remove debug

* Improve partial rundata recovery

* fix labels

* fix line through

* send manual rundata to ui at crash

* some type and msg push fixes

* improve recovered item rendering in preview

* update workflowStatistics on recover

* merge fix

* review fixes

* merge fix

* notify eventbus when ui is back up

* add a small timeout to make sure the UI is back up

* increase reconnect timeout to 30s

* adjust recover timeout and ui connection lost msg

* do not stop execution in editor after x reconnects

* add executionRecovered push event

* fix recovered connection not green

* remove reconnect toast and  merge existing rundata

* merge editor and recovered data for own mode
2023-02-17 10:54:07 +01:00
Csaba Tuncsik a2c6ea9e11
fix(core): Remove unnecessary info from GET /workflows response (#5311)
* fix(core): Remove unnecessary info from `GET /workflows` response

* fix(core): Remove unnecessary info from `GET /workflows` response

* fix(core): Remove credentials from `GET /workflows` response

* fix(core): Update unit tests for `GET /workflows` response

* fix(core): Remove `usedCredentials` from `GET /workflows` response

* fix(core): Update unit tests for `GET /workflows` response

* fix(core): remove nodes from getMany

* fix(core): remove unnecessary owner props from workflow list items

* fix(core): fix lint error

* fix(core): remove unused function

* fix(core): simplifying ownerId usage

* fix(core): trim down the query for workflow listing
2023-02-16 10:36:24 +01:00
कारतोफ्फेलस्क्रिप्ट™ 83505cb0d4
ci(core): Add unit tests for "me" controller (no-changelog) (#5479) 2023-02-15 09:00:41 +01:00
Omar Ajoue a2e2ec5442
test: Add tests for ActiveWorkflowRunner class (#5278) 2023-02-10 15:24:20 +01:00
कारतोफ्फेलस्क्रिप्ट™ 538984dc2f
feat(core): Add support for WebSockets as an alternative to Server-Sent Events (#5443)
Co-authored-by: Matthijs Knigge <matthijs@volcano.nl>
2023-02-10 15:02:47 +01:00
कारतोफ्फेलस्क्रिप्ट™ 7e2f2f7453
refactor(core): Add unit tests for all external auth middlewares (no-changelog) (#5386) 2023-02-07 15:49:35 +01:00
freya 4bd9ed675e
refactor: Clean up workflow stats test file (#5282)
* 🔨 - Use .spyOn for UserManagment

* 🔨 - Remove a no longer needed test

* 🔨 - Refactored and cleaned up workflowstats tests

* 🔨 - Clean up unused imports / lines
2023-01-30 16:34:26 +00:00
कारतोफ्फेलस्क्रिप्ट™ 845f0f9d20
refactor(core): Switch over all user-management routes to use decorators (#5115) 2023-01-27 11:19:47 +01:00
कारतोफ्फेलस्क्रिप्ट™ c8a146ba31
ci: Fix CI timeout issues (no-changelog) (#5250) 2023-01-26 11:44:50 +01:00
कारतोफ्फेलस्क्रिप्ट™ ac460aa841
ci: Simplify DB truncate in tests (no-changelog) (#5243) 2023-01-25 10:02:28 +01:00
Ricardo Espinoza 0c70a40317
feat(core): Add LDAP support (#3835) 2023-01-25 02:18:39 +01:00
कारतोफ्फेलस्क्रिप्ट™ a86c9a628b
refactor(core): Add support for implicit schema in postgres migrations (#5233) 2023-01-24 10:55:20 +01:00
कारतोफ्फेलस्क्रिप्ट™ bd14ec1110
ci: Fix typing issues in cli tests (no-changelog) (#5227) 2023-01-23 17:41:55 +01:00
Iván Ovejero 7aa65315cc
test: Skip some syslog tests (no-changelog) (#5206)
:test: Skip some syslog tests
2023-01-20 11:02:53 +01:00
कारतोफ्फेलस्क्रिप्ट™ 0a5ab560b1
refactor: Upgrade typeorm to 0.3.x (#5151) 2023-01-13 18:12:22 +01:00
Michael Auerswald e845eb33f9
fix(core): Remove threads pkg, rewrite log writer worker (#5134) 2023-01-13 15:39:25 +01:00
Michael Auerswald 62d06b1e6e
fix(core): Fixes event msg confirmations if no subscribers present (#5118)
* adds ExecutionEvents view modal to ExecutionList

* fix time rendering and remove wf column

* checks for unfinished executions and fails them

* prevent re-setting stoppedAt for execution

* removing UI changes but keeping eventbus fixes

* remove comment
2023-01-11 14:09:09 +01:00
Alex Grozav 2327563c44
feat: Add user management invite links without SMTP set up (#5084)
* feat: update n8n-users-list to no longer use preset list of actions

* feat: prepared users settings for invite links feature

* refactor: Return invite link URLs when inviting users (#5079)

* refactor: Return invite link URLs when inviting users

* test: Refactor and add tests to mailer

* feat: Add FE inviteAcceptUrl integration (#5085)

* feat: update n8n-users-list to no longer use preset list of actions

* feat: prepared users settings for invite links feature

* feat: add integration with new inviteAcceptUrl changes

* feat: Add inviteAcceptUrl to user list for pending users

Co-authored-by: Alex Grozav <alex@grozav.com>

* fix conflicts

* fix lint issue

* test: Make sure inviteAcceptUrl is defined

* feat: update smtp setup suggestion

* feat: add invite link summary when inviting multiple users

* refactor: Add telemetry flag for when email is sent

* fix: add email_sent correctly to telemetry event

* feat: move SMTP info-tip to invite modal

Co-authored-by: Omar Ajoue <krynble@gmail.com>
2023-01-05 17:10:08 +02:00
Jan Oberhauser 93da026c0d
fix(core): Fix OAuth credential creation via API (#5064)
* fix(core): Fix OAuth credential creation via API

* Fix tests
2023-01-05 07:06:37 -06:00
Iván Ovejero d548161632
feat(core): Security audit (#5034)
*  Implement security audit

*  Use logger

* 🧪 Fix test

*  Switch logger with stdout

* 🎨 Set new logo

*  Fill out Public API schema

* ✏️ Fix typo

*  Break dependency cycle

*  Add security settings values

* 🧪 Test security settings

*  Add publicly accessible instance warning

*  Add metric to CLI command

* ✏️ Fix typo

* 🔥 Remove unneeded path alias

* 📘 Add type import

* 🔥 Remove inferrable output type

*  Set description at correct level

*  Rename constant for consistency

*  Sort URLs

*  Rename local var

*  Shorten name

* ✏️ Improve phrasing

*  Improve naming

*  Fix casing

* ✏️ Add docline

* ✏️ Relocate comment

*  Add singular/plurals

* 🔥 Remove unneeded await

* ✏️ Improve test description

*  Optimize with sets

*  Adjust post master merge

* ✏️ Improve naming

*  Adjust in spy

* 🧪 Fix outdated instance test

* 🧪 Make diagnostics check consistent

*  Refactor `getAllExistingCreds`

*  Create helper `getNodeTypes`

* 🐛 Fix `InternalHooksManager` call

* 🚚 Rename `execution` to `nodes` risk

*  Add options to CLI command

*  Make days configurable

* :revert: Undo changes to `BaseCommand`

*  Improve CLI command UX

*  Change no-report return value

Empty array to trigger empty state on FE.

*  Add empty check to `reportInstanceRisk`

* 🧪 Extend Jest `expect`

* 📘 Augment `jest.Matchers`

* 🧪 Set extend as setup file

* 🔧 Override lint rule for `.d.ts`

*  Use new matcher

*  Update check

* 📘 Improve typings

*  Adjust instance risk check

* ✏️ Rename `execution` → `nodes` in Public API schema

* ✏️ Add clarifying comment

* ✏️ Fix typo

*  Validate categories in CLI command

* ✏️ Improve naming

* ✏️ Make audit reference consistent

* 📘 Fix typing

*  Use `finally` in CLI command
2023-01-05 13:28:40 +01:00
freya 59004fe7bb
fix(core): Fixes issue with workflow lastUpdated field (#5015)
Fixed issue causing workflow updated field to be affected by statistics data
2023-01-05 12:16:40 +00:00
कारतोफ्फेलस्क्रिप्ट™ 5d746c4a83
fix: Apply credential overwrites recursively (#5072)
This ensures that overwrites defined for a parent credential type also applies to all credentials extending it.
2023-01-04 18:16:48 +01:00
कारतोफ्फेलस्क्रिप्ट™ 8b19fdd5f0
refactor: Delete a lot of unused and duplicate code in Server and WebhookServer (#5080)
* store n8n version string in a const and use that everywhere

* reduce code duplication between Server and WebhookServer

* unify redis checks

* fix linting
2023-01-04 11:38:48 +01:00
Michael Auerswald b67f803cbe
feat: Add global event bus (#4860)
* fix branch

* fix deserialize, add filewriter

* add catchAll eventGroup/Name

* adding simple Redis sender and receiver to eventbus

* remove native node threads

* improve eventbus

* refactor and simplify

* more refactoring and syslog client

* more refactor, improved endpoints and eventbus

* remove local broker and receivers from mvp

* destination de/serialization

* create MessageEventBusDestinationEntity

* db migrations, load destinations at startup

* add delete destination endpoint

* pnpm merge and circular import fix

* delete destination fix

* trigger log file shuffle after size reached

* add environment variables for eventbus

* reworking event messages

* serialize to thread fix

* some refactor and lint fixing

* add emit to eventbus

* cleanup and fix sending unsent

* quicksave frontend trial

* initial EventTree vue component

* basic log streaming settings in vue

* http request code merge

* create destination settings modals

* fix eventmessage options types

* credentials are loaded

* fix and clean up frontend code

* move request code to axios

* update lock file

* merge fix

* fix redis build

* move destination interfaces into workflow pkg

* revive sentry as destination

* migration fixes and frontend cleanup

* N8N-5777 / N8N-5789 N8N-5788

* N8N-5784

* N8N-5782 removed event levels

* N8N-5790 sentry destination cleanup

* N8N-5786 and refactoring

* N8N-5809 and refactor/cleanup

* UI fixes and anonymize renaming

* N8N-5837

* N8N-5834

* fix no-items UI issues

* remove card / settings label in modal

* N8N-5842 fix

* disable webhook auth for now and update ui

* change sidebar to tabs

* remove payload option

* extend audit events with more user data

* N8N-5853 and UI revert to sidebar

* remove redis destination

* N8N-5864 / N8N-5868 / N8N-5867 / N8N-5865

* ui and licensing fixes

* add node events and info bubbles to frontend

* ui wording changes

* frontend tests

* N8N-5896 and ee rename

* improves backend tests

* merge fix

* fix backend test

* make linter happy

* remove unnecessary cfg / limit  actions to owners

* fix multiple sentry DSN and anon bug

* eslint fix

* more tests and fixes

* merge fix

* fix workflow audit events

* remove 'n8n.workflow.execution.error' event

* merge fix

* lint fix

* lint fix

* review fixes

* fix merge

* prettier fixes

* merge

* review changes

* use loggerproxy

* remove catch from internal hook promises

* fix tests

* lint fix

* include review PR changes

* review changes

* delete duplicate lines from a bad merge

* decouple log-streaming UI options from public API

* logstreaming -> log-streaming for consistency

* do not make unnecessary api calls when log streaming is disabled

* prevent sentryClient.close() from being called if init failed

* fix the e2e test for log-streaming

* review changes

* cleanup

* use `private` for one last private property

* do not use node prefix package names.. just yet

* remove unused import

* fix the tests

because there is a folder called `events`, tsc-alias is messing up all imports for native events module.
https://github.com/justkey007/tsc-alias/issues/152

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-01-04 09:47:48 +01:00
कारतोफ्फेलस्क्रिप्ट™ ee28213538
refactor: Use string ids on Credentials, Workflows, Tags, and Executions DB entities (#5041) 2023-01-02 17:42:32 +01:00
कारतोफ्फेलस्क्रिप्ट™ b828cb31d6
perf: Lazy-load queue-mode and analytics dependencies (#5061)
* refactor: lazy load ioredis and bull

* upgrade bull and hiredis

* refactor: lazy load posthog, rudderstack, and sentry

* upgrade Sentry sdk
2023-01-02 12:14:39 +01:00
Omar Ajoue 8881ba8d4a
test: Add test case for when policy is set to any and fix a few others (#5019)
* 🚨 - testing subworkflow policies

* test: Add test case for workflow policy 'any'

* refactor: Remove unnecessary information in tests

* test: Improve types and lint

* fix: Add not throw to tests

* fix: Adding missing await statements

Co-authored-by: freyamade <freya@n8n.io>
2022-12-23 15:23:36 +01:00
freya 789682763c
test: Ensure all subworkflow execution policies are tested (#5010) 2022-12-22 17:28:23 +00:00
कारतोफ्फेलस्क्रिप्ट™ 0a416eebea
fix: Remove circular dependencies from cli tests (no-changelog) (#5000)
* fix typescript errors in cli

* remove circular dependencies from cli tests
2022-12-22 10:14:15 +01:00