community.aegirproject.org
Using Contributed Modules
Placeholder -
Eventually, we will have a list of known contributed modules and lots of other good stuff
Aegir Services
Aegir Services integrates the Services API framework into the Hostmaster suite of tools. It allows Aegir managers the ability to build Services API connections over any of the available servers for Services API.
Using Services 3.x we are aiming at full CRUD support for clients, tasks and sites, as well as read access to profiles, platforms, and eventually, packages.
The 2.x branch of Aegir Ubercart Integration will take advantage of this support to provide a remote storefront functionality.
Please report issues and request support via the issue queue on Drupal.org
Installation
- Install Aegir
- Install the dev version of services 3.x, including at least one server and, ideally, an authentication server.
- Install this module.
- Configure your endpoint, it's resources and authentication, normally.
- Optionally, test your rest server using the included bash script,
hosting_services.rest_test.sh
Contribs for Aegir 7.x-3.x
1. Extensions to Hostmaster (frontend)
- Hosting Git
- This is a simple module for the Aegir project that adds a 'Git pull', 'Git checkout' and 'Git clone' task for sites.
- The successor of Hosting site Git & Hosting platform Git
- Hosting Logs
- This is a simple module for the Aegir project that adds a 'Logs' tab to sites and platforms. Showing Apache error, Git commit and watchdog logs.
- Hosting Platform Pathauto
- This is an add-on module for the Aegir hosting system: http://aegirproject.org/ This module simply makes a little time-saving tweak when creating a new platform: ...
- Hosting site make
- Allows a site to have its modules built from a makefile in the sites directory.
- Hosting tasks extra
- This module extends Aegir hostmaster (and drush/provision) with some additional tasks. Such as: cache-clear and registry-rebuild.
- Now also includes the functionality from Aegir HTTP basic authentication
2. Extensions to Provision (backend)
Starting from Aegir 7.x-3.x the Drush component can be included in a 'drush' directory in the same git repository as the hosting module.
Therefore this list will be shorter then for previous versions.
- Provision STS
- Adds the Strict Transport Security header to hosts that require SSL.
3. Themes
4. Puppet modules and Chef cookbooks
Those projects allow you to manage Aegir instance(s) through Puppet. Chef recipes also welcome, we don't discriminate.
5. Others
- Aegir up
- Aegir-up is a Drush extension that deploys a local instance of the Aegir Hosting System atop Vagrant and Virtualbox, for development and testing purposes.
- DevShop
- DevShop is a Drupal Development Environment Manager built on Aegir.
-
DevShop creates Aegir platforms and sites automatically from Git URLs. It tracks multiple Projects and allows multiple environments to be created for each Project, such as dev, test, and live. It provides tools to Pull Code, Sync Data, Commit Features, and Run Tests on these environments, and provides a dashboard with useful links and information for developers.
- Aegir Pathologic Files
- A tiny Drupal Module to simplify file paths in content. This helps prevent broken images when the site directory name changes. Requires an apache rewrite rule to point /files to /sites/example.com/files, which Aegir provides by default.
- This module is not for hostmaster, but for the sites hosted under Aegir.
6. Your module here?
Developers: Please add your contributed module here, and feel free to put install instructions or other documentation in a child page. If you are looking for ways of extending Aegir or have already done so and want to document the internals of your module, head over to the extending Aegir page.
DevShop Provision
Homepage: http://drupal.org/project/devshop
DevShop Provision
Drupal development infrastructure made easy.
This module provides the backend commands needed to deploy and manage sites using the DevShop git and features based development workflow.
About DevShop
The goals of DevShop are...
- to simplify management of multiple environments for multiple Drupal projects.
- to provide web-based tools that streamline the Drupal site building workflow.
- to provide a common, open-source infrastructure for Drupal development shops.
Installation
To install devshop_provision, simply use drush:
$ drush dl devshop_provision
Or, you can download the source code to any available drush commands folder, such as /usr/share/drush or ~/.drush
Usage
DevShop Provision works by providing a new Provision class called "Project".
To start, you must have a Project drush alias. Using the DevShop+Hostmaster system will make this much easier, but if you wish to only use the backend, you can create a project alias with provision-save, for project NAME:
$ drush provision-save project_NAME --context_type=project --code_path=/var/aegir/projects/NAME --git_url=http://git.url/to/repo.git --base_url=NAME.server.com
$ drush provision-save project_NAME --project_name=NAME --context_type=project --code_path=/var/aegir/projects/NAME --git_url=git@github.com:devudo/drupal-flat.git --base_url=NAME.server.com
Commands
DevShop contains a set of features that make Drupal site building within a version-controlled code workflow quick and easy.
Currently you must create new platforms within a project in hostmaster. Once created, you can execute the following commands:
1. Pull Code
$ drush @project_NAME provision-devshop-pull ENVIRONMENT
This task runs on the dev platform for this project. It runs git pull, and optionally runs new updates, reverts features, and clears caches. It is used to keep the dev server up to date on every commit via the devshop_pull module, and can be used as the deployment task.
- Git Pull the code for your site's platform.
- Then, all optionally:
- Run update.php.
- Revert all Features modules
- Clear caches
2. Commit Features
$ drush @project_NAME provision-devshop-commit ENVIRONMENT --message="My Commit"
This task integrates with Features.module to make it very easy to commit your changes to your features.
- Calls drush features-update-all
- Commits the result, with a part automated and part customized commit message.
- (Optionally) pushes the commits.
- (Optionally) force-reverts after a commit.
3. Sync Content
$ drush @project_NAME provision-devshop-sync SOURCE_ENVIRONMENT DESTINATION_ENVIRONMENT
This task makes it easy to syncronize the database and files down from other environments within the project.
WARNING: This will DESTROY the destination site's database!
This task:
- (optionally) Pulls code
- Drops the @destination database.
- Creates an SQL dump from @source.
- Copies the SQL dump to the local system (if @source is a remote).
- Imports the SQL dump into @destination database.
- (optionally) Runs update.php.
- (optionally) Runs features-revert-all.
- (optionally) Clears all caches.
Commands
$ drush --filter=devshop_provision
All commands in devshop_provision: (devshop_provision)
provision-devshop-co Export the site's Features and commit the result.
mmit (pdc)
provision-devshop-pu Pull & verify platform code and (optionally) run update.php, clear cache, and revert features.
ll (pdp)
provision-devshop-sy Sync database (and files, coming soon) from a chosen source site.
nc (pds)
provision-devshop-te Run a group of SimpleTest tests.
st (pdt)
$ drush provision-devshop-commit --help
Export the site's Features and commit the result.
Examples:
drush @project_mysite Recreates and Commits all features from the dev environment of @project_mysite with an additional commit
provision-devshop-commit dev message.
--message="changed some settings"
Arguments:
environment The name of the environment to commit from.
Options:
--message Add a commit message
--revert Force revert all features after exporting and committing.
Aliases: pdc
$ drush provision-devshop-pull --help
Pull & verify platform code and (optionally) run update.php, clear cache, and revert features.
Examples:
drush @project_mysite Triggers a git pull and a clear cache command on @project_mysite's dev and test environments.
provision-devshop-pull dev test --cache
Arguments:
environments A list of environment names to Pull Code to.
Options:
--update Run update.php after code pull.
--revert Revert all features after code pull.
--cache Clear all caches after code pull.
Aliases: pdp
$ drush provision-devshop-sync --help
Sync database (and files, coming soon) from a chosen source site.
Examples:
drush @project_mysite Syncs the database from for project_mysite's live to project_mysite's dev server.
provision-devshop-sync live dev
Arguments:
from Environment to sync from.
to Environment to sync to.
Options:
--update Run update.php after content sync.
--revert Revert all features after content sync.
--cache Clear all caches after content sync.
--files Sync site files.
Aliases: pds
$ drush provision-devshop-test --help
Run a group of SimpleTest tests.
Arguments:
environment The name of the environment to run tests on.
Options:
--tests-to-run The list of tests to run.
--sync-from-live Sync contents from Live before running tests.
Aliases: pdt
Provision ACL
This page documents the Provision ACL extension to Aegir which allows more granular access control over your sites files and directories.
1. Install instructions
First, you'll need a running Aegir install (1.0-rc3 or later), see http://community.aegirproject.org/installing. Most (if not all) of these commands will have to be run as root (or using sudo, etc.)
1.1. Download and install provision
drush dl provisionacl-6.x
1.2. Enable ACLs on your filesystem
mount -o remount,acl /
Here we assume everything is under the root (/
) filesystem here, otherwise run this command for every filesystem Aegir will work on (e.g. /srv
, /var
or /home
).
You also need to edit your /etc/fstab
for this configuration to survive reboots.
1.3. Install ACL support package
apt-get install acl
1.4. Create a UNIX group
In this case we choose a group called "devs" but you can choose another name.
groupadd devs
1.5. Add users to the group
Add one or more UNIX users that you want to give access to that group. For an existing user (socrates32), this would look like:
usermod -a -G devs socrates32
For a new user (ergonlogic), this would look like:
useradd -G devs ergonlogic
1.6. Create a client
Create a client (should be called "devs" for this example) in the frontend at /node/add/client.
1.7. Create a site
Create a site for the client in the frontend at /node/add/site.
2. What it does
When the site is installed, members of the "devs" group will be able to write to the sites' directories (e.g. upload files and modules) and run drush commands on the site (yes, including site aliases, although see caveats below).
This works also for existing sites; make sure you create a group matching the internal name of the existing client and reverify the site.
3. LDAP integration
Provisionacl supports LDAP groups as well. Ensure that an LDAP client is running and that the 'aegir' user can see the LDAP-provided groups:
getent groups
You may need to restart the Name Service Cache Daemon (nscd):
/etc/init.d/nscd restart
4. API - how to add ACL support to your Aegir extension
To change ACLs on files, you should use something like this:
if (function_exists('provisionacl_set_acl')) {
provisionacl_files_acls(d()->site_path . '/mysettings.php');
}
You can optionnally pass a group as an argument, but it will guess that from the client name of the site. Also note that this will raise a drush error if setfacl fails, but just set a warning if the group doesn't exist.
5. Caveats (ie. what it does not)
Giving shell access to users in Aegir is still insecure, see this upstream issue: #762138.
We aim to refactor this into the Aegir core in 2.x, but in the meantime this should provide a good workaround for the limitations of the existing permission system.
This will only work in 1.0 and above, as it needs the "client_name" field to be populated.
You will need to change your $HOME variable for aliases to work, because of this bug in drush: #1104438. Example:
env HOME=/var/aegir drush @hostmaster cc all
See also this post for context and design.
6. Debugging
If for some reason you have lost the ACLs on the directories and you need to restore them, use the following commands, which is basically what the module does:
cd sites/example.com
setfacl -R -m user:aegir:rwx .
setfacl -R -m default:user:aegir:rwx .
setfacl -R -m group:www-data:rwx .
setfacl -R -m d:group:www-data:rwx .
setfacl -R -m group:cl-group:rwx .
setfacl -R -m default:group:cl-admin:rwx .
7. Notes
This page is the reference documentation for the Provision ACL module page on Drupal.org - keep this in mind when editing please.
Ubercart Integration
This module provides several features to ubercart products on an Aegir platform.
Requirements
- Hostmaster 6.x-1.0 or higher
- Ubercart 6.x-2.4 or higher
- Patience
Installation
- Download the module and its dependencies into sites/all/modules on your hostmaster platform (
drush @hostmaster dl uc_hosting ubercart
should work) - Activate the clients feature for hostmaster (
admin/hosting/features
) - Enable the module uc_hosting_products. This should enable all dependencies (
drush @hostmaster en uc_hosting_products
)
Creating your first site product
N.B. A video introduction covering configuration is available from the DrupalCon London session Aegir-based Business Models (starting at 26:30).
- Create a product. Make sure it is not shippable. (
node/add/product
) - Edit the product. Go to the features tab.
- Choose the "Create a site and adjust quotas accordingly" feature. It should use the sku of your product automatically.
- For single-site products, make sure, on the product feature form, to check off "Force clients to create their site on purchase" if you want to be sure people create their site.
- Now all you need is a drupal platform that any user can create sites on and you are ready to go. (
node/add/platform
)
Creating more complex offerings using product kits
The method we recommend for creating complex offerings, including multiple site quotas and access to restricted platforms, is via Ubercart product kits.
- Enable uc_product_kit.
- Create one or more uc_hosting products.
- Create a product kit with these products in them in the appropriate quantities.
Support
You can report bugs, request support and propose patches via our issue queue on Drupal.org.
Development
If you would like to use uc_hosting to develop your own Aegir dependant product features, be sure to read the relevant documentation.
Check out the roadmap.
Other Resources
- Aegir community site
- Ubercart Documentation
- #aegir IRC channel on freenode
Provision CiviCRM
provision_civicrm helps to manage the installation and upgrades of CiviCRM in Drupal sites managed with Aegir.
CiviCRM is not a typical Drupal module. It is a third-party system that integrates with Drupal, WordPress and Joomla for its front-end and permission system. CiviCRM has its own installer, upgrade system and cron. The "provision_civicrm" module helps to manage any CiviCRM+Drupal site as any other Drupal site managed in Aegir.
Requirements
- Aegir 2.x or 3.x
- hosting_civicrm must be installed in the hostmaster front-end (~/hostmaster-x-y/sites/example.org/modules).
Installation
Download the provision_civicrm module as the "aegir" user:
drush dl provision_civicrm-6.x-2.x
This should install the module in ~/.drush/provision_civicrm.
NB: provision_civicrm 6.x-2.x is a Drush module, and works with both Aegir 2 and Aegir 3. However, for Aegir 3, you must use the 7.x-3.x branch of the hosting_civicrm module.
Creating a CiviCRM platform
provision_civicrm assumes that if you have a CiviCRM installation in your sites/all/modules/civicrm, then this is a CiviCRM platform and CiviCRM should be installed automatically.
(A cleaner way, in theory, would be to have an install profile and let the user configure it through the front-end, patches welcome! -- however, you do not want any site to simply enable CiviCRM from the Drupal admin/build/modules, so having dedicated platforms for CiviCRM makes sense in any case.)
A sample drush makefile is provided with provision_civicrm.
Assuming you are running as the user 'aegir', whose $HOME is /var/aegir/, save this in a file such as ~/makefiles/drupal-6.22-civicrm-3.3.4.make
Then create the new platform:
mkdir ~/platforms/drupal-6.22-civicrm-3.3.4
cd ~/platforms/drupal-6.22-civicrm-3.3.4
drush make ~/makefiles/drupal-6.22-civicrm-3.3.4.make
You can now add your platform in the Aegir front-end and then create new sites.