Skip to content

Commit

Permalink
enforce password at least 16 chars
Browse files Browse the repository at this point in the history
add comment re uiHost so user knows what we are doing
  • Loading branch information
dceejay committed Jan 6, 2024
1 parent 40fdb91 commit 53cc202
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/commands/init/index.js
Expand Up @@ -105,10 +105,10 @@ async function promptUser() {
{
type: 'password',
name: 'password',
message: "Password",
message: "Password (>16 characters)",
validate(val) {
if (val.length < 8) {
return "Password too short. Must be at least 8 characters"
if (val.length < 16) {
return "Password too short. Must be at least 16 characters"
}
return true
}
Expand All @@ -135,7 +135,7 @@ async function promptSecurity() {
type: 'select',
name: 'adminAuth',
initial: "Yes",
message: 'Do you want to setup user security?\n DO NOT select No if you will expose Node-RED to the internet - or you will be hacked!',
message: 'Do you want to setup user security?\n DO NOT select No if you will expose Node-RED to the internet - or you will be hacked!\n If you select No we will restrict browser access to only the machine Node-RED is running on.\n This can be changed by editing the uiHost entry in settings.js',
choices: ['Yes', 'No'],
result(value) {
return value === "Yes"
Expand Down Expand Up @@ -164,6 +164,7 @@ async function promptSecurity() {
}
else {
responses.uiHost = 'uiHost: "127.0.0.1",'
console.log("\nuiHost set to 127.0.0.1 to restrict access to local machine ONLY.");
}
return responses;
}
Expand Down

0 comments on commit 53cc202

Please sign in to comment.