Skip to content

Commit

Permalink
Merge pull request #41 from n8n-io/master
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
wasimakh2 authored Jun 3, 2021
2 parents 718929c + 8ce158d commit 8704f34
Show file tree
Hide file tree
Showing 1,990 changed files with 247,796 additions and 23,349 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
packages/*/node_modules
packages/*/dist
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Expand All @@ -12,4 +13,4 @@ indent_style = space
indent_size = 2

[*.ts]
quote_type = single
quote_type = single
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
- OS: [e.g. Ubuntu Linux 18.04]
- n8n Version [e.g. 0.26.0]
- Node.js Version [e.g. 10.16.0]
- n8n Version [e.g. 0.119.0]
- Node.js Version [e.g. 14.16.0]
- Database system [e.g. SQLite; n8n uses SQLite as default otherwise changed]
- Operation mode [e.g. own; operation modes are `own`, `main` and `queue`. Default is `own`]

**Additional context**
Add any other context about the problem here.
49 changes: 49 additions & 0 deletions .github/workflows/docker-images-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Nightly Image CI

on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
branch:
description: 'Name of the GitHub branch to create image off.'
required: true
default: 'master'
tag:
description: 'Name of the docker tag to create.'
required: true
default: 'nightly'

jobs:

build:

runs-on: ubuntu-latest

steps:
-
name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch || 'master' }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/images/n8n-custom/Dockerfile
platforms: linux/amd64
push: true
tags: n8nio/n8n:${{ github.event.inputs.tag || 'nightly' }}
40 changes: 40 additions & 0 deletions .github/workflows/docker-images-rpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker Image CI - Rpi

on:
push:
tags:
- n8n@*
workflow_dispatch:
inputs:
version:
description: 'n8n version to build docker image for.'
required: true
default: '0.112.0'

jobs:
armv7_job:
runs-on: ubuntu-18.04
name: Build on ARMv7 (Rpi)
steps:
- uses: actions/checkout@v1
- name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:14})

- name: Log in to Docker registry
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
with:
buildx-version: latest
qemu-version: latest
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build \
--platform linux/arm/v7 \
--build-arg N8N_VERSION=${{github.event.inputs.version || steps.vars.outputs.tag}} \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:${{github.event.inputs.version || steps.vars.outputs.tag}}-rpi \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:latest-rpi \
--output type=image,push=true docker/images/n8n-rpi
12 changes: 8 additions & 4 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
- name: Push docker images of latest
run: docker push n8nio/n8n:latest

- name: Build the Docker image of version (Ubuntu)
run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu docker/images/n8n-ubuntu
- name: Push Docker image of version (Ubuntu)
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu
- name: Build the Docker image of version (Debian)
run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-debian docker/images/n8n-debian
- name: Push Docker image of version (Debian)
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-debian
- name: Tag Docker image with latest (Debian)
run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}}-debian n8nio/n8n:latest-debian
- name: Push docker images of latest (Debian)
run: docker push n8nio/n8n:latest-debian
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -23,5 +23,6 @@ jobs:
npm run bootstrap
npm run build --if-present
npm test
npm run tslint
env:
CI: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ _START_PACKAGE
.env
.vscode
.idea
.prettierrc.js
vetur.config.js
82 changes: 21 additions & 61 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ n8n is split up in different modules which are all in a single mono repository.

The most important directories:

- [/docker/image](/docker/image) - Dockerfiles to create n8n containers
- [/docker/image](/docker/images) - Dockerfiles to create n8n containers
- [/docker/compose](/docker/compose) - Examples Docker Setups
- [/packages](/packages) - The different n8n modules
- [/packages/cli](/packages/cli) - CLI code to run front- & backend
- [/packages/core](/packages/core) - Core code which handles workflow
execution, active webhooks and
workflows
- [/packages/editor-ui](/packages/editor-ui) - Vue frontend workflow editor
- [/packages/node-dev](/packages/node-dev) - Simple CLI to create new n8n-nodes
- [/packages/node-dev](/packages/node-dev) - CLI to create new n8n-nodes
- [/packages/nodes-base](/packages/nodes-base) - Base n8n nodes
- [/packages/workflow](/packages/workflow) - Workflow code with interfaces which
get used by front- & backend
Expand All @@ -57,11 +57,16 @@ dependencies are installed and the packages get linked correctly. Here a short g

The packages which n8n uses depend on a few build tools:

Linux:
Debian/Ubuntu:
```
apt-get install -y build-essential python
```

CentOS:
```
yum install gcc gcc-c++ make
```

Windows:
```
npm install -g windows-build-tools
Expand Down Expand Up @@ -119,6 +124,10 @@ To start n8n execute:
npm run start
```

To start n8n with tunnel:
```
./packages/cli/bin/n8n start --tunnel
```

## Development Cycle

