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

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • 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

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.