Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
44de0782
Commit
44de0782
authored
Jan 09, 2017
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable new portal with Nginx (
#595
)
parent
f6d85f50
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
32 deletions
+55
-32
Makefile
Makefile
+4
-4
_example/etc/manager-nginx.conf
_example/etc/manager-nginx.conf
+2
-0
_example/etc/portal-nginx.conf
_example/etc/portal-nginx.conf
+8
-3
e2e-tests/index.psgi
e2e-tests/index.psgi
+3
-0
e2e-tests/nginx.conf
e2e-tests/nginx.conf
+3
-1
fastcgi-server/man/llng-fastcgi-server.1p
fastcgi-server/man/llng-fastcgi-server.1p
+1
-1
fastcgi-server/sbin/llng-fastcgi-server
fastcgi-server/sbin/llng-fastcgi-server
+31
-23
lemonldap-ng-portal/site/htdocs/index.psgi
lemonldap-ng-portal/site/htdocs/index.psgi
+3
-0
No files found.
Makefile
View file @
44de0782
...
...
@@ -385,7 +385,7 @@ prepare_test_server:
SBINDIR
=
`
pwd
`
/e2e-tests/conf/sbin
\
INITDIR
=
`
pwd
`
/e2e-tests/conf/init
\
ETCDEFAULTDIR
=
`
pwd
`
/e2e-tests/conf/def
@
cp
-f
e2e-tests/index.
fcgi
e2e-tests/conf/
index.fcgi
@
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/form.html e2e-tests/conf/site
@
perl
-i
-pe
'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s#__port__#
$(TESTWEBSERVERPORT)
#;s#__FASTCGISOCKDIR__#
$(FASTCGISOCKDIR)
#;'
\
...
...
@@ -626,15 +626,15 @@ install_manager_site: install_conf_dir
# Clean svn files
@
rm
-rf
$$
(
find
${RMANAGERSTATICDIR}
$(RMANAGERPSGIDIR)
\
$(RMANAGERTEMPLATESDIR)
$(RCONFDIR)
-type
d
-name
.svn
)
$(PERL)
-i
-pe
's#__MANAGERSTATICDIR__#
$(MANAGERRELATIVESTATICDIR)
#g'
$(RCONFDIR)
/
$(CONFFILENAME)
$(PERL)
-i
-pe
's#__MANAGERTEMPLATESDIR__#
$(MANAGERTEMPLATESDIR)
#g'
$(RCONFDIR)
/
$(CONFFILENAME)
@
$(PERL)
-i
-pe
's#__MANAGERSTATICDIR__#
$(MANAGERRELATIVESTATICDIR)
#g'
$(RCONFDIR)
/
$(CONFFILENAME)
@
$(PERL)
-i
-pe
's#__MANAGERTEMPLATESDIR__#
$(MANAGERTEMPLATESDIR)
#g'
$(RCONFDIR)
/
$(CONFFILENAME)
install_portal_site
:
install_conf_dir
# Portal install
@
install
-v
-d
$(RPORTALDIR)
$(RPORTALSTATICDIR)
\
$(RPORTALDIR)
/skins/
\
$(RCRONDIR)
$(RCONFDIR)
@
cp
-pR
-f
$(SRCPORTALDIR)
/site/htdocs/index.
fcgi
$(RPORTALDIR)
@
cp
-pR
-f
$(SRCPORTALDIR)
/site/htdocs/index.
*
$(RPORTALDIR)
@
cp
-pR
-f
$(SRCPORTALDIR)
/site/htdocs/static/
*
$(RPORTALSTATICDIR)
@
tar
-cf
-
-C
${SRCPORTALDIR}
/site/templates/
$$
(
ls
${SRCPORTALDIR}
/site/templates/
)
|tar
-xf
-
-C
$(RPORTALTEMPLATESDIR)
@
for
f
in
`
find
$(RPORTALTEMPLATEDIR)
-type
f
-name
'*.tpl'
`
;
do
\
...
...
_example/etc/manager-nginx.conf
View file @
44de0782
...
...
@@ -12,6 +12,8 @@ server {
fastcgi_pass
unix
:
__
FASTCGISOCKDIR__
/
llng
-
fastcgi
.
sock
;
fastcgi_param
LLTYPE
manager
;
fastcgi_param
SCRIPT_NAME
/
manager
.
psgi
;
fastcgi_split_path_info
^(.*\.
psgi
)(/.+)$;
fastcgi_param
PATH_INFO
$
fastcgi_path_info
;
}
location
/ {
...
...
_example/etc/portal-nginx.conf
View file @
44de0782
...
...
@@ -10,13 +10,14 @@ server {
location
~ \.
psgi
(?:$|/) {
include
/
etc
/
nginx
/
fastcgi_params
;
fastcgi_pass
unix
:
__
FASTCGISOCKDIR__
/
llng
-
fastcgi
.
sock
;
fastcgi_param
LLTYPE
c
gi
;
fastcgi_param
LLTYPE
ps
gi
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
set
$
sn
$
reques
t_uri
;
if
($
sn
~
"^(.*
)\?
"
) {
set
$
sn
$
documen
t_uri
;
if
($
sn
~
"^(.*
\.psgi).*
"
) {
set
$
sn
$
1
;
}
fastcgi_param
SCRIPT_NAME
$
sn
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
sn
;
fastcgi_split_path_info
^(.*\.
psgi
)(/.+)$;
fastcgi_param
PATH_INFO
$
fastcgi_path_info
;
}
...
...
@@ -29,6 +30,10 @@ server {
#add_header Strict-Transport-Security "15768000";
}
location
/
static
/ {
alias
__
PORTALSTATICDIR__
;
}
# SOAP functions for sessions management (disabled by default)
location
/
index
/
adminSessions
{
deny
all
;
...
...
e2e-tests/index.psgi
0 → 100644
View file @
44de0782
use Lemonldap::NG::Portal::Main;
Lemonldap::NG::Portal::Main->run( {} );
e2e-tests/nginx.conf
View file @
44de0782
worker_processes
auto
;
pid
conf/nginx
.pid
;
load_module
/usr/lib/nginx/modules/ndk_http_module.so
;
load_module
/usr/lib/nginx/modules/ngx_http_lua_module.so
;
events
{
worker_connections
768
;
...
...
@@ -15,7 +17,7 @@ http {
types_hash_max_size
2048
;
include
/etc/nginx/mime.types
;
default_type
application/octet-stream
;
error_log
conf/nginx
.log
info
;
error_log
conf/nginx
.log
debug
;
gzip
off
;
include
conf/*nginx.conf
;
access_log
conf/nginx
.log
lm_combined
;
...
...
fastcgi-server/man/llng-fastcgi-server.1p
View file @
44de0782
...
...
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "llng-fastcgi-server 1"
.TH llng-fastcgi-server 1 "2017-01-0
5
" "perl v5.24.1" "User Contributed Perl Documentation"
.TH llng-fastcgi-server 1 "2017-01-0
9
" "perl v5.24.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
...
...
fastcgi-server/sbin/llng-fastcgi-server
View file @
44de0782
...
...
@@ -5,7 +5,7 @@ use strict;
use
warnings
;
use
POSIX
;
use
Getopt
::
Long
;
use
Lemonldap::NG::Handler::
SharedConf
;
use
Lemonldap
::
NG
::
Handler
::
Main
::
Reload
;
our
$
VERSION
=
'2.0.0'
;
...
...
@@ -87,6 +87,14 @@ my %builder = (
return
$
_apps
{$
script
}->(@
_
);
};
},
psgi
=>
sub
{
return
sub
{
my
$
script
=
$
_
[
0
]->{
SCRIPT_FILENAME
};
return
$
_apps
{$
script
}->(@
_
)
if
(
$
_apps
{$
script
}
);
$
_apps
{$
script
}
=
do
$
script
;
return
$
_apps
{$
script
}->(@
_
);
}
},
);
unless
($>)
{
...
...
@@ -104,15 +112,30 @@ my $app = sub {
};
#
Hook
for
customFunctions
initialization
use
Lemonldap::NG::Handler::API::PSGI::
Server
;
$
Lemonldap::NG::Handler::API::
mode
=
'
PSGI::Server
';
Lemonldap::NG::Handler::
SharedConf
->
init
();
Lemonldap
::
NG
::
Handler
::
Main
::
Reload
->
onReload
(
bless
(
{},
'Lemonldap::NG::Handler::FastCGI::Loader'
),
'loadCustomLogins'
);
my
$
server
=
Plack
::
Runner
->
new
();
$
server
->
parse_options
(
'-s'
=>
$
engine
,
'-E'
=>
'deployment'
,
'--pid'
=>
$
pidFile
,
'--nproc'
=>
$
nproc
,
'--socket'
=>
$
socket
,
'--proc-title'
=>
'llng-fastcgi-server'
,
(
$
foreground
?
()
:
'--daemonize'
),
'--no-default-middleware'
,
%
plackOptions
,
);
$
server
->
run
($
app
);
package
Lemonldap
::
NG
::
Handler
::
FastCGI
::
Loader
;
#
Load
configuration
and
look
if
custom
handlers
have
been
defined
{
$
Lemonldap::NG::Handler::API::
mode
=
'
PSGI::Server
';
my
$conf
=
Lemonldap::NG::Handler::
SharedConf
->
checkConf
()
or
die
"
Unable to get configuration
";
sub
loadCustomLogins
{
my
(
$
obj
,
$
conf
)
=
@
_
;
foreach
my
$
lltype
(
keys
%{
$
conf
->{
nginxCustomHandlers
}
//
{}
}
)
{
my
$
v
=
$
conf
->{
nginxCustomHandlers
}->{$
lltype
};
if
(
$
v
=~
m
#[/\\\.]#
)
{
...
...
@@ -131,21 +154,6 @@ Lemonldap::NG::Handler::SharedConf->init();
};
}
}
my
$server
=
Plack::
Runner
->
new
();
$server
->
parse_options
(
'
-s
'
=>
$engine
,
'
-E
'
=>
'
deployment
',
'
--pid
'
=>
$pidFile
,
'
--nproc
'
=>
$nproc
,
'
--socket
'
=>
$socket
,
'
--proc-title
'
=>
'
llng-fastcgi-server
',
(
$foreground
?
()
:
'
--daemonize
'
),
'
--no-default-middleware
',
%plackOptions
,
);
$server
->
run
(
$app
);
__END__
=
head1
NAME
...
...
lemonldap-ng-portal/site/htdocs/index.psgi
0 → 100644
View file @
44de0782
use Lemonldap::NG::Portal::Main;
Lemonldap::NG::Portal::Main->run({});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment