Instead of putting plugins in the file system, make them a wiki page
Idea
I have been thinking about this idea for some time. Instead of installing plugins as files in specific points of the file system, put them in the wiki with particular names. I guess the names would be something like !MyWiki/Extensions/Macro/Macroname for macros !MyWiki/Extensions/Action/ActionName for actions, ...etc.
A macro page can look like this:
When you view the page, the colored code is displayed. When the wiki try to load the macro on the first time, it will load the page text and save a compiled code in the page cache directory as MacroName.pyc. The next load will be done from the compiled module.
Advantages
- The users can modify the code of the running wiki
- The plugin could then be protected by ACL - only certain user can run the plugin.
- The wiki provide (simplified) version control for its own code
- Easier for plugin development
Disadvantages
- The users can modify the code of the running wiki - not safe for a public wiki without real secure auth.
- A wrong written routine by an authorised user could kill the whole server. No one is aware to make mistakes. Only a few amount of the wiki users know really what does secureness mean on a webserver and they don't know all about. Who likes to be an administrator of such an uncontrolled system?
- Each save is versioned instead only significant revisions. In a real version control system you commit only working version, not every stupid mistake you do between commits.
- Browser editor is the worst editor you can use
- Could imports be as fast as the conventional method?
- For a long running process it does not matter, import is done only once. For CGI, the describe method above make it fast just like regular macros.
Implementation
The loading system can be created as a plugin itself. For example, a Macro macro can be installed as a wiki macro, and load exiting pages as macros.
[[Macro(HelloWord)]]
This markup will load a macro from the page HelloWorld. This kind of system will work of any version of moin without changing the core.
Discussion
Might be easy enough to write an action that copies the latest version of the page to the conventional location in the file system. -- TimCera 2005-10-07 02:05:02
Storing executable code in wiki and its problems is already discussed somewhere else. In 2.0 we will concentrate on storing non-executable stuff as wiki items first.
The security aspects are overwhelmingly against this. -- JohannesBerg 2008-03-18 02:14:59