Annotate

mod_lib_ldap/dev/t/TestConnection.pm @ 6305:1c62edeb9147

mod_pastebin: Update Readme diff --git a/mod_pastebin/README.md b/mod_pastebin/README.md --- a/mod_pastebin/README.md +++ b/mod_pastebin/README.md @@ -37,12 +37,14 @@ For example: Pastes will be available by default at `http://<your-prosody>:5280/pastebin/` by default. -In Prosody 0.9 and later this can be changed with [HTTP -settings](https://prosody.im/doc/http). +Ports and path can be changed with [HTTP +settings](https://prosody.im/doc/http), for example like: -In 0.8 and older this can be changed with `pastebin_ports` (see below), -or you can forward another external URL from your web server to Prosody, -use `pastebin_url` to set that URL. +``` {.lua} + http_paths = { + pastebin = "/$host-paste"; + } +``` # Discovery @@ -82,27 +84,16 @@ The line and character tresholds are adv pastebin_line_threshold The maximum number of lines a message may have before it is sent to the pastebin. (default 4 lines) pastebin_trigger A string of characters (e.g. "!paste ") which if detected at the start of a message, always sends the message to the pastebin, regardless of length. (default: not set) pastebin_expire_after Number of hours after which to expire (remove) a paste, defaults to 24. Set to 0 to store pastes permanently on disk. - pastebin_ports List of ports to run the HTTP server on, same format as mod_httpserver's http_ports[^1] - pastebin_url Base URL to display for pastebin links, must end with / and redirect to Prosody's built-in HTTP server[^2] # Compatibility - ------ ------- - trunk Works + ------ --------------------- + trunk Works as of 25-06-13 + 13 Works 0.12 Works - 0.11 Works - 0.10 Works - 0.9 Works - 0.8 Works - ------ ------- + ------ --------------------- # Todo - Maximum paste length - Web interface to submit pastes? - -[^1]: As of Prosody 0.9, `pastebin_ports` is replaced by `http_ports`, - see [Prosody HTTP server documentation](https://prosody.im/doc/http) - -[^2]: See also - [http_external_url](https://prosody.im/doc/http#external_url)
author Menel <menel@snikket.de>
date Fri, 13 Jun 2025 11:39:58 +0200
parent 1465:07582b8aaf84
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
809
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
1 package TestConnection;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
2
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
3 use strict;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
4 use warnings;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
5 use parent 'AnyEvent::XMPP::IM::Connection';
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
6
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
7 use 5.010;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
8
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
9 our $HOST = 'localhost';
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
10 our $TIMEOUT = 5;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
11 our %PASSWORD_FOR = (
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
12 one => '12345',
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
13 two => '23451',
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
14 three => '34512',
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
15 four => '45123',
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
16 five => '51234',
866
8495dae58d78 Test login for user 'six'
Rob Hoelz <rob@hoelz.ro>
parents: 809
diff changeset
17 six => '123456',
875
ce7a128d139d Add password for user 'seven'
Rob Hoelz <rob@hoelz.ro>
parents: 866
diff changeset
18 seven => '1234567',
809
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
19 );
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
20
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
21 sub new {
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
22 my ( $class, $username, %options ) = @_;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
23
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
24 my $cond = AnyEvent->condvar;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
25 my $timer = AnyEvent->timer(
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
26 after => $TIMEOUT,
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
27 cb => sub {
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
28 $cond->send('timeout');
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
29 },
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
30 );
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
31
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
32 my $self = $class->SUPER::new(
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
33 username => $username,
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
34 domain => $HOST,
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
35 password => $options{'password'} // $PASSWORD_FOR{$username},
1465
07582b8aaf84 Fix connections for LDAP tests
Rob Hoelz <rob@hoelz.ro>
parents: 875
diff changeset
36 resource => 'test bot',
809
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
37 );
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
38
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
39 $self->reg_cb(error => sub {
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
40 my ( undef, $error ) = @_;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
41
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
42 $cond->send($error->string);
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
43 });
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
44
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
45 bless $self, $class;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
46
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
47 $self->{'condvar'} = $cond;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
48 $self->{'timeout_timer'} = $timer;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
49
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
50 $self->connect;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
51
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
52 return $self;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
53 }
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
54
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
55 sub cond {
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
56 my ( $self ) = @_;
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
57
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
58 return $self->{'condvar'};
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
59 }
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
60
1d51c5e38faa Add LDAP plugin suite
rob@hoelz.ro
parents:
diff changeset
61 1;