summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames An2015-02-26 22:04:44 -0500
committerJames An2015-06-30 07:27:49 -0400
commit9175e9ffd307a1e7077178fd3ee7a97ca98fb78a (patch)
tree63560e182aa59d97e8144a6af7b9230790e7e2c3
parenta2fe1bd219e5378df61adfd9d7004d36124e0a54 (diff)
downloadaur-9175e9ffd307a1e7077178fd3ee7a97ca98fb78a.tar.gz
Changed aegir package to further automate basic configuration of such a web server.
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD23
-rw-r--r--aegir.install18
-rw-r--r--msmtprc11
-rw-r--r--nginx.conf2
-rw-r--r--php.ini1
-rw-r--r--sudoers2
-rw-r--r--systemd.service (renamed from service)0
-rw-r--r--systemd.target (renamed from aegir.target)0
9 files changed, 42 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c276d3ea8b81..69bc6de3d511 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 = 2
+ pkgrel = 3
url = http://aegirproject.org
install = aegir.install
arch = any
@@ -18,18 +18,20 @@ pkgbase = aegir
depends = smtp-forwarder
depends = unzip
options = emptydirs
- source = aegir.target
- source = php.ini
+ source = msmtprc
source = nginx.conf
source = nginx.svc.conf
- source = service
+ source = php.ini
source = sudoers
- md5sums = 80773e4278e09b14cc6843e346540a9d
- md5sums = 6c534cc2a9bea282b9895f099c902ca2
- md5sums = 7edbcc6b449a2f09ed93f88b77f300a5
+ source = systemd.service
+ source = systemd.target
+ md5sums = 1e9dd39b8c305eaab83e41a782e7c3c9
+ md5sums = 3079abdb035783843375b1745d651f8b
md5sums = 75535f9870f06c540f513262a9b7b1ab
+ md5sums = 451f623150d84118f6801a63053226f0
+ md5sums = b3bd87cc4571873fd860bf4b6a0e51fa
md5sums = 4889b3de48732ec149a71aeb72039455
- md5sums = 1736705ac5a1c2982ce5b4eee09b0831
+ md5sums = 80773e4278e09b14cc6843e346540a9d
pkgname = aegir
diff --git a/PKGBUILD b/PKGBUILD
index d1dbb727ed4a..bef63e5f0b4f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=aegir
pkgver=7.x_3.0_alpha2
-pkgrel=2
+pkgrel=3
pkgdesc="Configuration for a dedicated Aegir server."
arch=('any')
url='http://aegirproject.org'
@@ -23,19 +23,21 @@ depends=(
options=(emptydirs)
install=$pkgname.install
source=(
- 'aegir.target'
- 'php.ini'
+ 'msmtprc'
'nginx.conf'
'nginx.svc.conf'
- 'service'
+ 'php.ini'
'sudoers'
+ 'systemd.service'
+ 'systemd.target'
)
-md5sums=('80773e4278e09b14cc6843e346540a9d'
- '6c534cc2a9bea282b9895f099c902ca2'
- '7edbcc6b449a2f09ed93f88b77f300a5'
+md5sums=('1e9dd39b8c305eaab83e41a782e7c3c9'
+ '3079abdb035783843375b1745d651f8b'
'75535f9870f06c540f513262a9b7b1ab'
+ '451f623150d84118f6801a63053226f0'
+ 'b3bd87cc4571873fd860bf4b6a0e51fa'
'4889b3de48732ec149a71aeb72039455'
- '1736705ac5a1c2982ce5b4eee09b0831')
+ '80773e4278e09b14cc6843e346540a9d')
package() {
msg2 'Adding config files'
@@ -43,10 +45,11 @@ package() {
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"
msg2 'Adding systemd files'
install -Dm644 nginx.svc.conf "$pkgdir/usr/lib/systemd/system/nginx.service.d/$pkgname.conf"
- install -Dm644 service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -Dm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
msg2 'Creating aegir directory structure'
mkdir -pm700 "$pkgdir/var/lib/aegir/config/server_master/nginx/"{platform,post,pre,subdir,platform,vhost}".d"
@@ -57,7 +60,7 @@ package() {
ln -sr nginx_vhost_common.conf "$pkgdir/var/lib/aegir/config/includes/nginx_simple_include.conf"
install -Dm644 <( ) "$pkgdir/var/spool/cron/http"
- install -Dm644 aegir.target "$pkgdir/usr/lib/systemd/system/aegir.target"
+ install -Dm644 systemd.target "$pkgdir/usr/lib/systemd/system/$pkgname.target"
chown -R http:http "$pkgdir/var/lib/$pkgname" "$pkgdir/var/spool/cron/http"
}
diff --git a/aegir.install b/aegir.install
index 68955a0e5d06..63e4e0c3d845 100644
--- a/aegir.install
+++ b/aegir.install
@@ -6,8 +6,8 @@ post_install() {
echo " grep --quiet $(resolveip $(hostname) | cut --fields=6 --delimiter=' ') && echo Success!"
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:"
- echo " $ php -R 'mail("example@example.com", "Test email from PHP", "Test email body.");
+ 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 ">>> 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,24 +33,16 @@ post_install() {
}
post_upgrade() {
- if ! getent group aegir &>/dev/null; then
- groupadd --non-unique --gid $(id --group http) aegir
- # Rearrange group database so aegir group name comes before http
- cat \
- <(sed -n '/http:/q;p' /etc/group) \
- <(tail -n1 /etc/group) \
- <(sed -n '/http:/{p;q}' /etc/group) \
- <(head -n-1 /etc/group | sed '1,/http:/d')
- grpconv
- fi
+ 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 \
+ 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
}
diff --git a/msmtprc b/msmtprc
new file mode 100644
index 000000000000..38bbb796e536
--- /dev/null
+++ b/msmtprc
@@ -0,0 +1,11 @@
+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/nginx.conf b/nginx.conf
index 99731557e5d2..e7612d80b6a4 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -1,4 +1,4 @@
-user http;
+user aegir;
worker_processes 1;
error_log stderr;
diff --git a/php.ini b/php.ini
index b56096037bb9..1c93516c4f41 100644
--- a/php.ini
+++ b/php.ini
@@ -12,6 +12,7 @@ extension = mysqli.so
extension = openssl.so
extension = pdo_mysql.so
extension = phar.so
+extension = posix.so
;
; Required config tweaks
diff --git a/sudoers b/sudoers
index b82c973f96c0..3dabed2fc961 100644
--- a/sudoers
+++ b/sudoers
@@ -1,2 +1,2 @@
Defaults:http !requiretty
-http ALL=NOPASSWD: /usr/bin/nginx
+aegir ALL=NOPASSWD: /usr/bin/nginx
diff --git a/service b/systemd.service
index 70e5a2573ccb..70e5a2573ccb 100644
--- a/service
+++ b/systemd.service
diff --git a/aegir.target b/systemd.target
index 27cf23c8aec2..27cf23c8aec2 100644
--- a/aegir.target
+++ b/systemd.target