feat: allow disabling the nginx-vhosts plugin by default

This allows us to force another plugin as the default vhost implementation, or disable it altogether in favor of some higher-level proxy implementation, such as one that integrates with service discovery.
This commit is contained in:
Jose Diaz-Gonzalez committed 2018-09-30 17:04:05 -04:00
1 parent 31adb13bde
commit fabb18c55c
7 files changed
+18 -2

No files matched your search

+1
View File
@@ -173,6 +173,7 @@ install-dokku-from-deb-package() {
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections [[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
[[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections [[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections [[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_NGINX_ENABLE ]] && echo "dokku dokku/nginx_enable string $DOKKU_NGINX_ENABLE" | sudo debconf-set-selections
if [[ -n $DOKKU_CHECKOUT ]]; then if [[ -n $DOKKU_CHECKOUT ]]; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
+1
View File
@@ -120,6 +120,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
proc.stdin.close() proc.stdin.close()
proc.wait() proc.wait()
set_debconf_selection('boolean', 'nginx_enable', 'true')
set_debconf_selection('boolean', 'skip_key_file', 'true') set_debconf_selection('boolean', 'skip_key_file', 'true')
set_debconf_selection('boolean', 'vhost_enable', vhost_enable) set_debconf_selection('boolean', 'vhost_enable', vhost_enable)
set_debconf_selection('boolean', 'web_config', 'false') set_debconf_selection('boolean', 'web_config', 'false')
+1
View File
@@ -17,6 +17,7 @@ if [ $RET = "true" ]; then
exit 0 exit 0
fi fi
db_input "high" "dokku/nginx_enable" || true
db_input "high" "dokku/hostname" || true db_input "high" "dokku/hostname" || true
db_input "high" "dokku/vhost_enable" || true db_input "high" "dokku/vhost_enable" || true
if [ "$ACTION" != "reconfigure" ]; then if [ "$ACTION" != "reconfigure" ]; then
+5 -1
View File
@@ -59,9 +59,13 @@ case "$1" in
fi fi
done done
db_get "dokku/nginx_enable"
echo "Enabling all core plugins" echo "Enabling all core plugins"
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then if [ "$plugin" = "nginx-vhosts" ] && [ "$RET" = "false" ]; then
echo "Skipping enable of nginx-vhosts plugin"
continue
elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin; ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
+4 -1
View File
@@ -21,7 +21,10 @@ main() {
rm -f /etc/systemd/system/dokku-redeploy.service rm -f /etc/systemd/system/dokku-redeploy.service
rm -f /etc/update-motd.d/99-dokku rm -f /etc/update-motd.d/99-dokku
(nginx -t && service nginx reload) || true db_get "dokku/nginx_enable"
if [ "$RET" = "true" ]; then
(nginx -t && service nginx reload) || true
fi
if [[ "$1" == "purge" ]]; then if [[ "$1" == "purge" ]]; then
rm -f /etc/nginx/conf.d/dokku.conf rm -f /etc/nginx/conf.d/dokku.conf
+5
View File
@@ -22,3 +22,8 @@ Template: dokku/key_file
Description: Keyfile for initial user: Description: Keyfile for initial user:
Type: string Type: string
Default: /root/.ssh/id_rsa.pub Default: /root/.ssh/id_rsa.pub
Template: dokku/nginx_enable
Description: Enable nginx-vhosts plugin?
Type: boolean
Default: true
+1
View File
@@ -41,3 +41,4 @@ After setting the desired options, proceed with the installation as described ab
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy | | dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. | | dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) | | dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |
| dokku/nginx_enable | boolean | true | Enable nginx-vhosts plugin |