diff --git a/_example/conf/lmConf-1.json b/_example/conf/lmConf-1.json index 86576584a..b0d8fb5d5 100644 --- a/_example/conf/lmConf-1.json +++ b/_example/conf/lmConf-1.json @@ -86,6 +86,7 @@ "authentication" : "Demo", "cfgAuthor" : "The LemonLDAP::NG team", "cfgNum" : 1, + "cfgVersion" : "2.0.0", "cookieName" : "lemonldap", "demoExportedVars" : { "cn" : "cn", diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Cli.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Cli.pm index 38794502e..22898f599 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Cli.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Cli.pm @@ -39,6 +39,7 @@ Num : $conf->{cfgNum} Author : $conf->{cfgAuthor} Author IP: $conf->{cfgAuthorIP} Date : } . localtime( $conf->{cfgDate} ) . qq{ +Version : $conf->{cfgVersion} Log : $conf->{cfgLog} }; } diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RESTServer.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RESTServer.pm index f3f3ac722..ea59cf145 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RESTServer.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RESTServer.pm @@ -646,7 +646,7 @@ sub metadatas { return $self->sendError( $req, undef, 400 ) if ( $req->error ); return $self->sendError( $req, "Configuration without cfgNum", 500 ) unless ( defined $res->{cfgNum} ); - foreach my $key (qw(cfgAuthor cfgDate cfgAuthorIP cfgLog)) { + foreach my $key (qw(cfgAuthor cfgDate cfgAuthorIP cfgLog cfgVersion)) { $res->{$key} = $self->getConfKey( $req, $key ); } diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 0b34964e1..115c68957 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -670,6 +670,9 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'default' => 0, 'type' => 'int' }, + 'cfgVersion' => { + 'type' => 'text' + }, 'checkXSS' => { 'default' => 1, 'type' => 'bool' diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index 5fab4f352..a957f3d92 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -236,6 +236,10 @@ sub attributes { type => 'longtext', documentation => 'Configuration update log', }, + cfgVersion => { + type => 'text', + documentation => 'Version of LLNG which build configuration', + }, confirmFormMethod => { type => "select", select => diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm index f52d10824..92eeda669 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm @@ -127,6 +127,7 @@ sub scanTree { || '_whatToTrace' } // "anonymous"; $self->newConf->{cfgAuthorIP} = $self->req->address; $self->newConf->{cfgDate} = time; + $self->newConf->{cfgVersion} = $VERSION; $self->newConf->{key} ||= join( '', map { chr( int( rand(94) ) + 33 ) } ( 1 .. 16 ) ); diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Zero.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Zero.pm index 7abc46a23..798d7f874 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Zero.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Zero.pm @@ -166,6 +166,7 @@ sub zeroConf { 'securedCookie' => 0, 'cookieName' => 'lemonldap', 'cfgAuthor' => 'The LemonLDAP::NG team', + 'cfgVersion' => $VERSION, 'exportedVars' => { 'UA' => 'HTTP_USER_AGENT' }, diff --git a/lemonldap-ng-manager/site/htdocs/static/forms/home.html b/lemonldap-ng-manager/site/htdocs/static/forms/home.html index ef993be80..e41796a63 100644 --- a/lemonldap-ng-manager/site/htdocs/static/forms/home.html +++ b/lemonldap-ng-manager/site/htdocs/static/forms/home.html @@ -25,6 +25,10 @@ {{currentCfg.date}} + + + {{currentCfg.cfgVersion}} + {{currentCfg.cfgLog}} diff --git a/lemonldap-ng-manager/site/htdocs/static/languages/en.json b/lemonldap-ng-manager/site/htdocs/static/languages/en.json index 7b0e6e96c..04cea8c18 100644 --- a/lemonldap-ng-manager/site/htdocs/static/languages/en.json +++ b/lemonldap-ng-manager/site/htdocs/static/languages/en.json @@ -118,6 +118,7 @@ "cspConnect": "Ajax destinations", "cspFont": "Font source", "cfgLog": "Resume", +"cfgVersion": "Configuration version", "checkXSS": "Check XSS attacks", "clickHereToForce": "Click here to force", "choiceParams": "Choice parameters", diff --git a/lemonldap-ng-manager/site/htdocs/static/languages/fr.json b/lemonldap-ng-manager/site/htdocs/static/languages/fr.json index 6545dacd6..cd18e3871 100644 --- a/lemonldap-ng-manager/site/htdocs/static/languages/fr.json +++ b/lemonldap-ng-manager/site/htdocs/static/languages/fr.json @@ -118,6 +118,7 @@ "cspConnect": "Destinations des requêtes Ajax", "cspFont": "Font source", "cfgLog": "Résumé", +"cfgVersion": "Version de la configuration", "checkXSS": "Contrôler les attaques XSS", "clickHereToForce": "Cliquer ici pour forcer", "choiceParams": "Paramètres des choix", diff --git a/lemonldap-ng-manager/t/80-attributes.t b/lemonldap-ng-manager/t/80-attributes.t index 7e694b174..d50c75e28 100644 --- a/lemonldap-ng-manager/t/80-attributes.t +++ b/lemonldap-ng-manager/t/80-attributes.t @@ -22,7 +22,7 @@ my @notManagedAttributes = ( 'oidcOPMetaDataOptions', 'vhostOptions', # Metadatas (added by manager itself) - 'cfgAuthor', 'cfgAuthorIP', 'cfgNum', 'cfgDate', 'cfgLog', + 'cfgAuthor', 'cfgAuthorIP', 'cfgNum', 'cfgDate', 'cfgLog', 'cfgVersion', # HTML template parameter (for PSGI) (must be set in lemonldap-ng.ini) 'staticPrefix', diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm index 59c596ae9..8ec4b9abb 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm @@ -1113,6 +1113,7 @@ sub registration { $conf->{cfgAuthor} = "OpenID Connect Registration ($client_name)"; $conf->{cfgAuthorIP} = $source_ip; + $conf->{cfgVersion} = $VERSION; $conf->{oidcRPMetaDataExportedVars}->{$rp} = {}; $conf->{oidcRPMetaDataOptions}->{$rp}->{oidcRPMetaDataOptionsClientID} =