diff --git a/debian/aegir-hostmaster.config b/debian/aegir-hostmaster.config new file mode 100644 index 0000000000000000000000000000000000000000..efeaa3cb937d9afd67cfc2f96c7e21bc6d46c1b6 --- /dev/null +++ b/debian/aegir-hostmaster.config @@ -0,0 +1,30 @@ +#! /bin/sh + +set -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +if su aegir -c 'drush @hostmaster status' | grep -q 'Drupal bootstrap.*Successful'; then + # there's already an install, do not go around asking silly questions + exit 0 +fi + +db_get aegir/email +if [ -z "$RET" ]; then + db_set aegir/email "aegir@`hostname -f`" +fi +db_input medium aegir/site || true +if [ -z "$RET" ]; then + db_set aegir/site `hostname -f` +fi +db_input low aegir/makefile || true +db_input low aegir/email || true +db_input low aegir/db_host || true +db_input low aegir/db_user || true +# if we got here, it means aegir is not installed and we forgot the +# root password, ask for it again +db_reset aegir/db_password || true +db_fset aegir/db_password "seen" "false" || true +db_input high aegir/db_password || true +db_go diff --git a/debian/aegir-hostmaster.postinst b/debian/aegir-hostmaster.postinst new file mode 100644 index 0000000000000000000000000000000000000000..3591d56a1b63f4562e401a5df9405c0e262d217e --- /dev/null +++ b/debian/aegir-hostmaster.postinst @@ -0,0 +1,105 @@ +#!/bin/sh +# postinst script for hostmaster +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Source debconf library. +. /usr/share/debconf/confmodule + +VARLIB="/var/aegir" + +case "$1" in + configure) + # fetch the version number from the makefile. the line we're looking for looks like this + # projects[hostmaster][download][url] = "http://files.aegirproject.org/hostmaster-0.4-beta1.tgz" + # this obviously doesn't work for git releases + VERSION=`sed -n '/^version/{s/^.*= *//;p}' /usr/share/drush/commands/provision/provision.info` + + TEMPFILE=`tempfile` + su aegir -c 'drush @hostmaster status' >> $TEMPFILE || true + if grep -q 'Drupal bootstrap.*Successful' $TEMPFILE; then + db_stop + echo "Aegir frontend (@hostmaster) site detected" + SITE=`grep URI $TEMPFILE | sed -e 's/^.*://'` + OLD_PLATFORM=`grep 'Drupal root' $TEMPFILE | sed -e 's/^.*:[[:space:]]*//;s/[[:space:]]*$//'` + NEW_PLATFORM="$VARLIB/hostmaster-$VERSION" + if [ -d "$NEW_PLATFORM" ] && [ "$OLD_PLATFORM" = "$NEW_PLATFORM" ]; then + echo "it seems to be the same version as the one we're trying to install, not upgrading" + else + echo "upgrading the frontend from $OLD_PLATFORM to $NEW_PLATFORM" + cd "$OLD_PLATFORM" + su aegir -c "drush hostmaster-migrate --yes '$SITE' '$NEW_PLATFORM'" + fi + else + db_get "aegir/site" + if [ ! -z "$RET" ]; then + SITE="$RET" + fi + db_get "aegir/db_host" + AEGIR_DB_HOST="$RET" + db_get "aegir/db_user" + AEGIR_DB_USER="$RET" + db_get "aegir/db_password" + AEGIR_DB_PASS="$RET" + db_get "aegir/email" + EMAIL="$RET" + db_get "aegir/makefile" + if [ ! -z "$RET" ]; then + MAKEFILE="--makefile='$RET'" + fi + db_reset aegir/db_password || true + db_fset aegir/db_password "seen" "true" || true + + db_go + db_stop + + if [ -d $VARLIB/.drush/provision ]; then + echo "existing provision in $VARLIB/.drush/provision detected, move away and try again" + exit 1 + fi + echo "installing the Aegir frontend (Drupal with the hostmaster profile), please wait..." + # pass data through JSON + su aegir -c "drush hostmaster-install --backend $MAKEFILE $SITE | drush backend-parse" <&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/aegir-hostmaster.templates b/debian/aegir-hostmaster.templates new file mode 100644 index 0000000000000000000000000000000000000000..a7e842aefcc547c9802aa3fd4b2497fe6eaa59e3 --- /dev/null +++ b/debian/aegir-hostmaster.templates @@ -0,0 +1,40 @@ +Template:aegir/site +Type: string +Description: URL of the hostmaster frontend: + This is the main URL under which Aegir will be controlled. A Virtual + Host and Drupal website with the Aegir frontend modules + ("hostmaster") will be created for that domain. + . + Leave empty to use the default (the domain of this machine). + +Template:aegir/db_host +Type: string +Default: localhost +Description: Database server hostname: + This is the hostname at which the database server is available. + +Template:aegir/db_user +Type: string +Default: root +Description: Database server user: + This should be a root MySQL user. + +Template:aegir/db_password +Type: password +Description: Database server password: + The password for the root MySQL user. + +Template:aegir/email +Type: string +Description: Main client email: + This is the email that will receive confirmations for created sites and so on. + +Template:aegir/makefile +Type: string +Description: Makefile used to create the platform: + The makefile passed to drush_make to create the hostmaster + platform. Note that this needs specific modules and profiles for the + frontend to work correctly, be careful in changing this from the + default. + . + If this is left empty, Aegir will use its internal makefile. diff --git a/debian/control b/debian/control index ebd91f3a986d67262d14be3e387336ae7ecd1a4b..13f3a852959892b0724f929710f6f8bea6e36fc5 100644 --- a/debian/control +++ b/debian/control @@ -26,3 +26,23 @@ Description: backend of the Aegir hosting system The provision component of this system provides the back end used for system level tasks such as creating configuration files and managing databases and backup files. + +Package: aegir-hostmaster +Architecture: all +Depends: ${misc:Depends}, drush (>= 2.0), php5-mysql, apache2 | apache, aegir-provision +Description: frontend of the Aegir hosting system + Hostmaster is a component of the Aegir hosting system. + . + Aegir is a set of contributed modules for Drupal that aims to solve + the problem of managing a large number of Drupal sites. It does this + by providing you with a simple Drupal based hosting front end for + your entire network of sites. To deploy a new site you simply have to + create a new Site node. To backup or upgrade sites, you simply manage + your site nodes as you would any other node. + . + The hostmaster component provides the frontend that drives the + backend. It's made up of a regular Drupal site with a custom install + profile, module and theme. + . + This meta-package will dynamically install the frontend using drush + and provision.