summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyrton Araujo2018-11-07 15:49:29 -0200
committerAyrton Araujo2018-11-07 15:54:02 -0200
commit8b8366ca7a603df968aa9674ebe6abad53d859d7 (patch)
treee50162ac07c3ed98c930617cd9a7cef289a172e5
parentf802cf72ded0de9ecc6e2cd9e7ff12be231ea2de (diff)
downloadaur-8b8366ca7a603df968aa9674ebe6abad53d859d7.tar.gz
upgpkg: dokku 0.12.13-1
upstream release Co-authored-by: Fabien LEFEBVRE <D1ceWard@users.noreply.github.com>
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD48
-rw-r--r--dokku.install86
3 files changed, 87 insertions, 71 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c969319f5394..6aa6ad5189a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,28 +1,28 @@
-# Generated by mksrcinfo v8
-# Tue Jan 17 04:44:57 UTC 2017
pkgbase = dokku
pkgdesc = Docker powered mini-Heroku in around 100 lines of Bash.
- pkgver = 0.8.0
+ pkgver = 0.12.13
pkgrel = 1
url = https://github.com/dokku/dokku
install = dokku.install
arch = any
license = MIT
+ makedepends = go
makedepends = plugn
+ depends = bind-tools
depends = docker
- depends = nginx
- depends = plugn>=0.2.2
- depends = sshcommand>=0.4.0
- depends = herokuish>=0.3.24
- depends = openbsd-netcat
depends = gliderlabs-sigil
+ depends = go
+ depends = herokuish>=0.4.4
depends = lsb-release
- depends = bind-tools
+ depends = nginx
+ depends = openbsd-netcat
+ depends = plugn>=0.3.0
depends = python
- source = https://github.com/dokku/dokku/archive/v0.8.0.zip
+ depends = sshcommand>=0.7.0
+ source = https://github.com/dokku/dokku/archive/v0.12.13.zip
source = dokku.install
- sha256sums = d50624eee715b6c67cd58f471855c90caf176c99d91e393771c5ac52dd6de7b1
- sha256sums = 99a9d421fe100ef889f0f23be409289c8e627e55e6d5231c79a50d5da290eeb7
+ sha256sums = 2ebb883f207da87eaf34e70a4051d42657fab79e8bcbff64bb4b3daa00403658
+ sha256sums = d8df381f8c9c170e2e446bed20beb6442dd2058ba8f0e9c5e234d31d86b2c9bc
pkgname = dokku
diff --git a/PKGBUILD b/PKGBUILD
index fd4d3f44d122..1af76528549e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,45 +1,51 @@
-# Maintainer: Morris Jobke <hey AT morrisjobke.de>
-# Maintainer: Martin Mlynář <nexus+arch@smoula.net>
+# Maintainer: Ayrton Araujo <root@ayr-ton.net>
+# Contributor: Fabien LEFEBVRE <contact@d1ceward.com>
+
pkgname=dokku
-pkgver=0.8.0
+pkgver=0.12.13
pkgrel=1
pkgdesc="Docker powered mini-Heroku in around 100 lines of Bash."
arch=(any)
url="https://github.com/dokku/dokku"
license=(MIT)
makedepends=(
- 'plugn'
+ 'go'
+ 'plugn'
)
depends=(
- 'docker'
- 'nginx'
- 'plugn>=0.2.2'
- 'sshcommand>=0.4.0'
- 'herokuish>=0.3.24'
- 'openbsd-netcat'
- 'gliderlabs-sigil'
- 'lsb-release'
- 'bind-tools'
- 'python'
+ 'bind-tools'
+ 'docker'
+ 'gliderlabs-sigil'
+ 'go'
+ 'herokuish>=0.4.4'
+ 'lsb-release'
+ 'nginx'
+ 'openbsd-netcat'
+ 'plugn>=0.3.0'
+ 'python'
+ 'sshcommand>=0.7.0'
)
-
source=(
"https://github.com/dokku/dokku/archive/v${pkgver}.zip"
"${pkgname}.install"
)
-sha256sums=('d50624eee715b6c67cd58f471855c90caf176c99d91e393771c5ac52dd6de7b1'
- '99a9d421fe100ef889f0f23be409289c8e627e55e6d5231c79a50d5da290eeb7')
+sha256sums=('2ebb883f207da87eaf34e70a4051d42657fab79e8bcbff64bb4b3daa00403658'
+ 'd8df381f8c9c170e2e446bed20beb6442dd2058ba8f0e9c5e234d31d86b2c9bc')
install=${pkgname}.install
package() {
- cd "${srcdir}/"
-
- cd "$pkgname-$pkgver"
+ cd "${srcdir}/${pkgname}-${pkgver}"
install -Dm755 dokku "${pkgdir}/usr/bin/dokku"
+ go get github.com/ryanuber/columnize
+ go get github.com/dokku/dokku/plugins/config
+ env PLUGIN_MAKE_TARGET=build make go-build
mkdir -p "${pkgdir}/var/lib/dokku/core-plugins/available"
+ cp common.mk "${pkgdir}/var/lib/dokku/core-plugins/common.mk"
cp -r plugins/* "${pkgdir}/var/lib/dokku/core-plugins/available"
+ find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd "${pkgdir}/var/lib/dokku/core-plugins/available/${plugin}" && if [ -e Makefile ]; then make src-clean; fi; done
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch "${pkgdir}/var/lib/dokku/core-plugins/available/${plugin}/.core"; done
-
+ rm "${pkgdir}/var/lib/dokku/core-plugins/common.mk"
+ echo "${pkgver}" > "${pkgdir}/var/lib/dokku/STABLE_VERSION"
}
diff --git a/dokku.install b/dokku.install
index daac6d899495..f29898624fbe 100644
--- a/dokku.install
+++ b/dokku.install
@@ -1,38 +1,16 @@
#!/bin/sh
post_install() {
- getent group dokku >/dev/null ||
- groupadd --system dokku
-
- # same as: sshcommand create dokku /usr/bin/dokku
- getent passwd dokku >/dev/null ||
- useradd --system \
- --gid dokku \
- --shell /usr/bin/dokku \
- --home-dir /var/dokku/ \
- -m \
- dokku
-
- chown dokku:dokku /var/dokku/
- mkdir -p /var/dokku/.ssh/
- touch /var/dokku/.ssh/authorized_keys
- chown -R dokku:dokku /var/dokku/.ssh/
- gpasswd -a dokku docker > /dev/null
-
- echo "$1" | cut -d "-" -f 1 > /var/dokku/VERSION
-
- if [ ! -f "/var/dokku/HOSTNAME" ]; then
- hostname -f > "/var/dokku/HOSTNAME"
- chown dokku:dokku "/var/dokku/HOSTNAME"
- fi
-
- echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
+ DOKKU_ROOT="/home/dokku"
+ DOKKU_LIB_ROOT="/var/lib/dokku"
- mkdir -p /etc/nginx/conf.d
+ sshcommand create dokku /usr/bin/dokku &>/dev/null
- DOKKU_LIB_ROOT="/var/lib/dokku"
+ (egrep -i "^docker" /etc/group || groupadd docker) &>/dev/null
+ usermod -aG docker dokku
- echo "Cleanup orphaned symlinks"
- find -L ${DOKKU_LIB_ROOT} -type l -delete
+ echo "Setting up storage directories"
+ mkdir -p ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
+ chown dokku:dokku ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
echo "Setting up plugin directories"
# should be replaced by `plugn init`
@@ -40,6 +18,17 @@ post_install() {
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 "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
+ elif [ -f ${DOKKU_LIB_ROOT}/plugins/$plugin/.core ]; then
+ rm -rf ${DOKKU_LIB_ROOT}/plugins/$plugin
+ elif [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
+ mv ${DOKKU_LIB_ROOT}/plugins/$plugin ${DOKKU_LIB_ROOT}/plugins/available;
+ fi
+ done
+
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
@@ -48,35 +37,56 @@ post_install() {
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi
done
+ find -L ${DOKKU_LIB_ROOT} -type l -delete
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
+ echo "Ensure proper sshcommand path"
+ echo '/usr/bin/dokku' > "${DOKKU_ROOT}/.sshcommand"
+ mkdir -p ${DOKKU_ROOT}/.ssh
+ touch ${DOKKU_ROOT}/.ssh/authorized_keys
+ if [[ -f .ssh/authorized_keys ]]; then
+ sed -i.bak 's#/usr/local/bin/dokku#/usr/bin/dokku#' "${DOKKU_ROOT}/.ssh/authorized_keys"
+ rm "${DOKKU_ROOT}/.ssh/authorized_keys"
+ fi
+
echo "Install all core plugins"
dokku plugin:install --core
+ rm -f ${DOKKU_ROOT}/VERSION
+ cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
+
+ hostname -f > "${DOKKU_ROOT}/HOSTNAME"
+
+ mkdir -p /etc/nginx/conf.d
+ echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
+
echo "
Please add your ssh pubkey like:
- $ cat ~/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku 'local key'
+ $ cat ~/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku default
To enable nginx autoconfiguration, add to your /etc/nginx/nginx.conf in http section:
include /etc/nginx/conf.d/*.conf;
-"
+ And reload nginx:
+ $ sudo systemctl reload nginx
+ "
}
post_upgrade() {
post_install $1
}
-pre_remove() {
- userdel dokku &>/dev/null || true
- groupdel dokku &>/dev/null || true
-}
-
post_remove() {
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
- rm -rf /var/dokku
+
rm -rf /etc/nginx/conf.d/dokku.conf
+ systemctl reload nginx
+
+ rm -rf /var/lib/dokku
+ rm -rf /var/log/dokku
+
+ userdel -r dokku &>/dev/null
}