y を選択すると、内部的に node-red admin init が実行され、settings.js を対話形式で作成するウィザードが始まります。以下の順に質問が表示されます。
① Settings file(設定ファイルの保存先)
Node-RED Settings File initialisation
======================================
This tool will help you create a Node-RED settings file.
? Settings file · /home/ユーザー名/.node-red/settings.js
デフォルトのパスのまま Enter で進みます。
② Share Anonymous Usage Information(テレメトリ)
Share Anonymouse Usage Information
====================================
? Node-RED can notify you when there is a new version available.
This ensures you keep up to date with the latest features and fixes.
This requires sending anonymised data back to the Node-RED team.
It does not include any details of your flows or users.
For full information on what information is collected and how it is used,
please see https://nodered.org/docs/telemetry
Yes, send my usage data
❯ No, do not send my usage data
匿名の使用状況データを送信するかどうかを選択します。どちらでも動作に影響はありません。
③ User Security(ユーザーセキュリティ)
User Security
=============
? Do you want to setup user security? · Yes
Yes を強く推奨します。Node-RED エディタへのアクセスにユーザー名・パスワード認証を設定します。
⚠️ セキュリティ上の注意
セキュリティ設定を行わない場合、同じネットワーク上の誰でもNode-REDエディタにアクセスしてフローを変更できてしまいます。特にネットワーク経由でアクセスする場合は必ず設定してください。
Yes を選択すると、続けて以下の入力を求められます。
| 質問 |
入力例 |
説明 |
| Username |
admin |
ログインユーザー名 |
| Password |
******** |
8文字以上のパスワード(入力時は非表示) |
| User permissions |
full access |
full access(フル権限)または read-only access(閲覧のみ)を選択 |
| Add another user? |
No |
追加ユーザーが必要な場合は Yes |
✔ Do you want to setup user security? · Yes
✔ Username · admin
✔ Password · ****************
? User permissions …
❯ full access
read-only access
✔ Add another user? · No
④ Projects(プロジェクト機能)
Projects
========
The Projects feature allows you to version control your flow using a local git
repository.
? Do you want to enable the Projects feature? …
❯ Yes
No
フローをGitで管理できるプロジェクト機能の有効/無効を選択します。
💡 Projects 機能について
Yes を選ぶとフローをローカルGitリポジトリでバージョン管理できます。チーム開発やバックアップ目的に便利です。No の場合はフローファイル名とクレデンシャル暗号化パスフレーズの入力が代わりに表示されます。
Yes を選んだ場合、プロジェクトワークフローを選択します。
? What project workflow do you want to use? …
❯ manual - you must manually commit changes
auto - changes are automatically committed
No を選んだ場合、以下の入力が表示されます。
| 質問 |
デフォルト |
説明 |
| Enter a name for your flows file |
flows.json |
フロー定義の保存ファイル名 |
| Provide a passphrase to encrypt your credentials file |
(なし) |
ノードに保存された認証情報の暗号化キー |
⑤ Editor settings(エディタ設定)
Editor settings
===============
? Select a theme for the editor. To use any theme other than "default", you will
need to install @node-red-contrib-themes/theme-collection in your Node-RED user
directory. …
❯ default
aurora
cobalt2
dark
dracula
espresso-libre
...
エディタのテーマを選択します。default 以外を使う場合は別途テーマパッケージのインストールが必要です。
? Select the text editor component to use in the Node-RED Editor …
❯ monaco (default)
ace
コードエディタのエンジンを選択します。monaco(VS Code と同じエンジン)が推奨です。
⑥ Node settings(ノード設定)
Node settings
=============
? Allow Function nodes to load external modules? (functionExternalModules) …
❯ Yes
No
Functionノード内で require() を使って外部 npm モジュールを読み込めるようにするかの設定です。Yes にすると便利ですが、セキュリティが気になる場合は No を選んでください。
✅ 設定完了
すべての質問に回答すると settings.js が生成され、インストールが続行されます。これらの設定は後から ~/.node-red/settings.js を直接編集するか、node-red admin init を再実行して変更できます。