mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-09-13 19:14:49 +02:00
Update to 2025-08-28 17:00
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
ldap_auth: true
|
ldap_auth: false
|
||||||
ldap_schema: rfc2307
|
ldap_schema: rfc2307
|
||||||
ldap_modules:
|
ldap_modules:
|
||||||
- pam
|
- pam
|
||||||
|
Reference in New Issue
Block a user