don't require sudo for tailing logs since we're root anyway

This commit is contained in:
Michael Hobbs
2015-09-15 10:15:22 -07:00
parent cca49230d9
commit 72a1b76b63
3 changed files with 2 additions and 4 deletions

2
dokku
View File

@@ -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" ]]; then
if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" && $1 != nginx:*-logs ]]; then
sudo -u dokku -E -H $0 "$@"
exit
fi

View File

@@ -175,7 +175,7 @@ EOF
NGINX_LOGS_ARGS="-n 20"
fi
sudo tail "$NGINX_LOGS_ARGS" "$NGINX_LOGS_PATH"
tail "$NGINX_LOGS_ARGS" "$NGINX_LOGS_PATH"
;;
help | nginx:help)

View File

@@ -4,12 +4,10 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
ubuntu)
echo "%dokku ALL=(ALL) NOPASSWD:/etc/init.d/nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/tail" >> /etc/sudoers.d/dokku-nginx
;;
opensuse)
echo "%dokku ALL=(ALL) NOPASSWD:/sbin/service nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/tail" >> /etc/sudoers.d/dokku-nginx
;;
esac