Compare commits

..

35 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
155f4e9aba Release 0.3.8 2014-12-08 22:14:03 -05:00
Jose Diaz-Gonzalez
1bfbdb449b Merge pull request #808 from progrium/proper-editorconfig
Ensure makefiles are properly formatted
2014-12-08 22:12:21 -05:00
Jose Diaz-Gonzalez
b3ca3368e8 Ensure makefiles are properly formatted 2014-12-08 22:12:04 -05:00
Jose Diaz-Gonzalez
04921d6876 Merge pull request #807 from progrium/799-force-nginx-conf
#799: Force nginx conf
2014-12-08 22:05:17 -05:00
Jose Diaz-Gonzalez
a915b8888f Ensure ruby is installed when running the dokku-installer 2014-12-08 21:57:10 -05:00
Jose Diaz-Gonzalez
129a5fd33d Force install a default nginx.conf. Closes #799 2014-12-08 21:20:54 -05:00
Jose Diaz-Gonzalez
e567ce1a90 Merge pull request #806 from progrium/fix-remote-user
Dokku pushes now happen as the dokku user, not git. Refs #796
2014-12-08 20:59:22 -05:00
Jose Diaz-Gonzalez
489f131ffc Dokku pushes now happen as the dokku user, not git. Refs #796 2014-12-08 20:58:50 -05:00
Jose Diaz-Gonzalez
45ec8df7be Merge pull request #805 from ademuk/patch-1
Fixed import-ssl server.crt/key check
2014-12-08 20:36:18 -05:00
Adem Gaygusuz
469d1e3f49 Fix crt/key check 2014-12-09 00:37:47 +00:00
Jose Diaz-Gonzalez
7ca2f49d78 Merge pull request #801 from joelvh/patch-1
Point users to upgrade guides
2014-12-02 08:55:48 -05:00
Joel Van Horn
69176d2d9a Point users to upgrade guides 2014-12-02 00:33:44 -05:00
Jose Diaz-Gonzalez
ad030b21d4 Merge pull request #796 from progrium/795-better-docs
795 better docs
2014-11-27 15:13:31 -05:00
Jose Diaz-Gonzalez
8c8f5e17f1 Tell users to change directory to dokku before running vagrant up. Refs #795 2014-11-27 15:10:33 -05:00
Jose Diaz-Gonzalez
e0b994c415 Standardize on dokku.me as the test hostname. Refs #795 2014-11-27 15:09:46 -05:00
Jose Diaz-Gonzalez
a12b1e2b56 Release 0.3.7 2014-11-25 15:46:48 -05:00
Jose Diaz-Gonzalez
590c5fc017 Merge pull request #789 from mmerickel/fix.deploy-vhost 2014-11-25 15:44:19 -05:00
Michael Merickel
ee5c35dd9d do not output message when creating ENV file
This fixes a bug introduced when deploying apps where the
nginx-vhosts plugin runs ``dokku config:get $APP NO_VHOST``. The initial
run of this actually was creating the ``ENV`` file and dumping to
stdout the value "NO_VHOST=-----> Creating /home/dokku/foo/ENV". This
was obviously no good because nginx-vhosts was considering this to be a
value of true.

