Home > app-pocosi

app-pocosi

App-pocosi is a project mainly written in Perl, it's free.

A command line tool for launching a POE::Component::Server::IRC instance

=encoding utf8

=head1 NAME

App::Pocosi - A command line tool for launching a POE::Component::Server::IRC instance

=head1 DESCRIPTION

This distribution provides a generic way to launch a L<POE::Component::Server::IRC|POE::Component::Server::IRC> instance.

=over 4

=item * Prints useful status information (to your terminal and/or a log file)

=item * Will daemonize if you so wish

=item * Supports a configuration file

=item * Offers a user friendly way to pass arguments to POE::Component::Server::IRC

=item * Has an interactive mode where you can issue issue commands and call methods on the IRC component(s).

=back

=head1 CONFIGURATION

class: POE::Component::Server::IRC log_file: /my/log.file pid_file: /my/pid.file lib: /my/modules flood: false auth: true

config: servername: myserver.com motd:

  • "Welcome to this great server"
  • ""
  • "Enjoy your stay"

plugins:

  • [OperServ]

listeners:

  • bindaddr: "127.0.0.1" port: 10023

denials:

  • ["12.34.56.0/24", "I don't like this IP block"]

exemptions:

  • "12.34.56.78"

operators:

  • username: jack password: foo ipmask: ["127.0.0.1", "1.2.3.4", "192.168.1.0/24"]
  • username: locke password: bar ipmask: "10.0.0.*"

auths:

  • mask: "*@example.com" password: hlagh spoof: jacob no_tilde: true

peers:

  • name: otherserver.com rpass: hlaghpass pass: hlaghpass type: r raddress: "127.0.0.1" rport: 12345 auto: true

The configuration file is in L<YAML|YAML> or L<JSON|JSON> format. It consists of a hash containing the options described in the above code example. Only C is required.

=head2 C

Either the name of a directory containing Perl modules (e.g. plugins), or an array of such names. Kind of like Perl's I<-I>.

=head2 C

Path to a pid file, as used by most daemons. If is specified, App::Pocosi will refuse to run if the file already exists.

=head2 C

Path to a log file to which status messages will be written.

=head2 C

The IRC server component class. Defaults to L<POE::Component::Server::IRC::State|POE::Component::Server::IRC::State>.

=head2 C

This is a hash of various configuration variables for the IRCd. See PoCo-Server-IRC's L<C|POE::Component::Server::IRC/configure> for a list of parameters.

=head2 C

An array of arrays containing a short plugin class name (e.g. 'OperServ') and optionally a hash of arguments to that plugin. When figuring out the correct package name, App::Pocosi will first try to load POE::Component::Server::IRC::Plugin::I before trying to load I.

=head2 C

An array of hashes. The keys should be any of the options listed in the docs for PoCo-Server-IRC-Backend's L<C|POE::Component::Server::IRC::Backend/add_listener> method.

=head2 C

An array of hashes. The keys are described in the docs for PoCo-Server-IRC's L<C|POE::Component::Server::IRC/add_auth> method.

=head2 C

An array of hashes. The keys are described in the docs for PoCo-Server-IRC's L<C|POE::Component::Server::IRC/add_operator> method. You you can supply an array of netmasks (the kind accepted by L<Net::Netmask|Net::Netmask>'s constructor) for the B<'ipmask'> key.

=head2 C

An array of hashes. The keys should be any of the options listed in the docs for PoCo-Server-IRC's L<C|POE::Component::Server::IRC/add_listener> method.

=head2 C

An array of arrays. The first element of the inner array should be a netmask accepted by L<Net::Netmask|Net::Netmask>'s constructor. The second (optional) element should be a reason for the denial.

=head2 C

An array of netmasks (the kind which L<Net::Netmask|Net::Netmask>'s constructor accepts).

=head1 OUTPUT

Here is some example output from the program:

$ pocosi -f example/config.yml 2011-05-22 15:30:02 Started (pid 13191) 2011-05-22 15:30:02 Constructing plugins 2011-05-22 15:30:02 Spawning IRCd component (POE::Component::Server::IRC) 2011-05-22 15:30:02 Registering plugins 2011-05-22 15:30:02 Added plugin PocosiStatus_1 2011-05-22 15:30:02 Added plugin OperServ_1 2011-05-22 15:30:02 Started listening on 127.0.0.1:10023 2011-05-22 15:30:02 Connected to peer otherserver.com on 127.0.0.1:12345 2011-05-22 15:30:02 Server otherserver.com (hops: 1) introduced to the network by myserver.com ^C2011-05-22 15:30:18 Exiting due to SIGINT 2011-05-22 15:30:18 Deleted plugin OperServ_1 2011-05-22 15:30:18 Deleted plugin PocosiStatus_1 2011-05-22 15:30:18 IRC component shut down

=head1 AUTHOR

Hinrik Ern SigurEsson, [email protected]

=head1 LICENSE AND COPYRIGHT

Copyright 2011 Hinrik Ern SigurEsson

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

=cut

Previous:md5calc