Applications disappear from the portal in rare cases after saving configuration in the manager
Concerned version
Version: %2.0.2
Summary
I have witnessed a strange case in which all applications disappear from the portal after editing a completely unrelated setting.
Making a minor edit (description) to one application makes them appear again.
Logs
The faulty applications look like this in configuration:
"applicationList" : {
...
"0005-cat" : {
"0006-app" : {
"options" : {
"description" : "Configure LemonLDAP::NG WebSSO",
"display" : "on",
"logo" : "configure.png",
"name" : "WebSSO Manager",
"uri" : "https://manager.example.com/manager.html"
},
"type" : "menuApp"
},
...
They have type: menuApp
instead of type: application
, and after making any minor edit, the type is set to the correct value again and they all display correctly
And this is a redacted diff between a working configuration and the faulty one:
--- /dev/fd/63 2019-05-07 17:49:13.393814123 +0200
+++ /dev/fd/62 2019-05-07 17:49:13.393814123 +0200
@@ -14,7 +14,7 @@
},
- "type" : "application"
+ "type" : "menuApp"
},
"0003-app" : {
"options" : {
@@ -24,7 +24,7 @@
- "type" : "application"
+ "type" : "menuApp"
},
"0004-app" : {
"options" : {
@@ -34,7 +34,7 @@
},
- "type" : "application"
+ "type" : "menuApp"
},
@@ -48,7 +48,7 @@
"name" : "WebSSO Manager",
},
- "type" : "application"
+ "type" : "menuApp"
},
"0007-app" : {
"options" : {
@@ -58,7 +58,7 @@
"name" : "Notifications explorer",
},
- "type" : "application"
+ "type" : "menuApp"
},
"0008-app" : {
"options" : {
@@ -68,7 +68,7 @@
"name" : "Sessions explorer",
},
- "type" : "application"
+ "type" : "menuApp"
},
"catname" : "Administration",
"type" : "category"
@@ -82,7 +82,7 @@
"name" : "Local documentation",
- "type" : "application"
+ "type" : "menuApp"
},
"0011-app" : {
"options" : {
@@ -92,7 +92,7 @@
"name" : "Official Website",
"uri" : "http://lemonldap-ng.org/"
},
- "type" : "application"
+ "type" : "menuApp"
},
"catname" : "Documentation",
"type" : "category"
@@ -113,9 +113,9 @@
"cda" : "0",
- "cfgDate" : 1557133222,
+ "cfgDate" : 1557135349,
"cfgLog" : "",
- "cfgNum" : 90,
+ "cfgNum" : 91,
"cfgVersion" : "2.0.2",
"checkXSS" : "1",
"combModules" : {
@@ -206,9 +206,10 @@
"uid" : "lc $_user"
},
"mail2fActivation" : "$_2fDevices !~ /\"type\"\\s*:\\s*\"(UBK|TOTP|U2F)\"/s",
- "mail2fAuthnLevel" : "3",
+ "mail2fAuthnLevel" : 3,
"mail2fCodeRegex" : "\\d{6}",
+ "mail2fTimeout" : 300,
"mailCharset" : "utf-8",
@@ -509,7 +510,7 @@
"totp2fUserCanRemoveKey" : "1",
"trustedDomains" : "'*'",
"u2fActivation" : "1",
- "u2fAuthnLevel" : "4",
+ "u2fAuthnLevel" : 4,
"u2fSelfRegistration" : "$authenticationLevel > 2",
"u2fUserCanRemoveKey" : "1",
"upgradeSession" : "1",
As you can see, the corruption occurs when saving some setting in the mail2f plugin. It's probably a coincidence, I tried to reproduce the same change, but it did not break the menu this time.
There seem to be something wrong going on when parsing the JSON sent by the manager into an LLNG config. But I couldn't figure out what after looking at Conf::Parser.pm
.
Backends used
JSON file backend is used
Possible fixes
Saving the configuration again is enough to "repair" the applicationList by replacing the keyword menuApp
by application
.
EDITOR="sed -i 's/menuApp/application/'" /usr/*/lemonldap-ng/bin/lmConfigEditor