Mupsi: a multiplier for self-maintained OPS instances

Introduction

This is the documentation for mupsi, a multiplier for OPS installations. It is written by and being maintained by, me Thomas Krichel. Its development was funded by FundEc.

Basic assumptions

Mupsi is written for Debian GNU/Linux. It may run on other operating systems. But it will share the basic model of users in a Debian system. The root user only has to be involved when mupsi is installed. At that time, the root user sets up a sudo file that gives permissions to the so-called sponsor user.

The sponsor user holds an copy of the mupsi software. The sponsor can generate other Debian users. These user run OPS installations, called sites, in their home directories. Each site has an identifier, known as the sitid. Since a user name on a Debian system may clash with a sitid, Users' names as used by Linux may have a prefix or a postfix in addition to the sitid.

Mupsi is developed and tested only on Debian GNU/Linux.

Basic model

mupsi is run in the home of a user known as the sponsor. This user is endowed with sudo permissions. These have to be setup by root.

The sponsor can create other users who will run sites. These users are known as siters.

Pre install

You will need to external data pieces.

  1. a key for a dynamic DNS system available for your domain;
  2. a wildcard certificate for subdomains, because each site runs in its own subdomain.

See the “External keys” section.

Install

To get started, a sponsor needs to get the mupsi software

mkdir ~/mupsi
rsync -va rsync://mupsi.openlib.org/mupsi/ ~/mupsi

You can not put the files in a different directory other than ~/mupsi. This can not be configured. I leave outt the ~/mupsi here when I gives relative paths.

I do not have a complete list of required software. But bin/apt_get is a start. Note that this file is not used in mupsi production, it is just there to help you to get packages you need. And these have to be installed by root. Also note that bin/apt_get involves removing apparmor. Out of the box in Debian, apparmor will prevent the creation of the database. If you find an apparmor profile that will work kindly let me know. In the meantime, the advice is to remove apparmor.

There are two configuration files in the sponsor’s home directory /home/sponsor. Both are XML files using the name space http://mupsi.openlib.org.

etc/sites.xml
It defines the siters. Since this also has the siters’ default credentials, it needs to be kept secret.
etc/mupsi.xslt.xml
This the public configuration file. This is plain XSLT. It is included in other XSLT files. It sets out data elements that are configurable at the sponsor level. Generally, the values set there have no end-user-facing implications. They can not be overwritten by siters.

Permissions

For the sponsor to work for the sites, it need sudo. The suggested sudo is generated by running ~/mupsi/bin/show_sudo, It needs to be installed by root.

The root user sets up a sudo file for the sponsor, either /etc/sudoers.d/sponsor or in /etc/sudoers.d/mupsi. If this file is not there, mupsi will complain. This is just a simple way to point out to a sponsor that the sudo configuration is not set up.

OPS setup

Set the ops_folder in the public configuration and then untar your ops files into that folder.

Each siter gets a copy of the complete OPS code. Each siter runs her own database instance (mariadb only at this time), and her own instance of the cgi processor (php-fpm only at this time). She owns the web configuration (both apache and nginx are supported). She can force-reload the web server configuration.

The current apache default systemd setup for Debian require apache logs to be stored in /var/log/apache2. I did not want to fiddle with that. Other than that, all logs are stored in /home/siter/var/log.

External keys

If you run your sites in say *.ops.example.com, you are assumed to have a http wild certificate. You need to reference that in mupsi.xslt.xml.

Mupsi also assumes that you have a key for a dynamic DNS system for the zone ops.example.com, say, where ops is a name you want to place your sites in. So a site with sidit sidit would be in sidit.ops.example.com. In that sense, mupsi has a dependency on bind 9.

Main scripts

There are two main scripts.

bin/run_setup_by_sidit sitid
It sets up the site with sitid sidit
bin/run_delete_by_sidit sitid
It deletes the site with sitid sidit

Limitations

mupsi has no support for neither AppArmor, nor SELinux. It will fail to run the main run_setup_b_sitid script if either of these I would be happy to work with somebody on this.