mirror of
https://github.com/dokku/dokku.git
synced 2025-12-28 16:06:40 +01:00
The python version should allow us to remove any ruby dependencies and should also slightly speed up dokku installation. All LSB-compliant distributions should have python, so we should be okay depending upon it. Closes #1783 Closes #1786
60 lines
1.3 KiB
Bash
Executable File
60 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
case "$1" in
|
|
install)
|
|
db_get "dokku/web_config"
|
|
if [ "$RET" = "true" ]; then
|
|
INIT_CONF="/etc/init/dokku-installer.conf"
|
|
NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf"
|
|
|
|
rm -f $INIT_CONF
|
|
touch $INIT_CONF
|
|
echo 'start on runlevel [2345]' >> $INIT_CONF
|
|
echo 'exec /usr/local/share/dokku/contrib/dokku-installer.py selfdestruct' >> $INIT_CONF
|
|
|
|
rm -f $NGINX_CONF
|
|
touch $NGINX_CONF
|
|
|
|
{
|
|
echo 'upstream dokku-installer { server 127.0.0.1:2000; }'
|
|
echo 'server {'
|
|
echo ' listen 80;'
|
|
echo ' location / {'
|
|
echo ' proxy_pass http://dokku-installer;'
|
|
echo ' }'
|
|
echo '}'
|
|
} >> $NGINX_CONF
|
|
|
|
rm -f /etc/nginx/sites-enabled/*
|
|
service nginx reload || /etc/init.d/nginx reload
|
|
exit 0
|
|
fi
|
|
|
|
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
|
|
db_get "dokku/key_file"
|
|
if [ ! -f "$RET" ]; then
|
|
echo "Error: keyfile '$RET' not found."
|
|
echo " you can enter a new keyfile path when you restart the installation."
|
|
db_reset "dokku/key_file"
|
|
exit 1
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
upgrade)
|
|
;;
|
|
|
|
abort-upgrade)
|
|
;;
|
|
|
|
*)
|
|
echo "preinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|