diff --git a/code/espurna/config/defaults.h b/code/espurna/config/defaults.h index d97d7711..1bb4ed7f 100644 --- a/code/espurna/config/defaults.h +++ b/code/espurna/config/defaults.h @@ -556,9 +556,13 @@ // General // ----------------------------------------------------------------------------- -// Default hostname will be ESPURNA-XXXXXX, where XXXXXX is last 3 octets of chipID +// Device name (DNS, SoftAP SSID, ALEXA etc.) +// If empty, default will be ESPURNA-XXXXXX, where XXXXXX is last 3 octets of chipID +// When set, must be 1..31 characters. See: +// https://github.com/xoseperez/espurna/issues/921 +// https://github.com/xoseperez/espurna/issues/1151 #ifndef HOSTNAME -#define HOSTNAME "" +#define HOSTNAME "" #endif // Relay providers diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 5c1431b2..357c3bed 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -9,8 +9,11 @@ #define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name +// When defined, ADMIN_PASS must be 8..63 printable ASCII characters. See: +// https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution) +// https://github.com/xoseperez/espurna/issues/1151 #ifndef ADMIN_PASS -#define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI) +#define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI SoftAP) #endif #ifndef USE_PASSWORD diff --git a/code/html/custom.js b/code/html/custom.js index 754fa772..4a111572 100644 --- a/code/html/custom.js +++ b/code/html/custom.js @@ -150,13 +150,17 @@ function validateForm(form) { // http://www.the-art-of-web.com/javascript/validate-password/ // at least one lowercase and one uppercase letter or number - // at least five characters (letters, numbers or special characters) - var re_password = /^(?=.*[A-Z\d])(?=.*[a-z])[\w~!@#$%^&*\(\)<>,.\?;:{}\[\]\\|]{5,}$/; + // at least eight characters (letters, numbers or special characters) + + // MUST be 8..63 printable ASCII characters. See: + // https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution) + // https://github.com/xoseperez/espurna/issues/1151 + var re_password = /^(?=.*[A-Z\d])(?=.*[a-z])[\w~!@#$%^&*\(\)<>,.\?;:{}\[\]\\|]{8,63}$/; // password var adminPass1 = $("input[name='adminPass']", form).first().val(); if (adminPass1.length > 0 && !re_password.test(adminPass1)) { - alert("The password you have entered is not valid, it must have at least 5 characters, 1 lowercase and 1 uppercase or number!"); + alert("The password you have entered is not valid, it must be 8..63 characters and have at least 1 lowercase and 1 uppercase / number!"); return false; } @@ -173,9 +177,9 @@ function validateForm(form) { // No other symbols, punctuation characters, or blank spaces are permitted. // Negative lookbehind does not work in Javascript - // var re_hostname = new RegExp('^(?!-)[A-Za-z0-9-]{1,32}(? - +