Build first lmConf-1.js file with Zero.pm
This commit is contained in:
parent
6f7629953b
commit
e84e8b106d
6
Makefile
6
Makefile
|
@ -122,12 +122,14 @@ ERASECONFIG=1 # Set to 0 if you do not want to replace your configuration
|
||||||
MANAGERJSONSRC= scripts/jsongenerator.pl \
|
MANAGERJSONSRC= scripts/jsongenerator.pl \
|
||||||
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build.pm \
|
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build.pm \
|
||||||
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Build/Attributes.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 \
|
MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
|
||||||
$(SRCMANAGERDIR)/site/static/js/conftree.js \
|
$(SRCMANAGERDIR)/site/static/js/conftree.js \
|
||||||
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Attributes.pm \
|
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Attributes.pm \
|
||||||
$(SRCMANAGERDIR)/lib/Lemonldap/NG/Manager/Constants.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')
|
PERLCOMMONSRC:=$(shell find $(SRCCOMMONDIR)/lib -name '*.pm')
|
||||||
PERLCOMMONDST=$(SRCCOMMONDIR)/blib/lib/Lemonldap/NG/Common.pm
|
PERLCOMMONDST=$(SRCCOMMONDIR)/blib/lib/Lemonldap/NG/Common.pm
|
||||||
PERLHANDLERSRC:=$(shell find $(SRCHANDLERDIR)/lib -name '*.pm')
|
PERLHANDLERSRC:=$(shell find $(SRCHANDLERDIR)/lib -name '*.pm')
|
||||||
|
|
|
@ -1,145 +1,98 @@
|
||||||
{
|
{
|
||||||
"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" : {
|
"applicationList" : {
|
||||||
"1sample" : {
|
"1sample" : {
|
||||||
"catname" : "Sample applications",
|
"catname" : "Sample applications",
|
||||||
"test2" : {
|
"test1" : {
|
||||||
"options" : {
|
"options" : {
|
||||||
"uri" : "http://test2.__DNSDOMAIN__/",
|
"description" : "A simple application displaying authenticated user",
|
||||||
"display" : "auto",
|
"display" : "auto",
|
||||||
"name" : "Application Test 2",
|
"logo" : "demo.png",
|
||||||
"description" : "The same simple application displaying authenticated user",
|
"name" : "Application Test 1",
|
||||||
"logo" : "thumbnail.png"
|
"uri" : "http://test1.__DNSDOMAIN__/"
|
||||||
},
|
},
|
||||||
"type" : "application"
|
"type" : "application"
|
||||||
},
|
},
|
||||||
"test1" : {
|
"test2" : {
|
||||||
"options" : {
|
"options" : {
|
||||||
"logo" : "demo.png",
|
"description" : "The same simple application displaying authenticated user",
|
||||||
"description" : "A simple application displaying authenticated user",
|
"display" : "auto",
|
||||||
"name" : "Application Test 1",
|
"logo" : "thumbnail.png",
|
||||||
"uri" : "http://test1.__DNSDOMAIN__/",
|
"name" : "Application Test 2",
|
||||||
"display" : "auto"
|
"uri" : "http://test2.__DNSDOMAIN__/"
|
||||||
|
},
|
||||||
|
"type" : "application"
|
||||||
|
},
|
||||||
|
"type" : "category"
|
||||||
|
},
|
||||||
|
"2administration" : {
|
||||||
|
"catname" : "Administration",
|
||||||
|
"manager" : {
|
||||||
|
"options" : {
|
||||||
|
"description" : "Configure LemonLDAP::NG WebSSO",
|
||||||
|
"display" : "auto",
|
||||||
|
"logo" : "configure.png",
|
||||||
|
"name" : "WebSSO Manager",
|
||||||
|
"uri" : "http://manager.__DNSDOMAIN__/manager.html"
|
||||||
|
},
|
||||||
|
"type" : "application"
|
||||||
|
},
|
||||||
|
"notifications" : {
|
||||||
|
"options" : {
|
||||||
|
"description" : "Explore WebSSO notifications",
|
||||||
|
"display" : "auto",
|
||||||
|
"logo" : "database.png",
|
||||||
|
"name" : "Notifications explorer",
|
||||||
|
"uri" : "http://manager.__DNSDOMAIN__/notifications.html"
|
||||||
|
},
|
||||||
|
"type" : "application"
|
||||||
|
},
|
||||||
|
"sessions" : {
|
||||||
|
"options" : {
|
||||||
|
"description" : "Explore WebSSO sessions",
|
||||||
|
"display" : "auto",
|
||||||
|
"logo" : "database.png",
|
||||||
|
"name" : "Sessions explorer",
|
||||||
|
"uri" : "http://manager.__DNSDOMAIN__/sessions.html"
|
||||||
},
|
},
|
||||||
"type" : "application"
|
"type" : "application"
|
||||||
},
|
},
|
||||||
"type" : "category"
|
"type" : "category"
|
||||||
},
|
},
|
||||||
"3documentation" : {
|
"3documentation" : {
|
||||||
"officialwebsite" : {
|
"catname" : "Documentation",
|
||||||
"type" : "application",
|
|
||||||
"options" : {
|
|
||||||
"logo" : "network.png",
|
|
||||||
"display" : "on",
|
|
||||||
"uri" : "http://lemonldap-ng.org/",
|
|
||||||
"description" : "Official LemonLDAP::NG Website",
|
|
||||||
"name" : "Offical Website"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"localdoc" : {
|
"localdoc" : {
|
||||||
"options" : {
|
"options" : {
|
||||||
"logo" : "help.png",
|
"description" : "Documentation supplied with LemonLDAP::NG",
|
||||||
"uri" : "http://manager.__DNSDOMAIN__/doc/",
|
|
||||||
"display" : "on",
|
"display" : "on",
|
||||||
|
"logo" : "help.png",
|
||||||
"name" : "Local documentation",
|
"name" : "Local documentation",
|
||||||
"description" : "Documentation supplied with LemonLDAP::NG"
|
"uri" : "http://manager.__DNSDOMAIN__/doc/"
|
||||||
},
|
},
|
||||||
"type" : "application"
|
"type" : "application"
|
||||||
},
|
},
|
||||||
"type" : "category",
|
"officialwebsite" : {
|
||||||
"catname" : "Documentation"
|
|
||||||
},
|
|
||||||
"2administration" : {
|
|
||||||
"type" : "category",
|
|
||||||
"manager" : {
|
|
||||||
"options" : {
|
"options" : {
|
||||||
"logo" : "configure.png",
|
"description" : "Official LemonLDAP::NG Website",
|
||||||
"uri" : "http://manager.__DNSDOMAIN__/manager.html",
|
"display" : "on",
|
||||||
"display" : "auto",
|
"logo" : "network.png",
|
||||||
"name" : "WebSSO Manager",
|
"name" : "Offical Website",
|
||||||
"description" : "Configure LemonLDAP::NG WebSSO"
|
"uri" : "http://lemonldap-ng.org/"
|
||||||
},
|
},
|
||||||
"type" : "application"
|
"type" : "application"
|
||||||
},
|
},
|
||||||
"sessions" : {
|
"type" : "category"
|
||||||
"type" : "application",
|
|
||||||
"options" : {
|
|
||||||
"logo" : "database.png",
|
|
||||||
"uri" : "http://manager.__DNSDOMAIN__/sessions.html",
|
|
||||||
"display" : "auto",
|
|
||||||
"description" : "Explore WebSSO sessions",
|
|
||||||
"name" : "Sessions explorer"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"catname" : "Administration",
|
"authentication" : "Demo",
|
||||||
"notifications" : {
|
|
||||||
"type" : "application",
|
|
||||||
"options" : {
|
|
||||||
"logo" : "database.png",
|
|
||||||
"uri" : "http://manager.__DNSDOMAIN__/notifications.html",
|
|
||||||
"display" : "auto",
|
|
||||||
"description" : "Explore WebSSO notifications",
|
|
||||||
"name" : "Notifications explorer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notificationStorage" : "File",
|
|
||||||
"cfgAuthor" : "The LemonLDAP::NG team",
|
"cfgAuthor" : "The LemonLDAP::NG team",
|
||||||
"sessionDataToRemember" : {},
|
"cfgNum" : "1",
|
||||||
"notification" : 1,
|
"cookieName" : "lemonldap",
|
||||||
"persistentStorageOptions" : {
|
"demoExportedVars" : {
|
||||||
"Directory" : "__PSESSIONDIR__",
|
"cn" : "cn",
|
||||||
"LockDirectory" : "__PSESSIONDIR__/lock"
|
"mail" : "mail",
|
||||||
|
"uid" : "uid"
|
||||||
},
|
},
|
||||||
"domain" : "__DNSDOMAIN__",
|
"domain" : "__DNSDOMAIN__",
|
||||||
"notificationStorageOptions" : {
|
|
||||||
"dirName" : "__NOTIFICATIONDIR__"
|
|
||||||
},
|
|
||||||
"reloadUrls" : {
|
|
||||||
"reload.__DNSDOMAIN__" : "http://reload.__DNSDOMAIN__/reload"
|
|
||||||
},
|
|
||||||
"cookieName" : "lemonldap",
|
|
||||||
"securedCookie" : 0,
|
|
||||||
"whatToTrace" : "_whatToTrace",
|
|
||||||
"groups" : {},
|
|
||||||
"macros" : {
|
|
||||||
"_whatToTrace" : "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\""
|
|
||||||
},
|
|
||||||
"timeout" : 72000,
|
|
||||||
"demoExportedVars" : {
|
|
||||||
"uid" : "uid",
|
|
||||||
"cn" : "cn",
|
|
||||||
"mail" : "mail"
|
|
||||||
},
|
|
||||||
"userDB" : "Demo",
|
|
||||||
"exportedHeaders" : {
|
"exportedHeaders" : {
|
||||||
"test1.__DNSDOMAIN__" : {
|
"test1.__DNSDOMAIN__" : {
|
||||||
"Auth-User" : "$uid"
|
"Auth-User" : "$uid"
|
||||||
|
@ -148,7 +101,54 @@
|
||||||
"Auth-User" : "$uid"
|
"Auth-User" : "$uid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"loginHistoryEnabled" : 1,
|
"exportedVars" : {
|
||||||
"registerUrl" : "http://auth.__DNSDOMAIN__/register.pl",
|
"UA" : "HTTP_USER_AGENT"
|
||||||
"globalStorage" : "Apache::Session::File"
|
},
|
||||||
|
"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",
|
||||||
|
"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 {
|
'test' => sub {
|
||||||
my $test =
|
my $test =
|
||||||
grep( { $_ eq $_[0]; }
|
grep( { $_ eq $_[0]; }
|
||||||
map( { $$_{'k'}; } @{ $_[2]{'select'}; } ) );
|
map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) );
|
||||||
return $test
|
return $test
|
||||||
? 1
|
? 1
|
||||||
: ( 0, "Invalid value '$_[0]' for this select" );
|
: ( 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',
|
'default' => 'ldap://localhost',
|
||||||
'test' => sub {
|
'test' => sub {
|
||||||
my $l = shift();
|
my $l = shift();
|
||||||
my (@s) = split( /[\s,]+/, $l, 0 );
|
my @s = split( /[\s,]+/, $l, 0 );
|
||||||
foreach my $s (@s) {
|
foreach my $s (@s) {
|
||||||
return 0, qq[Bad ldap uri "$s"]
|
return 0, qq[Bad ldap uri "$s"]
|
||||||
unless $s =~
|
unless $s =~
|
||||||
|
|
|
@ -5,6 +5,7 @@ use Mouse;
|
||||||
use Lemonldap::NG::Manager::Build::Attributes;
|
use Lemonldap::NG::Manager::Build::Attributes;
|
||||||
use Lemonldap::NG::Manager::Build::Tree;
|
use Lemonldap::NG::Manager::Build::Tree;
|
||||||
use Lemonldap::NG::Manager::Build::CTrees;
|
use Lemonldap::NG::Manager::Build::CTrees;
|
||||||
|
use Lemonldap::NG::Manager::Conf::Zero;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Regexp::Assemble;
|
use Regexp::Assemble;
|
||||||
use JSON::MaybeXS;
|
use JSON::MaybeXS;
|
||||||
|
@ -16,6 +17,7 @@ has confTreeFile => ( isa => 'Str', is => 'ro', required => 1 );
|
||||||
has managerConstantsFile => ( isa => 'Str', is => 'ro', required => 1 );
|
has managerConstantsFile => ( isa => 'Str', is => 'ro', required => 1 );
|
||||||
has managerAttributesFile => ( isa => 'Str', is => 'ro', required => 1 );
|
has managerAttributesFile => ( isa => 'Str', is => 'ro', required => 1 );
|
||||||
has defaultValuesFile => ( 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 @managerAttrKeys = qw(keyTest select type test msgFail default);
|
||||||
my $format = 'Creating %-69s: ';
|
my $format = 'Creating %-69s: ';
|
||||||
|
@ -249,6 +251,23 @@ $managerAttr}
|
||||||
print F $dst;
|
print F $dst;
|
||||||
close F;
|
close F;
|
||||||
print STDERR "done\n";
|
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 {
|
sub mydump {
|
||||||
|
@ -393,6 +412,7 @@ system.
|
||||||
managerConstantsFile => "lib/Lemonldap/NG/Manager/Constants.pm",
|
managerConstantsFile => "lib/Lemonldap/NG/Manager/Constants.pm",
|
||||||
managerAttributesFile => 'lib/Lemonldap/NG/Manager/Attributes.pm',
|
managerAttributesFile => 'lib/Lemonldap/NG/Manager/Attributes.pm',
|
||||||
defaultValuesFile => "lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
|
defaultValuesFile => "lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
|
||||||
|
firstLmConfFile => "_example/conf/lmConf-1.js",
|
||||||
);
|
);
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package Lemonldap::NG::Manager::Conf::Zero;
|
package Lemonldap::NG::Manager::Conf::Zero;
|
||||||
|
|
||||||
sub zeroConf {
|
sub zeroConf {
|
||||||
my ($domain, $sessionDir, $notificationDir, $persistentSessionDir) = @_;
|
my ($domain, $sessionDir, $persistentSessionDir, $notificationDir) = @_;
|
||||||
$domain ||= 'example.com';
|
$domain ||= 'example.com';
|
||||||
$sessionDir ||= '/var/lib/lemonldap-ng/sessions';
|
$sessionDir ||= '/var/lib/lemonldap-ng/sessions';
|
||||||
$persistentSessionDir ||= '/var/lib/lemonldap-ng/psessions';
|
$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",
|
managerConstantsFile => "lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Constants.pm",
|
||||||
managerAttributesFile => 'lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm',
|
managerAttributesFile => 'lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm',
|
||||||
defaultValuesFile => "lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
|
defaultValuesFile => "lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
|
||||||
|
firstLmConfFile => "_example/conf/lmConf-1.js",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user