Update to 2025-08-28 17:00

This commit is contained in:
Daniel Berteaud
2025-08-28 17:00:23 +02:00
parent 053499f33c
commit 0008480f7b
4 changed files with 18 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
- openssl - openssl
when: rand_pass_tools_installed is not defined or not rand_pass_tools_installed when: rand_pass_tools_installed is not defined or not rand_pass_tools_installed
# Mark tool sas installed so we do not check each time, as it can be slow # Mark tools as installed so we do not check each time, as it can be slow
- set_fact: rand_pass_tools_installed=True - set_fact: rand_pass_tools_installed=True
# Check if a non encrypted file exists. We do it first for backward compatibility # Check if a non encrypted file exists. We do it first for backward compatibility

View File

@@ -22,9 +22,9 @@ sub new {
$args->{server} = DEFAULTWS; $args->{server} = DEFAULTWS;
$logger->info("$pr no server given"); $logger->info("$pr no server given");
} }
elsif ( $args->{server} =~ m#^(?:(?:http|ws)(s)?://)?([^/:]+:[^/:]+)/?$# ) { elsif ( $args->{server} =~ m#^(?:(?:http|ws)(s)?://)?(.+?)/*$# ) {
$args->{server} = $2; $args->{server} = $2;
$ssl = 1 if $1; $ssl = 's' if $1;
} }
else { else {
$logger->error("$pr unparsable server '$args->{server}'"); $logger->error("$pr unparsable server '$args->{server}'");
@@ -108,6 +108,14 @@ sub waitForNextMessage {
sub _connect { sub _connect {
my ($self) = @_; my ($self) = @_;
my ( $host, $port ) = split /:/, $self->{server}; my ( $host, $port ) = split /:/, $self->{server};
# Remove any path from host or port
$host =~ s|/.*$||;
$port =~ s|/.*$||;
# If port is not defined, use 80 or 443
unless ( $port =~ m/^\d+$/ ){
$port = ( $self->{ssl} eq 's' ) ? 443 : 80;
}
my $sock = IO::Socket::INET->new( my $sock = IO::Socket::INET->new(
PeerHost => $host, PeerHost => $host,
PeerPort => $port, PeerPort => $port,
@@ -130,7 +138,7 @@ sub _connect {
}; };
$self->logger->debug("$pr connection upgraded to TLS"); $self->logger->debug("$pr connection upgraded to TLS");
} }
my $url = "ws" . ($self->{ssl} ? 's' : '') . "://$self->{server}/subscribe?" my $url = "ws$self->{ssl}://$self->{server}/subscribe?"
. build_urlencoded( channels => $self->{channels} ); . build_urlencoded( channels => $self->{channels} );
$self->logger->debug("$pr connects to $url"); $self->logger->debug("$pr connects to $url");
my $client = Protocol::WebSocket::Client->new( url => $url ); my $client = Protocol::WebSocket::Client->new( url => $url );
@@ -180,6 +188,10 @@ sub _connect {
$client->connect(); $client->connect();
my $buf;
$sock->sysread( $buf, 4096 );
$client->read($buf);
$self->{socket} = $sock; $self->{socket} = $sock;
$self->{selector} = IO::Select->new($sock); $self->{selector} = IO::Select->new($sock);
$self->{ws} = $client; $self->{ws} = $client;

View File

@@ -57,6 +57,7 @@
- name: Install MessageBroker::Web - name: Install MessageBroker::Web
copy: src=Web.pm dest=/usr/share/perl5/vendor_perl/Lemonldap/NG/Common/MessageBroker/Web.pm owner=root group=root mode=644 copy: src=Web.pm dest=/usr/share/perl5/vendor_perl/Lemonldap/NG/Common/MessageBroker/Web.pm owner=root group=root mode=644
notify: "{{ (llng_server == 'nginx' and llng_engine == 'uwsgi') | ternary('reload', 'restart') }} {{ (llng_server == 'nginx') | ternary('llng', 'httpd') }}"
tags: web tags: web
- name: Deploy Lemonldap::NG main configuration - name: Deploy Lemonldap::NG main configuration

View File

@@ -1,5 +1,5 @@
--- ---
ldap_auth: true ldap_auth: false
ldap_schema: rfc2307 ldap_schema: rfc2307
ldap_modules: ldap_modules:
- pam - pam