Commit 08fc4b16 authored by Xavier Guimard's avatar Xavier Guimard

Build first lmConf-1.js file with Zero.pm

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/trunk@4169 1dbb9719-a921-0410-b57f-c3a383c2c641
parent fa38f73e
......@@ -122,12 +122,14 @@ ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
MANAGERJSONSRC= scripts/jsongenerator.pl \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Attributes.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Tree.pm
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Tree.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Conf/Zero.pm
MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
$(SRCMANAGERDIR)/site/static/js/conftree.js \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Attributes.pm \
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Constants.pm \
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm \
_example/conf/lmConf-1.js
PERLCOMMONSRC:=$(shell find $(SRCCOMMONDIR)/lib -name '*.pm')
PERLCOMMONDST=$(SRCCOMMONDIR)/blib/lib/Lemonldap/NG/Common.pm
PERLHANDLERSRC:=$(shell find $(SRCHANDLERDIR)/lib -name '*.pm')
......
{
"portal" : "http://auth.__DNSDOMAIN__/",
"persistentStorage" : "Apache::Session::File",
"portalSkinBackground" : "1280px-Cedar_Breaks_National_Monument_partially.jpg",
"globalStorageOptions" : {
"LockDirectory" : "__SESSIONDIR__/lock",
"Directory" : "__SESSIONDIR__",
"generateModule" : "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
},
"passwordDB" : "Demo",
"locationRules" : {
"test2.__DNSDOMAIN__" : {
"default" : "accept",
"^/logout" : "logout_sso"
},
"manager.__DNSDOMAIN__" : {
"default" : "$uid eq \"dwho\""
},
"test1.__DNSDOMAIN__" : {
"^/logout" : "logout_sso",
"default" : "accept"
}
},
"cfgNum" : "1",
"exportedVars" : {
"UA" : "HTTP_USER_AGENT"
},
"authentication" : "Demo",
"mailUrl" : "http://auth.__DNSDOMAIN__/mail.pl",
"applicationList" : {
"1sample" : {
"catname" : "Sample applications",
"test2" : {
"options" : {
"uri" : "http://test2.__DNSDOMAIN__/",
"display" : "auto",
"name" : "Application Test 2",
"description" : "The same simple application displaying authenticated user",
"logo" : "thumbnail.png"
},
"type" : "application"
},
"test1" : {
"options" : {
"logo" : "demo.png",
"description" : "A simple application displaying authenticated user",
"display" : "auto",
"logo" : "demo.png",
"name" : "Application Test 1",
"uri" : "http://test1.__DNSDOMAIN__/",
"display" : "auto"
"uri" : "http://test1.__DNSDOMAIN__/"
},
"type" : "application"
},
"type" : "category"
},
"3documentation" : {
"officialwebsite" : {
"type" : "application",
"options" : {
"logo" : "network.png",
"display" : "on",
"uri" : "http://lemonldap-ng.org/",
"description" : "Official LemonLDAP::NG Website",
"name" : "Offical Website"
}
},
"localdoc" : {
"test2" : {
"options" : {
"logo" : "help.png",
"uri" : "http://manager.__DNSDOMAIN__/doc/",
"display" : "on",
"name" : "Local documentation",
"description" : "Documentation supplied with LemonLDAP::NG"
"description" : "The same simple application displaying authenticated user",
"display" : "auto",
"logo" : "thumbnail.png",
"name" : "Application Test 2",
"uri" : "http://test2.__DNSDOMAIN__/"
},
"type" : "application"
},
"type" : "category",
"catname" : "Documentation"
"type" : "category"
},
"2administration" : {
"type" : "category",
"catname" : "Administration",
"manager" : {
"options" : {
"logo" : "configure.png",
"uri" : "http://manager.__DNSDOMAIN__/manager.html",
"description" : "Configure LemonLDAP::NG WebSSO",
"display" : "auto",
"logo" : "configure.png",
"name" : "WebSSO Manager",
"description" : "Configure LemonLDAP::NG WebSSO"
"uri" : "http://manager.__DNSDOMAIN__/manager.html"
},
"type" : "application"
},
"sessions" : {
"type" : "application",
"notifications" : {
"options" : {
"logo" : "database.png",
"uri" : "http://manager.__DNSDOMAIN__/sessions.html",
"description" : "Explore WebSSO notifications",
"display" : "auto",
"description" : "Explore WebSSO sessions",
"name" : "Sessions explorer"
}
"logo" : "database.png",
"name" : "Notifications explorer",
"uri" : "http://manager.__DNSDOMAIN__/notifications.html"
},
"type" : "application"
},
"catname" : "Administration",
"notifications" : {
"type" : "application",
"sessions" : {
"options" : {
"logo" : "database.png",
"uri" : "http://manager.__DNSDOMAIN__/notifications.html",
"description" : "Explore WebSSO sessions",
"display" : "auto",
"description" : "Explore WebSSO notifications",
"name" : "Notifications explorer"
}
}
"logo" : "database.png",
"name" : "Sessions explorer",
"uri" : "http://manager.__DNSDOMAIN__/sessions.html"
},
"type" : "application"
},
"type" : "category"
},
"3documentation" : {
"catname" : "Documentation",
"localdoc" : {
"options" : {
"description" : "Documentation supplied with LemonLDAP::NG",
"display" : "on",
"logo" : "help.png",
"name" : "Local documentation",
"uri" : "http://manager.__DNSDOMAIN__/doc/"
},
"type" : "application"
},
"officialwebsite" : {
"options" : {
"description" : "Official LemonLDAP::NG Website",
"display" : "on",
"logo" : "network.png",
"name" : "Offical Website",
"uri" : "http://lemonldap-ng.org/"
},
"type" : "application"
},
"type" : "category"
}
},
"notificationStorage" : "File",
"authentication" : "Demo",
"cfgAuthor" : "The LemonLDAP::NG team",
"sessionDataToRemember" : {},
"notification" : 1,
"persistentStorageOptions" : {
"Directory" : "__PSESSIONDIR__",
"LockDirectory" : "__PSESSIONDIR__/lock"
},
"domain" : "__DNSDOMAIN__",
"notificationStorageOptions" : {
"dirName" : "__NOTIFICATIONDIR__"
},
"reloadUrls" : {
"reload.__DNSDOMAIN__" : "http://reload.__DNSDOMAIN__/reload"
},
"cfgNum" : "1",
"cookieName" : "lemonldap",
"securedCookie" : 0,
"whatToTrace" : "_whatToTrace",
"groups" : {},
"macros" : {
"_whatToTrace" : "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\""
},
"timeout" : 72000,
"demoExportedVars" : {
"uid" : "uid",
"cn" : "cn",
"mail" : "mail"
"mail" : "mail",
"uid" : "uid"
},
"userDB" : "Demo",
"domain" : "__DNSDOMAIN__",
"exportedHeaders" : {
"test1.__DNSDOMAIN__" : {
"Auth-User" : "$uid"
......@@ -148,7 +101,54 @@
"Auth-User" : "$uid"
}
},
"exportedVars" : {
"UA" : "HTTP_USER_AGENT"
},
"globalStorage" : "Apache::Session::File",
"globalStorageOptions" : {
"Directory" : "__SESSIONDIR__",
"LockDirectory" : "__SESSIONDIR__/lock",
"generateModule" : "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
},
"groups" : {},
"locationRules" : {
"manager.__DNSDOMAIN__" : {
"default" : "$uid eq \"dwho\""
},
"test1.__DNSDOMAIN__" : {
"^/logout" : "logout_sso",
"default" : "accept"
},
"test2.__DNSDOMAIN__" : {
"^/logout" : "logout_sso",
"default" : "accept"
}
},
"loginHistoryEnabled" : 1,
"macros" : {
"_whatToTrace" : "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\""
},
"mailUrl" : "http://auth.__DNSDOMAIN__/mail.pl",
"notification" : 1,
"notificationStorage" : "File",
"notificationStorageOptions" : {
"dirName" : "__NOTIFICATIONDIR__"
},
"passwordDB" : "Demo",
"persistentStorage" : "Apache::Session::File",
"persistentStorageOptions" : {
"Directory" : "__PSESSIONDIR__",
"LockDirectory" : "__PSESSIONDIR__/lock"
},
"portal" : "http://auth.__DNSDOMAIN__/",
"portalSkinBackground" : "1280px-Cedar_Breaks_National_Monument_partially.jpg",
"registerUrl" : "http://auth.__DNSDOMAIN__/register.pl",
"globalStorage" : "Apache::Session::File"
"reloadUrls" : {
"reload.__DNSDOMAIN__" : "http://reload.__DNSDOMAIN__/reload"
},
"securedCookie" : 0,
"sessionDataToRemember" : {},
"timeout" : 72000,
"userDB" : "Demo",
"whatToTrace" : "_whatToTrace"
}
......@@ -181,7 +181,7 @@ qr/^(?:(?:\-+\s*BEGIN\s+PUBLIC\s+KEY\s*\-+\r?\n)?[a-zA-Z0-9\/\+\r\n]+={0,2}(?:\r
'test' => sub {
my $test =
grep( { $_ eq $_[0]; }
map( { $$_{'k'}; } @{ $_[2]{'select'}; } ) );
map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) );
return $test
? 1
: ( 0, "Invalid value '$_[0]' for this select" );
......@@ -998,7 +998,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
'default' => 'ldap://localhost',
'test' => sub {
my $l = shift();
my (@s) = split( /[\s,]+/, $l, 0 );
my @s = split( /[\s,]+/, $l, 0 );
foreach my $s (@s) {
return 0, qq[Bad ldap uri "$s"]
unless $s =~
......
......@@ -5,6 +5,7 @@ use Mouse;
use Lemonldap::NG::Manager::Build::Attributes;
use Lemonldap::NG::Manager::Build::Tree;
use Lemonldap::NG::Manager::Build::CTrees;
use Lemonldap::NG::Manager::Conf::Zero;
use Data::Dumper;
use Regexp::Assemble;
use JSON::MaybeXS;
......@@ -16,6 +17,7 @@ has confTreeFile => ( isa => 'Str', is => 'ro', required => 1 );
has managerConstantsFile => ( isa => 'Str', is => 'ro', required => 1 );
has managerAttributesFile => ( isa => 'Str', is => 'ro', required => 1 );
has defaultValuesFile => ( isa => 'Str', is => 'ro', required => 1 );
has firstLmConfFile => ( isa => 'Str', is => 'ro', required => 1 );
my @managerAttrKeys = qw(keyTest select type test msgFail default);
my $format = 'Creating %-69s: ';
......@@ -249,6 +251,23 @@ $managerAttr}
print F $dst;
close F;
print STDERR "done\n";
$self->buildZeroConf();
}
sub buildZeroConf {
my $self = shift;
$jsonEnc->pretty(1);
printf STDERR $format, $self->firstLmConfFile;
open( F, '>', $self->firstLmConfFile ) or die($!);
print F $jsonEnc->encode(
Lemonldap::NG::Manager::Conf::Zero::zeroConf(
'__DNSDOMAIN__', '__SESSIONDIR__',
'__PSESSIONDIR__', '__NOTIFICATIONDIR__'
)
);
close F;
print STDERR "done\n";
}
sub mydump {
......@@ -393,6 +412,7 @@ system.
managerConstantsFile => "lib/Lemonldap/NG/Manager/Constants.pm",
managerAttributesFile => 'lib/Lemonldap/NG/Manager/Attributes.pm',
defaultValuesFile => "lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
firstLmConfFile => "_example/conf/lmConf-1.js",
);
=head1 DESCRIPTION
......
package Lemonldap::NG::Manager::Conf::Zero;
sub zeroConf {
my ($domain, $sessionDir, $notificationDir, $persistentSessionDir) = @_;
my ($domain, $sessionDir, $persistentSessionDir, $notificationDir) = @_;
$domain ||= 'example.com';
$sessionDir ||= '/var/lib/lemonldap-ng/sessions';
$persistentSessionDir ||= '/var/lib/lemonldap-ng/psessions';
......
......@@ -8,5 +8,6 @@ Lemonldap::NG::Manager::Build->run(
managerConstantsFile => "lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Constants.pm",
managerAttributesFile => 'lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm',
defaultValuesFile => "lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
firstLmConfFile => "_example/conf/lmConf-1.js",
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment