Commit graph

55 commits

Author SHA1 Message Date
Ben Hesseldieck d3a1d3ffef
Revert " Simplify config imports in cli package (#1840)" (#1931)
This reverts commit c21c8b3369.
2021-06-23 11:20:07 +02:00
Iván Ovejero c21c8b3369
Simplify config imports in cli package (#1840)
*  Set path alias for config

*  Update config export

*  Simplify config imports

*  Update also additional imports

*  Update path in collation migration

*  Resolve aliased paths

* 👕 Fix Codacy issue

* 👕 Retry to fix Codacy issue

Co-authored-by: Jan <janober@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-06-22 23:18:52 +02:00
Ben Hesseldieck 05eec87d1d
Add tagging of workflows (#1647)
* clean up dropdown

* clean up focusoncreate

*  Ignore mistaken ID in POST /workflows

*  Fix undefined tag ID in PATCH /workflows

*  Shorten response for POST /tags

* remove scss mixins

* clean up imports

*  Implement validation with class-validator

* address ivan's comments

* implement modals

* Fix lint issues

* fix disabling shortcuts

* fix focus issues

* fix focus issues

* fix focus issues with modal

* fix linting issues

* use dispatch

* use constants for modal keys

* fix focus

* fix lint issues

* remove unused prop

* add modal root

* fix lint issues

* remove unused methods

* fix shortcut

* remove max width

*  Fix duplicate entry error for pg and MySQL

* update rename messaging

* update order of buttons

* fix firefox overflow on windows

* fix dropdown height

* 🔨 refactor tag crud controllers

* 🧹 remove unused imports

* use variable for number of items

* fix dropdown spacing

*  Restore type to fix build

*  Fix post-refactor PATCH /workflows/:id

*  Fix PATCH /workflows/:id for zero tags

*  Fix usage count becoming stringified

* address max's comments

* fix filter spacing

* fix blur bug

* address most of ivan's comments

* address tags type concern

* remove defaults

*  return tag id as string

* 🔨 add hooks to tag CUD operations

* 🏎 simplify timestamp pruning

* remove blur event

* fix onblur bug

*  Fix fs import to fix build

* address max's comments

* implement responsive tag container

* fix lint issues

* Set default dates in entities

* 👕 Fix lint in migrations

* update tag limits

* address ivan's comments

* remove rename, refactor header, implement new designs for save, remove responsive tag container

* update styling

* update styling

* implement responsive tag container

* implement header tags edit

* implement header tags edit

* fix lint issues

* implement expandable input

* minor fixes

* minor fixes

* use variable

* rename save as

* duplicate fixes

*  Implement unique workflow names

*  Create /workflows/new endpoint

* minor edit fixes

* lint fixes

* style fixes

* hook up saving name

* hook up tags

* clean up impl

* fix dirty state bug

* update limit

* update notification messages

* on click outside

* fix minor bug with count

* lint fixes

*  Add query string params to /workflows/new

* handle minor edge cases

* handle minor edge cases

* handle minor bugs; fix firefox dropdown issue

* Fix min width

* apply tags only after api success

* remove count fix

* 🚧 Adjust to new qs requirements

* clean up workflow tags impl, fix tags delete bug

* fix minor issue

* fix minor spacing issue

* disable wrap for ops

* fix viewport root; save on click in dropdown

* save button loading when saving name/tags

* implement max width on tags container

* implement cleaner create experience

* disable edit while updating

* codacy hex color

* refactor tags container

* fix clickability

* fix workflow open and count

* clean up structure

* fix up lint issues

*  Create migrations for unique workflow names

* fix button size

* increase workflow name limit for larger screen

* tslint fixes

* disable responsiveness for workflow modal

* rename event

* change min width for tags

* clean up pr

*  Adjust quotes in MySQL migration

*  Adjust quotes in Postgres migration

* address max's comments on styles

* remove success toasts

* add hover mode to name

* minor fixes

* refactor name preview

* fix name input not to jiggle

* finish up name input

* Fix up add tags

* clean up param

* clean up scss

* fix resizing name

* fix resizing name

* fix resize bug

* clean up edit spacing

* ignore on esc

* fix input bug

* focus input on clear

* build

* fix up add tags clickablity

* remove scrollbars

* move into folders

* clean up multiple patch req

* remove padding top from edit

* update tags on enter

* build

* rollout blur on enter behavior

* rollout esc behavior

* fix tags bug when duplicating tags

* move key to reload tags

* update header spacing

* build

* update hex case

* refactor workflow title

* remove unusued prop

* keep focus on error, fix bug on error

* Fix bug with name / tags toggle on error

* impl creating new workflow name

*  Refactor endpoint per new guidelines

* support naming endpoint

*  Refactor to support numeric suffixes

* 👕 Lint migrations for unique workflow names

*  Add migrations set default dates to indexes

* fix connection push bug

*  Lowercase default workflow name

*  Add prefixes to set default dates migration

*  Fix indentation on default dates migrations

*  Add temp ts-ignore for unrelated change

*  Adjust default dates migration for MySQL

Remove change to data column in credentials_entity, already covered by Omar's migration. Also, fix quotes from table prefix addition.

*  Adjust quotes in dates migration for PG

* fix safari color bug

* fix count bug

* fix scroll bugs in dropdown

* expand filter size

* apply box-sizing to main header

* update workflow names in executions to be wrapped by quotes

* fix bug where key is same in dropdown

* fix firefox bug

* move up push connection session

* 🔨 Remove mistakenly added nullable property

* 🔥 Remove unneeded index drop-create (PG)

* 🔥 Remove unneeded table copying

*  Merge dates migration with tags migration

* 🔨 Refactor endpoint and make wf name env

* dropdown colors in firefox

* update colors to use variables

* update thumb color

* change error message

* remove 100 char maximum

* fix bug with saving tags dropdowns multiple times

* update error message when no name

*  Update name missing toast message

*  Update workflow already exists message

* disable saving for executions

* fix bug causing modal to close

* make tags in workflow open clickable

* increase workflow limit to 3

* remove success notifications

* update header spacing

* escape tag names

* update tag and table colors

* remove tags from export

* build

* clean up push connection dependencies

* address ben's comments

* revert tags optional interface

* address comments

* update duplicate message

* build

* fix eol

* add one more eol

*  Update comment

* add hover style for workflow open, fix up font weight

Co-authored-by: Mutasem <mutdmour@gmail.com>
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
2021-05-29 13:31:21 -05:00
Omar Ajoue c972f3dd50
Added logging to n8n (#1381)
* Added logging to n8n

This commit adds logging to n8n using the Winston library.

For now, this commit only allows logging to console (default behavior)
or file (need to pass in config via environment variables).

Other logging methods can be further implemented using hooks. These were
skipped for now as it would require adding more dependencies.

Logging level is notice by default, meaning no additional messages would
be displayed at the moment. Logging level can be set to info or debug as
well to enrich the generated logs.

The ILogger interface was added to the workflow project as it would make
it available for all other projects but the implementation was done on
the cli project.

* Lint fixes and logging level naming. Also fixed the way we use the logger as it was not working previously

* Improvements to logging framework

Using appropriate single quotes
Improving the way the logger is declared

* Improved naming for Log Types

* Removed logger global variable, replacing it by a proxy

* Add logging to CLI commands

* Remove unused GenericHelpers

* Changed back some messages to console instead of logger and added npm
shortcuts for worker and webhook

* Fix typos

* Adding basic file rotation to logs as suggested by @mutdmour

* Fixed linting issues

* Correcting comment to correctly reflect space usage

* Added settings for log files rotation

* Correcting config type from String to Number

* Changed default file settings to number

To reflect previous changes to the type

* Changed the way log messages are added to be called statically. Also minor naming improvements

* Applying latest corrections sent by @ivov

*  Some logging improvements

* Saving logs to a folder inside n8n home instead of root

* Fixed broken tests and linting

* Changed some log messages to improve formatting

* Adding quotes to names  on log messages

* Added execution and session IDs to logs. Also removed unnecessary line breaks

*  Added file caller to log messages (#1657)

This is done using callsites library which already existed
in the project as another library's dependency. So in fact
it does not add any new dependency.

* Adding logs to help debug Salesforce node

*  Add function name to logs and add more logs

*  Improve some error messages

*  Improve some more log messages

*  Rename logging env variables to match others

Co-authored-by: dali <servfrdali@yahoo.fr>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-05-01 22:43:01 -05:00
Jan Oberhauser 2273a4cff2 Make max payload size configurable #1447 2021-04-09 12:13:42 +02:00
Jan Oberhauser 263813a8f9 Rename metrics environment variable 2021-03-11 00:10:39 +01:00
Bruno Bacarini b0b172a362
Add metrics endpoint (#1515)
This commit adds the new package prom-client in order to expose metrics
to prometheus as well as the endpoint and the configuration to do so.
2021-03-11 00:10:10 +01:00
Omar Ajoue 3ff7d3af39
🐛 Fix naming and description of environment variable (#1458) 2021-03-01 21:21:16 +01:00
Omar Ajoue e53efdd337
Separate webhooks from core (#1408)
* Unify execution ID across executions

* Fix indentation and improved comments

* WIP: saving data after each node execution

* Added on/off to save data after each step, saving initial data and retries working

* Fixing lint issues

* Fixing more lint issues

*  Add bull to execute workflows

* 👕 Fix lint issue

*  Add graceful shutdown to worker

*  Add loading staticData to worker

* 👕 Fix lint issue

*  Fix import

* Changed tables metadata to add nullable to stoppedAt

* Reload database on migration run

* Fixed reloading database schema for sqlite by reconnecting and fixing postgres migration

* Added checks to Redis and exiting process if connection is unavailable

* Fixing error with new installations

* Fix issue with data not being sent back to browser on manual executions with defined destination

* Merging bull and unify execution id branch fixes

* Main process will now get execution success from database instead of redis

* Omit execution duration if execution did not stop

* Fix issue with execution list displaying inconsistant information information while a workflow is running

* Remove unused hooks to clarify for developers that these wont run in queue mode

* Added active pooling to help recover from Redis crashes

* Lint issues

* Changing default polling interval to 60 seconds

* Removed unnecessary attributes from bull job

* Added webhooks service and setting to disable webhooks from main process

* Fixed executions list when running with queues. Now we get the list of actively running workflows from bull.

* Add option to disable deregistration of webhooks on shutdown

* Rename WEBHOOK_TUNNEL_URL to WEBHOOK_URL keeping backwards compat.

* Added auto refresh to executions list

* Improvements to workflow stop process when running with queues

* Refactor queue system to use a singleton and avoid code duplication

* Improve comments and remove unnecessary commits

* Remove console.log from vue file

* Blocking webhook process to run without queues

* Handling execution stop graciously when possible

* Removing initialization of all workflows from webhook process

* Refactoring code to remove code duplication for job stop

* Improved execution list to be more fluid and less intrusive

* Fixing workflow name for current executions when auto updating

*  Right align autorefresh checkbox

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-02-09 23:32:40 +01:00
Omar Ajoue 7a3aaf8a24
Unify execution id + Queue system (#1340)
* Unify execution ID across executions

* Fix indentation and improved comments

* WIP: saving data after each node execution

* Added on/off to save data after each step, saving initial data and retries working

* Fixing lint issues

* Fixing more lint issues

*  Add bull to execute workflows

* 👕 Fix lint issue

*  Add graceful shutdown to worker

*  Add loading staticData to worker

* 👕 Fix lint issue

*  Fix import

* Changed tables metadata to add nullable to stoppedAt

* Reload database on migration run

* Fixed reloading database schema for sqlite by reconnecting and fixing postgres migration

* Added checks to Redis and exiting process if connection is unavailable

* Fixing error with new installations

* Fix issue with data not being sent back to browser on manual executions with defined destination

* Merging bull and unify execution id branch fixes

* Main process will now get execution success from database instead of redis

* Omit execution duration if execution did not stop

* Fix issue with execution list displaying inconsistant information information while a workflow is running

* Remove unused hooks to clarify for developers that these wont run in queue mode

* Added active pooling to help recover from Redis crashes

* Lint issues

* Changing default polling interval to 60 seconds

* Removed unnecessary attributes from bull job

*  Improved output on worker job start

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-02-09 08:59:32 +01:00
Jan b33a5fcd13
💥 Remove MongoDB support 2021-01-23 20:35:38 +01:00
Jan Oberhauser 78f8114499 Minor text change 2021-01-07 13:17:49 +01:00
Omar Ajoue 04a8912a94 Changed vacuum operation to run on startup only. Also it is now off by default. 2021-01-04 09:30:02 +01:00
Omar Ajoue d528e442ba Run vacuum on sqlite periodically 2020-12-31 10:42:16 +01:00
Jan Oberhauser ea79e80c17 Make it possible to load only specific nodes 2020-12-01 10:53:43 +01:00
Jan Oberhauser 40c2acd77b 👕 Fix lint issue 2020-10-22 15:46:03 +02:00
Jan Oberhauser 3374fda7c6 Make it possible to open endpoints 2020-09-23 14:14:31 +02:00
Ahsan Virani 2a6f4ebf86
Add hash support in basic auth (#943) 2020-09-10 17:49:44 +02:00
Matthew Tovbin 4c275513b4
JWT extras (#817)
* JWT extras: check issues, expiration, namespace and tenant

* idents
2020-08-06 17:44:19 +02:00
Ben Hesseldieck 051598d30e
Add max execution time for Workflows (#755)
* 🎉 basic setup and execution stopping

* 🚧 soft timeout for own process executions

* 🚧 add hard timeout for subprocesses

* 🚧 add soft timeout to main thread

* 🔧 set default timeout to 5 mins --> 500s

* 💡 adding documentation to configs

* 🚧 deactivate timeout by default

* 🚧 add logic of max execution timeout

*  adding timeout to settings in frontend and server

* 🎨 improve naming

* 💡 fix change in config docs

* ✔️ fixing compilation issue

* 🎨 add format for new config variables

* 👌 type cast before checking equality

*  Improve error message if NodeType is not known

* 🐳 Tag also rpi latest image

* 🐛 Fix Postgres issue with Node.js 14 #776

* 🚧 add toggle to activate workflow timeout

* 💄 improving UX of setting a timeout and its duration

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2020-07-29 14:12:54 +02:00
Ben Hesseldieck ebe2775701
Add index stopped at (#766)
* 🚧 add index on sqlite

* 🚧 add migration for postgres

* 🚧 add mysql migration

* 🚧 add mongodb migration

*  revert change of default postgresdb user
2020-07-17 17:08:40 +02:00
Jan Oberhauser 8bfc5a4b65 Small improvements on execution pruning 2020-07-12 12:49:42 +02:00
Jan Oberhauser 78dc1e9449 🔀 Merge branch 'master' into WorkflowExecutionMaintainance 2020-07-12 12:20:59 +02:00
Jan Oberhauser 941ee06b14 Make n8n work in subfolder & Fix events in AffinityTrigger 2020-07-12 12:17:01 +02:00
Ben Hesseldieck b956444c0e 🐎 pruning execution data complete 2020-07-09 16:52:38 +02:00
Ricardo Espinoza 8aff042e04
* Endpoint to preset credentials
*  Endpoint to preset credentials

*  Improvements

* 🐛 Small fix

* 🐛 Small fix
2020-07-07 19:03:53 +02:00
Jan Oberhauser 6af3743e1b Add Postgres SSL support 2020-06-25 11:39:04 +02:00
Jan Oberhauser 1451f94814 🔀 Merge branch 'external-hooks' 2020-06-10 13:02:45 +02:00
Jan Oberhauser c7a901083b 🔀 Merge branch 'master' of github.com:n8n-io/n8n 2020-06-04 17:03:11 +02:00
Patrick Wellever 49ea7e2739
Make server listen address configurable (#618) 2020-06-04 09:36:10 +02:00
Jan Oberhauser 0387671cae Add additional external hooks and provide additional data 2020-05-05 01:23:54 +02:00
Jan Oberhauser a380a9a394 Add first basic code for external hooks 2020-05-04 08:56:01 +02:00
Jan Oberhauser 90fe5113a0 🔀 Merge branch 'master' into oauth-support 2020-04-14 20:54:19 +02:00
Jan Oberhauser 303062623b Add MariaDB support 2020-04-14 19:54:11 +02:00
Jan Oberhauser 9dd9e0d8ba 🔀 Merge branch 'master' into oauth-support 2020-04-04 17:34:10 +02:00
Jan Oberhauser 7c5f437e92 Make sure that it looks for SSL certs only if defined 2020-03-30 13:29:42 +02:00
Jan Oberhauser f00b7347c8 Minor improvements to SSL support 2020-03-29 12:46:55 +02:00
KH Wong 2870818211 Add HTTPS support by giving an SSL Cert and Key 2020-03-28 01:19:30 +08:00
Jan Oberhauser 764172d46f Add support for n8n configuration via file 2020-03-27 12:30:42 +01:00
Jan Oberhauser 255d30b2c7 Make it possible to define prefix for table names 2020-03-21 18:32:26 +01:00
Istvan Richter 31a2138f92 Add custom Postgres schema support 2020-03-18 06:26:33 +01:00
Guilherme Almeida Girardi 9e4b6cc97a Fixed MySQL default port 2020-02-10 13:18:28 -03:00
Guilherme Almeida Girardi 3bdd9096e1 Added support for MySQL
* In packages/cli/src/Db.ts, conditional test of dbType replaced by a
switch;
* removeAll() function adapted to not cause an error using MySQL;
* Added the cross-env module in the "serve" script in the
packages/editor-ui/package.json file. This was done to ensure
compatibility between platforms when declaring environment variables.
Without it, Windows compilation would give an error, for example;
* .idea added to .gitignore (IntelliJ IDEA solutions);
2020-02-10 13:09:06 -03:00
Jan Oberhauser eb285ef711 Make it possible to set credentials to fixed values 2020-01-25 23:48:38 -08:00
Jan Oberhauser e5ae4c77eb Change same-process-execution setting to make it future proof 2020-01-17 19:49:31 -06:00
Jan Oberhauser 95cb1b2788 Add possibility to execute workflows in same process 2020-01-17 19:34:31 -06:00
Jan Oberhauser 92669bb77a 🔀 Merge pull request #68 from ccakes:jwt-auth 2019-10-14 22:37:51 +02:00
Jan Oberhauser f3d84fc29e Make it possible to secure n8n via basic auth 2019-08-04 14:24:48 +02:00
Jan Oberhauser a9453806b8 Add support for PostgresDB and save date as Date 2019-07-22 20:29:06 +02:00
Jan Oberhauser d027545986 Use convict for configuration to make n8n easier to configure 2019-07-21 19:52:57 +02:00