summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD72
-rw-r--r--dokku-redeploy.service11
-rw-r--r--dokku.install28
-rw-r--r--nginx-dokku.conf11
-rw-r--r--nginx-reload.patch20
-rw-r--r--pluginhook.go93
-rw-r--r--sshcommand67
8 files changed, 62 insertions, 271 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1ea8ef756971..6b512f4ff16b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,22 @@
+# Generated by mksrcinfo v8
+# Mon Feb 15 22:53:31 UTC 2016
pkgbase = dokku
pkgdesc = Docker powered mini-Heroku in around 100 lines of Bash.
- pkgver = 0.3.22
- pkgrel = 4
- url = https://github.com/progrium/dokku
+ pkgver = 0.4.13
+ pkgrel = 2
+ url = https://github.com/dokku/dokku
install = dokku.install
- arch = i686
- arch = x86_64
+ arch = any
license = MIT
- makedepends = go
depends = docker
depends = nginx
- source = git+https://github.com/progrium/dokku.git#tag=v0.3.22
+ depends = plugn
+ depends = sshcommand
+ depends = herokuish
+ source = https://github.com/MorrisJobke/dokku/archive/arch-linux.zip
source = dokku.install
- source = pluginhook.go
- source = sshcommand
- source = dokku-redeploy.service
- source = nginx-dokku.conf
- source = nginx-reload.patch
- sha256sums = SKIP
- sha256sums = ce4935c51cff475e918c698d82d0735fa5b766fb8e576df5bb6eb5bf5259ffdd
- sha256sums = a8be92d37d9e99e2f5d0b44aed2451dc590daa7e5366b5cb2ba3197fb0ae65b0
- sha256sums = 610eb140386de622ea46e6144be9f6f0a130887f94005319a395aed081d95879
- sha256sums = 1d0557dd1f8cb0b0f39ac011c69fc6224e287f34cc7974f3420b608829d36ff1
- sha256sums = a5c81c91f3858d2325bd60a1b63efa5b71cc42c98746bcf1dd47668ccb5eeead
- sha256sums = 9b011c60a14bb9a74576c4bf55e785aa6757fdb6a280f73737629cd34bb626b7
+ sha256sums = ecd18ced116e9ed321903a97d2fe398bdbb3eb80333fcfaa880e0e8f9b598077
+ sha256sums = 91681fac3bde0a83105a7f767b1e7d3d02db40137113b2842dc1aa38abedd9dd
pkgname = dokku
diff --git a/PKGBUILD b/PKGBUILD
index 24d895aa8e65..89c29eafba92 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,70 +1,50 @@
# Maintainer: Martin Mlynář <nexus+arch@smoula.net>
pkgname=dokku
-pkgver=0.3.22
-pkgrel=4
+pkgver=0.4.13
+pkgrel=2
pkgdesc="Docker powered mini-Heroku in around 100 lines of Bash."
-arch=(i686 x86_64)
-url="https://github.com/progrium/dokku"
+arch=(any)
+url="https://github.com/dokku/dokku"
license=(MIT)
depends=(
'docker'
'nginx'
-)
-makedepends=(
- 'go'
+ 'plugn'
+ 'sshcommand'
+ 'herokuish'
)
-#https://raw.githubusercontent.com/progrium/pluginhook/master/pluginhook.go
-#https://raw.githubusercontent.com/progrium/sshcommand/master/sshcommand
source=(
- "git+https://github.com/progrium/dokku.git#tag=v0.3.22"
+# "https://github.com/dokku/dokku/archive/v${pkgver}.zip"
+ "https://github.com/MorrisJobke/dokku/archive/arch-linux.zip"
"${pkgname}.install"
- "pluginhook.go"
- "sshcommand"
- "dokku-redeploy.service"
- "nginx-dokku.conf"
- "nginx-reload.patch"
)
sha256sums=(
- 'SKIP'
- 'ce4935c51cff475e918c698d82d0735fa5b766fb8e576df5bb6eb5bf5259ffdd'
- 'a8be92d37d9e99e2f5d0b44aed2451dc590daa7e5366b5cb2ba3197fb0ae65b0'
- '610eb140386de622ea46e6144be9f6f0a130887f94005319a395aed081d95879'
- '1d0557dd1f8cb0b0f39ac011c69fc6224e287f34cc7974f3420b608829d36ff1'
- 'a5c81c91f3858d2325bd60a1b63efa5b71cc42c98746bcf1dd47668ccb5eeead'
- '9b011c60a14bb9a74576c4bf55e785aa6757fdb6a280f73737629cd34bb626b7'
+ 'ecd18ced116e9ed321903a97d2fe398bdbb3eb80333fcfaa880e0e8f9b598077'
+ '91681fac3bde0a83105a7f767b1e7d3d02db40137113b2842dc1aa38abedd9dd'
)
install=${pkgname}.install
-build() {
- cd "${srcdir}/"
- export GOPATH="${srcdir}/"
- go get "golang.org/x/crypto/ssh/terminal"
- GOOS=linux go build -o pluginhook.linux
-}
-
package() {
cd "${srcdir}/"
- patch -p0 < ../nginx-reload.patch
-
- install -Dm755 sshcommand "${pkgdir}"/usr/bin/sshcommand
- install -Dm755 pluginhook.linux "${pkgdir}"/usr/bin/pluginhook
- install -Dm644 dokku-redeploy.service "$pkgdir"/usr/lib/systemd/system/dokku-redeploy.service
- install -Dm644 dokku-redeploy.service "$pkgdir"/usr/lib/systemd/system/dokku-redeploy.service
- install -Dm644 nginx-dokku.conf "$pkgdir"/etc/nginx/conf.d/dokku.conf
-
- sed -i 's#\$DOKKU_ROOT#/var/dokku#' "$pkgdir"/etc/nginx/conf.d/dokku.conf
-
cd "$pkgname"
+ CORE_PLUGINS_PATH="${pkgdir}/var/lib/dokku/core-plugins/"
PLUGINS_PATH="${pkgdir}/var/lib/dokku/plugins/"
install -Dm755 dokku "${pkgdir}/usr/bin/dokku"
- mkdir -p ${PLUGINS_PATH}
+
+ mkdir -p ${CORE_PLUGINS_PATH} ${PLUGINS_PATH}
+ test -d ${CORE_PLUGINS_PATH}/enabled || PLUGIN_PATH=${CORE_PLUGINS_PATH} plugn init
+ test -d ${PLUGINS_PATH}/enabled || PLUGIN_PATH=${PLUGINS_PATH} plugn init
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
- rm -Rf ${PLUGINS_PATH}/$plugin && \
- cp -R plugins/$plugin ${PLUGINS_PATH} && \
- touch ${PLUGINS_PATH}/$plugin/.core; \
- rm -f ${PLUGINS_PATH}/$plugin/install
- done
+ rm -Rf ${CORE_PLUGINS_PATH}/available/$plugin && \
+ rm -Rf ${PLUGINS_PATH}/available/$plugin && \
+ rm -rf ${CORE_PLUGINS_PATH}/$plugin && \
+ rm -rf ${PLUGINS_PATH}/$plugin && \
+ cp -R plugins/$plugin ${CORE_PLUGINS_PATH}/available && \
+ ln -s ${CORE_PLUGINS_PATH}/available/$plugin ${PLUGINS_PATH}/available; \
+ find "$pkgdir"/var/lib/dokku/ -xtype l -delete;\
+ PLUGIN_PATH=${CORE_PLUGINS_PATH} plugn enable $plugin ;\
+ PLUGIN_PATH=${PLUGINS_PATH} plugn enable $plugin ;\
+ done
}
-
diff --git a/dokku-redeploy.service b/dokku-redeploy.service
deleted file mode 100644
index 2b061cbada15..000000000000
--- a/dokku-redeploy.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Dokku app redeploy service
-After=docker.service
-
-[Service]
-Type=simple
-User=dokku
-ExecStart=/usr/bin/dokku ps:restartall
-
-[Install]
-WantedBy=multi-user.target
diff --git a/dokku.install b/dokku.install
index e6a9017c99ae..2467599b7240 100644
--- a/dokku.install
+++ b/dokku.install
@@ -3,18 +3,24 @@ 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 \
+ -m \
dokku
chown dokku:dokku /var/dokku/
mkdir /var/dokku/.ssh/
- chown dokku:dokku /var/dokku/.ssh/
- gpasswd -a dokku docker
+ 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
+
+ chown -R dokku:dokku /var/lib/dokku/
if [ ! -f "/var/dokku/HOSTNAME" ]; then
hostname -f > "/var/dokku/HOSTNAME"
@@ -23,9 +29,13 @@ post_install() {
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload nginx, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
+ mkdir -p /etc/nginx/conf.d
+
+ dokku plugin:install --core
+
echo "
Please add your ssh pubkey like:
- $ cat ~/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku comment
+ $ cat ~/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku 'local key'
To enable nginx autoconfiguration, add to your /etc/nginx/nginx.conf in http section:
include /etc/nginx/conf.d/*.conf;
@@ -36,3 +46,13 @@ 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
+}
diff --git a/nginx-dokku.conf b/nginx-dokku.conf
deleted file mode 100644
index f24a0904d5b8..000000000000
--- a/nginx-dokku.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-include $DOKKU_ROOT/*/nginx.conf;
-
-ssl_session_cache shared:SSL:20m;
-ssl_session_timeout 10m;
-
-ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
-ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
-ssl_prefer_server_ciphers on;
-
-# ssl_certificate $DOKKU_ROOT/tls/server.crt;
-# ssl_certificate_key $DOKKU_ROOT/tls/server.key;
diff --git a/nginx-reload.patch b/nginx-reload.patch
deleted file mode 100644
index 003214e914e1..000000000000
--- a/nginx-reload.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -ruN dokku.orig/plugins/nginx-vhosts/commands dokku/plugins/nginx-vhosts/commands
---- dokku.orig/plugins/nginx-vhosts/commands 2015-07-26 00:25:13.665938706 +0200
-+++ dokku/plugins/nginx-vhosts/commands 2015-07-26 00:30:32.813534100 +0200
-@@ -14,15 +14,7 @@
- }
-
- restart_nginx () {
-- case "$DOKKU_DISTRO" in
-- ubuntu)
-- sudo /etc/init.d/nginx reload > /dev/null
-- ;;
--
-- opensuse)
-- sudo /sbin/service nginx reload > /dev/null
-- ;;
-- esac
-+ sudo /usr/bin/systemctl reload nginx
- }
-
- case "$1" in
diff --git a/pluginhook.go b/pluginhook.go
deleted file mode 100644
index 5ee57a0b44f8..000000000000
--- a/pluginhook.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package main
-
-import (
- "os"
- "fmt"
- "os/exec"
- "syscall"
- "path/filepath"
- "log"
- "flag"
- "bytes"
- "strings"
- "golang.org/x/crypto/ssh/terminal"
-)
-
-func main() {
- var parallel = flag.Bool("p", false, "Run hooks in parallel")
- var trace = flag.Bool("x", false, "Trace mode")
- flag.Parse()
-
- if len(os.Getenv("PLUGINHOOK_TRACE")) > 0 {
- *trace = true
- }
-
- pluginPath := os.Getenv("PLUGIN_PATH")
- if pluginPath == "" {
- log.Fatal("[ERROR] Unable to locate plugins: set $PLUGIN_PATH\n")
- os.Exit(1)
- }
- if flag.NArg() < 1 {
- log.Fatal("[ERROR] Hook name argument is required\n")
- os.Exit(1)
- }
- cmds := make([]exec.Cmd, 0)
- var matches, _ = filepath.Glob(fmt.Sprintf("%s/*/%s", pluginPath, flag.Arg(0)))
- for _, hook := range matches {
- cmd := exec.Command(hook, flag.Args()[1:]...)
- cmds = append(cmds, *cmd)
- }
- for i := len(cmds)-1; i >= 0; i-- {
- cmds[i].Stderr = os.Stderr
-
- if i == len(cmds)-1 {
- cmds[i].Stdout = os.Stdout
- }
- if i > 0 {
- if *parallel {
- stdout, err := cmds[i-1].StdoutPipe()
- if err != nil {
- log.Fatal(err)
- }
- cmds[i].Stdin = stdout
- } else {
- var buf bytes.Buffer
- cmds[i-1].Stdout = &buf
- cmds[i].Stdin = &buf
- }
- }
- if i == 0 && !terminal.IsTerminal(syscall.Stdin) {
- cmds[i].Stdin = os.Stdin
- }
- }
-
- if *parallel {
- done := make(chan bool, len(cmds))
-
- for i := 0; i < len(cmds); i++ {
- go func(cmd exec.Cmd, i int) {
- if *trace {
- fmt.Fprintln(os.Stderr, "+", strings.Join(cmds[i].Args, " "))
- }
- err := cmd.Run()
- if msg, ok := err.(*exec.ExitError); ok { // there is error code
- os.Exit(msg.Sys().(syscall.WaitStatus).ExitStatus())
- }
- done <- true
- }(cmds[i], i)
- }
- for i := 0; i < len(cmds); i++ {
- <-done
- }
- } else {
- for i := 0; i < len(cmds); i++ {
- if *trace {
- fmt.Fprintln(os.Stderr, "+", strings.Join(cmds[i].Args, " "))
- }
- err := cmds[i].Run()
- if msg, ok := err.(*exec.ExitError); ok { // there is error code
- os.Exit(msg.Sys().(syscall.WaitStatus).ExitStatus())
- }
- }
- }
-}
diff --git a/sshcommand b/sshcommand
deleted file mode 100644
index e106f3a72d6b..000000000000
--- a/sshcommand
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-set -e
-
-shopt -s nocasematch #For case insensitive string matching, for the first parameter
-
-SELF=`which $0`
-
-case "$1" in
- create) # sshcommand create <user> <command>
- if [[ $# -ne 3 ]]; then
- echo "Usage : sshcommand create user command"
- exit -1
- fi
- USER="$2"; COMMAND="$3"
-
- if id -u $USER >/dev/null 2>&1; then
- echo "User '$USER' already exists"
- else
- adduser --disabled-password --gecos "" $USER
- fi
-
- USERHOME=$(sh -c "echo ~$USER")
- mkdir -p "$USERHOME/.ssh"
- touch $USERHOME/.ssh/authorized_keys
- echo "$COMMAND" > "$USERHOME/.sshcommand"
- chown -R $USER $USERHOME
- ;;
-
- acl-add) # sshcommand acl-add <user> <identifier>
- if [[ $# -ne 3 ]]; then
- echo "Usage : sshcommand acl-add user identifier"
- exit -1
- fi
- USER="$2"; NAME="$3"
-
- getent passwd $USER > /dev/null || false
- USERHOME=$(sh -c "echo ~$USER")
-
- KEY=$(cat)
- FINGERPRINT=$(ssh-keygen -lf /dev/stdin <<< $(echo $KEY) | awk '{print $2}')
- KEY_PREFIX="command=\"FINGERPRINT=$FINGERPRINT NAME=$NAME \`cat $USERHOME/.sshcommand\` \$SSH_ORIGINAL_COMMAND\",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding"
- echo "$KEY_PREFIX $KEY" >> "$USERHOME/.ssh/authorized_keys"
- echo $FINGERPRINT
- ;;
-
- acl-remove) # sshcommand acl-remove <user> <identifier>
- if [[ $# -ne 3 ]]; then
- echo "Usage : sshcommand acl-remove user identifier"
- exit -1
- fi
- USER="$2"; NAME="$3"
-
- getent passwd $USER > /dev/null || false
- USERHOME=$(sh -c "echo ~$USER")
-
- sed --in-place "/ NAME=$NAME /d" "$USERHOME/.ssh/authorized_keys"
- ;;
-
- help|*) # sshcommand help
- echo "Usage : sshcommand create user command"
- echo " sshcommand acl-add user identifier"
- echo " sshcommand acl-remove user identifier"
- echo " sshcommand help # shows this usage message"
- ;;
-
-esac
-