From 1581884c6d6134f00c7d2671d40deff06b4822a8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:34:09 -0500 Subject: [PATCH 01/28] Fix issue where installer created dokku-installer for both upstart and systemd We should only create the upstart version if the OS does not use systemd. --- contrib/dokku-installer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index 8d824f12b..bf11abaee 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -38,10 +38,6 @@ def check_boot(): systemd_dir = os.getenv('SYSTEMD_DIR', '/etc/systemd/system') nginx_dir = os.getenv('NGINX_DIR', '/etc/nginx/conf.d') - if os.path.exists(init_dir): - with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: - f.write("start on runlevel [2345]\n") - f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(systemd_dir): with open('{0}/dokku-installer.service'.format(systemd_dir), 'w') as f: f.write("[Unit]\n") @@ -53,6 +49,10 @@ def check_boot(): f.write("[Install]\n") f.write("WantedBy=multi-user.target\n") f.write("WantedBy=graphical.target\n") + elif os.path.exists(init_dir): + with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: + f.write("start on runlevel [2345]\n") + f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(nginx_dir): with open('{0}/dokku-installer.conf'.format(nginx_dir), 'w') as f: f.write("upstream dokku-installer { server 127.0.0.1:2000; }\n") From 9da11dc8f81e02197b0c121f11fa65647b4f5b50 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:34:51 -0500 Subject: [PATCH 02/28] Fix lintian warning: description-synopsis-starts-with-article --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 34beba49e..70ebc5f85 100644 --- a/debian/control +++ b/debian/control @@ -7,5 +7,5 @@ Depends: locales, git, make, curl, gcc, man-db, sshcommand, docker-engine-cs | d Recommends: herokuish Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo Maintainer: Jose Diaz-Gonzalez -Description: A docker-powered PaaS that helps you build and manage the lifecycle of applications +Description: Docker-powered PaaS that helps build and manage the lifecycle of applications From 55b2aba3a881565139c40e1e4cc8fa7509a0cb11 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:35:11 -0500 Subject: [PATCH 03/28] Fix casing on all debugging messages --- debian/postinst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/postinst b/debian/postinst index 1b1793b8d..8e64bc19d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -18,13 +18,13 @@ case "$1" in egrep -i "^docker" /etc/group || groupadd docker usermod -aG docker dokku - echo "setup plugin directories" + echo "Setting up plugin directories" # should be replaced by `plugn init` mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml - echo "migrate old plugins" + echo "Migrating old plugins" find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then continue @@ -35,7 +35,7 @@ case "$1" in fi done - echo "enable 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 if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin; @@ -45,7 +45,7 @@ case "$1" in done chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins - echo "install all core plugins" + echo "Install all core plugins" dokku plugin:install --core rm -f ${DOKKU_ROOT}/VERSION From 1314b3942d183c43f6d7cd8e069579b2a3c0616f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:37:42 -0500 Subject: [PATCH 04/28] Correctly handle dokku-installer init file creation on systemd instances - Use the nginx.conf file's existence as a check for whether we should start the service or not - Create the init files with the dokku-installer.py file. This adds actual systemd support. - Also ensure we *always* start the service, regardless of it's status. This fixes an issue with processing systemd output --- debian/postinst | 10 +++++++--- debian/preinst | 6 ------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/debian/postinst b/debian/postinst index 8e64bc19d..ac206d54d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -51,9 +51,13 @@ case "$1" in rm -f ${DOKKU_ROOT}/VERSION cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION - echo "starting dokku-installer if necessary" - if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then - sudo service dokku-installer start + if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then + echo "Setting up dokku-installer" + /usr/local/share/dokku/contrib/dokku-installer.py onboot + + echo "Starting dokku-installer" + [[ -f /etc/systemd/system ]] && systemctl daemon-reload + service dokku-installer start fi db_get "dokku/web_config" diff --git a/debian/preinst b/debian/preinst index 65f04f69c..9efc00b1b 100755 --- a/debian/preinst +++ b/debian/preinst @@ -7,14 +7,8 @@ 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 From b0a32dfd1b3f943a0d9ab4384c2d3b9dc8a499e1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:38:26 -0500 Subject: [PATCH 05/28] Fixup debconf descriptions --- debian/templates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/templates b/debian/templates index e63a3e859..f75dce42d 100644 --- a/debian/templates +++ b/debian/templates @@ -1,10 +1,10 @@ Template: dokku/web_config -Description: Use the web-based config page? +Description: Enable the web-based config page? Type: boolean Default: true Template: dokku/vhost_enable -Description: Use vhost based deployments? +Description: Enable vhost-based deployments? Type: boolean Default: false From 1d22f8c89705f5a54a3ad464180cd502b6ab3cf8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:38:51 -0500 Subject: [PATCH 06/28] Fix lintian warning: malformed-prompt-in-templates --- debian/templates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/templates b/debian/templates index f75dce42d..030ed895d 100644 --- a/debian/templates +++ b/debian/templates @@ -9,11 +9,11 @@ Type: boolean Default: false Template: dokku/hostname -Description: Machine's hostname or IP +Description: Hostname or IP for server: Type: string Default: dokku.me Template: dokku/key_file -Description: Keyfile for initial user +Description: Keyfile for initial user: Type: string Default: /root/.ssh/id_rsa.pub From b962221b415681c18494f9512b9df61913868f60 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:39:30 -0500 Subject: [PATCH 07/28] Fix lintian warning: control-file-is-empty --- debian/conffiles | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 debian/conffiles diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index e69de29bb..000000000 From 4cb713cebf03c6153f5f10bf307e3f4b0502fde5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:45:38 -0500 Subject: [PATCH 08/28] Fix lintian warning: postrm-does-not-purge-debconf --- debian/postrm | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 debian/postrm diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 000000000..248b5833e --- /dev/null +++ b/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/bash +set -eo pipefail; [[ $TRACE ]] && set -x + +if [[ "$1" == "purge" ]] && [[ -e /usr/share/debconf/confmodule ]]; then + . /usr/share/debconf/confmodule + db_purge +fi From b8630b45d7b8ae4361ddc28546dd1c10bbd26ae8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:47:22 -0500 Subject: [PATCH 09/28] Fix lintian error: python-script-but-no-python-dep --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 70ebc5f85..495fbc8d8 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Priority: optional Architecture: amd64 Depends: locales, git, make, curl, gcc, man-db, sshcommand, docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent, software-properties-common, python-software-properties Recommends: herokuish -Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo +Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7 Maintainer: Jose Diaz-Gonzalez Description: Docker-powered PaaS that helps build and manage the lifecycle of applications From 5667f9cef1afa2bcaf5bb3eff47aaf5af998550c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:49:16 -0500 Subject: [PATCH 10/28] Fix lintian warning: missing-debconf-dependency-for-preinst --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 495fbc8d8..83a41c6a3 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Priority: optional Architecture: amd64 Depends: locales, git, make, curl, gcc, man-db, sshcommand, docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent, software-properties-common, python-software-properties Recommends: herokuish -Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7 +Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7, debconf Maintainer: Jose Diaz-Gonzalez Description: Docker-powered PaaS that helps build and manage the lifecycle of applications From 3fb59fd04d835aed77cb30df1227409b77fff1b1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:54:34 -0500 Subject: [PATCH 11/28] Fix lintian warning: file-in-unusual-dir --- deb.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deb.mk b/deb.mk index 70739149f..96c4c7730 100644 --- a/deb.mk +++ b/deb.mk @@ -83,12 +83,12 @@ deb-dokku: deb-setup mkdir -p /tmp/tmp /tmp/build cp -r debian /tmp/build/DEBIAN - mkdir -p /tmp/build/usr/local/bin + mkdir -p /tmp/build/usr/bin mkdir -p /tmp/build/var/lib/dokku/core-plugins/available mkdir -p /tmp/build/usr/local/share/man/man1 mkdir -p /tmp/build/usr/local/share/dokku/contrib - cp dokku /tmp/build/usr/local/bin + cp dokku /tmp/build/usr/bin cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done $(MAKE) help2man From 220923071cd38d1d675c60d9ae4f3fb05652c0e3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:59:00 -0500 Subject: [PATCH 12/28] Fix lintian warning: file-in-unusual-dir --- deb.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deb.mk b/deb.mk index 96c4c7730..e6df22a7c 100644 --- a/deb.mk +++ b/deb.mk @@ -85,7 +85,7 @@ deb-dokku: deb-setup cp -r debian /tmp/build/DEBIAN mkdir -p /tmp/build/usr/bin mkdir -p /tmp/build/var/lib/dokku/core-plugins/available - mkdir -p /tmp/build/usr/local/share/man/man1 + mkdir -p /tmp/build/usr/share/man/man1 mkdir -p /tmp/build/usr/local/share/dokku/contrib cp dokku /tmp/build/usr/bin @@ -93,7 +93,7 @@ deb-dokku: deb-setup find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done $(MAKE) help2man $(MAKE) addman - cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/local/share/man/man1/dokku.1 + cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1 cp contrib/dokku-installer.py /tmp/build/usr/local/share/dokku/contrib git describe --tags > /tmp/build/var/lib/dokku/VERSION cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION From f7a1f5c095cbb17fbe83dffa654a59359720079c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 22:02:40 -0500 Subject: [PATCH 13/28] Fix lintian warning: file-in-unusual-dir --- deb.mk | 4 ++-- debian/postinst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deb.mk b/deb.mk index e6df22a7c..7910af3b3 100644 --- a/deb.mk +++ b/deb.mk @@ -86,7 +86,7 @@ deb-dokku: deb-setup mkdir -p /tmp/build/usr/bin mkdir -p /tmp/build/var/lib/dokku/core-plugins/available mkdir -p /tmp/build/usr/share/man/man1 - mkdir -p /tmp/build/usr/local/share/dokku/contrib + mkdir -p /tmp/build/usr/share/dokku/contrib cp dokku /tmp/build/usr/bin cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available @@ -94,7 +94,7 @@ deb-dokku: deb-setup $(MAKE) help2man $(MAKE) addman cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1 - cp contrib/dokku-installer.py /tmp/build/usr/local/share/dokku/contrib + cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib git describe --tags > /tmp/build/var/lib/dokku/VERSION cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV diff --git a/debian/postinst b/debian/postinst index ac206d54d..d6fd2101d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -53,7 +53,7 @@ case "$1" in if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then echo "Setting up dokku-installer" - /usr/local/share/dokku/contrib/dokku-installer.py onboot + /usr/share/dokku/contrib/dokku-installer.py onboot echo "Starting dokku-installer" [[ -f /etc/systemd/system ]] && systemctl daemon-reload From 70b29590b9f0b12ddc606094efd834571b449698 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 22:05:25 -0500 Subject: [PATCH 14/28] Fix lintian error: manpage-not-compressed --- deb.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/deb.mk b/deb.mk index 7910af3b3..da36437ad 100644 --- a/deb.mk +++ b/deb.mk @@ -94,6 +94,7 @@ deb-dokku: deb-setup $(MAKE) help2man $(MAKE) addman cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/share/man/man1/dokku.1 + gzip -9 /tmp/build/usr/share/man/man1/dokku.1 cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib git describe --tags > /tmp/build/var/lib/dokku/VERSION cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION From 389d6773928c25e988753b3620cbfbbbcef26dca Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 22:11:06 -0500 Subject: [PATCH 15/28] Fix lintian error: no-copyright-file --- deb.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deb.mk b/deb.mk index da36437ad..77979a0da 100644 --- a/deb.mk +++ b/deb.mk @@ -87,8 +87,10 @@ deb-dokku: deb-setup mkdir -p /tmp/build/var/lib/dokku/core-plugins/available mkdir -p /tmp/build/usr/share/man/man1 mkdir -p /tmp/build/usr/share/dokku/contrib + mkdir -p /tmp/build/usr/share/doc/dokku cp dokku /tmp/build/usr/bin + cp LICENSE /tmp/build/usr/share/doc/dokku/copyright cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done $(MAKE) help2man From 7c88cecad4aa7e5909aa6c4fd0cdbdec39001c88 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 22:26:46 -0500 Subject: [PATCH 16/28] Plugin documentation formatting --- docs/plugins.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index a5b2d1b9d..f3e915788 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -176,13 +176,13 @@ Note: The following plugins have been supplied by our community and may not have | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | | [App name as env](https://github.com/cjblomqvist/dokku-app-name-env) | [cjblomqvist][] | 0.3.x | | [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | | -| [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ | +| [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ | | [Dokku Copy App Config Files](https://github.com/heichblatt/dokku-supply-config) | [heichblatt][] | | | [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] | | [Dokku Registry](https://github.com/agco-adm/dokku-registry)1 | [agco-adm][] | 0.4.0+ | | [git rev-parse HEAD in env](https://github.com/cjblomqvist/dokku-git-rev) | [cjblomqvist][] | 0.4.0+ | | [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ | -| [Haproxy tcp load balancerdokku](https://github.com/256dpi/dokku-haproxy) | [256dpi][] | 0.4.0+ | +| [Haproxy tcp load balancer](https://github.com/256dpi/dokku-haproxy) | [256dpi][] | 0.4.0+ | | [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | 0.4.0+ | | [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ | | [Lets Encrypt](https://github.com/sseemayer/dokku-letsencrypt) | [sseemayer][] | 0.4.0+ | @@ -225,7 +225,7 @@ Note: The following plugins have been supplied by our community and may not have | [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ | | [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Ɓebkowski][] | 0.4.0+ | | [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | | -| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | | +| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | | | [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains | 1 Forked from [jezdez/dokku-elasticsearch-plugin](https://github.com/jezdez/dokku-elasticsearch-plugin): uses Elasticsearch 1.2 (instead of 0.90), doesn't depend on dokku-link, runs as elasticsearch user instead of root, and turns off multicast autodiscovery for use in a VPS environment. @@ -237,18 +237,18 @@ The following plugins have been removed as their functionality is now in Dokku C | Plugin | Author | In Dokku Since | | ------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------- | | [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | v0.3.10 (domains plugin) | -| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) | +| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | v0.3.9 (trace command) | | [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | v0.3.17 (docker-options plugin) | | [Events Logger](https://github.com/alessio/dokku-events) | [alessio][] | v0.3.21 (events plugin) | | [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | v0.3.17 (docker-options plugin) | -| [List Containers](https://github.com/heichblatt/dokku-list) | [heichblatt][] | v0.3.14 (ps plugin | +| [List Containers](https://github.com/heichblatt/dokku-list) | [heichblatt][] | v0.3.14 (ps plugin | | [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | v0.3.17 (docker-options plugin) | | [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)1 | [wmluke][] | v0.3.10 (domains plugin) | | [Named-containers](https://github.com/Flink/dokku-named-containers) | [Flink][] | v0.4.2 (named-containers plugin) | | [Nginx-Alt](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | v0.3.10 (domains plugin) | | [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | v0.3.17 (docker-options plugin) | | [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel][] | v0.3.0 (zero downtime deploys) | -| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) | +| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | v0.3.14 (ps plugin) | | [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)2 | [cameron-martin][] | v0.3.9 (build-env plugin) | | [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)2 | [musicglue][] | v0.3.9 (build-env plugin) | | [user-env-compile](https://github.com/motin/dokku-user-env-compile)2 | [motin][] | v0.3.9 (build-env plugin) | @@ -267,11 +267,11 @@ The following plugins are no longer maintained by their developers. | Plugin | Author | Compatibility | | ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | | [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 | -| [CouchDB (multi containers)](https://github.com/Flink/dokku-couchdb-multi-containers) | [Flink][] | 0.4.0+ | +| [CouchDB (multi containers)](https://github.com/Flink/dokku-couchdb-multi-containers) | [Flink][] | 0.4.0+ | | [CouchDB](https://github.com/racehub/dokku-couchdb-plugin) | [RaceHub][] | Compatible with 0.2.0 | | [Elasticsearch](https://github.com/robv/dokku-elasticsearch) | [robv][] | Not compatible with >= 0.3.0 (still uses /home/git) | | [Elasticsearch](https://github.com/blag/dokku-elasticsearch-plugin)1 | [blag][] | Compatible with 0.2.0 | -| [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.4.0+ | +| [Memcached](https://github.com/Flink/dokku-memcached-plugin) | [Flink][] | 0.4.0+ | | [MongoDB (single container)](https://github.com/jeffutter/dokku-mongodb-plugin) | [jeffutter][] | | | [MySQL](https://github.com/hughfletcher/dokku-mysql-plugin) | [hughfletcher][] | | | [Neo4j](https://github.com/Aomitayo/dokku-neo4j-plugin) | [Aomitayo][] | | From 63d961afa0926fe63bd9fb36823aab7dd02d380b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 23:57:18 -0500 Subject: [PATCH 17/28] Revert "Fix lintian warning: file-in-unusual-dir" This reverts commit 3fb59fd04d835aed77cb30df1227409b77fff1b1. Changing the path to dokku cannot be done in a patch release, as it would break existing sshcommand entries. --- deb.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deb.mk b/deb.mk index 77979a0da..0f472df10 100644 --- a/deb.mk +++ b/deb.mk @@ -83,13 +83,13 @@ deb-dokku: deb-setup mkdir -p /tmp/tmp /tmp/build cp -r debian /tmp/build/DEBIAN - mkdir -p /tmp/build/usr/bin + mkdir -p /tmp/build/usr/local/bin mkdir -p /tmp/build/var/lib/dokku/core-plugins/available mkdir -p /tmp/build/usr/share/man/man1 mkdir -p /tmp/build/usr/share/dokku/contrib mkdir -p /tmp/build/usr/share/doc/dokku - cp dokku /tmp/build/usr/bin + cp dokku /tmp/build/usr/local/bin cp LICENSE /tmp/build/usr/share/doc/dokku/copyright cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done From 932e8191ad306e5538b429b8f1d6320f3af08305 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 00:52:04 -0500 Subject: [PATCH 18/28] Revert "Fix issue where installer created dokku-installer for both upstart and systemd" This reverts commit 1581884c6d6134f00c7d2671d40deff06b4822a8. --- contrib/dokku-installer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index bf11abaee..8d824f12b 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -38,6 +38,10 @@ def check_boot(): systemd_dir = os.getenv('SYSTEMD_DIR', '/etc/systemd/system') nginx_dir = os.getenv('NGINX_DIR', '/etc/nginx/conf.d') + if os.path.exists(init_dir): + with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: + f.write("start on runlevel [2345]\n") + f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(systemd_dir): with open('{0}/dokku-installer.service'.format(systemd_dir), 'w') as f: f.write("[Unit]\n") @@ -49,10 +53,6 @@ def check_boot(): f.write("[Install]\n") f.write("WantedBy=multi-user.target\n") f.write("WantedBy=graphical.target\n") - elif os.path.exists(init_dir): - with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: - f.write("start on runlevel [2345]\n") - f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(nginx_dir): with open('{0}/dokku-installer.conf'.format(nginx_dir), 'w') as f: f.write("upstream dokku-installer { server 127.0.0.1:2000; }\n") From cac272a247ea16058347601dd12a3de10ba3e99d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:29:57 -0500 Subject: [PATCH 19/28] Fix restarts of systemctl and dokku-installer We previously assumed that systemd was detectable by the existence of certain directories. Unfortunately, it seems 14.04 already has these directories, so we need to handle this case separately. One other note is that dokku-installer will fail to "start" if already started on certain systems, thus the previous grep was more accurate in it's running. --- debian/postinst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index d6fd2101d..2493a9b41 100755 --- a/debian/postinst +++ b/debian/postinst @@ -56,8 +56,13 @@ case "$1" in /usr/share/dokku/contrib/dokku-installer.py onboot echo "Starting dokku-installer" - [[ -f /etc/systemd/system ]] && systemctl daemon-reload - service dokku-installer start + if command -v systemctl &>/dev/null; then + systemctl daemon-reload + fi + + if service dokku-installer status 2> /dev/null | grep -E "waiting|inactive" ; then + service dokku-installer start + fi fi db_get "dokku/web_config" From 89d96dfee148dc9d548804315253635e7165b77f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:30:34 -0500 Subject: [PATCH 20/28] Only trigger systemctl if that command exists --- plugins/00_dokku-standard/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install index 1bf0ab7cd..5e999582c 100755 --- a/plugins/00_dokku-standard/install +++ b/plugins/00_dokku-standard/install @@ -39,7 +39,9 @@ ExecStart=/usr/local/bin/dokku ps:restore [Install] WantedBy=multi-user.target EOF - systemctl enable dokku-redeploy + if command -v systemctl &>/dev/null; then + systemctl enable dokku-redeploy + fi ;; esac From 40047f0f8bf01fded0845f80a2d6934882c91f97 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:31:06 -0500 Subject: [PATCH 21/28] Add support for symlinked directory paths and sort the output --- plugins/common/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common/functions b/plugins/common/functions index 8b18d18b5..9f216cfa2 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -10,7 +10,7 @@ has_tty() { } dokku_apps() { - local INSTALLED_APPS=$(find $DOKKU_ROOT -maxdepth 1 -mindepth 1 -type d ! -name 'tls' ! -name '.*' -printf "%f\n") || (dokku_log_fail "You haven't deployed any applications yet") + local INSTALLED_APPS=$(find $DOKKU_ROOT -follow -maxdepth 1 -mindepth 1 -type d ! -name 'tls' ! -name '.*' -printf "%f\n" | sort) || (dokku_log_fail "You haven't deployed any applications yet") [[ $INSTALLED_APPS ]] && echo $INSTALLED_APPS } From 51a50fb5715637d5775cde5e1b4bb06e23de3ba4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:31:34 -0500 Subject: [PATCH 22/28] Use dokku_apps for listing apps instead of re-inventing the wheel --- plugins/apps/commands | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/apps/commands b/plugins/apps/commands index b9baa53ee..1cea6b0f1 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -7,13 +7,13 @@ source "$PLUGIN_AVAILABLE_PATH/apps/functions" case "$1" in apps) dokku_log_info2_quiet "My Apps" - find $DOKKU_ROOT -follow -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort + dokku_apps ;; apps:create) apps_create $2 ;; - + apps:rename) [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -d "$DOKKU_ROOT/$3" ]] && dokku_log_fail "Name is already taken" @@ -31,7 +31,7 @@ case "$1" in plugn trigger post-app-rename $OLD_APP $NEW_APP echo "Renaming $OLD_APP to $NEW_APP... done" ;; - + apps:destroy) [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ "$2" == "tls" ]] && dokku_log_fail "Unable to destroy tls directory" From 73b3c4af40575b7b1183ae871f0ec22678e9ab24 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:52:30 -0500 Subject: [PATCH 23/28] Properly handle dokku data removal - remove deployed applications during dpkg purge - disable all core plugins during dpkg purge - ensure init files are removed - ensure motd is removed - remove all core plugins, dokku config files (including tls/sshcommand entries etc.) during purge - remove all empty directories and broken symlinks in the DOKKU_ROOT and DOKKU_LIB_ROOT directories during purge Note that we do not delete the dokku user itself as there might be other data we don't know about in this directory. --- debian/postrm | 40 +++++++++++++++++++++++++++++++++---- debian/prerm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 4 deletions(-) create mode 100755 debian/prerm diff --git a/debian/postrm b/debian/postrm index 248b5833e..c5da77b89 100755 --- a/debian/postrm +++ b/debian/postrm @@ -1,7 +1,39 @@ #!/bin/bash set -eo pipefail; [[ $TRACE ]] && set -x -if [[ "$1" == "purge" ]] && [[ -e /usr/share/debconf/confmodule ]]; then - . /usr/share/debconf/confmodule - db_purge -fi +readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" +readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" + +main() { + rm -f /etc/init/dokku-installer.conf + rm -f /etc/init/dokku-redeploy.conf + rm -f /etc/systemd/system/dokku-installer.conf + rm -f /etc/systemd/system/dokku-redeploy.service + rm -f /etc/update-motd.d/99-dokku + + if [[ "$1" == "purge" ]]; then + rm -f ${DOKKU_ROOT}/.dokkurc ${DOKKU_ROOT}/dokkurc ${DOKKU_ROOT}/tls + rm -f ${DOKKU_ROOT}/.ssh/authorized_keys ${DOKKU_ROOT}/.sshcommand + rm -f ${DOKKU_ROOT}/ENV ${DOKKU_ROOT}/HOSTNAME ${DOKKU_ROOT}/VERSION + rm -rf ${DOKKU_ROOT}/.cache + rm -rf ${DOKKU_LIB_ROOT}/core-plugins + + rm -f ${DOKKU_LIB_ROOT}/plugins/config.toml + if [[ -d ${DOKKU_LIB_ROOT} ]]; then + find -L ${DOKKU_LIB_ROOT} -type l -delete + find ${DOKKU_LIB_ROOT} -type d -empty -delete + fi + + if [[ -d ${DOKKU_ROOT} ]]; then + find -L ${DOKKU_ROOT} -type l -delete + find ${DOKKU_ROOT} -type d -empty -delete + fi + + if [[ -e /usr/share/debconf/confmodule ]]; then + . /usr/share/debconf/confmodule + db_purge + fi + fi +} + +main "$@" diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 000000000..c62cef9a0 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,55 @@ +#!/bin/bash +set -eo pipefail; [[ $TRACE ]] && set -x + +readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" +readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" + +ps_backtrace() { + if [ $# -lt 1 ]; then + echo "Usage: $0 PID" > /dev/stderr + exit 1 + fi + + declare -i pid=$1; + ppid=0; + header_modifier=""; + while : ; do + if [ $ppid -ne 0 ]; then + header_modifier=h; + fi; + ppid=$(ps -o ppid= $pid); + ps uww $header_modifier -p $pid; + if [ $pid -eq 1 ]; then + break; + fi; + pid=$ppid; + done; +} + +main() { + # HACK: Ensure that we only delete data when purging dokku from the system + if ps_backtrace $BASHPID 2> /dev/null | grep dpkg | grep -- "--purge" > /dev/null; then + echo "Processing purge" + + echo "Destroying deployed applications" + for app in $(DOKKU_QUIET_OUTPUT=1 dokku apps); do + dokku --force apps:destroy $app + done + + # HACK: Only disable core plugins, as we don't know what data users store in non-core plugin directories + echo "Disabling all core plugins" + 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 + rm ${DOKKU_LIB_ROOT}/plugins/available/$plugin; + PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn disable $plugin + PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn disable $plugin + fi + done + else + echo "Processing $1" + fi + + dokku cleanup +} + +main "$@" From a2f0962b76c0de6578940268f225ef27f583cd2d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 03:37:16 -0500 Subject: [PATCH 24/28] Stop any running dokku-installer processes They will cease to function regardless of whether the package has been purged or not --- debian/postrm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/postrm b/debian/postrm index c5da77b89..c6746594c 100755 --- a/debian/postrm +++ b/debian/postrm @@ -5,6 +5,10 @@ readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" main() { + if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then + service dokku-installer stop || true + fi + rm -f /etc/init/dokku-installer.conf rm -f /etc/init/dokku-redeploy.conf rm -f /etc/systemd/system/dokku-installer.conf From 933a5c0abf7825e31cff4b686bbe45b98bd938cf Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 03:37:44 -0500 Subject: [PATCH 25/28] Reload the nginx configuration Otherwise we run the risk of proxying a request to a bad backend --- debian/postrm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/postrm b/debian/postrm index c6746594c..a75895a58 100755 --- a/debian/postrm +++ b/debian/postrm @@ -15,6 +15,8 @@ main() { rm -f /etc/systemd/system/dokku-redeploy.service rm -f /etc/update-motd.d/99-dokku + service nginx reload + if [[ "$1" == "purge" ]]; then rm -f ${DOKKU_ROOT}/.dokkurc ${DOKKU_ROOT}/dokkurc ${DOKKU_ROOT}/tls rm -f ${DOKKU_ROOT}/.ssh/authorized_keys ${DOKKU_ROOT}/.sshcommand From bb525a3cf1a575c50dac7a1b7de762cf8745a13a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 03:53:27 -0500 Subject: [PATCH 26/28] Properly handle dokku-installer installation --- debian/postinst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/postinst b/debian/postinst index 2493a9b41..e6dce02b9 100755 --- a/debian/postinst +++ b/debian/postinst @@ -55,13 +55,14 @@ case "$1" in echo "Setting up dokku-installer" /usr/share/dokku/contrib/dokku-installer.py onboot - echo "Starting dokku-installer" if command -v systemctl &>/dev/null; then - systemctl daemon-reload + echo "Enabling dokku-installer" + systemctl enable dokku-installer fi - if service dokku-installer status 2> /dev/null | grep -E "waiting|inactive" ; then - service dokku-installer start + if echo $(service dokku-installer status 2> /dev/null || true) | grep -Eq "(inactive|waiting)" > /dev/null; then + echo "Starting dokku-installer" + service dokku-installer start || echo "Unable to start dokku-installer" fi fi From 5a74d5c2477bd78fb59ed3b38fe546b122036924 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 04:08:54 -0500 Subject: [PATCH 27/28] Create the proper init file in a distribution-agnostic way From http://unix.stackexchange.com/a/164092/105389 --- plugins/00_dokku-standard/install | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install index 5e999582c..636145dfa 100755 --- a/plugins/00_dokku-standard/install +++ b/plugins/00_dokku-standard/install @@ -11,9 +11,8 @@ fi # temporary hack for https://github.com/dokku/dokku/issues/82 # redeploys all apps after a reboot -case "$DOKKU_DISTRO" in - ubuntu) - cat< /etc/init/dokku-redeploy.conf +if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then + cat< /etc/init/dokku-redeploy.conf description "Dokku app redeploy service" start on filesystem and started docker @@ -23,10 +22,10 @@ script sudo -i -u dokku /usr/local/bin/dokku ps:restore end script EOF - ;; +fi - debian|opensuse) - cat< /etc/systemd/system/dokku-redeploy.service +if [[ $(systemctl 2> /dev/null) =~ -\.mount ]]; then + cat< /etc/systemd/system/dokku-redeploy.service [Unit] Description=Dokku app redeploy service After=docker.target @@ -39,11 +38,10 @@ ExecStart=/usr/local/bin/dokku ps:restore [Install] WantedBy=multi-user.target EOF - if command -v systemctl &>/dev/null; then - systemctl enable dokku-redeploy - fi - ;; -esac + if command -v systemctl &>/dev/null; then + systemctl enable dokku-redeploy + fi +fi mkdir -p /etc/update-motd.d cat< /etc/update-motd.d/99-dokku From 61f9ae6e6764868d88d2c15ed8101f12edc57795 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 04:31:48 -0500 Subject: [PATCH 28/28] Fix shellcheck violation --- debian/postinst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/postinst b/debian/postinst index e6dce02b9..10b8068ad 100755 --- a/debian/postinst +++ b/debian/postinst @@ -60,7 +60,8 @@ case "$1" in systemctl enable dokku-installer fi - if echo $(service dokku-installer status 2> /dev/null || true) | grep -Eq "(inactive|waiting)" > /dev/null; then + installer_status="$(service dokku-installer status 2> /dev/null || true)" + if echo $installer_status | grep -Eq "(inactive|waiting)" > /dev/null; then echo "Starting dokku-installer" service dokku-installer start || echo "Unable to start dokku-installer" fi