This commit is contained in:
@@ -5,18 +5,14 @@ add-apt-repository -y ppa:nginx/stable
|
|||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y nginx dnsutils
|
apt-get install -y nginx dnsutils
|
||||||
|
|
||||||
cat<<EOF > /etc/init/nginx-reloader.conf
|
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
||||||
description "Dokku nginx reloader service"
|
touch /etc/sudoers.tmp
|
||||||
|
cp /etc/sudoers /tmp/sudoers.new
|
||||||
start on runlevel [2345]
|
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
||||||
stop on runlevel [!2345]
|
echo "%git ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
||||||
|
EDITOR="cp /tmp/sudoers.new" visudo
|
||||||
script
|
rm /tmp/sudoers.new
|
||||||
[[ -f /home/git/reload-nginx ]] && rm -rf /home/git/reload-nginx
|
fi
|
||||||
echo | sudo -u git nc -l -U /home/git/reload-nginx && /etc/init.d/nginx reload
|
|
||||||
end script
|
|
||||||
respawn
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "include /home/git/*/nginx.conf;" > /etc/nginx/conf.d/dokku.conf
|
echo "include /home/git/*/nginx.conf;" > /etc/nginx/conf.d/dokku.conf
|
||||||
|
|
||||||
@@ -25,4 +21,3 @@ sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/n
|
|||||||
[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME > /home/git/VHOST
|
[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME > /home/git/VHOST
|
||||||
|
|
||||||
/etc/init.d/nginx start
|
/etc/init.d/nginx start
|
||||||
start nginx-reloader || true
|
|
||||||
|
|||||||
@@ -79,5 +79,5 @@ EOF
|
|||||||
echo "http://$hostname" > "$HOME/$APP/URL"
|
echo "http://$hostname" > "$HOME/$APP/URL"
|
||||||
fi
|
fi
|
||||||
pluginhook nginx-pre-reload $APP
|
pluginhook nginx-pre-reload $APP
|
||||||
nc -U $HOME/reload-nginx
|
sudo /etc/init.d/nginx reload
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user