From f9e636ddb1c7b2442b1a7ae3cea7ce7aa49ed121 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Tue, 20 Oct 2015 15:47:44 -0700 Subject: [PATCH] make sure dokku can read nginx logs and don't remove other perms. closes #1572 --- dokku | 2 +- plugins/nginx-vhosts/install | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dokku b/dokku index b15993024..602e7bce0 100755 --- a/dokku +++ b/dokku @@ -41,7 +41,7 @@ if [[ "${args[0]}" =~ ^--.* ]]; then fi ! has_tty && DOKKU_QUIET_OUTPUT=1 -if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" && $1 != nginx:*-logs ]]; then +if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" ]]; then sudo -u dokku -E -H $0 "$@" exit fi diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 6eacf85c0..a6824e512 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -32,6 +32,11 @@ fi echo 'server_names_hash_bucket_size 512;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf +# make sure dokku can read the default log dir +gpasswd -M "$(egrep ^adm /etc/group | awk -F ":" '{ print $4 }')" dokku +chgrp -R dokku /var/log/nginx +chmod g+r /var/log/nginx + case "$DOKKU_DISTRO" in ubuntu) /etc/init.d/nginx start