Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Support configuration of Node-Red webserver root with HTTP_ROOT #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Or, you can create an application in your balenaCloud dashboard and balena push
## Configure via [environment variables](https://balena.io/docs/learn/manage/serv-vars/)

| Variable Name | Default | Description |
| -------------- | -------- | ------------------------------------------------------- |
| -------------- | ------- | ------------------------------------------------------- |
| PORT | `80` | the port that exposes the Node-RED UI |
| USERNAME | `balena` | the Node-RED admin username |
| PASSWORD | `balena` | the Node-RED admin password |
| ENCRIPTION_KEY | `balena` | the encription key used to store your credentials files |
| HTTP_ROOT | `/` | default HTTP root. can be overridden for reverse proxy |

You **must** set the `USERNAME` and `PASSWORD` environment variables to be able to save or run programs in Node-RED.
More information about using and setting environment variables can be found in
Expand Down
1 change: 1 addition & 0 deletions balena.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data:
- USERNAME: balena
- PASSWORD: balena
- ENCRIPTION_KEY: balena
- HTTP_ROOT: "/"
defaultDeviceType: raspberry4-64
supportedDeviceTypes:
- raspberry-pi
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- "USERNAME=balena"
- "PASSWORD=balena"
- "ENCRIPTION_KEY=balena"
- "HTTP_ROOT=/"
cap_add:
- SYS_RAWIO
devices:
Expand Down
2 changes: 1 addition & 1 deletion node-red/app/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = {

// The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
// to apply the same root to both parts.
//httpRoot: '/red',
httpRoot: process.env.HTTP_ROOT,

// When httpAdminRoot is used to move the UI to a different root path, the
// following property can be used to identify a directory of static content
Expand Down