Rename lmConf-*.js to lmConf-*.json (fix: #1090)
This commit is contained in:
parent
c52bbcb527
commit
1e4c6da389
10
Makefile
10
Makefile
|
@ -193,7 +193,7 @@ MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
|
||||||
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/ReConstants.pm \
|
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/ReConstants.pm \
|
||||||
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm \
|
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm \
|
||||||
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/Constants.pm \
|
$(SRCCOMMONDIR)/lib/Lemonldap/NG/Common/Conf/Constants.pm \
|
||||||
_example/conf/lmConf-1.js
|
_example/conf/lmConf-1.json
|
||||||
|
|
||||||
# Javascript and CSS to minify
|
# Javascript and CSS to minify
|
||||||
JSSRCFILES:=$(shell find */site/static/js $(SRCPORTALDIR)/site/htdocs/static -type f -name '*.js' ! -name '*.min.js') \
|
JSSRCFILES:=$(shell find */site/static/js $(SRCPORTALDIR)/site/htdocs/static -type f -name '*.js' ! -name '*.min.js') \
|
||||||
|
@ -384,11 +384,11 @@ prepare_test_server:
|
||||||
INITDIR=`pwd`/e2e-tests/conf/init \
|
INITDIR=`pwd`/e2e-tests/conf/init \
|
||||||
ETCDEFAULTDIR=`pwd`/e2e-tests/conf/def
|
ETCDEFAULTDIR=`pwd`/e2e-tests/conf/def
|
||||||
@cp -f e2e-tests/index.* e2e-tests/conf/
|
@cp -f e2e-tests/index.* e2e-tests/conf/
|
||||||
@cp e2e-tests/lmConf-1.js e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/test-nginx.conf e2e-tests/conf/
|
@cp e2e-tests/lmConf-1.json e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/test-nginx.conf e2e-tests/conf/
|
||||||
@cp e2e-tests/form.html e2e-tests/conf/site
|
@cp e2e-tests/form.html e2e-tests/conf/site
|
||||||
@perl -i -pe 'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s#__port__#$(TESTWEBSERVERPORT)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#;' \
|
@perl -i -pe 'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s#__port__#$(TESTWEBSERVERPORT)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#;' \
|
||||||
e2e-tests/conf/lemonldap-ng.ini \
|
e2e-tests/conf/lemonldap-ng.ini \
|
||||||
e2e-tests/conf/lmConf-1.js \
|
e2e-tests/conf/lmConf-1.json \
|
||||||
e2e-tests/conf/env.conf \
|
e2e-tests/conf/env.conf \
|
||||||
e2e-tests/conf/test-nginx.conf
|
e2e-tests/conf/test-nginx.conf
|
||||||
|
|
||||||
|
@ -731,11 +731,11 @@ install_conf_dir: install_sessions_dir install_notif_dir install_captcha_dir
|
||||||
cp -f $(SRCCOMMONDIR)/$(CONFFILENAME) $(RCONFDIR); \
|
cp -f $(SRCCOMMONDIR)/$(CONFFILENAME) $(RCONFDIR); \
|
||||||
$(PERL) -i -pe 's#^dirName\s*=\s*.*#dirName = $(FILECONFIGDIR)#g' $(RCONFDIR)/$(CONFFILENAME); \
|
$(PERL) -i -pe 's#^dirName\s*=\s*.*#dirName = $(FILECONFIGDIR)#g' $(RCONFDIR)/$(CONFFILENAME); \
|
||||||
fi
|
fi
|
||||||
@cp _example/conf/lmConf-1.js $(RFILECONFIGDIR)
|
@cp _example/conf/lmConf-1.json $(RFILECONFIGDIR)
|
||||||
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g;\
|
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g;\
|
||||||
s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)#g;\
|
s#__SESSIONDIR__#$(APACHESESSIONFILEDIR)#g;\
|
||||||
s#__PSESSIONDIR__#$(APACHEPSESSIONFILEDIR)#g;\
|
s#__PSESSIONDIR__#$(APACHEPSESSIONFILEDIR)#g;\
|
||||||
s#__NOTIFICATIONDIR__#$(APACHEFILENOTIFDIR)#g;' $(RFILECONFIGDIR)/lmConf-1.js
|
s#__NOTIFICATIONDIR__#$(APACHEFILENOTIFDIR)#g;' $(RFILECONFIGDIR)/lmConf-1.json
|
||||||
@if [ "$(APACHEUSER)" != "" ]; then \
|
@if [ "$(APACHEUSER)" != "" ]; then \
|
||||||
chown $(APACHEUSER) $(RFILECONFIGDIR) || exit 1; \
|
chown $(APACHEUSER) $(RFILECONFIGDIR) || exit 1; \
|
||||||
if [ "$(APACHEGROUP)" != "" ]; then \
|
if [ "$(APACHEGROUP)" != "" ]; then \
|
||||||
|
|
|
@ -15,7 +15,7 @@ sub Lemonldap::NG::Common::Conf::_lock {
|
||||||
|
|
||||||
sub Lemonldap::NG::Common::Conf::_file {
|
sub Lemonldap::NG::Common::Conf::_file {
|
||||||
my ( $self, $cfgNum ) = @_;
|
my ( $self, $cfgNum ) = @_;
|
||||||
return "$self->{dirName}/lmConf-$cfgNum.js";
|
return "$self->{dirName}/lmConf-$cfgNum.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub prereq {
|
sub prereq {
|
||||||
|
@ -40,7 +40,7 @@ sub available {
|
||||||
closedir D;
|
closedir D;
|
||||||
@conf =
|
@conf =
|
||||||
sort { $a <=> $b }
|
sort { $a <=> $b }
|
||||||
map { /lmConf-(\d+)(?:\.js)?/ ? ( $1 + 0 ) : () } @conf;
|
map { /lmConf-(\d+)(?:\.js(?:on))?/ ? ( $1 + 0 ) : () } @conf;
|
||||||
return @conf;
|
return @conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,11 +96,17 @@ sub store {
|
||||||
|
|
||||||
sub load {
|
sub load {
|
||||||
my ( $self, $cfgNum, $fields ) = @_;
|
my ( $self, $cfgNum, $fields ) = @_;
|
||||||
my $f;
|
my ($f,$filename);
|
||||||
if ( -e $self->_file($cfgNum) ) {
|
if ( -e $self->_file($cfgNum) ) {
|
||||||
|
$filename = $self->_file($cfgNum);
|
||||||
|
}
|
||||||
|
elsif ( -e "$self->{dirName}/lmConf-$cfgNum.js" ) {
|
||||||
|
$filename = "$self->{dirName}/lmConf-$cfgNum.js";
|
||||||
|
}
|
||||||
|
if($filename) {
|
||||||
local $/ = '';
|
local $/ = '';
|
||||||
my $ret;
|
my $ret;
|
||||||
unless ( open FILE, $self->_file($cfgNum) ) {
|
unless ( open FILE, $filename ) {
|
||||||
$Lemonldap::NG::Common::Conf::msg .= "Read error: $!$@";
|
$Lemonldap::NG::Common::Conf::msg .= "Read error: $!$@";
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
|
||||||
$count++;
|
$count++;
|
||||||
if ( -x '/usr/bin/file' ) {
|
if ( -x '/usr/bin/file' ) {
|
||||||
eval {
|
eval {
|
||||||
open F, 'file t/lmConf-1.js |';
|
open F, 'file t/lmConf-1.json |';
|
||||||
$_ = join( '', <F> );
|
$_ = join( '', <F> );
|
||||||
close F;
|
close F;
|
||||||
ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
|
ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
|
||||||
|
@ -60,6 +60,6 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
|
||||||
$count += 2;
|
$count += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#unlink 't/lmConf-1.js';
|
unlink 't/lmConf-1.json';
|
||||||
|
|
||||||
done_testing($count);
|
done_testing($count);
|
||||||
|
|
|
@ -48,7 +48,7 @@ t/61-Lemonldap-NG-Handler-PSGI-Server.t
|
||||||
t/62-Lemonldap-NG-Handler-Nginx.t
|
t/62-Lemonldap-NG-Handler-Nginx.t
|
||||||
t/63-Lemonldap-NG-Handler-PSGI-Try.t
|
t/63-Lemonldap-NG-Handler-PSGI-Try.t
|
||||||
t/99-pod.t
|
t/99-pod.t
|
||||||
t/lmConf-1.js
|
t/lmConf-1.json
|
||||||
t/sessions/lock/Apache-Session-f5eec18ebb9bc96352595e2d8ce962e8ecf7af7c9a98cb9a43f9cd181cf4b545.lock
|
t/sessions/lock/Apache-Session-f5eec18ebb9bc96352595e2d8ce962e8ecf7af7c9a98cb9a43f9cd181cf4b545.lock
|
||||||
t/test-psgi-lib.pm
|
t/test-psgi-lib.pm
|
||||||
t/test.pm
|
t/test.pm
|
||||||
|
|
|
@ -171,7 +171,7 @@ t/50-notifications.t
|
||||||
t/80-attributes.t
|
t/80-attributes.t
|
||||||
t/90-translations.t
|
t/90-translations.t
|
||||||
t/99-pod.t
|
t/99-pod.t
|
||||||
t/conf/lmConf-1.js
|
t/conf/lmConf-1.json
|
||||||
t/jsonfiles/01-base-tree.json
|
t/jsonfiles/01-base-tree.json
|
||||||
t/jsonfiles/02-base-tree-all-nodes-opened.json
|
t/jsonfiles/02-base-tree-all-nodes-opened.json
|
||||||
t/jsonfiles/12-modified.json
|
t/jsonfiles/12-modified.json
|
||||||
|
|
|
@ -38,7 +38,7 @@ WriteMakefile(
|
||||||
: ()
|
: ()
|
||||||
),
|
),
|
||||||
clean => {
|
clean => {
|
||||||
FILES => 't/conf/lmConf-2.js',
|
FILES => 't/conf/lmConf-2.json',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ system.
|
||||||
managerConstantsFile => "lib/Lemonldap/NG/Common/Conf/ReConstants.pm",
|
managerConstantsFile => "lib/Lemonldap/NG/Common/Conf/ReConstants.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",
|
firstLmConfFile => "_example/conf/lmConf-1.json",
|
||||||
reverseTreeFile => "site/static/reverseTree.json",
|
reverseTreeFile => "site/static/reverseTree.json",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ constants used to read configuration;
|
||||||
|
|
||||||
parameters attributes used by the manager during configuration upload;
|
parameters attributes used by the manager during configuration upload;
|
||||||
|
|
||||||
=item lmConf-1.js:
|
=item lmConf-1.json:
|
||||||
|
|
||||||
first configuration in file format;
|
first configuration in file format;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ require 't/test-lib.pm';
|
||||||
my @struct =
|
my @struct =
|
||||||
qw[t/jsonfiles/01-base-tree.json t/jsonfiles/02-base-tree-all-nodes-opened.json];
|
qw[t/jsonfiles/01-base-tree.json t/jsonfiles/02-base-tree-all-nodes-opened.json];
|
||||||
my @desc = ( 'Unopened conf', 'Unchanged conf with all nodes opened' );
|
my @desc = ( 'Unopened conf', 'Unchanged conf with all nodes opened' );
|
||||||
my $confFiles = [ 't/conf/lmConf-1.js', 't/conf/lmConf-2.js' ];
|
my $confFiles = [ 't/conf/lmConf-1.json', 't/conf/lmConf-2.json' ];
|
||||||
|
|
||||||
sub body {
|
sub body {
|
||||||
return 0 unless (@struct);
|
return 0 unless (@struct);
|
||||||
|
@ -19,7 +19,7 @@ sub body {
|
||||||
return IO::File->new( $t, 'r' );
|
return IO::File->new( $t, 'r' );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Delete lmConf-2.js if exists
|
# Delete lmConf-2.json if exists
|
||||||
eval { unlink $confFiles->[1]; };
|
eval { unlink $confFiles->[1]; };
|
||||||
mkdir 't/sessions';
|
mkdir 't/sessions';
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,13 @@ use Data::Dumper;
|
||||||
require 't/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
my $struct = 't/jsonfiles/12-modified.json';
|
my $struct = 't/jsonfiles/12-modified.json';
|
||||||
my $confFiles = [ 't/conf/lmConf-1.js', 't/conf/lmConf-2.js' ];
|
my $confFiles = [ 't/conf/lmConf-1.json', 't/conf/lmConf-2.json' ];
|
||||||
|
|
||||||
sub body {
|
sub body {
|
||||||
return IO::File->new( $struct, 'r' );
|
return IO::File->new( $struct, 'r' );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Delete lmConf-2.js if exists
|
# Delete lmConf-2.json if exists
|
||||||
eval { unlink $confFiles->[1]; };
|
eval { unlink $confFiles->[1]; };
|
||||||
mkdir 't/sessions';
|
mkdir 't/sessions';
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ sub body {
|
||||||
return IO::File->new( $struct, 'r' );
|
return IO::File->new( $struct, 'r' );
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink 't/conf/lmConf-2.js';
|
unlink 't/conf/lmConf-2.json';
|
||||||
|
|
||||||
my ( $res, $resBody );
|
my ( $res, $resBody );
|
||||||
ok( $res = &client->_post( '/confs/', 'cfgNum=1', &body, 'application/json' ),
|
ok( $res = &client->_post( '/confs/', 'cfgNum=1', &body, 'application/json' ),
|
||||||
|
@ -35,4 +35,4 @@ count(5);
|
||||||
|
|
||||||
done_testing( count() );
|
done_testing( count() );
|
||||||
|
|
||||||
unlink 't/conf/lmConf-2.js';
|
unlink 't/conf/lmConf-2.json';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user