I've modified this to simply not return anything when the value does not
exist. A better update may be to output the messages to stderr instead
of stdout.
2014-11-25 15:43:36 -05:00
Jose Diaz-Gonzalez
42a1363996 Merge pull request #788 from mmerickel/fix.apps-plugin
fix apps plugin issues in 0.3.6
2014-11-25 13:28:17 -05:00
Michael Merickel
4ae8cf8180 fix search for apps if DOKKU_ROOT is a symlink 2014-11-25 11:56:05 -06:00
Michael Merickel
aef3a68d2b fix app plugin that was always searching for empty app name 2014-11-25 11:55:25 -06:00
Jose Diaz-Gonzalez
58ca13e838 Release 0.3.6 2014-11-25 10:44:32 -05:00
Jose Diaz-Gonzalez
7c2f21fd2a Merge pull request #782 from progrium/simplified-config
Simplified config
2014-11-24 13:17:27 -05:00
Jose Diaz-Gonzalez
887637fb6b Merge pull request #785 from lsde/master
fix missing semicolon in nginx config
2014-11-24 10:33:26 -05:00
Jonas Svatos
c706344a94 fix missing semicolon in nginx config 2014-11-24 13:22:50 +01:00
Jose Diaz-Gonzalez
a1bbc1ec4d Release 0.3.5 2014-11-24 02:17:50 -05:00
Jose Diaz-Gonzalez
793f1b6058 Merge pull request #784 from progrium/no-vhost-hotfix
Fix NO_VHOST check
2014-11-24 02:16:39 -05:00
Jose Diaz-Gonzalez
20977fc2a2 Fix NO_VHOST check
It used to check if NO_VHOST is unset or set to the empty string
It now checks if NO_VHOST is set to a non-empty string
2014-11-24 02:16:21 -05:00
Jose Diaz-Gonzalez
407436b4cc Exit 0 if there is no configuration
heroku config:get exits 0 in this case
2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
04dbe31919 Unify the way in which all error messages are specified
Other parts of dokku use one-liners where possible, so these parts should as well
2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
56185fc1c2 Correct plugin example
$APP is not available until after the if guards
2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
303bd77226 Simplify if statement 2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
c6e39c08f0 Simplify env var checking in config plugin
All checks are now done within the commands, and we only need to ensure the config file exists.
2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
12194e2cc8 Add proper error handling to each config command 2014-11-23 23:32:42 -05:00
Jose Diaz-Gonzalez
a3b3a6a12a Unify missing app error messages 2014-11-23 23:32:42 -05:00
15 changed files with 134 additions and 116 deletions

View File

@@ -4,3 +4,8 @@ root = true
insert_final_newline = true
indent_style = space
indent_size = 2
[Makefile]
insert_final_newline = true
indent_style = tab
indent_size = 4

View File

@@ -1,5 +1,28 @@
# History
## 0.3.8
- #796: @josegonzalez Better vagrant documentation
- #801: @joelvh Point users to upgrade guides
- #805: @ademuk Fixed import-ssl server.crt/key check
- #806: @josegonzalez Dokku pushes now happen as the dokku user, not git. Refs #796
- #807: @josegonzalez Write proper nginx conf upon installation. Closes #799
- #808: @josegonzalez Ensure makefiles are properly formatted
## 0.3.7
- #788: @mmerickel fix apps plugin issues in 0.3.6
- #789: @mmerickel do not output message when creating ENV file
## 0.3.6
- #782: @josegonzalez Simplified config checking
- #785: @lsde fix missing semicolon in nginx config
## 0.3.5
- #784: @josegonzalez Fix NO_VHOST check
## 0.3.4
- #780: @josegonzalez Output error message when a command is not found. Closes #778

View File

@@ -91,6 +91,7 @@ count:
@find tests -type f | xargs cat | wc -l
dokku-installer:
apt-get install -qq -y ruby
test -f /var/lib/dokku/.dokku-installer-created || gem install rack -v 1.5.2 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install rack-protection -v 1.5.3 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || gem install sinatra -v 1.4.5 --no-rdoc --no-ri

View File

