thrasherbird.pl: Item disco target config was missing.
[thrasher.git] / perl / thrasherbird.pl
blobfb1bbfaa2c8f139b95f0dd375c9ac962f35617d2
1 #!/usr/bin/env perl
2 # (leave that line in there)
4 # This is the Thrasher Bird configuration file. It is also the Perl
5 # script that actually starts up Thrasher Bird. If that intimidates
6 # you, just treat this as any other configuration file: Follow the
7 # comments (after the # symbols), and ignore everything after the
8 # #### THRASHER BIRD PROGRAM comment.
10 # To configure Thrasher Bird, you need to specify three things:
11 # * The "Backend", which is what Thrasher Bird will use to store
12 # the data it generates.
13 # * The "Protocol", which tells it which supported protocol will
14 # be exposed by the component.
15 # * Connection information about the XMPP Server to connect to.
16 # You will need to consult your server's documentation about
17 # how to set up the server to receive connections.
19 ########
20 ## BACKEND
21 ########
23 # (Perl gurus: Anything in the Thrasher::Backend::* namespace may be
24 # used here; specify the module without Thrasher::Backend:: in it.)
26 # Uncomment the backend you wish to use, configure as appropriate.
27 # Backend names are case-sensitive.
29 ## The "Test" backend; can be used to test the system, but won't
30 # permanently store any data!
31 # $backend = 'Test';
32 # $backend_configuration = {};
34 # Example for the DBI backend:
35 # $backend = 'DBI';
36 # $backend_configuration = {
37 # dbi_data_source => 'dbi:mysql:thrasher',
38 # username => 'mysqluser',
39 # password => 'mysqlpass',
40 # db_driver => 'mysql_innodb',
41 # database_name => 'thrasher',
42 # transport_name => 'someprotocol.transport',
43 # };
45 #######
46 ## PROTOCOL
47 #######
49 # (Perl gurus: This is like the Backend, except under the
50 # Thrasher::Protocol:: namespace.)
52 # Uncomment the protocol you wish to use, configure as appropriate.
53 # Backend names are case-sensitive.
55 ## The "Test" protocol does very little for you.
57 # $protocol = Test;
58 # my $protocol_configuration = {};
60 #######
61 ## CONNECTION INFO
62 #######
64 # You need to tell Thrasher Bird how to connect to your server.
66 # Leave the apostrophes around the ip or domain here.
67 # This is the "local server".
68 $server_ip = '127.0.0.1';
70 # Server port: The port the server is expecting the transport to use.
71 $server_port = 5556;
73 # Secret: The shared secret that the server is expecting. If you're
74 # not familiar with Perl string rules, stick to letters and numbers
75 # only.
76 $server_secret = 'secret';
78 # Component name base; this will be composed together with the name
79 # of the protocol to determine the component name. If you don't know
80 # what this means, leave it be. If you want to share the transport
81 # with people off your server, though, it needs to be routable,
82 # which means you should set this as the domain name of your server.
83 $component_name_base = 'localhost';
85 # Set $server_target_for_service_discovery to a target entity for
86 # XEP-0030 service discovery if Thrasher should find and use other
87 # XMPP items like a XEP-0065 file transfer proxy. Otherwise, leave it
88 # undefined.
89 my $server_target_for_service_discovery;
91 #######
92 ## PLUGINS
93 #######
95 my $plugins = [];
97 # ProxyFileTransfer (currently must be used with a Purple protocol)
98 # enables file transfers to and from contacts on the transport.
99 # push(@{$plugins}, 'Thrasher::Plugin::ProxyFileTransfer');
101 #######
102 ## INSTALLATION LOCATION
103 #######
105 # Thrasher can use libraries built in the same directory as this
106 # script. If you'd like to install Thrasher to a different path,
107 # either configure the below or add the path to PERL5LIB:
109 my $thrasher_perl_dir;
111 # Default: figure out where the script is and use libraries from that path:
112 use Cwd qw(abs_path);
113 use File::Basename qw(dirname);
114 if (not $thrasher_perl_dir) {
115 $thrasher_perl_dir = dirname(abs_path($0));
116 require lib;
117 lib->import($thrasher_perl_dir . '/lib');
120 #### THRASHER BIRD PROGRAM
121 # If you are just configuring the program, ignore everything after
122 # this.
124 require Thrasher;
125 # Perl Gurus: This function call is all you need to start Thrasher
126 # Bird. This configuration file is unneccessary if you want
127 # to obtain these values some other way. (We do at Barracuda
128 # Networks.)
129 Thrasher::start($backend, $protocol, $server_ip, $server_port,
130 $server_secret, $backend_configuration,
131 $protocol_configuration, $component_name_base,
132 $server_target_for_service_discovery,
133 $plugins,