Skip to content

Commit

Permalink
Add env var for safe and projects, update README, bump to 1.0.1
Browse files Browse the repository at this point in the history
to close #133
to close #141
  • Loading branch information
Dave Conway-Jones committed Oct 4, 2019
1 parent 4439444 commit aa524d7
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 235 deletions.
11 changes: 7 additions & 4 deletions .docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ FROM base AS build

# Install Build tools
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python && \
npm install --unsafe-perm --no-update-notifier --only=production && \
npm install --unsafe-perm --no-update-notifier --no-audit --only=production && \
/tmp/remove_native_gpio.sh && \
cp -R node_modules prod_node_modules

Expand Down Expand Up @@ -77,9 +77,12 @@ RUN chown -R node-red:node-red /usr/src/node-red && \
USER node-red

# Env variables
ENV NODE_RED_VERSION=$NODE_RED_VERSION
ENV FLOWS=flows.json
ENV NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules
ENV NODE_RED_VERSION=$NODE_RED_VERSION \
NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules \
FLOWS=flows.json

# ENV NODE_RED_ENABLE_SAFE_MODE=true # Uncomment to enable safe start mode (flows not running)
# ENV NODE_RED_ENABLE_PROJECTS=true # Uncomment to enable projects option

# User configuration directory volume
VOLUME ["/data"]
Expand Down
13 changes: 13 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: needs-more-info
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
26 changes: 8 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ We welcome contributions, but request you follow these guidelines.
- [Raising issues](#raising-issues)
- [Feature requests](#feature-requests)
- [Pull-Requests](#pull-requests)
- [Contributor License Agreement](#contributor-license-agreement)

This project adheres to the [Contributor Covenant 1.4](http://contributor-covenant.org/version/1/4/).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to any of the [project's core team](https://github.com/orgs/node-red/teams/core).
behavior to the project's core team at [email protected].

## Raising issues

Expand All @@ -30,29 +29,21 @@ At a minimum, please include:

## Feature requests

For feature requests, please raise them on the [mailing list](https://groups.google.com/forum/#!forum/node-red).
For feature requests, please raise them on the [mailing list](https://discourse.nodered.org).

## Pull-Requests

If you want to raise a pull-request with a new feature, or a refactoring
of existing code, it may well get rejected if you haven't discussed it on
the [mailing list](https://groups.google.com/forum/#!forum/node-red) first.
the [forum](https://discourse.nodered.org) first.

### Contributor License Agreement
All contributors need to sign the JS Foundation's Contributor License Agreement.
It is an online process and quick to do. You can read the details of the agreement
here: https://cla.js.foundation/node-red/node-red.

In order for us to accept pull-requests, the contributor must first complete
a Contributor License Agreement (CLA). This clarifies the intellectual
property license granted with any contribution. It is for your protection as a
Contributor as well as the protection of IBM and its customers; it does not
change your rights to use your own Contributions for any other purpose.
If you raise a pull-request without having signed the CLA, you will be prompted
to do so automatically.

You can download the CLAs here:

- [individual](http://nodered.org/cla/node-red-cla-individual.pdf)
- [corporate](http://nodered.org/cla/node-red-cla-corporate.pdf)

If you are an IBMer, please contact us directly as the contribution process is
slightly different.

### Coding standards

Expand All @@ -63,4 +54,3 @@ code base. Some basic rules include:
- indent with 4-spaces, no tabs. No arguments.
- opening brace on same line as `if`/`for`/`function` and so on, closing brace
on its own line.
- There are .jshintrc and .jscsrc files included in the project which may help
322 changes: 128 additions & 194 deletions README.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions docker-custom/Dockerfile.custom
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ RUN chown -R node-red:node-red /usr/src/node-red && \
USER node-red

# Env variables
ENV NODE_RED_VERSION=$NODE_RED_VERSION
ENV FLOWS=flows.json
ENV NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules
ENV NODE_RED_VERSION=$NODE_RED_VERSION \
NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules \
FLOWS=flows.json

# ENV NODE_RED_ENABLE_SAFE_MODE=true # Uncomment to enable safe start mode (flows not running)
# ENV NODE_RED_ENABLE_PROJECTS=true # Uncomment to enable projects option

# User configuration directory volume
VOLUME ["/data"]
Expand Down
19 changes: 9 additions & 10 deletions docker-custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd node-red-docker/docker-custom

- Change the node-red version in package.json (from the docker-custom directory) to the version you require
- Add optionally packages you require

## 2. **docker-make.sh**

The `docker-make.sh` is a helper script to build a custom Node-RED docker image.
The `docker-make.sh` is a helper script to build a custom Node-RED docker image.

Change the build arguments as needed:

Expand All @@ -32,33 +32,32 @@ Change the build arguments as needed:
- `--build-arg NODE_RED_VERSION=${NODE_RED_VERSION}` : don't change this, ${NODE_RED_VERSION} gets populated from package.json
- `--build-arg OS=alpine` : the linux distro to use (alpine)
- `--build-arg BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")"` : don't change this
- `--build-arg TAG_SUFFIX=default` : to build the default or minimal image
- `--build-arg TAG_SUFFIX=default` : to build the default or minimal image
- `--file Dockerfile.custom` : Dockerfile to use to build your image.
- `--tag testing:node-red-build` : set the image name and tag

## 3. **Run docker-make.sh**

Run `docker-make.sh`
Run `docker-make.sh`

```shell script
$ ./docker-make.sh
```

This starts building your custom image and might take a while depending on the system you are running on.

When building is done you can run the custom image by the following command:

```shell script
$ docker run -it -p1880:1880 testing:node-red-build
```

With the following command you can verify your docker image:

```shell script
$ docker inspect testing:node-red-build
```

## 4. **Advanced Configuration**

`Dockerfile.custom` can be modified as required. To add more applications the `scripts/install_devtools.sh` can be modified as needed.

6 changes: 3 additions & 3 deletions docker-custom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-docker",
"version": "1.0.0",
"version": "1.0.1",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
Expand All @@ -10,7 +10,7 @@
},
"main": "node_modules/node-red/red/red.js",
"scripts": {
"start": "node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS"
"start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS"
},
"contributors": [
{
Expand All @@ -27,7 +27,7 @@
}
],
"dependencies": {
"node-red": "1.0.0"
"node-red": "^1.0.1"
},
"engines": {
"node": ">=10"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-docker",
"version": "1.0.0",
"version": "1.0.1",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
Expand All @@ -10,7 +10,7 @@
},
"main": "node_modules/node-red/red/red.js",
"scripts": {
"start": "node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS"
"start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS"
},
"contributors": [
{
Expand All @@ -27,7 +27,7 @@
}
],
"dependencies": {
"node-red": "1.0.0"
"node-red": "^1.0.1"
},
"engines": {
"node": ">=10"
Expand Down

0 comments on commit aa524d7

Please sign in to comment.