summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames An2015-06-10 17:54:00 -0400
committerJames An2015-06-30 07:27:49 -0400
commita06ec4956d2af89fadd45850f1f29918518f3abf (patch)
tree68749633a046bdebae251dd22d0233228638dc97
parent9175e9ffd307a1e7077178fd3ee7a97ca98fb78a (diff)
downloadaur-a06ec4956d2af89fadd45850f1f29918518f3abf.tar.gz
Added support for ruby-mailcatcher as the smtp-forwarder for the aegir package and added a unique system user for the aegir package.
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD70
-rw-r--r--aegir.ini4
-rw-r--r--aegir.install17
-rw-r--r--aegir.service (renamed from systemd.service)2
-rw-r--r--aegir.target8
-rw-r--r--msmtprc11
-rw-r--r--msmtprc.aegir6
-rw-r--r--mysqld.svc.conf2
-rw-r--r--nginx.conf2
-rw-r--r--nginx.svc.conf3
-rw-r--r--php-dev.ini3
-rw-r--r--php-fpm.svc.conf2
-rw-r--r--php-opt.ini3
-rw-r--r--php.ini28
-rw-r--r--sudoers2
-rw-r--r--systemd.target8
17 files changed, 94 insertions, 99 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 69bc6de3d51..46e80f0c934 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = aegir
- pkgdesc = Configuration for a dedicated Aegir server.
- pkgver = 7.x_3.0_alpha2
- pkgrel = 3
+ pkgdesc = Configuration for a dedicated Aegir server to host Drupal sites.
+ pkgver = 7.x_3.0_beta2
+ pkgrel = 2
url = http://aegirproject.org
install = aegir.install
arch = any
@@ -18,18 +18,18 @@ pkgbase = aegir
depends = smtp-forwarder
depends = unzip
options = emptydirs
- source = msmtprc
+ source = msmtprc.aegir
source = nginx.conf
source = nginx.svc.conf
- source = php.ini
+ source = aegir.ini
source = sudoers
- source = systemd.service
- source = systemd.target
- md5sums = 1e9dd39b8c305eaab83e41a782e7c3c9
- md5sums = 3079abdb035783843375b1745d651f8b
+ source = aegir.service
+ source = aegir.target
+ md5sums = ef91c3e0f09e6737105fc1b9971758cc
+ md5sums = 829ac9283a168f796354e78e8bc8e496
md5sums = 75535f9870f06c540f513262a9b7b1ab
- md5sums = 451f623150d84118f6801a63053226f0
- md5sums = b3bd87cc4571873fd860bf4b6a0e51fa
+ md5sums = 879237d0ca0dc54d5cdb4307adb40005
+ md5sums = cb3462fda27156851badf51d5a0595ae
md5sums = 4889b3de48732ec149a71aeb72039455
md5sums = 80773e4278e09b14cc6843e346540a9d
diff --git a/PKGBUILD b/PKGBUILD
index bef63e5f0b4..d4fa8d721d2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,15 @@
# Maintainer: James An <james@jamesan.ca>
pkgname=aegir
-pkgver=7.x_3.0_alpha2
-pkgrel=3
-pkgdesc="Configuration for a dedicated Aegir server."
+pkgver=7.x_3.0_beta2
+pkgrel=2
+pkgdesc="Configuration for a dedicated Aegir server to host Drupal sites."
arch=('any')
url='http://aegirproject.org'
license=('GPL')
depends=(
- 'aegir-provision'
- 'aegir-hostmaster'
+ "$pkgname-provision"
+ "$pkgname-hostmaster"
'cron'
'nginx'
'php-fpm'
@@ -23,44 +23,62 @@ depends=(
options=(emptydirs)
install=$pkgname.install
source=(
- 'msmtprc'
+ "msmtprc.$pkgname"
'nginx.conf'
'nginx.svc.conf'
- 'php.ini'
+ "$pkgname.ini"
'sudoers'
- 'systemd.service'
- 'systemd.target'
+ "$pkgname.service"
+ "$pkgname.target"
)
-md5sums=('1e9dd39b8c305eaab83e41a782e7c3c9'
- '3079abdb035783843375b1745d651f8b'
+md5sums=('ef91c3e0f09e6737105fc1b9971758cc'
+ '829ac9283a168f796354e78e8bc8e496'
'75535f9870f06c540f513262a9b7b1ab'
- '451f623150d84118f6801a63053226f0'
- 'b3bd87cc4571873fd860bf4b6a0e51fa'
+ '879237d0ca0dc54d5cdb4307adb40005'
+ 'cb3462fda27156851badf51d5a0595ae'
'4889b3de48732ec149a71aeb72039455'
'80773e4278e09b14cc6843e346540a9d')
+pkgver() {
+ echo \
+ $(drush rl --fields=version --field-labels=0 provision | sort | grep -v 'dev' | tail -n1 | tr '-' '_' | tr -d ' ') \
+ $(drush rl --fields=version --field-labels=0 hostmaster | sort | grep -v 'dev' | tail -n1 | tr '-' '_' | tr -d ' ') \
+ | tr ' ' $'\n' | sort -ur | head -n1
+}
+
+prepare() {
+ for extension in gd pdo_mysql; do
+ echo -e "; Required extension for $pkgname\nextension=$extension.so" >| "$extension.$pkgname.ini"
+ done
+}
+
package() {
msg2 'Adding config files'
install -dm750 "$pkgdir/etc/sudoers.d"
install -Dm440 sudoers "$pkgdir/etc/sudoers.d/$pkgname"
install -Dm644 nginx.conf "$pkgdir/etc/nginx/$pkgname.conf"
- install -Dm644 php.ini "$pkgdir/etc/php/conf.d/$pkgname.ini"
- install -Dm644 msmtprc "$pkgdir/etc/msmtprc.aegir"
+ install -Dm644 "$pkgname.ini" "$pkgdir/etc/php/conf.d/$pkgname.ini"
+ install -Dm644 "msmtprc.$pkgname" "$pkgdir/etc/msmtprc.$pkgname"
+ install -Dm644 <( ) "$pkgdir/var/spool/cron/$pkgname"
+ for extension in gd pdo_mysql; do
+ install -Dm644 $extension.$pkgname.ini "$pkgdir/etc/php/conf.d/$extension.$pkgname.ini"
+ done
msg2 'Adding systemd files'
install -Dm644 nginx.svc.conf "$pkgdir/usr/lib/systemd/system/nginx.service.d/$pkgname.conf"
- install -Dm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -Dm644 "$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -Dm644 "$pkgname.target" "$pkgdir/usr/lib/systemd/system/$pkgname.target"
- msg2 'Creating aegir directory structure'
- mkdir -pm700 "$pkgdir/var/lib/aegir/config/server_master/nginx/"{platform,post,pre,subdir,platform,vhost}".d"
- mkdir -pm755 "$pkgdir/var/lib/aegir/"{backups,clients,config{,/{includes,self,server_localhost,server_master{,/nginx}}}}
- mkdir -pm755 "$pkgdir/var/lib/aegir/"{.drush/cache,platforms}
- ln -sr server_master/nginx.conf "$pkgdir/var/lib/aegir/config/nginx.conf"
- ln -sr nginx_vhost_common.conf "$pkgdir/var/lib/aegir/config/includes/nginx_advanced_include.conf"
- ln -sr nginx_vhost_common.conf "$pkgdir/var/lib/aegir/config/includes/nginx_simple_include.conf"
+ msg2 'Creating $pkgname directory structure'
+ mkdir -p "$pkgdir/var/lib/$pkgname"
+ umask 077
+ mkdir -p "$pkgdir/var/lib/$pkgname/"{backups,clients/admin,config/{includes,self,server_master/nginx/{platform,post,pre,subdir,platform,vhost}.d}}
+ umask 022
+ mkdir -p "$pkgdir/var/lib/$pkgname/"{,config{includes,self,server_localhost,server_master/nginx}}
- install -Dm644 <( ) "$pkgdir/var/spool/cron/http"
- install -Dm644 systemd.target "$pkgdir/usr/lib/systemd/system/$pkgname.target"
+ ln -s "/var/lib/$pkgname/config/server_master/nginx.conf" "$pkgdir/var/lib/$pkgname/config/nginx.conf"
+ ln -s "/var/lib/$pkgname/config/includes/nginx_vhost_common.conf" "$pkgdir/var/lib/$pkgname/config/includes/nginx_advanced_include.conf"
+ ln -s "/var/lib/$pkgname/config/includes/nginx_vhost_common.conf" "$pkgdir/var/lib/$pkgname/config/includes/nginx_simple_include.conf"
- chown -R http:http "$pkgdir/var/lib/$pkgname" "$pkgdir/var/spool/cron/http"
+ chown -R 696:http "$pkgdir/var/lib/$pkgname" "$pkgdir/var/spool/cron/$pkgname"
}
diff --git a/aegir.ini b/aegir.ini
new file mode 100644
index 00000000000..545ba0771ab
--- /dev/null
+++ b/aegir.ini
@@ -0,0 +1,4 @@
+; Required config tweaks
+mbstring.http_input = pass
+mbstring.http_output = pass
+open_basedir =
diff --git a/aegir.install b/aegir.install
index 63e4e0c3d84..bcc1da516ea 100644
--- a/aegir.install
+++ b/aegir.install
@@ -7,7 +7,7 @@ post_install() {
echo ">>> 2. Ensure the http user and group exist (i.e. uid=gid=33):"
echo " $ test \$(id --user http) -eq 33 -a \$(id --group http) -eq 33 && echo Success!"
echo ">>> 3. Ensure PHP can successfully send outgoing emails (the supplied msmtprc template works for Google accounts):"
- echo " $ php -R 'mail(\"example@example.com\", \"Test email from PHP\", \"Test email body.\");"
+ echo " $ php -r 'mail(\"example@example.com\", \"Test email from PHP\", \"Test email body.\");'"
echo ">>> 4. Setup the MySQL instance (by running mysql_secure_installation, or the following shell commands):"
echo " # systemctl start mysqld"
echo " $ mysql --user=root --execute=\""
@@ -33,16 +33,7 @@ post_install() {
}
post_upgrade() {
- TEMPFILE="$(mktemp)"
- if ! getent passwd aegir &>/dev/null; then
- useradd --non-unique --uid $(id --user http) --gid $(id --group http) --home-dir /var/lib/aegir aegir
- # Rearrange user database so aegir user name comes before http
- cat >| $TEMPFILE \
- <(sed -n '/http:/q;p' /etc/passwd) \
- <(tail -n1 /etc/passwd) \
- <(sed -n '/http:/{p;q}' /etc/passwd) \
- <(head -n-1 /etc/passwd | sed '1,/http:/d')
- cp $TEMPFILE /etc/passwd
- pwconv
- fi
+ [ getent passwd aegir &>/dev/null ] || useradd --uid 696 --gid http --home-dir /var/lib/aegir aegir
+ chmod 755 /var/lib/aegir
+ pwconv
}
diff --git a/systemd.service b/aegir.service
index 70e5a2573cc..86963a15bb8 100644
--- a/systemd.service
+++ b/aegir.service
@@ -1,5 +1,6 @@
[Unit]
Description=Aegir queue daemon
+PartOf=aegir.target
After=mysqld.service php-fpm.service nginx.service
[Service]
@@ -7,6 +8,7 @@ Type=simple
ExecStart=/usr/bin/drush --quiet @hostmaster hosting-queued
User=aegir
Restart=always
+SuccessExitStatus=1
[Install]
WantedBy=multi-user.target
diff --git a/aegir.target b/aegir.target
new file mode 100644
index 00000000000..10962e08211
--- /dev/null
+++ b/aegir.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=Aegir Hosting System
+Requires=aegir.service mailcatcher.service mailcatcher-smtp.socket mysqld.service nginx.service php-fpm.service
+After=aegir.service mailcatcher.service mailcatcher-smtp.socket mysqld.service nginx.service php-fpm.service
+PropagatesReloadTo=aegir.service mailcatcher.service mailcatcher-smtp.socket mysqld.service nginx.service php-fpm.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/msmtprc b/msmtprc
deleted file mode 100644
index 38bbb796e53..00000000000
--- a/msmtprc
+++ /dev/null
@@ -1,11 +0,0 @@
-defaults
-auth on
-tls on
-tls_trust_file /etc/ssl/certs/ca-certificates.crt
-
-account default
-host smtp.gmail.com
-port 587
-from address@gmail.com
-user address@gmail.com
-password yourpassword
diff --git a/msmtprc.aegir b/msmtprc.aegir
new file mode 100644
index 00000000000..7e826cd1a85
--- /dev/null
+++ b/msmtprc.aegir
@@ -0,0 +1,6 @@
+account mailcatcher
+host localhost
+port 25
+auto_from on
+
+account default: mailcatcher
diff --git a/mysqld.svc.conf b/mysqld.svc.conf
new file mode 100644
index 00000000000..21c138229ad
--- /dev/null
+++ b/mysqld.svc.conf
@@ -0,0 +1,2 @@
+[Unit]
+PartOf=aegir.target
diff --git a/nginx.conf b/nginx.conf
index e7612d80b6a..e9a9d6594fd 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -1,4 +1,4 @@
-user aegir;
+user aegir http;
worker_processes 1;
error_log stderr;
diff --git a/nginx.svc.conf b/nginx.svc.conf
index 0e3604838aa..55161a6b2ef 100644
--- a/nginx.svc.conf
+++ b/nginx.svc.conf
@@ -1,3 +1,6 @@
+[Unit]
+PartOf=aegir.target
+
[Service]
ExecStart=
ExecStart=/usr/bin/nginx -c /etc/nginx/aegir.conf
diff --git a/php-dev.ini b/php-dev.ini
new file mode 100644
index 00000000000..721939a12e7
--- /dev/null
+++ b/php-dev.ini
@@ -0,0 +1,3 @@
+; Error handling
+display_errors = stderr
+error_reporting = E_ALL | E_NOTICE | E_STRICT
diff --git a/php-fpm.svc.conf b/php-fpm.svc.conf
new file mode 100644
index 00000000000..21c138229ad
--- /dev/null
+++ b/php-fpm.svc.conf
@@ -0,0 +1,2 @@
+[Unit]
+PartOf=aegir.target
diff --git a/php-opt.ini b/php-opt.ini
new file mode 100644
index 00000000000..9e5c782f971
--- /dev/null
+++ b/php-opt.ini
@@ -0,0 +1,3 @@
+; Optional settings
+date.timezone = UTC
+memory_limit = 192M
diff --git a/php.ini b/php.ini
deleted file mode 100644
index 1c93516c4f4..00000000000
--- a/php.ini
+++ /dev/null
@@ -1,28 +0,0 @@
-;
-; Error handling
-;
-display_errors = stderr
-error_reporting = E_ALL | E_NOTICE | E_STRICT
-
-;
-; Required extensions
-;
-extension = gd.so
-extension = mysqli.so
-extension = openssl.so
-extension = pdo_mysql.so
-extension = phar.so
-extension = posix.so
-
-;
-; Required config tweaks
-;
-mbstring.http_input = pass
-mbstring.http_output = pass
-open_basedir =
-
-;
-; Configurable settings
-;
-date.timezone = UTC
-memory_limit = 192M
diff --git a/sudoers b/sudoers
index 3dabed2fc96..bdd4749c977 100644
--- a/sudoers
+++ b/sudoers
@@ -1,2 +1,2 @@
-Defaults:http !requiretty
+Defaults:aegir !requiretty
aegir ALL=NOPASSWD: /usr/bin/nginx
diff --git a/systemd.target b/systemd.target
deleted file mode 100644
index 27cf23c8aec..00000000000
--- a/systemd.target
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Aegir Hosting System
-Requires=aegir.service mysqld.service nginx.service php-fpm.service
-After=aegir.service mysqld.service nginx.service php-fpm.service
-PropagatesReloadTo=aegir.service mysqld.service nginx.service php-fpm.service
-
-[Install]
-WantedBy=multi-user.target