This is a mock help for farm plugins, to be moved to MoinMaster when farm plugins are implemented. OLD:See also FeatureRequests/WikifarmPluginDirectory.

Farm plugins

To Install plugins in a wikifarm-wide fashion, use the plugin_dirs configuration variable wich is just for that. I've tested it with moin 1.8.4. My setup is something like this:

wikifarm/
 config/farmconfig.py
 plugins/
 plugins/macro
 wikis/

The folder plugins/ and macro/ must contain an empty file named __init__.py, this is required by Python so that this folders become modules that MoinMoin can import.

Then in config/farmconfig.py just add the plugin_dirs variable pointing to your directory, e.g.:

# In farmconfig.py
plugin_dirs = ['/path/to/wikifarm/plugins',]

Whit this setup you should still be able to install specific plugins for one wiki, using his plugins directory inside his data directory.

I find it useful to look at the code:

--Cesco (07/2009)

WriteMe

Plugin types

What does each type of plugin, from the wiki admin point of view.

WriteMe

Wiki plugins

Why wiki plugins are needed? common use cases (when you want to use wiki plugins instead of farm plugins).

Plugins have security implications. It can be important that the use of a particular plugin's features be governed by specific access rules that don't pertain to all wikis in a WikiFarm. Allowing the plugin to be installed for only a specific wiki can allow the appropriate security restrictions to be made for the wiki without impacting the security decisions for wikis that don't need the feature(s) offered by that plugin.

WriteMe


Technical details

The hardest part is the default location that works out of the box.

  1. Add farm_plugin_dir to multiconfig.DefaultConfig, with a default that will work for a simple install.

    • Let a wiki config change its farm plugin dir? does not make sense.
  2. Make it required like the wiki plugin directory?

These are easy, based on exiting code:

  1. Refactor the plugin load method in multiconfing.DefaultConfig to general function, probably in wikiutil (until we have a plugin module) or in pysupport.

  2. load the plugin package once - when multiconfig is imported? or maybe wait for the first call to farmPlugins?

  3. Save the farm plugins module as farm.plugins. From now on, __import__('farm.plugins.kind.name') will work. Maybe use MoinMoin.farm.plugins? Maybe we should have a real module with this name, and a load function that import the plugin package from the correct path and bind it to 'plugins'.

  4. Add new function wikiutil.importFarmPlugin, use same code as importWikiPlugin.

  5. Add wikiutil.farmPlugins function, works like wikiPlugins

  6. In wikiutil.importPlugin, try to load wiki plugin, then farm plugin, then built in.

MoinMoin: FarmPlugins (last edited 2009-07-30 08:18:07 by host82-180-static)