Some Notes on the OpenPanel Architecture
May 14th, 2008 by pimI’m a strong believer in systems that are easily discoverable, where the structure of the files that make up the system communicate something about the application’s internal structure to the outside world. I tried to do much of the same thing with OpenPanel, but at the end of the day there’s still a lot to go around, so perhaps now’s a good time to write up a bit about the thinking and architecture behind OpenPanel and its components.
When we started the design, we wanted to focus on the following demands:
- OpenPanel should be modular, and modules should not be restricted to any specific language
- There should be elementary protection against security defects in module code
- There should be a possibility of multiple user interfaces (at the very least both a GUI and a command line tool)
- The system should anticipate the possibility of remote control and clustered integration
- Configuration provided by OpenPanel should follow the standard configuration practices for the programs involved — no funky business relying on access to a MySQL database
- It should be possible to dedicate an installation to a single purpose (like mail) without requiring unrelated services (Apache, MySQL) through dependencies
What we came up with, is a design that could best be explained as a domain-specific object database that reflects changes into the configuration of outside programs. The opencore daemon implements this abstraction. At the bottom it has an sqlite database that stores object and class data. Modules are implemented as directories inside /var/opencore/modules that define object classes for the database and the program that executes the necessary changes to outside configuration related to objects of those classes. A JSON-based RPC interface accepts requests through HTTP. This backend port is also used to serve static files related to the web-based GUI.
Obviously, accepting remote RPC requests is something you don’t want to combine with root privileges. Also, since we wanted to keep a low number of privileges exposed directly to module code, running the back-end programs/scripts for module actions was definitely not something we felt should be done as the root user. This is where the authd daemon comes in. It accept requests on a unix domain socket that is only accessible to the opencore daemon. Whenever opencore runs a module program, it will fork to a new process, open a socket to authd, tell authd which module will be executed and drop the privileges needed to open any new connections to authd. The unprivileged module can talk to authd on fd 3, but will be restricted to those privileged actions defined in its module.xml file.
Documentation for the Module API and the RPC Interface is on our site, but some of it may still be a bit rough around the edges.
Tags: opencore, openpanel, programming












May 14th, 2008 at 11:55 pm
Hey OpenPanel! Thanks for commenting on my blog post about openpanel. Take a look at hypermagnet - its a project I’ve been working on to centrally manage debian packages. Not much at the site yet, but the idea is to use XSL to generate the various types of configuration files used by open source operating systems and applications.
http://www.hypermagnet.com/blog/