This removes the need for two distinct users. Git pushes and dokku commands are sent using the same user.
23 lines
681 B
Bash
Executable File
23 lines
681 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# latest stable NGINX 1.4.x with websocket support
|
|
add-apt-repository -y ppa:nginx/stable
|
|
apt-get update
|
|
apt-get install -y nginx dnsutils
|
|
|
|
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
|
touch /etc/sudoers.tmp
|
|
cp /etc/sudoers /tmp/sudoers.new
|
|
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
|
EDITOR="cp /tmp/sudoers.new" visudo
|
|
rm /tmp/sudoers.new
|
|
fi
|
|
|
|
echo "include $HOME/*/nginx.conf;" > /etc/nginx/conf.d/dokku.conf
|
|
|
|
sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
|
|
|
|
[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME > $HOME/VHOST
|
|
|
|
/etc/init.d/nginx start
|