Component Configuration
Martin Atkins
mart at degeneration.co.uk
Thu Jul 13 20:26:26 UTC 2006
As of my last commit (changeset 622) I've simplified the Component stuff
so that they are back to being normal plugins again. They can now only
be used as Delivery-type plugins, which means you need a vhost for each
plugin.
This is nicer code-wise, since the code for dispatching to components is
no longer duplicated between the two code paths. However, it makes the
configuration a bit arduous. Since including components as a subdomain
is quite a common thing, I want to add a configuration shortcut for it,
but I'm not sure what the best way to go is.
Here's one idea, just so you can tell what I'm talking about:
<VHost mydomain.com>
# ....
<Component chat DJabberd::Component::MUC>
# configuration options here
</Component>
# ....
</VHost>
which would do trickery behind the scenes to create a setup equivilent
to the following:
<VHost mydomain.com>
# ....
<Plugin DJabberd::Delivery::LocalVHosts>
AllowVHost chat.mydomain.com
</Plugin>
# ....
</VHost>
<VHost chat.mydomain.com>
<Plugin DJabberd::Delivery::LocalVHosts>
AllowVHost mydomain.com
</Plugin>
<Plugin DJabberd::Component::MUC>
# configuration options here
</Plugin>
</VHost>
In other words, it implicitly creates a new vhost and sets up local
delivery between the two, so it acts just like a subdomain did under the
old setup.
However, I don't really like soiling the general config parser with
component-specific stuff. One other idea I had, that's more verbose but
more general:
<VHost mydomain.com>
# ....
<Subdomain chat>
<Plugin DJabberd::Component::MUC>
# configuration options here
</Plugin>
</Subdomain>
# ....
</VHost>
Again, this would automagically create a new vhost and implicitly add
the LocalVHosts delivery plugin to both domains.
Comments, opinions and alternative suggestions are welcome.
More information about the Djabberd
mailing list