Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

DJabberd config file

Ahhh yeah, Artur and I just added Apache-style conf to DJabberd so you don't have to write a Perl file with a bunch of server/vhost/plugin constructors by hand. Now it looks like:

$ cat djabberd.conf
OldSSL  enable

# defaults:
ClientPort 5222
ServerPort 5269

#PerlModule DJabberd::SixApart

<VHost jabber.bradfitz.com>
  S2S enable
  RequireSSL no

  <Plugin DJabberd::Authen::AllowedUsers>
     Policy accept
     AllowedUsers brad crucially test
  </Plugin>

  <Plugin DJabberd::Authen::StaticPassword>
      Password password
  </Plugin>

  <Plugin DJabberd::PresenceChecker::Local />
  <Plugin DJabberd::Delivery::Local />
  <Plugin DJabberd::Delivery::S2S   />

  <Plugin DJabberd::RosterStorage::SQLite>
     Database roster.sqlite
  </Plugin>

</VHost>

$ ./djabberd --conf=djabberd.conf
Next step is removing the need for the must-have plugins and making them automatic. That means adding plugin-declared before/after dependencies so DJabberd can do the hook ordering. Should be easy. Then DJabberd should be getting ready for usability by the masses. :-)

Update: the as_bool function was fun:
sub as_bool {
    my $val = shift;
    return 1 if $val =~ /^1|yes|true|t|on|enabled?$/;
    return 0 if $val =~ /^0|no|false|f|off|disabled?$/;
    die "Can't determine booleanness of '$val'\n";
}
Tags: djabberd, tech
Subscribe

  • Doing Hos is Hard Work

    Etch-a-Sketch doesn't involve much hill climbing. GPS-a-Sketch in San Francisco does, however: Merry Christmas from me and…

  • Adventurous Weekend

    Before I fall asleep, I'll try to recap the awesomeness that was this weekend. Friday: -- kinda short day at work, due to floor…

  • Bike Route

    A fellow biker last Friday recorded our ride to work: our ride.

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 17 comments

  • Doing Hos is Hard Work

    Etch-a-Sketch doesn't involve much hill climbing. GPS-a-Sketch in San Francisco does, however: Merry Christmas from me and…

  • Adventurous Weekend

    Before I fall asleep, I'll try to recap the awesomeness that was this weekend. Friday: -- kinda short day at work, due to floor…

  • Bike Route

    A fellow biker last Friday recorded our ride to work: our ride.