Update Lemonldap to 2.19.0

This commit is contained in:
Daniel Berteaud 2024-05-02 13:53:52 +02:00
parent 96978c4cb8
commit e76733c74b
3 changed files with 1 additions and 63 deletions

View File

@ -1,4 +1,4 @@
FROM danielberteaud/alpine:24.4-1
FROM danielberteaud/alpine:24.5-1
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ARG VERSION=3.0.0

View File

@ -1,53 +0,0 @@
package Lemonldap::NG::Handler::Server::Traefik;
use strict;
use Mouse;
use Lemonldap::NG::Handler::Server::Main;
our $VERSION = '2.17.0';
extends 'Lemonldap::NG::Handler::PSGI';
sub init {
my $self = shift;
$self->api('Lemonldap::NG::Handler::Server::Main');
my $tmp = $self->SUPER::init(@_);
}
sub _run {
my $self = shift;
# Create regular _authAndTrace PSGI app
my $app = $self->psgiAdapter(
sub {
my $req = $_[0];
return $self->_authAndTrace($req);
}
);
# Middleware to set correct values for Traefik
return sub {
my $env = $_[0];
$env->{HTTP_HOST} = $env->{HTTP_X_FORWARDED_HOST};
$env->{REQUEST_URI} = $env->{HTTP_X_FORWARDED_URI};
return $app->($env);
}
}
sub handler {
my ( $self, $req ) = @_;
# See https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/merge_requests/480
my @convertedHdrs =
( 'Content-Length' => 0, Cookie => ( $req->env->{HTTP_COOKIE} // '' ) );
while ( my ( $k, $v ) = splice( @{ $req->{respHeaders} }, 0, 2 ) ) {
if ( $k =~ /^(?:Deleteheader\d+|Cookie)$/ ) {
next;
}
else {
push @convertedHdrs, $k, $v;
}
}
return [ 200, \@convertedHdrs, [] ];
}
1;

View File

@ -120,8 +120,6 @@ _EOF
image = "[[ .lemonldap.image ]]"
volumes = [
"secrets/lemonldap-ng.ini:/etc/lemonldap-ng/lemonldap-ng.ini:ro",
# Workaround this bug: https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/3047
"local/Traefik.pm:/usr/share/perl5/vendor_perl/Lemonldap/NG/Handler/Server/Traefik.pm:ro"
]
# Add a tmpfs to store config and session cache
[[ template "common/tmpfs" dict "size" "10000000" "target" "/tmp" ]]
@ -157,13 +155,6 @@ _EOT
gid = 100048
}
template {
data = <<_EOT
[[ template "traefik/Traefik.pm" ]]
_EOT
destination = "local/Traefik.pm"
}
template {
data =<<_EOT
[[ template "traefik/minit.yml.tpl" . ]]