Expand All @@ -130,7 +139,7 @@ automatically build your code, restart the backend and refresh the frontend
```
npm run dev
```
1. hack, hack, hack
1. Hack, hack, hack
1. Check if everything still runs in production mode
```
npm run build
Expand Down Expand Up @@ -159,83 +168,34 @@ tests of all packages.

## Create Custom Nodes

It is very easy to create own nodes for n8n. More information about that can
be found in the documentation of "n8n-node-dev" which is a small CLI which
helps with n8n-node-development.
Learn about [using the node dev CLI](https://docs.n8n.io/nodes/creating-nodes/node-dev-cli.html) to create custom nodes for n8n.

[To n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev)
More information can
be found in the documentation of [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev), which is a small CLI which
helps with n8n-node-development.



## Create a new node to contribute to n8n

If you want to create a node which should be added to n8n follow these steps:

1. Read the information in the [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) package as it contains a lot of generic information about node development.

1. Create the n8n development setup like described above and start n8n in develoment mode `npm run dev`

1. Create a new folder for the new node. For a service named "Example" the folder would be called: `/packages/nodes-base/nodes/Example`

1. If there is already a similar node simply copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder.

1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to simply copy existing similar ones.
Follow this tutorial on [creating your first node](https://docs.n8n.io/nodes/creating-nodes/create-node.html) for n8n.

1. Add the path to the new node (and optionally credentials) to package.json of `nodes-base`. It already contains a property `n8n` with its own keys `credentials` and `nodes`.

1. Add icon for the node (60x60 PNG)

1. Start n8n. The new node will then be available via the editor UI and can be tested.


When developing n8n must get restarted and the browser reloaded every time parameters of a node change (like new ones added, removed or changed). Only then will the new data be loaded and the node displayed correctly.

If only the code of the node changes (the execute method) than it is not needed as each workflow automatically starts a new process and so will always load the latest code.


## Checklist before submitting a new node

If you'd like to submit a new node, please go through the following checklist. This will help us be quicker to review and merge your PR.

- [ ] Make failing requests to the API to ensure that the errors get displayed correctly (like malformed requests or requests with invalid credentials)
- [ ] Ensure that the default values do not change and that the parameters do not get renamed, as it would break the existing workflows of the users
- [ ] Ensure that all the top-level parameters use camelCase
- [ ] Ensure that all the options are ordered alphabetically, unless a different order is needed for a specific reason
- [ ] Ensure that the parameters have the correct type
- [ ] Make sure that the file-name and the Class name are identical (case sensitive). The name under "description" in the node-code should also be identical (except that it starts with a lower-case letter and that it will never have a space)
- [ ] Names of Trigger-Nodes always have to end with "Trigger"
- [ ] Add credentials and nodes to the `package.json` file in alphanumerical order
- [ ] Use tabs in all the files except in the `package.json` file, where 4-spaces have to get used
- [ ] To make it as simple as possible for the users, check other similar nodes to ensure that they all behave similarly
- [ ] Try to add as few parameters as possible on the main level to ensure that the node doesn't appear overwhelming. It should only contain the required parameters. All the other ones should be hidden on lower levels as "Additional Parameters" or "Options"
- [ ] Create only one node per service which can do everything via "Resource" and "Options" and not a separate one for each possible operation.
There are several things to keep in mind when creating a node. To help you, we prepared a [checklist](https://docs.n8n.io/nodes/creating-nodes/node-review-checklist.html) that covers the requirements for creating nodes, from preparation to submission. This will help us be quicker to review and merge your PR.


## Extend Documentation

All the files which get used in the n8n documentation on [https://docs.n8n.io](https://docs.n8n.io)
can be found in the [/docs](https://github.com/n8n-io/n8n/tree/master/docs) folder. So all changes
and additions can directly be made in there

That the markdown docs look pretty we use [docsify](https://docsify.js.org). It is possible to test
locally how it looks like rendered with the following commands:

```bash
# 1. Install docisify
npm i docsify-cli -g

# 2. Go into n8n folder (the same folder which contains this file). For example:
cd /data/n8n

# 3. Start docsificy
docsify serve ./docs
```
The repository for the n8n documentation on [docs.n8n.io](https://docs.n8n.io) can be found [here](https://github.com/n8n-io/n8n-docs).


## Contributor License Agreement

That we do not have any potential problems later it is sadly necessary to sign a [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md). That can be done literally with the push of a button.

We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally just a few lines long.
We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally only a few lines long.

A bot will automatically comment on the pull request once it got opened asking for the agreement to be signed. Before it did not get signed it is sadly not possible to merge it in.
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Condition notice.

Software: n8n

License: Apache 2.0
License: Apache 2.0 with Commons Clause

Licensor: n8n GmbH

Expand Down Expand Up @@ -215,7 +215,7 @@ Licensor: n8n GmbH
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2020 n8n GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 8704f34

Please sign in to comment.