@@ -10,7 +10,11 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
To install the latest stable version of dokku, you can run the following bootstrapper command:
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.4/bootstrap.sh | sudo DOKKU_TAG=v0.3.4 bash
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.8/bootstrap.sh | sudo DOKKU_TAG=v0.3.8 bash
### Upgrading
[View the docs for upgrading](http://progrium.viewdocs.io/dokku/upgrading) from an older version of Dokku.
## Documentation

View File

@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
exit
end
version = "v0.3.4"
version = "v0.3.8"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip

View File

@@ -4,8 +4,8 @@ Now you can deploy apps on your Dokku. Let's deploy the [Heroku Node.js sample a
```
$ cd node-js-sample
$ git remote add progrium dokku@progriumapp.com:node-js-app
$ git push progrium master
$ git remote add dokku dokku@dokku.me:node-js-app
$ git push dokku master
Counting objects: 296, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (254/254), done.
@@ -18,12 +18,12 @@ Total 296 (delta 25), reused 276 (delta 13)
... blah blah blah ...
-----> Application deployed:
http://node-js-app.progriumapp.com
http://node-js-app.dokku.me
```
You're done!
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push progrium <local branch>:master```
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
Right now Buildstep supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/progrium/buildstep#supported-buildpacks). It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)!
Please check the documentation for your particular build pack as you may need to include configuration files (such as a Procfile) in your project root.
@@ -53,33 +53,33 @@ Alternatively, you may push an app to your dokku host with a name like "00-defau
The name of remote repository is used as the name of application to be deployed, as for example above:
$ git remote add progrium git@progriumapp.com:node-js-app
$ git push progrium master
$ git remote add dokku dokku@dokku.me:node-js-app
$ git push dokku master
Is deployed to,
remote: -----> Application deployed:
remote: http://node-js-app.progriumapp.com
remote: http://node-js-app.dokku.me
You can also specify fully qualified names, say `app.progrium.com`, as
You can also specify fully qualified names, say `app.dokku.me`, as
$ git remote add progrium git@progriumapp.com:app.progrium.com
$ git push progrium master
$ git remote add dokku dokku@dokku.me:app.dokku.me
$ git push dokku master
So, after deployment the application will be available at,
remote: -----> Application deployed:
remote: http://app.progrium.com
remote: http://app.dokku.me
This is in particular useful, then you want to deploy to root domain, as
$ git remote add progrium git@progriumapp.com:progrium.com
$ git push progrium master
$ git remote add dokku dokku@dokku.me:dokku.me
$ git push dokku master
... deployment ...
remote: -----> Application deployed:
remote: http://progrium.com
remote: http://dokku.me
# Removing a deployed app

View File

@@ -11,7 +11,7 @@ Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's de
To install the latest stable version of dokku, you can run the following bootstrapper command:
```bash
wget -qO- https://raw.github.com/progrium/dokku/v0.3.4/bootstrap.sh | sudo DOKKU_TAG=v0.3.4 bash
wget -qO- https://raw.github.com/progrium/dokku/v0.3.8/bootstrap.sh | sudo DOKKU_TAG=v0.3.8 bash
```
## Configuring
@@ -20,7 +20,7 @@ Set up a domain and a wildcard domain pointing to that host. Make sure `/home/do
You'll have to add a public key associated with a username by doing something like this from your local machine:
$ cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku progrium"
$ cat ~/.ssh/id_rsa.pub | ssh dokku.me "sudo sshcommand acl-add dokku $USER"
That's it!
@@ -110,6 +110,7 @@ sudo BUILD_STACK=true make install
# - `BOX_MEMORY`
# - `DOKKU_DOMAIN`
# - `DOKKU_IP`.
cd path/to/dokku
vagrant up
```

View File

@@ -39,7 +39,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
hello)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$APP" ]] && echo "App $APP does not exist" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2";
echo "Hello $APP"

View File

@@ -1,11 +1,11 @@
# Remote commands
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@progriumapp.com <command>`
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@dokku.me <command>`
The `-t` is used to request a pty. It is highly recommended to do so.
To avoid the need to type the `-t` option each time, simply create/modify a section in the `.ssh/config` on the client side, as follows:
```
Host progriumapp.com
Host dokku.me
RequestTTY yes
```

View File

@@ -7,15 +7,9 @@ case "$1" in
;;
logs)
if [[ -z $2 ]]; then
echo "Please specify an app to run the command on"
exit 1
fi
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
@@ -30,15 +24,10 @@ case "$1" in
;;
run)
if [[ -z $2 ]]; then
echo "Please specify an app to run the command on"
exit 1
fi
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2"; IMAGE="dokku/$APP"
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
shift 2
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
@@ -46,11 +35,9 @@ case "$1" in
;;
url)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
echo $(< "$DOKKU_ROOT/$APP/URL")

View File

@@ -4,39 +4,23 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
apps)
echo "=== My Apps"
find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort
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
;;
apps:create)
if [[ -z $2 ]]; then
echo "Please specify an app to create"
exit 1
fi
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ -d "$DOKKU_ROOT/$2" ]] && echo " ! Name is already taken" && exit 1
APP="$2"
if [[ -d "$DOKKU_ROOT/$APP" ]]; then
echo " ! Name is already taken"
exit 1
fi
mkdir -p "$DOKKU_ROOT/$APP"
echo "Creating $APP... done"
;;
apps:destroy)
if [[ -z $2 ]]; then
echo "Please specify an app to delete"
exit 1
fi
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
APP="$2"; IMAGE="dokku/$APP";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ "$APP" == "tls" ]]; then
echo "Unable to destroy tls directory"
exit 1
fi
echo " ! WARNING: Potentially Destructive Action"
echo " ! This command will destroy $APP (including all add-ons)."

View File

@@ -1,28 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# Check if name is specified
if [[ $1 == config ]] || [[ $1 == config:* ]]; then
if [[ -z $2 ]]; then
echo "You must specify an app name"
exit 1
else
APP="$2"
ENV_FILE="$DOKKU_ROOT/$APP/ENV"
ENV_FILE_TEMP="$DOKKU_ROOT/$APP/ENV.tmp"
# Check if app exists with the same name
if [ ! -d "$DOKKU_ROOT/$APP" ]; then
echo "App $APP does not exist"
exit 1
fi
[ -f $ENV_FILE ] || {
echo "-----> Creating $ENV_FILE"
touch $ENV_FILE
}
fi
fi
ENV_FILE="$DOKKU_ROOT/$2/ENV"
ENV_FILE_TEMP="$DOKKU_ROOT/$2/ENV.tmp"
config_create () {
[ -f $ENV_FILE ] || {
touch $ENV_FILE
}
}
config_styled_hash () {
vars="$1"
@@ -76,12 +61,12 @@ config_write() {
case "$1" in
config)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2"
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
echo "$APP has no config vars"
exit 1
fi
config_create
[[ ! -s $ENV_FILE ]] && echo "$APP has no config vars" && exit 1
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
@@ -97,14 +82,19 @@ case "$1" in
;;
config:get)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2"
if [[ -z $3 ]]; then
echo "Usage: dokku config:get APP KEY"
echo "Must specify KEY."
exit 1
fi
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
exit 1
config_create
if [[ ! -s $ENV_FILE ]] ; then
exit 0
fi
KEY="$3"
@@ -113,13 +103,17 @@ case "$1" in
;;
config:set)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2"
if [[ -z "${*:3}" ]]; then
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
echo "Must specify KEY and VALUE to set."
exit 1
fi
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
config_create
ENV_ADD=""
ENV_TEMP=`cat "${ENV_FILE}"`
RESTART_APP=false
@@ -157,13 +151,17 @@ ${var}"
;;
config:unset)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
APP="$2"
if [[ -z $3 ]]; then
echo "Usage: dokku config:unset APP KEY1 [KEY2 ...]"
echo "Must specify KEY to unset."
exit 1
fi
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
config_create
ENV_TEMP=`cat "${ENV_FILE}"`
VARS="${*:3}"

View File

@@ -3,31 +3,16 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
nginx:import-ssl)
if [[ -z $2 ]]; then
echo "Please specify an app to create"
exit 1
fi
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
[[ -t 0 ]] && echo "Tar archive containing server.crt and server.key expected on stdin" && exit 1
APP="$2"
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -t 0 ]]; then
echo "Tar archive containing server.crt and server.key expected on stdin"
exit 1
fi
TEMP_DIR=`mktemp -d`
cd $TEMP_DIR
tar xvf - <&0
if [[ -f "$TEMP_DIR/server.crt" ]]; then
echo "Tar archive missing server.crt"
exit 1
fi
if [[ -f "$TEMP_DIR/server.key" ]]; then
echo "Tar archive missing server.key"
exit 1
fi
[[ ! -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1
[[ ! -f "$TEMP_DIR/server.key" ]] && echo "Tar archive missing server.key" && exit 1
mkdir -p "$DOKKU_ROOT/$APP/tls"
mv "$TEMP_DIR/server.crt" "$DOKKU_ROOT/$APP/tls/server.crt"

View File

@@ -32,7 +32,37 @@ ssl_prefer_server_ciphers on;
EOF
fi
echo 'server_names_hash_bucket_size 64' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
cat<<EOF > /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
EOF
echo 'server_names_hash_bucket_size 64;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"

View File

@@ -9,11 +9,11 @@ set +e
NO_VHOST=$(dokku config:get $APP NO_VHOST)
set -e
if [[ -z "$NO_VHOST" ]]; then
if [[ -n "$NO_VHOST" ]]; then
echo "-----> NO_VHOST config detected"
fi
if [[ -f "$DOKKU_ROOT/VHOST" && ! -z "$NO_VHOST" ]]; then
if [[ -f "$DOKKU_ROOT/VHOST" && ! -n "$NO_VHOST" ]]; then
VHOST=$(< "$DOKKU_ROOT/VHOST")
SUBDOMAIN=${APP/%\.${VHOST}/}
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)