From 3faa37b2e108ae27d6889563fa700407a54ed2ee Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 13 Nov 2014 16:50:44 +0100 Subject: [PATCH 1/2] Keep environment for sudo To be able to set some other environment variables even if dokku gets called from a different user we have to keep the environment with sudo intact, so i added the -E option. --- dokku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku b/dokku index bacb6080f..50d2cb62d 100755 --- a/dokku +++ b/dokku @@ -12,7 +12,7 @@ export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"} [[ $DOKKU_TRACE ]] && set -x if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then - sudo -u dokku -H $0 "$@" + sudo -u dokku -E -H $0 "$@" exit fi From 9eab9ed1e1ca706b93ef826fa741b8758fef3939 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 13 Nov 2014 16:52:39 +0100 Subject: [PATCH 2/2] Replaced hard coded plugins path To be able to switch the plugin path i have removed the hard coded plugin path from the catch all section of the switch within the main dokku executable. --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index fc3eaf439..defbac45c 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_ STACK_URL ?= https://github.com/progrium/buildstep.git PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz DOKKU_ROOT ?= /home/dokku +PLUGINS_PATH ?= /var/lib/dokku/plugins # If the first argument is "vagrant-dokku"... ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS))) @@ -23,12 +24,12 @@ install: dependencies stack copyfiles plugin-dependencies plugins version copyfiles: addman cp dokku /usr/local/bin/dokku - mkdir -p /var/lib/dokku/plugins - find /var/lib/dokku/plugins -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf + mkdir -p ${PLUGINS_PATH} + find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \ - rm -Rf /var/lib/dokku/plugins/$$plugin && \ - cp -R plugins/$$plugin /var/lib/dokku/plugins && \ - touch /var/lib/dokku/plugins/$$plugin/.core; \ + rm -Rf ${PLUGINS_PATH}/$$plugin && \ + cp -R plugins/$$plugin ${PLUGINS_PATH} && \ + touch ${PLUGINS_PATH}/$$plugin/.core; \ done addman: