Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
lemonldap-ng
lemonldap-ng
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 245
    • Issues 245
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • LemonLDAP NG
  • lemonldap-nglemonldap-ng
  • Issues
  • #1397

Closed
Open
Opened Mar 15, 2018 by Xavier Guimard@guimardOwner

Plack servers support

Summary

Plack provides a family of powerful web servers. We simply have to build a Plack::Middleware::Auth::LemonldapNG module to support them

Full example

#!/usr/bin/perl

use Data::Dumper;
use Plack::Builder;

# Test
my $testApp = sub {
    my ($env) = @_;
    return [
        200,
        [ 'Content-Type' => 'text/plain' ],
        [ "Hello world\n\n" . Dumper($env) ],
    ];
};

my $test = builder {
    enable "Auth::LemonldapNG";
    $testApp;
};

use Lemonldap::NG::Portal::Main;
my $portal = builder {
    enable "Plack::Middleware::Static",
      path => '^/static/',
      root => '/path/to/portal/htdocs/';
    Lemonldap::NG::Portal::Main->run( {} );
};

use Lemonldap::NG::Manager;
my $manager = builder {
    enable "Plack::Middleware::Static",
      path => '^/static/',
      root => '/path/to/manager/htdocs/';
    enable "Plack::Middleware::Static",
      path => '^/doc/',
      root => '/path/to/parent/of/doc/';
    enable "Plack::Middleware::Static",
      path => '^/lib/',
      root => '/path/to/doc/pages/documentation/current/';
    enable "Plack::Middleware::Static",
      path => '^/fr-doc/',
      root => '/path/to/parent/of/fr-doc/link/';
    Lemonldap::NG::Manager->run( {} );
};

builder {
    mount 'http://test1.example.com/'   => $test;
    mount 'http://auth.example.com/'    => $portal;
    mount 'http://manager.example.com/' => $manager;
};
Edited Mar 15, 2018 by Xavier Guimard
Assignee
Assign to
2.0.0
Milestone
2.0.0 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: lemonldap-ng/lemonldap-ng#1397