Skip to content

Commit

Permalink
Merge pull request #375 from fisuda/fix/issue_373
Browse files Browse the repository at this point in the history
Fix NODE_RED_INSTANCE_NUMBER value checking (#373)
  • Loading branch information
fisuda committed May 28, 2024
2 parents b85c20f + 422683f commit 16c2d83
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## FIWARE Big Bang v0.37.0-next

- Fix NODE_RED_INSTANCE_NUMBER value checking (#375)
- Update Cygnus to 3.8.0 (#372)
- Update IoT Agent for JSON to 3.4.0 (#371)
- Update IoT Agent for UltraLight to 3.4.0 (#370)
Expand Down
2 changes: 1 addition & 1 deletion docs/en/installation/node-red.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can specify configurations by editing the `config.sh` file.
| Variable name | Description | Default value |
| -------------------------------------- | --------------------------------------------------------------------- | ---------------------------------- |
| NODE\_RED | A sub-domain name of Node-RED | (empty) |
| NODE\_RED\_INSTANCE\_NUMBER | Number of Node-RED instance. | 1 |
| NODE\_RED\_INSTANCE\_NUMBER | Number of Node-RED instance. Must be between 1 and 20 when specified | 1 |
| NODE\_RED\_INSTANCE\_USERNAME | Username for Node-RED instance. | node-red |
| NODE\_RED\_INSTANCE\_HTTP\_ROOT | HTTP root for Node-RED instance. Must be a path starting with '/' | / (single) or /node-red??? (multi) |
| NODE\_RED\_INSTANCE\_HTTP\_ADMIN\_ROOT | httpAdminRoot for Node-RED instance. Must be a path starting with '/' | / (single) or /node-red??? (multi) |
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/installation/node-red.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
| 変数名 | 説明 | 既定値 |
| -------------------------------------- | ------------------------------------------------------------- | ----------------------------------------- |
| NODE\_RED | Node-RED のサブドメイン名 | (なし) |
| NODE\_RED\_INSTANCE\_NUMBER | Node-RED のインスタンス数 | 1 |
| NODE\_RED\_INSTANCE\_NUMBER | Node-RED のインスタンス数。1 から20 の間の数値を指定可能 | 1 |
| NODE\_RED\_INSTANCE\_USERNAME | Node-RED インスタンスのユーザ名 | node-red |
| NODE\_RED\_INSTANCE\_HTTP\_ROOT | Node-RED インスタンスの HTTP ルート。'/' で始まるパスを指定 | / (シングル) または /node-red??? (マルチ) |
| NODE\_RED\_INSTANCE\_HTTP\_ADMIN\_ROOT | Node-RED インスタンスの httpAdminRoot。'/' で始まるパスを指定 | / (シングル) または /node-red??? (マルチ) |
Expand Down
15 changes: 8 additions & 7 deletions lets-fiware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,20 @@ check_iot_agent_values() {
check_node_red_values() {
logging_info "${FUNCNAME[0]}"

if [ -n "${NODE_RED_INSTANCE_NUMBER}" ]; then
if [ "${NODE_RED_INSTANCE_NUMBER}" -lt 2 ] || [ "${NODE_RED_INSTANCE_NUMBER}" -gt 20 ]; then
echo "error: NODE_RED_INSTANCE_NUMBER out of range (2-20)"
exit "${ERR_CODE}"
fi
NODE_RED_INSTANCE_NUMBER=${NODE_RED_INSTANCE_NUMBER:-1}

if [ "${NODE_RED_INSTANCE_NUMBER}" -lt 1 ] || [ "${NODE_RED_INSTANCE_NUMBER}" -gt 20 ]; then
echo "error: NODE_RED_INSTANCE_NUMBER out of range (1-20)"
exit "${ERR_CODE}"
fi

if [ "${NODE_RED_INSTANCE_NUMBER}" -ge 2 ]; then
if [ -z "${NODE_RED_INSTANCE_HTTP_ADMIN_ROOT}" ]; then
NODE_RED_INSTANCE_HTTP_ADMIN_ROOT=/node-red
fi
if [ -z "${NODE_RED_INSTANCE_USERNAME}" ]; then
NODE_RED_INSTANCE_USERNAME=node-red
fi
else
NODE_RED_INSTANCE_NUMBER=1
fi
}

Expand Down

0 comments on commit 16c2d83

Please sign in to comment.