Compare commits

...

285 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
b22b366fb1 Release 0.4.9 2016-01-03 10:19:17 -05:00
Jose Diaz-Gonzalez
5387bce2d9 Merge pull request #1807 from dokku/josegonzalez-patch-1
Allow updating submodules at any revision
2016-01-02 20:07:54 -05:00
Jose Diaz-Gonzalez
f2c1cd8a35 Merge pull request #1812 from dokku/debian-packaging
Debian packaging updates
2016-01-02 20:04:28 -05:00
Jose Diaz-Gonzalez
188694fb29 Merge pull request #1814 from blackxored/fix-ip-extraction
fix: use new Go template for extracting IP
2016-01-02 19:56:34 -05:00
Adrian Perez
84fba7ff2b fix: try to preserve pre 1.9 compatibility 2016-01-02 20:16:03 +01:00
Adrian Perez
6c7d34a773 fix: use new template for extracting IP
I was running into issues with the IP addresses, and it seems
that it's using an incorrect/outdated syntax for retrieving
the container's IP Address. In multi-host networking
`NetworkSettings.IPAddress` is empty.

The docker documentation at https://docs.docker.com/engine/reference/commandline/inspect/
uses a different syntax which I've tested to work both on multi-host and
standard bridge networking.

If you're interested in the other issues and the work/hacks I've been doing related
to #1795, let me know. In the meantime, I think this fix is needed.
2016-01-02 18:21:23 +01:00
Jose Diaz-Gonzalez
61f9ae6e67 Fix shellcheck violation 2016-01-02 04:31:48 -05:00
Jose Diaz-Gonzalez
5a74d5c247 Create the proper init file in a distribution-agnostic way
From http://unix.stackexchange.com/a/164092/105389
2016-01-02 04:08:54 -05:00
Jose Diaz-Gonzalez
bb525a3cf1 Properly handle dokku-installer installation 2016-01-02 03:53:27 -05:00
Jose Diaz-Gonzalez
933a5c0abf Reload the nginx configuration
Otherwise we run the risk of proxying a request to a bad backend
2016-01-02 03:37:44 -05:00
Jose Diaz-Gonzalez
a2f0962b76 Stop any running dokku-installer processes
They will cease to function regardless of whether the package has been purged or not
2016-01-02 03:37:16 -05:00
Jose Diaz-Gonzalez
73b3c4af40 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.
2016-01-02 02:52:30 -05:00
Jose Diaz-Gonzalez
51a50fb571 Use dokku_apps for listing apps instead of re-inventing the wheel 2016-01-02 02:31:34 -05:00
Jose Diaz-Gonzalez
40047f0f8b Add support for symlinked directory paths and sort the output 2016-01-02 02:31:06 -05:00
Jose Diaz-Gonzalez
89d96dfee1 Only trigger systemctl if that command exists 2016-01-02 02:30:34 -05:00
Jose Diaz-Gonzalez
cac272a247 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.
2016-01-02 02:29:57 -05:00
Jose Diaz-Gonzalez
932e8191ad Revert "Fix issue where installer created dokku-installer for both upstart and systemd"
This reverts commit 1581884c6d.
2016-01-02 00:52:04 -05:00
Jose Diaz-Gonzalez
63d961afa0 Revert "Fix lintian warning: file-in-unusual-dir"
This reverts commit 3fb59fd04d.

Changing the path to dokku cannot be done in a patch release, as it
would break existing sshcommand entries.
2016-01-01 23:57:18 -05:00
Jose Diaz-Gonzalez
7c88cecad4 Plugin documentation formatting 2016-01-01 22:26:46 -05:00
Jose Diaz-Gonzalez
389d677392 Fix lintian error: no-copyright-file 2016-01-01 22:11:06 -05:00
Jose Diaz-Gonzalez
70b29590b9 Fix lintian error: manpage-not-compressed 2016-01-01 22:05:25 -05:00
Jose Diaz-Gonzalez
f7a1f5c095 Fix lintian warning: file-in-unusual-dir 2016-01-01 22:02:40 -05:00
Jose Diaz-Gonzalez
220923071c Fix lintian warning: file-in-unusual-dir 2016-01-01 21:59:00 -05:00
Jose Diaz-Gonzalez
3fb59fd04d Fix lintian warning: file-in-unusual-dir 2016-01-01 21:54:34 -05:00
Jose Diaz-Gonzalez
5667f9cef1 Fix lintian warning: missing-debconf-dependency-for-preinst 2016-01-01 21:49:16 -05:00
Jose Diaz-Gonzalez
b8630b45d7 Fix lintian error: python-script-but-no-python-dep 2016-01-01 21:47:22 -05:00
Jose Diaz-Gonzalez
4cb713cebf Fix lintian warning: postrm-does-not-purge-debconf 2016-01-01 21:45:38 -05:00
Jose Diaz-Gonzalez
b962221b41 Fix lintian warning: control-file-is-empty 2016-01-01 21:39:30 -05:00
Jose Diaz-Gonzalez
1d22f8c897 Fix lintian warning: malformed-prompt-in-templates 2016-01-01 21:38:51 -05:00
Jose Diaz-Gonzalez
b0a32dfd1b Fixup debconf descriptions 2016-01-01 21:38:26 -05:00
Jose Diaz-Gonzalez
1314b3942d 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
2016-01-01 21:37:42 -05:00
Jose Diaz-Gonzalez
55b2aba3a8 Fix casing on all debugging messages 2016-01-01 21:35:11 -05:00
Jose Diaz-Gonzalez
9da11dc8f8 Fix lintian warning: description-synopsis-starts-with-article 2016-01-01 21:34:51 -05:00
Jose Diaz-Gonzalez
1581884c6d 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.
2016-01-01 21:34:09 -05:00
Jose Diaz-Gonzalez
2b1929fc33 Merge pull request #1811 from dokku/josegonzalez-patch-2
Add dokku haproxy to plugins
2016-01-01 20:21:35 -05:00
Jose Diaz-Gonzalez
6c50e62f32 Add dokku haproxy to plugins
[ci skip]
2016-01-01 20:21:29 -05:00
Jose Diaz-Gonzalez
3f0a6a99da Merge pull request #1810 from dokku/josegonzalez-patch-2
Dockerfile installation requirements
2016-01-01 19:42:54 -05:00
Jose Diaz-Gonzalez
94b2a6a014 Invoke db_stop to ensure underlying services close open file descriptors 2015-12-31 08:54:02 -05:00
Jose Diaz-Gonzalez
ae2b2febe9 Enable debugging support to debian preinst hook
It is now possible to turn on debugging during an apt-get run by using `TRACE=1`
2015-12-31 08:22:38 -05:00
Jose Diaz-Gonzalez
908f551e0f Enable debugging support to debian postinst hook
It is now possible to turn on debugging during an apt-get run by using `TRACE=1`
2015-12-31 08:22:06 -05:00
Jose Diaz-Gonzalez
07506f1f53 Adding more info output to bootstrap script run
This allows us to better keep track of what commands are being run and when.
2015-12-31 08:19:39 -05:00
Jose Diaz-Gonzalez
2b624ac485 Release 0.4.8 2015-12-31 07:04:55 -05:00
Jose Diaz-Gonzalez
f73dfe0672 Merge pull request #1809 from dokku/josegonzalez-patch-2
Remove non-zero downtime version of letsencrypt plugin
2015-12-31 06:04:25 -05:00
Jose Diaz-Gonzalez
e3b5024ca3 Remove non-zero downtime version of letsencrypt plugin
[ci skip]
2015-12-31 06:04:19 -05:00
Jose Diaz-Gonzalez
a0c4f1fc1f Merge pull request #1808 from dokku/josegonzalez-patch-2
Fix path to dokku-installer
2015-12-31 05:47:04 -05:00
Jose Diaz-Gonzalez
399b3ecfe3 Fix path to dokku-installer
[ci skip]
2015-12-31 05:46:58 -05:00
Jose Diaz-Gonzalez
29ce25a040 Allow updating submodules at any revision
Using `--depth=1` breaks any submodules that are not at HEAD
2015-12-30 00:13:05 -05:00
Michael Hobbs
8832a9dd58 fix errant test file rename 2015-12-29 14:43:19 -08:00
Jose Diaz-Gonzalez
c561a8b900 Merge pull request #1798 from dokku/1774_mh-invalid-appname-failure
ensure app name begins with lowercase alphanumeric character
2015-12-25 21:55:02 -05:00
Jose Diaz-Gonzalez
eacb27d70b Merge pull request #1804 from dokku/josegonzalez-patch-2
Fix deprecated version constraint usage in debian control file
2015-12-25 21:54:36 -05:00
Jose Diaz-Gonzalez
a2359d6994 Fix deprecated version constraint usage
Fixes the following warning:

```
dpkg: warning: parsing file '/var/lib/dpkg/tmp.ci/control' near line 6 package 'dokku':
 `Depends' field, reference to `lxc-docker':
 `>' is obsolete, use `>=' or `>>' instead
```

Refs #1776
2015-12-24 18:02:26 -05:00
Jose Diaz-Gonzalez
67b4170e43 Merge pull request #1803 from dokku/mh-update-plugn
update plugn download url and version
2015-12-24 16:20:57 -05:00
Michael Hobbs
01f5c93585 update plugn download url and version 2015-12-24 10:41:09 -08:00
Jose Diaz-Gonzalez
f6306deb0a Merge pull request #1801 from dokku/josegonzalez-patch-1
Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install
2015-12-23 21:24:02 -05:00
Jose Diaz-Gonzalez
f6a4521e19 Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install 2015-12-23 20:02:56 -05:00
Jose Diaz-Gonzalez
35dc92fb3f Release 0.4.7 2015-12-23 07:16:49 -05:00
Jose Diaz-Gonzalez
eecd262eff Merge pull request #1800 from dokku/josegonzalez-patch-1
Respect DOKKU_ROOT in debian/postint
2015-12-23 03:59:16 -05:00
Jose Diaz-Gonzalez
6fbe8cabde Respect DOKKU_ROOT in debian/postint
[ci skip]
2015-12-23 03:59:10 -05:00
Jose Diaz-Gonzalez
dd0d0a3873 Merge pull request #1799 from dokku/josegonzalez-patch-1
Add support for tutum-agent
2015-12-23 01:41:56 -05:00
Jose Diaz-Gonzalez
4a36cbad53 Add support for tutum-agent
The agent embeds it's own docker, so installing both dokku and tutum-agent on the same instance is currently impossible.

[ci skip]
2015-12-23 01:41:48 -05:00
Jose Diaz-Gonzalez
3c3e5a962d Merge pull request #1794 from dokku/remove-ruby-dependency
Replace dokku-installer.rb with dokku-installer.py
2015-12-22 15:11:52 -05:00
Jose Diaz-Gonzalez
8775a2de1a Merge pull request #1797 from dokku/1768_mh-plugin-root-only
ensure we run plugin commands as root
2015-12-22 15:06:09 -05:00
Michael Hobbs
803ef7d9f3 ensure app name begins with lowercase. closes #1774 2015-12-22 12:02:18 -08:00
Michael Hobbs
d7b1e38cb7 ensure we run plugin commands as root. closes #1768 2015-12-22 11:16:25 -08:00
Jose Diaz-Gonzalez
e323770f89 Replace dokku-installer.rb with dokku-installer.py
The python version should allow us to remove any ruby dependencies and should also slightly speed up dokku installation. All LSB-compliant distributions should have python, so we should be okay depending upon it.

Closes #1783
Closes #1786
2015-12-22 01:59:23 -05:00
Michael Hobbs
32f1bc5396 Merge pull request #1789 from lvillani/skip-deploy
Make it possible to skip a deploy
2015-12-21 17:11:21 -08:00
Michael Hobbs
9d0f099e86 Merge pull request #1791 from dokku/mh-pare-down-test-suite
don't run app deploy tests and spread out unit tests to 4 containers
2015-12-21 16:36:25 -08:00
Michael Hobbs
76ad65b715 don't run app deploy tests and spread out unit tests to 4 containers. closes #1787 2015-12-21 10:18:16 -08:00
Michael Hobbs
d320203c2c Merge pull request #1793 from dokku/1792_mh-comments-in-procfile
filter out Procfile comments
2015-12-21 09:07:36 -08:00
Lorenzo Villani
30118d1b32 Make it possible to skip a deploy 2015-12-21 17:45:24 +01:00
Michael Hobbs
88be5083e0 filter out Procfile comments. closes #1792. closes #1742 2015-12-21 08:23:35 -08:00
Jose Diaz-Gonzalez
2955150dfe Merge pull request #1670 from zachfeldman/add-apps-rename
Add apps rename
2015-12-18 13:40:39 -05:00
Jose Diaz-Gonzalez
321c178f9f Merge pull request #1788 from dokku/mh-repo-move
updates for moving of dokku sshcommand and plugn repos
2015-12-18 04:16:39 -05:00
Michael Hobbs
a24b12eece Merge pull request #1790 from dokku/mh-dev-env-inputrc
use pgup/pgdown for history shortcut in dev env
2015-12-17 13:31:01 -08:00
Michael Hobbs
8b88cb8867 [ci skip] use pgup/pgdown for history shortcut in dev env 2015-12-17 13:30:34 -08:00
Michael Hobbs
8b879079e4 updates for moving of dokku sshcommand and plugn repos 2015-12-17 11:40:32 -08:00
Michael Hobbs
e4a23048ec Merge pull request #1784 from duboff/patch-1
Tiny fix in SSL documentation
2015-12-16 17:29:00 -08:00
Mikhail Dubov
a06166c08b Tiny fix in SSL documentation 2015-12-17 00:33:19 +00:00
Michael Hobbs
b3e9893e9d Merge pull request #1778 from mmerickel/optimize-build-clone
optimize git clone for building using depth=1
2015-12-16 15:47:48 -08:00
Michael Merickel
d31ac73066 avoid copying the entire git repo to a tmp folder when building the app
It's not possible to checkout a specific commit into a new repository
using ``git fetch`` and so a temporary tag is added to the host
repository, then fetched.
2015-12-16 16:08:56 -06:00
Michael Hobbs
6366aad1e7 Merge pull request #1781 from jvanbaarsen/add-post-config-update-hook
Add post config update hook
2015-12-16 14:00:01 -08:00
Michael Hobbs
208d3c13d9 Merge pull request #1780 from jvanbaarsen/add-domain-plugin-documentation
Add documentation for the new domain plugin hooks
2015-12-16 13:59:53 -08:00
Michael Hobbs
e408351ec6 Merge pull request #1777 from dokku/mh-test-labels
format test labels
2015-12-16 12:09:31 -08:00
Jeroen van Baarsen
66e255a396 Add documentation for the new domain plugin hooks
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-16 20:22:34 +01:00
Jeroen van Baarsen
441272d54b Add post config update hook
This adds a hook that will send in the $APP, action name and config vars.

By adding this, we allow plugin creators to handle this kind of events as well.

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-16 20:21:56 +01:00
Michael Hobbs
3d21132e98 format test labels 2015-12-16 10:50:10 -08:00
Michael Hobbs
51cd991174 Merge pull request #1782 from dokku/mh-make-docker-cp-work-on-ci
make docker cp work on circleci
2015-12-16 10:49:34 -08:00
Michael Hobbs
104b76129d install patched docker version on ci to make docker cp work 2015-12-16 09:00:23 -08:00
Jose Diaz-Gonzalez
4608a382b1 Merge pull request #1779 from sseemayer/master
Add link to new zero-downtime Let's Encrypt Plugin to docs
2015-12-16 03:51:33 -05:00
Stefan Seemayer
1286529c6e Add sseemayer/dokku-letsencrypt plugin to docs 2015-12-16 09:26:22 +01:00
Jose Diaz-Gonzalez
a00d4ef792 Merge pull request #1771 from jvanbaarsen/more-hook-info
Make plugin hooks send out more information
2015-12-15 14:27:36 -05:00
Jose Diaz-Gonzalez
d097a34735 Merge pull request #1776 from t-8ch/jessie-backports
fix version constraints
2015-12-15 14:27:21 -05:00
Thomas Weißschuh
dda3c721e0 fix version constraints
The version of docker.io in jessie-backports is 1.6.2~dfsg1-1~bpo8+1.
This is regarded as lower than 1.6.2 by dpkg because `~` has a special meaning
in regards to version sort in dpkg.

This leads to:
```
The following packages have unmet dependencies:
 dokku : Depends: docker-engine-cs but it is not installable or
                  docker-engine but it is not installable or
                  lxc-docker (>= 1.6.2) but it is not installable or
                  docker.io (>= 1.6.2) but 1.6.2~dfsg1-1~bpo8+1 is to be installed
         Recommends: herokuish but it is not going to be installed
```

By changing the contraints the version in backports will be accepted by dpkg.
2015-12-15 16:45:43 +00:00
Jose Diaz-Gonzalez
715e51b80c Release 0.4.6 2015-12-14 16:52:42 -05:00
Jose Diaz-Gonzalez
260b294ee9 Merge pull request #1775 from dokku/lg-fix-regex-in-named-containers
Match complete container name in named-containers plugin
2015-12-13 20:39:18 -05:00
Loïc Guitaut
16242e78ba Match complete container name in named-containers plugin
Fixes #1746
2015-12-13 23:28:00 +01:00
Jeroen van Baarsen
90ea6a5ba4 Make plugin hooks send out more information
Add this point you only get information that "something" happend on the given
hook. By adding more information to the hook, plugin creators can do more
interesting stuff.

* The first params remains the $APP name (to maintain backwards compatability)
* The second params sends in the action that happend, for domain this can be:
  "add", "clear" or "remove"
* The third param sends in the argument that was passed to the original
  function, for domain that would be a list of all the domains that was given.

One reason this addition would be great for plugin owners, is that when you have
a web tool over Dokku, and someone creates a domain over the CLI, we a plugin
can send back information about the event to the webapp over an API. That way
the webapp is always up-to-date with the Dokku installation.

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-12 17:02:28 +01:00
Jose Diaz-Gonzalez
74ebcb472f Merge pull request #1767 from jvanbaarsen/remove-shebang
Remove shebang from config/functions
2015-12-10 15:59:30 -05:00
Jeroen van Baarsen
2d147cfd12 Remove shebang from config/functions
In order to be one step closer to lintian compliance, lets remove the shebang
from this file so it doesn;t have to be executable

See #1641

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-12-10 21:55:43 +01:00
Jose Diaz-Gonzalez
7fa6b1901a Merge pull request #1761 from dokku/josegonzalez-patch-1
Fix link to docker-options documentation
2015-12-09 15:35:06 -05:00
Jose Diaz-Gonzalez
1c33159dcd Fix link to docker-options documentation
[ci skip]
2015-12-09 15:34:57 -05:00
Jose Diaz-Gonzalez
4e6f03a2c1 Merge pull request #1757 from dokku/josegonzalez-patch-1
Add DigitalOcean as a sponsor
2015-12-07 12:54:13 -05:00
Jose Diaz-Gonzalez
89a2dbfb3e Add DigitalOcean as a sponsor
They provide hosting for test infrastructure.

[ci skip]
2015-12-07 12:54:03 -05:00
Jose Diaz-Gonzalez
9001c1079b Merge pull request #1756 from dokku/josegonzalez-patch-1
Guard against invalid key file during installation
2015-12-07 11:52:20 -05:00
Jose Diaz-Gonzalez
ab2721bc37 Guard against invalid key file during installation
[ci skip]
2015-12-07 11:52:14 -05:00
Jose Diaz-Gonzalez
b4e56c43fc Merge pull request #1754 from dokku/josegonzalez-patch-1
Update all links to dokku repo
2015-12-06 04:56:27 -05:00
Jose Diaz-Gonzalez
80dc4cc3b6 Update all links to dokku repo
[ci skip]
2015-12-06 04:55:11 -05:00
Jose Diaz-Gonzalez
f66d764197 Merge pull request #1753 from hhff/patch-1
Add .ca-bundle information to SSL docs
2015-12-04 16:44:33 -05:00
Hugh Francis
37db940d1f Add .ca-bundle information to SSL docs 2015-12-04 16:40:36 -05:00
Jose Diaz-Gonzalez
fb5bc6c3e3 Merge pull request #1752 from byrnedo/master
Moved dokku-nats into official plugins section
2015-12-04 14:43:24 -05:00
Donal Byrne
244fd15d48 Moved dokku-nats into official plugins section 2015-12-04 20:40:45 +01:00
Jose Diaz-Gonzalez
6d58c8af40 Merge pull request #1748 from byrnedo/master
Added unofficial Nats plugin to plugins.md
2015-12-04 12:45:24 -05:00
Jose Diaz-Gonzalez
bed6254450 Merge pull request #1751 from progrium/josegonzalez-patch-1
Use flat-square style on image badges
2015-12-04 12:41:56 -05:00
Jose Diaz-Gonzalez
711a0c12d4 Use flat-square style on image badges
[ci skip]
2015-12-04 12:41:51 -05:00
Jose Diaz-Gonzalez
be1a9d3d9a Use master branch for badge
[ci skip]
2015-12-04 12:40:30 -05:00
Jose Diaz-Gonzalez
9ba2d15f86 Merge pull request #1750 from jlachowski/master
New graphite & statsd plugin with grafana frontend added
2015-12-04 12:39:24 -05:00
jlachowski
c1dfb46bf0 New graphite & statsd plugin with grafana frontend added 2015-12-04 14:23:28 +01:00
Donal Byrne
3fd4f519bf Added unofficial Nats plugin to plugins.md 2015-12-04 14:09:06 +01:00
Jose Diaz-Gonzalez
c2153aa840 Merge pull request #1747 from progrium/josegonzalez-patch-1
Add Lets Encrypt plugin
2015-12-03 15:23:32 -05:00
Jose Diaz-Gonzalez
f8f9aa7b1b Add Lets Encrypt plugin
[ci skip]
2015-12-03 15:23:26 -05:00
Jose Diaz-Gonzalez
012d8eabe7 Merge pull request #1745 from beverku/master
Change herokuish to recommended package
2015-12-03 14:29:24 -05:00
Jose Diaz-Gonzalez
9d3c856afd Merge pull request #1727 from louisbl/enable-redeploy-service
Enable dokku-redeploy systemd service.
2015-12-02 14:07:49 -05:00
Ryan Bever
65cda8b04e Change herokuish to recommended package
Changing the herokuish package to Recommends instead of Depends allows users to skip the installation of that package by specifying --no-install-recommends.  Herokuish will still be installed by default using apt-get
2015-12-02 11:47:33 -07:00
Michael Hobbs
da70a18601 Merge pull request #1739 from progrium/mh-clarify-nginx-template-location
clarify location of nginx.conf.template in app repo
2015-12-02 09:08:14 -08:00
Michael Hobbs
783cf417a0 [ci skip] clarify location of nginx.conf.template in app repo 2015-12-02 09:07:43 -08:00
Jose Diaz-Gonzalez
63867d4abe Merge pull request #1735 from progrium/mh-replace-restartall-with-restore
use ps:restore on instance boot
2015-12-01 15:36:21 -05:00
Michael Hobbs
606036a50f [ci skip] use ps:restore on instance boot 2015-12-01 11:54:36 -08:00
Michael Hobbs
0606d1a805 Merge pull request #1732 from progrium/1729_mh-fix-certs-gen
do not chown file that doesn't exist
2015-12-01 09:29:16 -08:00
Michael Hobbs
a86119ddb6 do not chown file that doesn't exist. closes #1729 2015-12-01 09:01:59 -08:00
Zach Feldman
f0b260d7dc Adds dokku apps:rename function, closes #1440.
Adds unit test for new apps:rename function.

Add example in the docs for new apps:rename function.

Add apps:rename command to help command.

Delete cache directory before copying old app directory to new app directory.

deploy_app instead of create_app for apps:rename testing.

Change app url to match new name. Fix unit tests.

Add some more tests, plugn triggers.
2015-11-30 16:27:10 -05:00
louisbl
2f95fa0a95 Fix #1726. Enable dokku-redeploy systemd service. 2015-11-29 22:26:40 +01:00
Jose Diaz-Gonzalez
cfe7604696 Merge pull request #1718 from progrium/post-create-hook
Add post-create hook
2015-11-26 20:03:09 -05:00
Jose Diaz-Gonzalez
8e9d04ae36 Add post-create hook
Note that this is invoked *before* the application is deployed, so it's usage is quite different than a potential post-successful-create hook.
2015-11-26 15:47:59 -05:00
Jose Diaz-Gonzalez
e0143ed226 Merge pull request #1717 from progrium/josegonzalez-nginx
Avoid using the PPA for ubuntu versions 15.10 and higher
2015-11-26 15:35:24 -05:00
Jose Diaz-Gonzalez
4894a03bfe Merge pull request #1723 from progrium/josegonzalez-patch-1
Add herokuish version to desired debugging info
2015-11-26 15:15:40 -05:00
Jose Diaz-Gonzalez
21799dcf40 Add herokuish version to desired debugging info
[ci skip]
2015-11-26 15:15:31 -05:00
Jose Diaz-Gonzalez
d520be9e81 Merge pull request #1720 from progrium/josegonzalez-patch-1
Add memory usage output as desired data for reporting issues
2015-11-26 15:14:21 -05:00
Jose Diaz-Gonzalez
757e6b8f68 Add memory usage output as desired data for reporting issues 2015-11-26 01:04:26 -05:00
Jose Diaz-Gonzalez
f11459faad Avoid using the PPA for ubuntu versions 15.10 and higher
As of 15.10, we are graced with a relatively recent version of nginx, and thus no longer need access to the ppa. Assuming this is the only such issue, this should also allow us to support Ubuntu 16.04 without any future changes.
2015-11-25 18:59:59 -05:00
Jose Diaz-Gonzalez
9c73cfa452 Release 0.4.5 2015-11-25 17:47:21 -05:00
Michael Hobbs
6495537d44 Merge pull request #1712 from progrium/1609_filter-link-with-dockerfile
filter incompatible docker option when building dockerfile vs herokuish apps
2015-11-25 11:14:31 -08:00
Michael Hobbs
2c34a60a8d filter incompatible docker option when building dockerfile vs herokuish apps. closes #1609 2015-11-25 09:09:11 -08:00
Michael Hobbs
f188e6ff3d Merge pull request #1715 from progrium/mh-use-official-static-fork
use patched static buildpack in test
2015-11-25 09:08:39 -08:00
Michael Hobbs
aae62398b0 use patched static buildpack in test 2015-11-25 09:06:53 -08:00
Jose Diaz-Gonzalez
d540b6e3fe Merge pull request #1714 from mbriskar/patch-2
added link
2015-11-24 15:42:38 -05:00
Matej Briskar
f6f1d2adfc added link 2015-11-24 21:38:14 +01:00
Jose Diaz-Gonzalez
dc4f7f6f88 Merge pull request #1713 from mbriskar/patch-1
Wkhtmltopdf plugin
2015-11-24 15:33:48 -05:00
Matej Briskar
b1632958f5 New plugin created
I have created a plugin for installing a specific library that is not working properly when installed using dokku-apt.
It took me a lot of time to figure out how to properly install it and therefore I wanted to share it.
2015-11-24 21:32:41 +01:00
Jose Diaz-Gonzalez
0e205b8133 Merge pull request #1708 from progrium/1705_mh-secure-tls
ensure permissions are locked down on tls folder and contents
2015-11-19 14:12:41 -05:00
Michael Hobbs
6a51ec0f64 Merge pull request #1709 from progrium/1614_mh-wildcard-domains
fix Must specify DOMAIN error over ssh (supercedes #1691)
2015-11-19 14:10:20 -05:00
Michael Hobbs
aa1ffd1aab Merge pull request #1707 from Flink/fix-named-container-filter-match
Do a perfect match on the container name
2015-11-19 12:09:33 -05:00
Michael Hobbs
11d396e6ef Merge pull request #1706 from progrium/1704_mh-rm-container
app/global override for DOKKU_RM_CONTAINER
2015-11-19 12:09:20 -05:00
Michael Hobbs
a2ccbcbbfb Merge pull request #1701 from progrium/mh-dont-call-nginx-build-twice
don't call nginx_build_config twice
2015-11-19 12:09:02 -05:00
Michael Hobbs
4b2a777425 add test for wildcard domain. don't match domain substring. closes #1614 2015-11-19 12:03:31 -05:00
Michael Hobbs
091c1acf15 ensure permissions are locked down on tls folder and contents. fixes #1705 2015-11-19 11:03:21 -05:00
Michael Hobbs
2ed0424860 app/global override for DOKKU_RM_CONTAINER. closes #1704 2015-11-19 10:40:14 -05:00
Loïc Guitaut
ad4a945941 Do a perfect match on the container name
This way we avoid to match every container that begins with the same
name.
2015-11-19 16:40:00 +01:00
Michael Hobbs
498d52ecdf don't call nginx_build_config twice and make ip regex functions globally accessible 2015-11-19 09:10:04 -05:00
Michael Hobbs
da91841ac6 Merge pull request #1698 from pmvieira/pv/vagrant-with-curl
if the repo we are pushing has a CHECKS file...
2015-11-19 07:43:27 -05:00
pmvieira
1eb1e1cd94 Adding back curl 2015-11-19 08:51:31 +00:00
Jose Diaz-Gonzalez
8bca701bc8 Merge pull request #1703 from progrium/josegonzalez-patch-1
Fix casing on help output
2015-11-19 03:15:02 -05:00
Jose Diaz-Gonzalez
6cd1b768ff Fix casing on help output
[ci skip]
2015-11-19 03:14:48 -05:00
Jose Diaz-Gonzalez
e23328b16c Merge pull request #1702 from progrium/josegonzalez-patch-1
Remove extra whitespace in command output
2015-11-19 03:13:32 -05:00
Jose Diaz-Gonzalez
939feb62eb Remove extra whitespace in command output
[ci skip]
2015-11-19 03:13:25 -05:00
Michael Hobbs
3e466917fd Merge pull request #1700 from progrium/1697_mh-copy-nginx-ssl-template-from-container
copy nginx.ssl.template from app container
2015-11-18 19:26:49 -05:00
Jose Diaz-Gonzalez
650dcd2538 Merge pull request #1671 from progrium/user-auth
User Auth plugin trigger
2015-11-18 19:23:47 -05:00
Michael Hobbs
518d7f9e56 make custom template tests actually test 2015-11-18 18:04:50 -05:00
Michael Hobbs
d2f288d3a9 Merge pull request #1699 from progrium/1685_mh-print-dokku-scale-location
print where we find DOKKU_SCALE when we find it
2015-11-18 17:45:37 -05:00
Michael Hobbs
09aa97f9e5 copy nginx.ssl.template from app container. fixes #1697 2015-11-18 17:36:02 -05:00
Michael Hobbs
e57d9dac3b print where we find DOKKU_SCALE when we find it. closes #1685 2015-11-18 16:10:29 -05:00
Jose Diaz-Gonzalez
5f7543bf46 Merge pull request #1696 from progrium/1554_mh-chown-plugins
chown plugins paths to dokku:dokku
2015-11-16 14:24:54 -05:00
Michael Hobbs
6eee13b67f chown plugins paths to dokku:dokku. closes #1554 2015-11-16 13:32:34 -05:00
Jose Diaz-Gonzalez
aae2213168 Merge pull request #1694 from MarcDiethelm/docs-improve-docker-options
Improve docker-options doc
2015-11-16 03:40:42 -05:00
Marc Diethelm
daa3b88d91 Add backticks around build, deploy and run 2015-11-15 23:12:42 +01:00
Marc Diethelm
9cfa1b9065 Docs, wording: else --> otherwise 2015-11-15 22:52:34 +01:00
Marc Diethelm
200d1128a1 Update docker-options plugin help for consistency with help docs 2015-11-15 22:50:24 +01:00
Marc Diethelm
06b8d166ca Small improvements to doc 2015-11-15 12:22:40 +01:00
Marc Diethelm
76e9ea6cc3 Improve docker-options.md
- Add note to avoid problems with shared volumes permissions
- Restructure the doc to help comprehension
- Make command examples consistent
- Improve wording in some places
- Advanced usage: remove "avoid if possible". It made little sense.
- docker (project) --> Docker
- dokku (project) --> Dokku
- dokku (command) --> `dokku`
- add `shell` to code blocks
2015-11-15 12:18:35 +01:00
Jose Diaz-Gonzalez
6ff55ff16c Merge pull request #1690 from u2mejc/u2mejc-issue1571
Fix "App tls has not been deployed" error
2015-11-13 21:57:03 -05:00
Justin Clark
59912d43f1 fix Must specify DOMAIN error over ssh 2015-11-13 18:02:07 -08:00
Justin Clark
ef7d49bafc Fix App tls has not been deployed error 2015-11-13 16:40:22 -08:00
Jose Diaz-Gonzalez
6af8811912 Merge pull request #1684 from u2mejc/u2mejc-certsremove
Cause certs:remove to return non zero on error
2015-11-12 14:12:18 -05:00
Jose Diaz-Gonzalez
d694a73aed Merge pull request #1683 from u2mejc/u2mejc-certs.bat
Add bats test for certs plugin
2015-11-11 22:17:37 -05:00
Justin Clark
8a1f7fb900 Cause certs:remove to return non zero on error
This was caught when writing the certs.bats. This patch will return
non zero on error instead of zero which can casue false negatives
in testing.
2015-11-11 18:18:06 -08:00
Justin Clark
3c1b85f272 Add bats test for certs plugin 2015-11-11 17:23:05 -08:00
Michael Hobbs
cff8e27545 Merge pull request #1682 from progrium/1678_mh-nullglob-fix
set nullglob when looking for PORT files
2015-11-11 15:51:02 -08:00
Michael Hobbs
75b8953799 set nullglob when looking for PORT files. closes #1678 2015-11-11 12:01:56 -08:00
Jose Diaz-Gonzalez
9b283fd6ec Merge pull request #1681 from progrium/josegonzalez-patch-1
Fix email in code of conduct
2015-11-11 12:14:30 -05:00
Jose Diaz-Gonzalez
8f5eacf516 Fix email in code of conduct
Closes #1676

[ci skip]
2015-11-11 12:14:24 -05:00
Jose Diaz-Gonzalez
ffbb2f3c42 Merge pull request #1667 from u2mejc/u2mejc-certs
Fix dokku certs:add file input bug
2015-11-10 20:16:54 -05:00
Jose Diaz-Gonzalez
acbd1b8655 Merge pull request #1666 from progrium/1572_mh-nginx-logrotate
revert dokku group changes and add dokku user to adm group
2015-11-10 15:09:23 -05:00
Jose Diaz-Gonzalez
b6240fcb9a Merge pull request #1642 from cjblomqvist/patch-3
Add new plugin adding app name to env
2015-11-10 15:08:18 -05:00
Jose Diaz-Gonzalez
23f4bb7983 Merge pull request #1677 from ignlg/patch-1
Added dokku-builders-plugin to plugins page
2015-11-10 15:07:35 -05:00
Jose Diaz-Gonzalez
cd633d4427 Merge pull request #1665 from callahad/funroll-curls
Replace curl with wget; see #1567
2015-11-10 14:00:44 -05:00
Michael Hobbs
0853850f7a revert dokku group changes and add dokku user to adm group. closes #1572 2015-11-10 09:21:09 -08:00
Ignacio Lago
db02e2a11a Added dokku-builders-plugin to plugins page 2015-11-10 17:38:01 +01:00
Dan Callahan
a49adef9b0 Use wget instead of curl when bootstrapping 2015-11-09 22:52:58 -06:00
Jose Diaz-Gonzalez
bb9fd8b320 Merge pull request #1675 from progrium/josegonzalez-patch-1
Create CODE_OF_CONDUCT.md
2015-11-09 21:00:35 -05:00
Jose Diaz-Gonzalez
4ddbb84367 Create CODE_OF_CONDUCT.md
Closes #1669

[ci skip]
2015-11-09 21:00:27 -05:00
Jose Diaz-Gonzalez
f3f9a11813 Merge pull request #1674 from progrium/buildpack-docs
Expand buildpack deployment documentation
2015-11-09 14:59:35 -05:00
Jose Diaz-Gonzalez
2a7e2393ad Expand buildpack deployment documentation
This should consolidate a lot of knowledge around how dokku deals with buildpacks, as well as clears up a few misconceptions - mainly that dokku doesn't support multiple/custom buildpacks.

By bringing this information front-and-center, we can avoid a lot of questions by users trying to use dokku.

[ci skip]
2015-11-09 14:56:45 -05:00
Jose Diaz-Gonzalez
fc125d41e8 Add user-auth plugin trigger
This plugin trigger should allow users to pair down the available commands for a given user. While this does not affect help output - or any output at all - this is a good first step in allowing administrative access to certain commands while still allowing users to deploy/manage given applications.

Note that because of how dokku works, all parsing of commands must be done within the pluginhook, and we cannot give visibility into the actual command or application that will be affected by a given run.
2015-11-08 15:36:04 -05:00
Jose Diaz-Gonzalez
0eab678fcc add documentation to example ci skip
[ci skip]
2015-11-08 15:33:57 -05:00
Jose Diaz-Gonzalez
7307b385d8 Ensure we exit with the proper status code 2015-11-08 15:33:15 -05:00
Jose Diaz-Gonzalez
3585ee8612 Release 0.4.4 2015-11-07 21:55:05 -05:00
Justin Clark
b7fbd9aea0 Fix dokku certs:add file input bug
- fixes issue #1658
- add better output for argument files missing
- don't delete (move) the certs passed in
2015-11-06 16:47:19 -08:00
Jose Diaz-Gonzalez
5dbb31cf8a Merge pull request #1612 from Flink/logs-options
Add multiple options to the logs plugin
2015-11-06 00:32:32 -05:00
Jose Diaz-Gonzalez
26d50b0140 Merge pull request #1660 from callahad/deb
Fixup debian/control for Debian
2015-11-06 00:18:51 -05:00
Jose Diaz-Gonzalez
c2fc3141a9 Merge pull request #1643 from Flink/fix-no-vhost
Fix generated nginx config when NO_VHOST=1
2015-11-06 00:06:08 -05:00
Dan Callahan
23c25d01ff Fixup debian/control for Debian
* Bump `Version` field.
* Set minimum nginx version to 1.4.6, per #1654
* Depend on both `rubygem-foo` (Ubuntu) and `ruby-foo` (Debian).
* Add distro-default `docker.io (>= 1.6.2)` as an alternative.

  Version 1.6.2 is in both `trusty-updates` and `jessie-backports`,
  while `trusty` itself has `0.9.1`. We seriously want to avoid that.

This also updates the docs so people don't forget to bump the version
field in the future. Even though we really do that for them with sed.
2015-11-05 22:34:28 -06:00
Jose Diaz-Gonzalez
de832c596a Merge pull request #1644 from mmerickel/watch-events-logrotate
watch dokku events through a logrotate
2015-11-05 22:01:19 -05:00
Jose Diaz-Gonzalez
237dfe2bbd Merge pull request #1634 from callahad/bats
bats is available in homebrew
2015-11-05 21:59:58 -05:00
Jose Diaz-Gonzalez
49a07e5210 Merge pull request #1664 from progrium/mh-add-rev-to-pre-receive-app
add $REV to pre-receive-app call
2015-11-05 21:59:25 -05:00
Jose Diaz-Gonzalez
a1983e0131 Merge pull request #1653 from callahad/SC2145
Resolve SC2145: 'Argument mixes string and array.'
2015-11-05 21:57:02 -05:00
Michael Hobbs
95a7a93cb9 [ci skip] update docs 2015-11-05 18:46:18 -08:00
Michael Hobbs
455033703a add $REV to pre-receive-app call 2015-11-05 17:18:44 -08:00
Jose Diaz-Gonzalez
0470d493ae Merge pull request #1662 from xadh00m/master
Only return users of group 'adm'
2015-11-05 11:15:48 -05:00
Mirko Geissler
c2858e5fb3 Merge pull request #1 from xadh00m/adm_group_fix
Only return users of group 'adm'
2015-11-05 11:52:42 +01:00
Mirko Geissler
f85775b870 Only return users of group 'adm'
This fixes the issue where all groups starting with 'adm' are returned which broke the installation.
2015-11-05 11:51:29 +01:00
Jose Diaz-Gonzalez
d50f3cd151 Merge pull request #1655 from callahad/SC2162
Resolve SC2162: 'read without -r mangles backslashes'
2015-11-05 00:36:48 -05:00
Jose Diaz-Gonzalez
9b887b6262 Merge pull request #1656 from callahad/SC2001
Resolve SC2001: 'See if you can use ${var//search/replace} instead'
2015-11-05 00:36:14 -05:00
Jose Diaz-Gonzalez
f3cc2310da Merge pull request #1657 from callahad/doc-updates
Various small doc updates
2015-11-05 00:35:35 -05:00
Kim Ausloos
ce26004fc8 Various small doc updates
Replaces #1622, addresses comments by @josegonzalez

[ci skip]
2015-11-04 21:26:54 -06:00
Dan Callahan
ff07842dc5 Resolve SC2001: 'See if you can use ${var//search/replace} instead'
https://github.com/koalaman/shellcheck/wiki/SC2001
2015-11-04 20:43:41 -06:00
Dan Callahan
c389b213b5 Resolve SC2162: 'read without -r mangles backslashes'
More information:

https://github.com/koalaman/shellcheck/wiki/SC2162

http://wiki.bash-hackers.org/commands/builtin/read
2015-11-04 20:40:42 -06:00
Jose Diaz-Gonzalez
e1e7fbcc52 Merge pull request #1652 from callahad/SC2143
Resolve SC2143: 'Instead of [ -n $(foo | grep bar) ], use foo | grep -q bar'
2015-11-04 17:20:45 -05:00
Dan Callahan
84c0988fd8 Resolve SC2145: 'Argument mixes string and array.'
https://github.com/koalaman/shellcheck/wiki/SC2145
2015-11-04 11:30:49 -06:00
Dan Callahan
9229e1a9a7 Resolve SC2143: 'Instead of [ -n $(foo | grep bar) ], use foo | grep -q bar'
...we actually don't violate this

https://github.com/koalaman/shellcheck/wiki/SC2143
2015-11-04 11:00:59 -06:00
Jose Diaz-Gonzalez
5f83476811 Merge pull request #1647 from callahad/SC2115
Resolve SC2115: 'Use "${var:?}" to ensure this never expands to /'
2015-11-04 11:54:53 -05:00
Jose Diaz-Gonzalez
0bd06e70d5 Merge pull request #1651 from callahad/SC2029
Resolve SC2029: 'this expands on client side'
2015-11-04 11:54:38 -05:00
Jose Diaz-Gonzalez
c78bf267a3 Merge pull request #1648 from callahad/SC2154
Resolve SC2154: 'variable is referenced but not assigned'
2015-11-04 11:54:16 -05:00
Jose Diaz-Gonzalez
c8c83703ed Merge pull request #1649 from callahad/SC2164
Resolve SC2164: 'Use cd ... || exit in case cd fails.'
2015-11-04 11:54:04 -05:00
Jose Diaz-Gonzalez
baac2ceda2 Merge pull request #1650 from callahad/SC2148
Resolve SC2148: 'target shell is unknown'
2015-11-04 11:53:48 -05:00
Dan Callahan
d465ceb045 Resolve SC2154: 'variable is referenced but not assigned'
In this case, Bats sets $status, $output, and $lines, but ShellCheck
doesn't statically know that. Therefore, we ignore SC2154 when those
variables are first introduced in ./tests/unit/test_helper.bash

https://github.com/koalaman/shellcheck/wiki/SC2154
2015-11-03 22:00:22 -06:00
Dan Callahan
8ed0193b1d Resolve SC2115: 'Use "${var:?}" to ensure this never expands to /'
https://github.com/koalaman/shellcheck/wiki/SC2115
2015-11-03 22:00:05 -06:00
Dan Callahan
1de54d52ac Resolve SC2164: 'Use cd ... || exit in case cd fails.'
https://github.com/koalaman/shellcheck/wiki/SC2164
2015-11-03 21:55:09 -06:00
Dan Callahan
e1b5b1aafc Resolve SC2148: 'target shell is unknown'
https://github.com/koalaman/shellcheck/wiki/SC2148
2015-11-03 21:46:23 -06:00
Dan Callahan
344d48e01b Resolve SC2029: 'this expands on client side'
https://github.com/koalaman/shellcheck/wiki/SC2029

This patch addes inline directives where this is the desired behavior,
instead of globaly excluding the check.
2015-11-03 21:40:31 -06:00
Jose Diaz-Gonzalez
279c49f084 Merge pull request #1645 from rvalyi/master
a git repo can be accessed via ssh
2015-11-03 19:56:48 -05:00
Raphaël Valyi
2b64fe4666 a git repo can be accessed via ssh 2015-11-03 01:11:12 -02:00
Michael Merickel
2d109a20c5 watch dokku events through a logrotate 2015-11-02 14:20:55 -06:00
Loïc Guitaut
804c822ace Fix generated nginx config when NO_VHOST=1
Fixes #1625
2015-11-02 19:08:41 +01:00
Loïc Guitaut
7f5c2caed6 Add multiple options to the logs plugin
New version of the logs plugin broke compatibility (as reported in #1534).
So options have been added to handle display:
* -t/--tail to tail logs (already existed)
* -n/--num NUM to display only this number of lines
* -p/--ps PS to display logs only from provided process
* -q/--quiet to display raw logs without color, time and names

This should close #1534
2015-11-02 15:31:17 +01:00
cjblomqvist
85db7c7552 Add new plugin adding app name to env
Which is quite useful in some situations, for example when you want each app to point to a DB with the same name as the app (reducing the amount of app-specific config).

I've not yet tested with 0.4.x but asap we upgrade our environment I'll ensure it's compatible (should be super simple since it's a super simple plugin).
2015-11-02 15:07:15 +01:00
Jose Diaz-Gonzalez
de29abdab6 Merge pull request #1635 from callahad/linode
Remove deprecated Linode stackscript
2015-10-31 18:09:48 -04:00
Dan Callahan
c250d170cd Remove deprecated Linode stackscript
This is nolonger relevant since we rewrote the Linode docs in commit
81523b3bd0

[ci skip]
2015-10-31 16:13:43 -05:00
Dan Callahan
c48fe4e2a9 bats is available in homebrew 2015-10-31 16:12:36 -05:00
Jose Diaz-Gonzalez
81c5173f5e Merge pull request #1633 from elia/patch-3
Add a warning regarding the use of `trace on`
2015-10-31 15:22:18 -04:00
Elia Schito
ac04199963 Add a warning regarding the use of trace on 2015-10-31 14:56:19 +01:00
Jose Diaz-Gonzalez
a2985e082b Merge pull request #1628 from progrium/mh-restore-var-namespace
move RESTORE variable to DOKKU_APP namespace
2015-10-29 12:40:35 -04:00
Jose Diaz-Gonzalez
8c24483fb7 Merge pull request #1630 from adamwolf/patch-1
Enabling tracing is actually 'dokku trace on'
2015-10-29 12:30:40 -04:00
Adam Wolf
cd3ce7de22 Enabling tracing is actually 'dokku trace on' 2015-10-29 11:28:36 -05:00
Michael Hobbs
e28c75e56a move RESTORE variable to DOKKU_APP namespace 2015-10-29 07:55:09 -07:00
Jose Diaz-Gonzalez
f13796fa57 Merge pull request #1613 from kdomanski/restore
add ps:restore to start applications which weren't manually stopped
2015-10-28 14:15:57 -04:00
Jose Diaz-Gonzalez
49d8cc4902 Merge pull request #1624 from u2mejc/master
Add trace to help output
2015-10-28 12:45:16 -04:00
Jose Diaz-Gonzalez
b22b04af8e Merge pull request #1626 from progrium/josegonzalez-patch-1
Add official dokku-copy-files-to-image plugin
2015-10-27 23:31:11 -04:00
Jose Diaz-Gonzalez
39bf2a2100 Add official dokku-copy-files-to-image plugin
[ci skip]
2015-10-27 23:31:03 -04:00
Jose Diaz-Gonzalez
b50df757db Merge pull request #1623 from sedouard/doc_azure
Doc - Add Azure Documentation
2015-10-27 20:40:50 -04:00
Steven Edouard
aaeae0d9cc Doc - Add Azure Documentation
[ci skip]
2015-10-27 17:24:56 -07:00
Justin Clark
4f6843104c Add trace to help output 2015-10-27 17:15:38 -07:00
Jose Diaz-Gonzalez
bdd0f50dd9 Merge pull request #1621 from elia/patch-2
Support for --force is present in official plugins
2015-10-27 08:10:46 -04:00
Elia Schito
77b3725d5b Support for --force is present in official plugins 2015-10-27 11:21:54 +01:00
Kamil Domański
6c19414b7a add ps:restore to start applications which weren't manually stopped 2015-10-26 20:06:53 +01:00
Jose Diaz-Gonzalez
b3f44e3f96 Merge pull request #1610 from kdomanski/post-stop
Add post-stop plugn trigger
2015-10-26 13:54:21 -04:00
Kamil Domański
f705004975 Add post-stop plugn trigger 2015-10-26 17:57:18 +01:00
Jose Diaz-Gonzalez
39ba53607a Merge pull request #1607 from progrium/debian-installation
Dokku support for Debian Jessie installation
2015-10-25 23:49:26 -04:00
Jose Diaz-Gonzalez
d17cb43bd3 Add missing sudo call to nginx reload 2015-10-25 22:56:48 -04:00
Jose Diaz-Gonzalez
c8bcd67498 Fix warnings in building plugn binary 2015-10-25 22:41:10 -04:00
Jose Diaz-Gonzalez
dcf34eb4d4 Create a systemd service for dokku-installer 2015-10-25 20:19:35 -04:00
Jose Diaz-Gonzalez
5a35c9a76c Run apt-get clean before calling apt-get update
This ensures that we can call apt-get update after adding a new apt source. Debian needs a bit more time to refresh it's own caches, so we just force it's cache to be clean before calling apt-get update again.
2015-10-25 20:13:10 -04:00
Jose Diaz-Gonzalez
b23e5d1cbb Add support for vmware_fusion 2015-10-25 20:09:37 -04:00
Jose Diaz-Gonzalez
a11b46058e Add ruby1.9.1 as a dependency
Debian systems do not have the proper ruby installed, so installing fpm fails.
2015-10-25 20:09:25 -04:00
Jose Diaz-Gonzalez
b3041661b3 Correctly set syslog user as owner on dokku logs for non-debian systems
On debian, rsyslog runs as root, so we don't want to force the non-existent syslog owner.

Fix syntax error
2015-10-25 00:09:26 -04:00
Jose Diaz-Gonzalez
66833f12a0 Ensure we have sudo installed when installing dokku debian packages
Refs #976
2015-10-24 23:15:03 -04:00
Jose Diaz-Gonzalez
18d6e1be3b Add special case commands for instances where we are running dokku in debian
Refs #976
2015-10-24 23:12:38 -04:00
Jose Diaz-Gonzalez
6674d7823e Automatically detect whether dokku is running on debian vs ubuntu
Refs #976
2015-10-24 23:12:14 -04:00
Jose Diaz-Gonzalez
f3959c38b0 Favor chgrp over chown to ensure proper group on logs
Refs #976
2015-10-24 22:44:10 -04:00
Jose Diaz-Gonzalez
8d0fbc0d1b Switch to ruby-dev package over ruby1.9.1-dev
This package is the version we use for as a dokku dependency, and thus there is no need to specify a *specific* version when building the deb packages.

Refs #976
2015-10-24 22:33:00 -04:00
Jose Diaz-Gonzalez
9878c0b6fa Ensure we have a directory for the dokku motd message. Refs #976 2015-10-24 22:11:27 -04:00
Jose Diaz-Gonzalez
79cc07d71b Add sudo pre-dependency for herokuish. Refs #976 2015-10-24 22:11:27 -04:00
Jose Diaz-Gonzalez
9d5d147a9c Use https url for cloning repository. Refs #976
Using git-based urls meant that the user must authenticate against github, which can fail in certain situations
2015-10-24 22:11:18 -04:00
Jose Diaz-Gonzalez
82475ab70d Merge pull request #1606 from progrium/josegonzalez-patch-1
Install plugn 0.2.0 in Makefile installs
2015-10-24 20:02:48 -04:00
Jose Diaz-Gonzalez
cc2c7be96e Install plugn 0.2.0 in Makefile installs
Closes #1479
2015-10-24 18:10:17 -04:00
Jose Diaz-Gonzalez
68e3f93b08 Merge pull request #1605 from progrium/nicer-code-styling
Make commented output a bit more readable
2015-10-24 16:32:10 -04:00
Jose Diaz-Gonzalez
9b3d722eec Make commented output a bit more readable
[ci skip]
2015-10-24 16:31:28 -04:00
115 changed files with 2019 additions and 1011 deletions

50
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,50 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at dokku@josediazgonzalez.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

View File

@@ -2,12 +2,12 @@
Dokku loves to welcome your contributions. There are several ways to help out:
* Create an [issue](https://github.com/progrium/dokku/issues) on GitHub, if you
* Create an [issue](https://github.com/dokku/dokku/issues) on GitHub, if you
have found a bug
* Write test cases for open bug issues
* Write patches for open bug/feature issues, preferably with test cases
included
* Contribute to the [documentation](http://progrium.viewdocs.io/dokku/)
* Contribute to the [documentation](http://dokku.viewdocs.io/dokku/)
There are a few guidelines that we need contributors to follow so that we have
a chance of keeping on top of things.
@@ -41,12 +41,12 @@ encounter an issue. We always appreciate a well-written, thorough bug report,
and will thank you for it!
Sometimes dokku is missing a feature you need. In some cases, those features can
be found in pre-existing [plugins](http://progrium.viewdocs.io/dokku/plugins/),
be found in pre-existing [plugins](http://dokku.viewdocs.io/dokku/plugins/),
and we encourage our users to create and contribute such packages. From time to
time, we will also pull plugins into the dokku core when the task they solve is
a common one for our users.
Check that [our issue database](https://github.com/progrium/dokku/issues)
Check that [our issue database](https://github.com/dokku/dokku/issues)
doesn't already include that problem or suggestion before submitting an issue.
If you find a match, add a quick "+1" or "I have this problem too." Doing this
helps prioritize the most common problems and requests.
@@ -55,8 +55,10 @@ When reporting issues, please include your host OS (Ubuntu 14.04, Fedora 19,
etc). Please include:
* The output of `uname -a`.
* The output of `free -m`
* The output of `docker version`.
* The output of `docker -D info`.
* The output of `docker run -ti gliderlabs/herokuish:latest herokuish version`
* The output of `dokku version`.
* The output of `dokku plugin`.
@@ -72,13 +74,16 @@ Description of problem:
Output of the following commands
- `uname -a`:
- `free -m`:
- `docker version`:
- `docker -D info`:
- `docker run -ti gliderlabs/herokuish:latest herokuish version`:
- `dokku version`:
- `dokku plugin`:
- `docker inspect CONTAINER_ID` (if applicable):
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
- Output of failing dokku commands with `dokku trace on`:
- Output of failing dokku commands with `dokku trace on`
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues):
Environment details (AWS, VirtualBox, physical, etc.):
@@ -107,7 +112,7 @@ Before you contribute to the dokku project, there are a few things that you'll
need to do
* Make sure you have a [GitHub account](https://github.com/signup/free).
* Submit an [issue](https://github.com/progrium/dokku/issues), assuming one
* Submit an [issue](https://github.com/dokku/dokku/issues), assuming one
does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you fill in the earliest version that you know has the issue.
@@ -131,7 +136,7 @@ need to do
* Check for unnecessary whitespace with `git diff --check` before committing.
* Use descriptive commit messages and reference the #issue number.
* Core test cases should continue to pass. You can run tests locally or enable
[circle-ci](https://circleci.com/gh/progrium/dokku) for your fork, so all
[circle-ci](https://circleci.com/gh/dokku/dokku) for your fork, so all
tests and codesniffs will be executed.
* Your work should apply the [Dokku coding standards](https://github.com/progrium/bashstyle)
* Pull requests must be cleanly rebased on top of master without multiple branches
@@ -181,13 +186,13 @@ To run the shellcheck sniffs for Dokku coding standards:
make ci-dependencies
make lint
The [testing docs](http://progrium.viewdocs.io/dokku/development/testing/)
The [testing docs](http://dokku.viewdocs.io/dokku/development/testing/)
contains installation info for bats and shellcheck.
# Additional Resources
* [Dokku coding standards](https://github.com/progrium/bashstyle)
* [Existing issues](https://github.com/progrium/dokku/issues)
* [Existing issues](https://github.com/dokku/dokku/issues)
* [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
* [#dokku IRC channel on freenode.org](https://webchat.freenode.net/?channels=dokku)

View File

@@ -1,5 +1,219 @@
# History
## 0.4.9
This release is significant for two reasons:
- A bugfix for git submodule support that was broken in 0.4.7
- Improved and tested support for modern variants of Ubuntu/Debian. This should also improve support for docker-based deployments of dokku, as well as potential support for the upcoming Ubuntu 16.04 release.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1810: @josegonzalez Fix debian packaging for usage inside of docker containers
- #1814: @blackxored Add support for new method of extracting container IP
- #1807: @josegonzalez Allow updating submodules at any revision
### New Features
- #1812: @josegonzalez Fully-tested debian packaging for modern Ubuntu/Debian distributions
### Documentation
- #1811: @josegonzalez Add dokku haproxy to plugins
## 0.4.8
If upgrading to 0.4.8, please note that we have tightened the application naming schema, per docker requirements. Upgrade your dokku installation to 0.4.7 first to take advantage of the `dokku apps:rename` command if you are having issues with the new requirement.
### Bug Fixes
- #1804: @josegonzalez Fix deprecated version constraint usage in debian control file
- #1798: @michaelshobbs Ensure app name begins with lowercase alphanumeric character
- #1808: @josegonzalez Fix path to dokku-installer
### New Features
- #1801: @josegonzalez Allow setting DOKKU_LIB_ROOT env var to modify the lib path on install
- #1803: @michaelshobbs update plugn download url and version
### Documentation
- #1809: @josegonzalez Remove non-zero downtime version of letsencrypt plugin
## 0.4.7
A few notable new features:
- The new `dokku apps:rename` command. It does not update linked containers, but is useful in many other cases.
- Updated git clone methodology to be more performant for large repositories.
- Moved the dokku-installer from Ruby to Python, allowing us to drop Ruby as a dependency. Python comes with the linux standard base, and should therefore be accessible on more systems.
### Bug Fixes
- #1776: @t-8ch Fix docker version constraints on jessie systems
- #1777: @michaelshobbs Format test labels
- #1782: @michaelshobbs make docker cp work on circleci
- #1788: @michaelshobbs Updates for moving of dokku sshcommand and plugn repos
- #1791: @michaelshobbs Don't run app deploy tests and spread out unit tests to 4 containers
- #1793: @michaelshobbs Filter out Procfile comments
### New Features
- #1670: @zachfeldman Add apps:rename
- #1771: @jvanbaarsen Make plugin hooks send out more information
- #1778: @mmerickel Optimize git clone for large repositories
- #1781: @jvanbaarsen Add post config update hook
- #1789: @lvillani Make it possible to skip a deploy
- #1790: @michaelshobbs Use pgup/pgdown for history shortcut in dev env
- #1794: @josegonzalez Replace dokku-installer.rb with dokku-installer.py
- #1797: @michaelshobbs Ensure we run plugin commands as root
- #1799: @josegonzalez Add support for tutum-agent as docker alternative
- #1800: @josegonzalez Respect DOKKU_ROOT in debian/postint
### Documentation
- #1779: @sseemayer Add link to new zero-downtime Let's Encrypt Plugin to docs
- #1780: @jvanbaarsen Add documentation for the new domain plugin hooks
- #1784: @duboff Tiny fix in SSL documentation
## 0.4.6
This is mostly a documentation change. A few notable changes:
- Rebooting dokku servers should properly handle not starting stopped services.
- Better support for newer versions of Debian/Ubuntu.
- Moved the dokku project to the dokku github organization.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1717: @josegonzalez Avoid using the PPA for ubuntu versions 15.10 and higher
- #1727: @louisbl Enable dokku-redeploy systemd service.
- #1732: @michaelshobbs do not chown file that doesn't exist
- #1745: @beverku Change herokuish to recommended package
- #1767: @jvanbaarsen Remove shebang from config/functions
- #1775: @Flink Match complete container name in named-containers plugin
### New Features
- #1718: @josegonzalez Add post-create hook
- #1735: @michaelshobbs use ps:restore on instance boot
### Documentation
- #1720: @josegonzalez Add memory usage output as desired data for reporting issues
- #1723: @josegonzalez Add herokuish version to desired debugging info
- #1739: @michaelshobbs clarify location of nginx.conf.template in app repo
- #1747: @josegonzalez Add Lets Encrypt plugin
- #1748: @byrnedo Added unofficial Nats plugin to plugins.md
- #1750: @jlachowski New graphite & statsd plugin with grafana frontend added
- #1751: @josegonzalez Use flat-square style on image badges
- #1752: @byrnedo Moved dokku-nats into official plugins section
- #1753: @hhff Add .ca-bundle information to SSL docs
- #1754: @josegonzalez Update all links to dokku repo
- #1757: @josegonzalez Add DigitalOcean as a sponsor
- #1761: @josegonzalez Fix link to docker-options documentation
## 0.4.5
This release is mostly a bugfix release. Two notable changes:
- It is now possible to build complex authentication layers around dokku using the new user auth plugin trigger introduced in #1671.
- We have a Code of Conduct in our repository. Please refer to this document if you have any questiosn regarding what is acceptable in the Dokku community.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1666: @michaelshobbs Revert dokku group changes and add dokku user to adm group
- #1667: @u2mejc Fix dokku certs:add file input bug
- #1682: @michaelshobbs Aet nullglob when looking for PORT files
- #1684: @u2mejc Cause certs:remove to return non zero on error
- #1690: @u2mejc Fix "App tls has not been deployed" error
- #1696: @michaelshobbs chown plugins paths to dokku:dokku
- #1698: @pmvieira Ensure curl is installed inside of source-based installations
- #1700: @michaelshobbs copy nginx.ssl.template from app container
- #1701: @michaelshobbs Don't call nginx_build_config twice
- #1702: @josegonzalez Remove extra whitespace in command output
- #1703: @josegonzalez Fix casing on help output
- #1706: @michaelshobbs Respect DOKKU_RM_CONTAINER in run phase
- #1707: @Flink Do a perfect match on the container name in named-containers plugin
- #1708: @michaelshobbs ensure permissions are locked down on tls folder and contents
- #1709: @michaelshobbs Fix Must specify DOMAIN error over ssh
- #1712: @michaelshobbs filter incompatible docker option when building dockerfile vs herokuish apps
- #1715: @michaelshobbs use patched static buildpack in test
### New Features
- #1665: @callahad Replace curl with wget
- #1671: @josegonzalez User Auth plugin trigger
- #1683: @u2mejc Add bats test for certs plugin
- #1699: @michaelshobbs print where we find DOKKU_SCALE when we find it
### Documentation
- #1642: @cjblomqvist Add new plugin adding app name to env
- #1674: @josegonzalez Expand buildpack deployment documentation
- #1675: @josegonzalez Create CODE_OF_CONDUCT.md
- #1677: @ignlg Added dokku-builders-plugin to plugins page
- #1681: @josegonzalez Fix email in code of conduct
- #1694: @MarcDiethelm Improve docker-options doc
- #1713: @mbriskar Wkhtmltopdf plugin
## 0.4.4
This release adds a few interesting changes:
- The `dokku logs` command now roughly maps to the `heroku logs` command, and supports most available options.
- Native Microsoft Azure support is now available!
- Quite a few shellcheck issues were fixed thanks to @callahad!
- Experimental debian installation support. Going forward, we will try and make dokku compatible with all systemd installations, as well as investigate dockerfile-based deployment to continue simplifying installation.
Thanks to all our contributors for making this release great!
### Bug Fixes
- #1606: @josegonzalez Install plugn 0.2.0 in Makefile installs
- #1643: @Flink Fix generated nginx config when NO_VHOST=1
- #1644: @mmerickel Watch dokku events through a logrotate
- #1647: @callahad Resolve SC2115: 'Use "${var:?}" to ensure this never expands to /'
- #1648: @callahad Resolve SC2154: 'variable is referenced but not assigned'
- #1649: @callahad Resolve SC2164: 'Use cd ... || exit in case cd fails.'
- #1650: @callahad Resolve SC2148: 'target shell is unknown'
- #1651: @callahad Resolve SC2029: 'this expands on client side'
- #1652: @callahad Resolve SC2143: 'Instead of [ -n $(foo | grep bar) ], use foo | grep -q bar'
- #1653: @callahad Resolve SC2145: 'Argument mixes string and array.'
- #1655: @callahad Resolve SC2162: 'read without -r mangles backslashes'
- #1656: @callahad Resolve SC2001: 'See if you can use ${var//search/replace} instead'
- #1660: @callahad Fixup debian/control for Debian
- #1662: @xadh00m Only return users of group 'adm'
### New Features
- #1607: @josegonzalez Dokku support for Debian Jessie installation
- #1610: @kdomanski Add post-stop plugn trigger
- #1612: @Flink Add multiple options to the logs plugin
- #1613: @kdomanski Add ps:restore to start applications which weren't manually stopped
- #1628: @michaelshobbs Move RESTORE variable to DOKKU_APP namespace
- #1634: @callahad Allow installation of bats via homebrew
- #1645: @rvalyi Add ability to access git repo via ssh
- #1664: @michaelshobbs Add $REV to pre-receive-app call
### Documentation
- #1605: @josegonzalez Make commented output a bit more readable
- #1621: @josegonzalez Document `--force` option for `:destroy` commands
- #1623: @sedouard Add Azure Documentation
- #1624: @u2mejc Add trace to help output
- #1626: @josegonzalez Add official dokku-copy-files-to-image plugin
- #1630: @adamwolf Enabling tracing is actually 'dokku trace on'
- #1633: @elia Add a warning regarding the use of `trace on`
- #1635: @callahad Remove deprecated Linode stackscript
- #1657: @kimausloos Various small doc updates
## 0.4.3
This release was mainly a documentation release/bugfix.
@@ -8,7 +222,7 @@ One major removal was is that as of 0.4.3, we no longer restart containers autom
If desired, you may replicate this functionality using the official `docker-options` plugin.
## Bug Fixes
### Bug Fixes
- #1560: @darklow Fixes issue where SSL and non-SSL templates cannot be used at the same time
- #1566: @michaelshobbs Fix logic error in enabling nginx
@@ -20,7 +234,7 @@ If desired, you may replicate this functionality using the official `docker-opti
- #1603: @josegonzalez Add missing plugin triggers
Quiet client #1568
## New Features
### New Features
- #1490: @vijayviji Add windows-specific vagrant setup
- #1563: @kdomanski Cleanup all dead containers in dokku cleanup
@@ -28,7 +242,7 @@ Quiet client #1568
- #1600: @josegonzalez Upgrade to Herokuish 0.3.4
- #1602: @josegonzalez Add pre-receive-app plugin trigger
## Documentation
### Documentation
- #1556: @josegonzalez Use proper cdn link for css asset
- #1557: @josegonzalez Code styling changes
@@ -107,9 +321,9 @@ One new feature is colorized logging output, which should make it easier to debu
This is our first minor release in almost a year. Many new features and removals have occurred, so here is a neat summary:
- Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation/) for more details.
- A few new official plugins have been added to the core, including [image tagging](http://progrium.viewdocs.io/dokku/application-deployment/), [certificate management](http://progrium.viewdocs.io/dokku/deployment/ssl-configuration/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details.
- We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](http://progrium.viewdocs.io/dokku/development/plugin-triggers/) to see what is available.
- Plugins are now triggered via `plugn`. Notably, you'll need add a `plugin.toml` to describe the plugin as well as use `plugn trigger` instead of `pluginhook` to trigger plugin callbacks. Please see the [plugin creation documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation/) for more details.
- A few new official plugins have been added to the core, including [image tagging](http://dokku.viewdocs.io/dokku/application-deployment/), [certificate management](http://dokku.viewdocs.io/dokku/deployment/ssl-configuration/), a tar-based deploy solution, and much more. Check out the *New Features* section for more details.
- We've removed a few deprecated plugin callbacks. Please see the [plugin triggers documentation](http://dokku.viewdocs.io/dokku/development/plugin-triggers/) to see what is available.
- [Official datastorage plugins](https://github.com/dokku) have been created for the most commonly used datastores. If you previously used/maintained a community contributed plugin, please check these out. We'll be adding more official plugins as time goes on.
Thanks to the *many* contributors for making this release our best release so far, and special thanks to both @michaelshobbs and @Flink for pushing along the `0.4.0` release!
@@ -212,13 +426,13 @@ This release is a bugfix release covering dokku packaging.
- #1397: @josegonzalez Use https docker apt repo
- #1394: @josegonzalez Remove `dokku plugins-install` from postinst hook
### Docs Changes
### Documentation
- #1395: @adrianmoya Adding fqdn requirement
## 0.3.23
This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](http://progrium.viewdocs.io/dokku/). Thanks to all of our contributors for making this a great release!
This release is a bugfix release mostly covering installation and nginx issues. As well, we launched a nicer documentation site [here](http://dokku.viewdocs.io/dokku/). Thanks to all of our contributors for making this a great release!
### Bug Fixes
@@ -239,7 +453,7 @@ This release is a bugfix release mostly covering installation and nginx issues.
- #1359: @michaelshobbs allow DOKKU_WAIT_TO_RETIRE to be defined per app
- #1365: @michaelshobbs support dockerfile images that don't include bash
### Docs Changes
### Documentation
- #1305: @josegonzalez Updated documentation site
- #1321: @fwolfst Mention alternative to nginx.conf templates: include-dir.
@@ -278,7 +492,7 @@ This release is a general bugfix release, with improvements to handling of nginx
- #1291: @michaelshobbs Refactored interface for managing global/local app configuration
- #1299: @SonicHedgehog Set X-Forwarded-Proto header if TLS is enabled when running checks
### Docs Changes
### Documentation
- #1273: @alessio Add docs for the events plugin
- #1276: @josegonzalez Reorder and deprecate a few plugins
@@ -319,7 +533,7 @@ This release pegs Dokku to Docker 1.6.2. Docker 1.7.0 introduced changes in `doc
- #1251: @josegonzalez Fallback to using /etc/init.d/nginx reload directly to restart nginx
- #1264: @josegonzalez Require lxc-docker-1.6.2
### Docs Changes
### Documentation
- #1252: @josegonzalez Fix ssh port for vagrant installation. Closes #1139. [ci skip]
- #1250: @josegonzalez SSL documentation is misleading
@@ -346,7 +560,7 @@ This release pegs Dokku to Docker 1.6.2. Docker 1.7.0 introduced changes in `doc
- #1227: @Flink Use --no-cache when building Dockerfile
- #1246: @josegonzalez Ensure we call apt-get before installing packages
### Docs Changes
### Documentation
- #1168: @cjblomqvist [docs] Update git-rev plugin to point to maintained version
- #1180: @sherbondy [docs] Clarify usage around official dokku `docker-options` plugin

View File

@@ -1,7 +1,7 @@
DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/progrium/sshcommand/master/sshcommand
PLUGN_URL ?= https://github.com/progrium/plugn/releases/download/v0.1.0/plugn_0.1.0_linux_x86_64.tgz
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/master/sshcommand
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
DOKKU_LIB_ROOT ?= /var/lib/dokku
@@ -38,7 +38,6 @@ package_cloud:
package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
packer:
@@ -72,10 +71,10 @@ version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
plugin-dependencies: plugn
dokku plugin:install-dependencies --core
sudo -E dokku plugin:install-dependencies --core
plugins: plugn docker
dokku plugin:install --core
sudo -E dokku plugin:install --core
dependencies: apt-update sshcommand plugn docker help2man man-db
$(MAKE) -e stack
@@ -103,7 +102,7 @@ docker: aufs
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
ifndef CI
curl -sSL https://get.docker.com/ | sh
wget -nv -O - https://get.docker.com/ | sh
ifdef DOCKER_VERSION
apt-get install -qq -y docker-engine=${DOCKER_VERSION} || (apt-cache madison docker-engine ; exit 1)
endif
@@ -123,7 +122,7 @@ ifdef BUILD_STACK
else
ifeq ($(shell echo ${PREBUILT_STACK_URL} | egrep -q 'http.*://|file://' && echo $$?),0)
@echo "Start importing herokuish from ${PREBUILT_STACK_URL}"
docker images | grep gliderlabs/herokuish || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - gliderlabs/herokuish
docker images | grep gliderlabs/herokuish || wget -nv -O - ${PREBUILT_STACK_URL} | gunzip -cd | docker import - gliderlabs/herokuish
else
@echo "Start pulling herokuish from ${PREBUILT_STACK_URL}"
docker images | grep gliderlabs/herokuish || docker pull ${PREBUILT_STACK_URL}
@@ -140,12 +139,7 @@ count:
@find tests -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | 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
test -f /var/lib/dokku/.dokku-installer-created || gem install tilt -v 1.4.1 --no-rdoc --no-ri
test -f /var/lib/dokku/.dokku-installer-created || ruby contrib/dokku-installer.rb onboot
test -f /var/lib/dokku/.dokku-installer-created || python contrib/dokku-installer.py onboot
test -f /var/lib/dokku/.dokku-installer-created || service dokku-installer start
test -f /var/lib/dokku/.dokku-installer-created || service nginx reload
test -f /var/lib/dokku/.dokku-installer-created || touch /var/lib/dokku/.dokku-installer-created

View File

@@ -1,4 +1,4 @@
# Dokku [![Build Status](https://img.shields.io/circleci/project/progrium/dokku.svg "Build Status")](https://circleci.com/gh/progrium/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg "Viewdocs")](http://progrium.viewdocs.io/dokku/) [![Gratipay](https://img.shields.io/gratipay/dokku.svg)](https://gratipay.com/dokku/)
# Dokku [![Build Status](https://img.shields.io/circleci/project/dokku/dokku/master.svg?style=flat-square "Build Status")](https://circleci.com/gh/dokku/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg?style=flat-square "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg?style=flat-square "Viewdocs")](http://dokku.viewdocs.io/dokku/) [![Gratipay](https://img.shields.io/gratipay/dokku.svg?style=flat-square)](https://gratipay.com/dokku/)
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/).
@@ -10,24 +10,24 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
To install the latest stable release, you can run the following commands as a user that has access to `sudo`:
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.3/bootstrap.sh
sudo DOKKU_TAG=v0.4.3 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.9/bootstrap.sh
sudo DOKKU_TAG=v0.4.9 bash bootstrap.sh
### Upgrading
[View the docs for upgrading](http://progrium.viewdocs.io/dokku/upgrading) from an older version of Dokku.
[View the docs for upgrading](http://dokku.viewdocs.io/dokku/upgrading) from an older version of Dokku.
## Documentation
Full documentation - including advanced installation docs - are available online at [docs](http://progrium.viewdocs.io/dokku/)
Full documentation - including advanced installation docs - are available online at [docs](http://dokku.viewdocs.io/dokku/)
## Support
You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Troubleshooting](http://progrium.viewdocs.io/dokku/troubleshooting) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku)
You can use [Github Issues](https://github.com/dokku/dokku/issues), check [Troubleshooting](http://dokku.viewdocs.io/dokku/troubleshooting) in the documentation, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku)
## Contribution
After checking [Github Issues](https://github.com/progrium/dokku/issues), the [Troubleshooting Guide](http://progrium.viewdocs.io/dokku/troubleshooting) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request.
After checking [Github Issues](https://github.com/dokku/dokku/issues), the [Troubleshooting Guide](http://dokku.viewdocs.io/dokku/troubleshooting) or having a chat with us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku), feel free to fork and create a Pull Request.
While we may not merge your PR as is, they serve to start conversations and improve the general dokku experience for all users.
@@ -37,4 +37,4 @@ Dokku is currently sponsored by the enterprise grade, multi-host PaaS project [D
## License
[MIT License](https://github.com/progrium/dokku/blob/master/LICENSE) © Jeff Lindsay
[MIT License](https://github.com/dokku/dokku/blob/master/LICENSE) © Jeff Lindsay

View File

@@ -1 +1,2 @@
Deis http://deis.io
Deis http://deis.io
DigitalOcean https://www.digitalocean.com/

12
Vagrantfile vendored
View File

@@ -27,6 +27,10 @@ Vagrant::configure("2") do |config|
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
end
config.vm.provider :vmware_fusion do |v, override|
v.vmx["memsize"] = BOX_MEMORY
end
config.vm.define "empty", autostart: false
config.vm.define "dokku", primary: true do |vm|
@@ -36,6 +40,14 @@ Vagrant::configure("2") do |config|
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
vm.vm.provision :shell do |s|
s.inline = <<-EOT
echo '"\e[5~": history-search-backward' > /root/.inputrc
echo '"\e[6~": history-search-forward' >> /root/.inputrc
echo 'set show-all-if-ambiguous on' >> /root/.inputrc
echo 'set completion-ignore-case on' >> /root/.inputrc
EOT
end
end
# For windows users. Sharing folder from windows creates problem with sym links and so, sync the repo instead from GOS.

View File

@@ -7,7 +7,7 @@
# We wrap this whole script in a function, so that we won't execute
# until the entire script is downloaded.
# That's good because it prevents our output overlapping with curl's.
# That's good because it prevents our output overlapping with wget's.
# It also means that we can't run a partially downloaded script.
@@ -16,11 +16,11 @@ bootstrap () {
set -eo pipefail
export DEBIAN_FRONTEND=noninteractive
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
if ! command -v apt-get &>/dev/null; then
echo "This installation script requires apt-get. For manual installation instructions, consult http://progrium.viewdocs.io/dokku/advanced-installation ."
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
exit 1
fi
@@ -29,8 +29,8 @@ hostname -f > /dev/null 2>&1 || {
exit 1
}
echo "--> Ensuring we have the proper dependencies"
apt-get update -qq > /dev/null
which curl > /dev/null || apt-get install -qq -y curl
[[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties
dokku_install_source() {
@@ -54,14 +54,14 @@ dokku_install_package() {
echo "--> Installing docker"
if uname -r | grep -q linode; then
echo "--> NOTE: Using Linode? Docker might complain about missing AUFS support."
echo " See http://progrium.viewdocs.io/dokku/getting-started/install/linode/"
echo " See http://dokku.viewdocs.io/dokku/getting-started/install/linode/"
echo " Installation will continue in 10 seconds."
sleep 10
fi
curl -sSL https://get.docker.com/ | sh
wget -nv -O - https://get.docker.com/ | sh
echo "--> Installing dokku"
curl -sSL https://packagecloud.io/gpg.key | apt-key add -
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | tee /etc/apt/sources.list.d/dokku.list
apt-get update -qq > /dev/null
@@ -91,14 +91,16 @@ elif [[ -n $DOKKU_TAG ]]; then
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package
dokku plugin:install-dependencies --core
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
else
export DOKKU_CHECKOUT="$DOKKU_TAG"
dokku_install_source
fi
else
dokku_install_package
dokku plugin:install-dependencies --core
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
fi
}

View File

@@ -1,4 +1,8 @@
machine:
pre:
- echo 'DOCKER_OPTS="-s btrfs -e lxc -D --userland-proxy=false"' | sudo tee -a /etc/default/docker
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.8.2-circleci-cp-workaround'
- sudo chmod 0755 /usr/bin/docker
services:
- docker
dependencies:

217
contrib/dokku-installer.py Executable file
View File

@@ -0,0 +1,217 @@
#!/usr/bin/env python2.7
import cgi
import json
import os
import SimpleHTTPServer
import SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.4.9'
hostname = ''
try:
command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'"
hostname = subprocess.check_output(command, shell=True)
if ':' in hostname:
hostname = ''
except subprocess.CalledProcessError:
pass
key_file = os.getenv('KEY_FILE', '/root/.ssh/authorized_keys')
admin_keys = []
if os.path.isfile(key_file):
try:
command = "cat {0}".format(key_file)
admin_keys = subprocess.check_output(command, shell=True).strip().split("\n")
except subprocess.CalledProcessError:
pass
def check_boot():
if 'onboot' not in sys.argv:
return
init_dir = os.getenv('INIT_DIR', '/etc/init')
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")
f.write("Description=Dokku web-installer\n")
f.write("\n")
f.write("[Service]\n")
f.write("ExecStart={0} selfdestruct\n".format(os.path.abspath(__file__)))
f.write("\n")
f.write("[Install]\n")
f.write("WantedBy=multi-user.target\n")
f.write("WantedBy=graphical.target\n")
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")
f.write("server {\n")
f.write(" listen 80;\n")
f.write(" location / {\n")
f.write(" proxy_pass http://dokku-installer;\n")
f.write(" }\n")
f.write("}\n")
subprocess.call('rm -f /etc/nginx/sites-enabled/*', shell=True)
sys.exit(0)
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
content = PAGE.replace('{VERSION}', VERSION)
content = content.replace('{HOSTNAME}', hostname)
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
self.send_response(200)
self.end_headers()
self.wfile.write(content)
def do_POST(self):
if self.path not in ['/setup', '/setup/']:
return
params = cgi.FieldStorage(fp=self.rfile,
headers=self.headers,
environ={
'REQUEST_METHOD': 'POST',
'CONTENT_TYPE': self.headers['Content-Type']})
dokku_root = os.getenv('DOKKU_ROOT', '/home/dokku')
if 'vhost' in params and params['vhost'].value == 'true':
with open('{0}/VHOST'.format(dokku_root), 'w') as f:
f.write(params['hostname'].value)
else:
try:
os.remove('{0}/VHOST'.format(dokku_root))
except OSError:
pass
command = ['sshcommand', 'acl-add', 'dokku', 'admin']
for key in params['keys'].value.split("\n"):
proc = subprocess.Popen(command, stdin=subprocess.PIPE)
proc.stdin.write(key)
proc.stdin.close()
proc.wait()
if 'selfdestruct' in sys.argv:
DeleteInstallerThread()
self.send_response(200)
self.end_headers()
self.wfile.write(json.dumps({'status': 'ok'}))
class DeleteInstallerThread(object):
def __init__(self, interval=1):
thread = threading.Thread(target=self.run, args=())
thread.daemon = True
thread.start()
def run(self):
command = "rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start"
try:
subprocess.call(command, shell=True)
except:
pass
command = "rm -f /etc/init/dokku-installer.conf /etc/systemd/system/dokku-installer.service && stop dokku-installer"
try:
subprocess.call(command, shell=True)
except:
pass
def main():
check_boot()
port = int(os.getenv('PORT', 2000))
httpd = SocketServer.TCPServer(("", port), GetHandler)
print "Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port)
httpd.serve_forever()
PAGE = """
<html>
<head>
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small>{VERSION}</small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="keys" rows="7" id="key">{ADMIN_KEYS}</textarea>
</div>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Hostname Configuration</small></h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="{HOSTNAME}" />
</div>
<div class="checkbox">
<label><input id="vhost" name="vhost" type="checkbox" value="true"> Use <abbr title="Nginx will be run on port 80 and backend to your apps based on hostname">virtualhost naming</abbr> for apps</label>
</div>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
function setup() {
if ($.trim($("#key").val()) == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "http://progrium.viewdocs.io/dokku/application-deployment";
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
}
}
$("#vhost").change(update);
$("#hostname").change(update);
update();
</script>
</body>
</html>
"""
if __name__ == "__main__":
main()

View File

@@ -1,125 +0,0 @@
#!/usr/bin/env ruby
require "sinatra"
require "open3"
if ARGV[0] == "onboot"
File.open("/etc/init/dokku-installer.conf", "w") do |f|
f.puts "start on runlevel [2345]"
f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct"
end
File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f|
f.puts "upstream dokku-installer { server 127.0.0.1:2000; }"
f.puts "server {"
f.puts " listen 80;"
f.puts " location / {"
f.puts " proxy_pass http://dokku-installer;"
f.puts " }"
f.puts "}"
end
`rm -f /etc/nginx/sites-enabled/*`
puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot."
exit
end
version = "v0.4.3"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_keys = `cat /root/.ssh/authorized_keys`.split("\n")
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
template = DATA.read
set :port, 2000
set :environment, :production
disable :protection
get "/" do
ERB.new(template).result binding
end
post "/setup" do
if params[:vhost] == "true"
File.open("#{dokku_root}/VHOST", "w") {|f| f.write params[:hostname] }
else
`rm #{dokku_root}/VHOST`
end
File.open("#{dokku_root}/HOSTNAME", "w") {|f| f.write params[:hostname] }
keys = params[:keys].split("\n")
keys.each do |k|
Open3.capture2("sshcommand acl-add dokku admin", :stdin_data => k)
end
Thread.new {
`rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start`
`rm /etc/init/dokku-installer.conf && stop dokku-installer`
}.run if ARGV[0] == "selfdestruct"
end
__END__
<html>
<head>
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small><%= version %></small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="keys" rows="7" id="key"><% admin_keys.each do |key| %><%= key + "\n" %><% end %></textarea>
</div>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Hostname Configuration</small></h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="<%= hostname %>" />
</div>
<div class="checkbox">
<label><input id="vhost" name="vhost" type="checkbox" value="true"> Use <abbr title="Nginx will be run on port 80 and backend to your apps based on hostname">virtualhost naming</abbr> for apps</label>
</div>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
function setup() {
if ($.trim($("#key").val()) == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "http://progrium.viewdocs.io/dokku/application-deployment";
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
}
}
$("#vhost").change(update);
$("#hostname").change(update);
update();
</script>
</body>
</html>

View File

@@ -93,6 +93,7 @@ if [[ ! -z $DOKKU_HOST ]]; then
fi
if [[ -z "$donotshift" ]]; then
# shellcheck disable=SC2029
ssh -o LogLevel=QUIET -t "dokku@$DOKKU_HOST" "$@"
exit $?
fi
@@ -119,7 +120,7 @@ if [[ ! -z $DOKKU_HOST ]]; then
done
fi
fi
# shellcheck disable=SC2086
# shellcheck disable=SC2086,SC2029
ssh -o LogLevel=QUIET -t "dokku@$DOKKU_HOST" $long_args "$verb" "$appname" "${args[@]}"
}

View File

@@ -1,174 +0,0 @@
#!/bin/bash
# <UDF name="hostname" default="" label="Hostname for dokku instance" example="example.com">
# <UDF name="ssh_key" default="" label="Public SSH Key for root user" example="Sets the root user's public ssh key, which is also automatically imported into the dokku installer">
# <UDF name="notify_email" default="" Label="Send Finish Notification To" example="Email address to send notification to when finished." />
logit() {
# Simple logging function that prepends an easy-to-find marker '=> ' and a timestamp to a message
TIMESTAMP=$(date -u +'%m/%d %H:%M:%S')
MSG="=> ${TIMESTAMP} $1"
echo ${MSG}
}
set_ssh_key() {
if [[ -n "${SSH_KEY}" ]]; then
logit "Setting root ssh key"
mkdir -p /root/.ssh
chmod 700 /root/.ssh
echo "$SSH_KEY" > /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
chown -R root:root /root/.ssh
fi
}
set_passwordless_ssh() {
logit "Turn off password authentication and root login for SSH"
echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
service ssh restart
}
system_primary_ip() {
# returns the primary IP assigned to eth0
ifconfig eth0 | awk -F: '/inet addr:/ {print $2}' | awk '{ print $1 }'
}
set_hostname() {
logit "Set up hostname"
if [[ -n "${HOSTNAME}" ]]; then
echo $HOSTNAME > /etc/hostname
echo $IPADDR $FQDN $HOSTNAME >> /etc/hosts
else
system_primary_ip > /etc/hostname
echo "$(system_primary_ip) localhost" >> /etc/hosts
fi
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
hostname -F /etc/hostname
}
postfix_install_loopback_only() {
logit "Installing and configuring Postfix"
# Installs postfix and configure to listen only on the local interface. Also
# allows for local mail delivery
echo "postfix postfix/destinations string localhost.localdomain, localhost" | debconf-set-selections
echo "postfix postfix/mailname string localhost" | debconf-set-selections
echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections
echo "postfix postfix/myhostname string localhost" | debconf-set-selections
sudo apt-get install -qq -y postfix > /dev/null 2>&1
/usr/sbin/postconf -e "inet_interfaces = loopback-only"
#/usr/sbin/postconf -e "local_transport = error:local delivery is disabled"
touch /tmp/restart-postfix
}
notify_install_via_email() {
if [[ -n "${NOTIFY_EMAIL}" ]]; then
logit "Sending notification email to ${NOTIFY_EMAIL}"
/usr/sbin/sendmail "${NOTIFY_EMAIL}" <<EOD
To: ${NOTIFY_EMAIL}
Subject: Dokku installation is complete
From: Dokku StackScript <no-reply@${HOSTNAME}>
Your Dokku installation is complete and now ready to be configured: http://$(system_primary_ip) . Please visit this url to complete the setup of your Dokku instance.
Enjoy using Dokku!
EOD
fi
}
notify_restart_via_email() {
if [[ -n "${NOTIFY_EMAIL}" ]]; then
logit "Sending notification email to ${NOTIFY_EMAIL} of required restart"
/usr/sbin/sendmail "${NOTIFY_EMAIL}" <<EOD
To: ${NOTIFY_EMAIL}
Subject: Dokku Linode instance must be restarted
From: Dokku StackScript <no-reply@${HOSTNAME}>
The following linode instance must be restarted:
${LINODE_LISHUSERNAME}
Before restarting, please go to this url:
https://manager.linode.com/linodes/dashboard/${LINODE_LISHUSERNAME}
Then click "Edit" next to the selected configuration profile and make the following changes:
- Change the "Kernel" option to the current "pv-grub" release
- Set the "Distro helper" option to "no"
Then save your changes. Next, reboot the instance from the Linode Dashboard. You'll receive an email once the instance is available to continue the dokku installation.
EOD
fi
}
setup_linode() {
logit "Installing via linode"
DEBIAN_FRONTEND=noninteractive apt-get install -qq -y linux-virtual
DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y grub2 grub-pc
DEBIAN_FRONTEND=noninteractive apt-get install -qq -y grub
mkdir -p /boot/grub
update-grub -y
sed -i 's/kopt=root=UUID=.* ro/kopt=root=\/dev\/xvda console=hvc0 ro quiet/g' /boot/grub/menu.lst
sed -i 's/# groot=(hd0,0)/# groot=(hd0)/g' /boot/grub/menu.lst
update-grub
cp /etc/rc.local /etc/rc.local-bak
cat << "EOF" > /etc/rc.local
#!/bin/sh -e
sudo apt-get update >> /root/setup_linode.txt 2>&1
sudo apt-get install -y linux-image-extra-"$(uname -r)" >> /root/setup_linode.txt 2>&1
modprobe aufs >> /root/setup_linode.txt 2>&1
sudo apt-get install -y apparmor cgroup-lite >> /root/setup_linode.txt 2>&1
sudo apt-get install -y dokku >> /root/setup_linode.txt 2>&1
# Clean up this script so it only runs once
rm -f /etc/rc.local
mv /etc/rc.local-bak /etc/rc.local
exit 0
EOF
chmod +x /etc/rc.local
}
install_prerequisites() {
logit "Installing pre-requisites"
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y apt-transport-https curl > /dev/null 2>&1
logit "Installing docker"
curl -sSL https://get.docker.com/ | sh
logit "Installing dokku"
curl -sSL https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - > /dev/null 2>&1
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
}
install_dokku() {
logit "Installing pre-requisites"
sudo apt-get install -qq -y linux-image-extra-"$(uname -r)" > /dev/null 2>&1
logit "Installing dokku"
sudo apt-get install -qq -y dokku > /dev/null 2>&1
logit "Done!"
}
exec &> /root/stackscript.log
set_ssh_key
set_passwordless_ssh
postfix_install_loopback_only
set_hostname
install_prerequisites
if [[ -n "$LINODE_ID" ]]; then
setup_linode
notify_restart_via_email
else
install_dokku
notify_install_via_email
fi

63
deb.mk
View File

@@ -1,55 +1,53 @@
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
HEROKUISH_VERSION ?= 0.3.4
HEROKUISH_VERSION ?= 0.3.7
HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash'
DOKKU_REPO_NAME ?= progrium/dokku
DOKKU_REPO_NAME ?= dokku/dokku
DOKKU_ARCHITECTURE = amd64
PLUGN_DESCRIPTION = 'Hook system that lets users extend your application with plugins'
PLUGN_REPO_NAME ?= progrium/plugn
PLUGN_VERSION ?= 0.2.0
PLUGN_REPO_NAME ?= dokku/plugn
PLUGN_VERSION ?= 0.2.1
PLUGN_ARCHITECTURE = amd64
PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb
SSHCOMMAND_DESCRIPTION = 'Turn SSH into a thin client specifically for your app'
SSHCOMMAND_REPO_NAME ?= progrium/sshcommand
SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
SSHCOMMAND_VERSION ?= 0.1.0
SSHCOMMAND_ARCHITECTURE = amd64
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
GEM_ARCHITECTURE = amd64
GOROOT = /usr/lib/go
GOBIN = /usr/bin/go
GOPATH = /home/vagrant/gocode
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-gems deb-plugn deb-setup deb-sshcommand
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-plugn deb-setup deb-sshcommand
install-from-deb:
echo "--> Initial apt-get update"
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y apt-transport-https curl
sudo apt-get install -qq -y apt-transport-https
echo "--> Installing docker"
curl -sSL https://get.docker.com/ | sh
wget -nv -O - https://get.docker.com/ | sh
echo "--> Installing dokku"
curl -sSL https://packagecloud.io/gpg.key | apt-key add -
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
sudo apt-get install dokku
deb-all: deb-herokuish deb-dokku deb-gems deb-plugn deb-sshcommand
deb-all: deb-herokuish deb-dokku deb-plugn deb-sshcommand
mv /tmp/*.deb .
echo "Done"
deb-setup:
echo "-> Updating deb repository and installing build requirements"
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y gcc git ruby1.9.1-dev > /dev/null 2>&1
sudo apt-get install -qq -y gcc git ruby-dev ruby1.9.1 > /dev/null 2>&1
command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
ssh -o StrictHostKeyChecking=no git@github.com || true
@@ -69,7 +67,7 @@ deb-herokuish: deb-setup
echo "sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install
echo "-> Cloning repository"
git clone -q "git@github.com:$(HEROKUISH_REPO_NAME).git" /tmp/tmp/herokuish > /dev/null
git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" /tmp/tmp/herokuish > /dev/null
rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore
echo "-> Copying files into place"
@@ -77,7 +75,7 @@ deb-herokuish: deb-setup
cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish
echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine | docker-engine-cs' --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine | docker-engine-cs' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
mv *.deb /tmp
deb-dokku: deb-setup
@@ -87,16 +85,19 @@ deb-dokku: deb-setup
cp -r debian /tmp/build/DEBIAN
mkdir -p /tmp/build/usr/local/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
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/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
$(MAKE) help2man
$(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build/usr/local/share/man/man1/dokku.1
cp contrib/dokku-installer.rb /tmp/build/usr/local/share/dokku/contrib
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
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
@@ -104,33 +105,23 @@ deb-dokku: deb-setup
dpkg-deb --build /tmp/build "/vagrant/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
mv *.deb /tmp
deb-gems: deb-setup
rm -rf /tmp/tmp /tmp/build rubygem-*.deb
mkdir -p /tmp/tmp /tmp/build
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp rack -v 1.5.2 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp rack-protection -v 1.5.3 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp sinatra -v 1.4.5 > /dev/null
gem install --quiet --no-verbose --no-ri --no-rdoc --install-dir /tmp/tmp tilt -v 1.4.1 > /dev/null
find /tmp/tmp/cache -name '*.gem' | xargs -rn1 fpm -d ruby -d ruby --prefix /var/lib/gems/1.9.1 -s gem -t deb -a $(GEM_ARCHITECTURE)
mv *.deb /tmp
deb-plugn: deb-setup
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build
echo "-> Cloning repository"
git clone -q "git@github.com:$(PLUGN_REPO_NAME).git" /tmp/tmp/plugn > /dev/null
git clone -q "https://github.com/$(PLUGN_REPO_NAME).git" /tmp/tmp/plugn > /dev/null
rm -rf /tmp/tmp/plugn/.git /tmp/tmp/plugn/.gitignore
echo "-> Copying files into place"
mkdir -p /tmp/build/usr/local/bin $(GOPATH)
sudo apt-get clean
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y git golang mercurial > /dev/null 2>&1
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH) && cd /tmp/tmp/plugn && make deps
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH) && cd /tmp/tmp/plugn && go build -o plugn
mv /tmp/tmp/plugn/plugn /tmp/build/usr/local/bin/plugn
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && go get github.com/dokku/plugn
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && make deps
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && rm plugn && go build -o plugn
mv /home/vagrant/gocode/src/github.com/dokku/plugn/plugn /tmp/build/usr/local/bin/plugn
echo "-> Creating $(PLUGN_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n plugn -v $(PLUGN_VERSION) -a $(PLUGN_ARCHITECTURE) -p $(PLUGN_PACKAGE_NAME) --url "https://github.com/$(PLUGN_REPO_NAME)" --description $(PLUGN_DESCRIPTION) --license 'MIT License' .
@@ -141,7 +132,7 @@ deb-sshcommand: deb-setup
mkdir -p /tmp/tmp /tmp/build
echo "-> Cloning repository"
git clone -q "git@github.com:$(SSHCOMMAND_REPO_NAME).git" /tmp/tmp/sshcommand > /dev/null
git clone -q "https://github.com/$(SSHCOMMAND_REPO_NAME).git" /tmp/tmp/sshcommand > /dev/null
rm -rf /tmp/tmp/sshcommand/.git /tmp/tmp/sshcommand/.gitignore
echo "-> Copying files into place"

0
debian/conffiles vendored
View File

12
debian/control vendored
View File

@@ -1,9 +1,11 @@
Package: dokku
Version: 0.3.12
Section: base
Version: 0.4.9
Section: web
Priority: optional
Architecture: amd64
Depends: locales, git, make, curl, software-properties-common, docker-engine | docker-engine-cs | lxc-docker, gcc, python-software-properties, man-db, herokuish, sshcommand
Pre-Depends: nginx, dnsutils, ruby, ruby-dev, rubygem-rack, rubygem-rack-protection, rubygem-sinatra, rubygem-tilt, apparmor, cgroupfs-mount | cgroup-lite, plugn
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, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Description: Docker powered mini-Heroku in around 100 lines of Bash
Description: Docker-powered PaaS that helps build and manage the lifecycle of applications

65
debian/postinst vendored
View File

@@ -1,9 +1,10 @@
#!/bin/sh
set -e
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
case "$1" in
abort-upgrade|abort-remove|abort-deconfigure)
@@ -17,43 +18,58 @@ case "$1" in
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
# setup plugin directories
echo "Setting up plugin directories"
# should be replaced by `plugn init`
mkdir -p /var/lib/dokku/core-plugins/available /var/lib/dokku/plugins/available
mkdir -p /var/lib/dokku/core-plugins/enabled /var/lib/dokku/plugins/enabled
touch /var/lib/dokku/core-plugins/config.toml /var/lib/dokku/plugins/config.toml
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
# migrate old plugins
find /var/lib/dokku/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do
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 /var/lib/dokku/plugins/$plugin/.core ]; then
rm -rf /var/lib/dokku/plugins/$plugin
elif [ ! -d /var/lib/dokku/plugins/available/$plugin ]; then
mv /var/lib/dokku/plugins/$plugin /var/lib/dokku/plugins/available;
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
# enable all core plugins
find /var/lib/dokku/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do
if [ ! -d /var/lib/dokku/plugins/available/$plugin ]; then
ln -s /var/lib/dokku/core-plugins/available/$plugin /var/lib/dokku/plugins/available/$plugin;
PLUGIN_PATH=/var/lib/dokku/core-plugins plugn enable $plugin
PLUGIN_PATH=/var/lib/dokku/plugins plugn enable $plugin
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;
PLUGIN_PATH=${DOKKU_LIB_ROOT}/core-plugins plugn enable $plugin
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi
done
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
echo "Install all core plugins"
dokku plugin:install --core
rm -f /home/dokku/VERSION
cp /var/lib/dokku/STABLE_VERSION /home/dokku/VERSION
rm -f ${DOKKU_ROOT}/VERSION
cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
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/share/dokku/contrib/dokku-installer.py onboot
if command -v systemctl &>/dev/null; then
echo "Enabling dokku-installer"
systemctl enable dokku-installer
fi
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
fi
db_get "dokku/web_config"
if [ "$RET" = "true" ]; then
db_stop
exit 0
fi
@@ -70,7 +86,9 @@ case "$1" in
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
sshcommand acl-add dokku default < "$RET"
if [ -f "$RET" ]; then
sshcommand acl-add dokku default < "$RET"
fi
fi
;;
@@ -80,4 +98,5 @@ case "$1" in
;;
esac
db_stop
exit 0

45
debian/postrm vendored Executable file
View File

@@ -0,0 +1,45 @@
#!/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}"
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
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
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 "$@"

10
debian/preinst vendored
View File

@@ -1,5 +1,5 @@
#!/bin/sh
set -e
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
@@ -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.rb selfdestruct' >> $INIT_CONF
rm -f $NGINX_CONF
touch $NGINX_CONF

55
debian/prerm vendored Executable file
View File

@@ -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 "$@"

8
debian/templates vendored
View File

@@ -1,19 +1,19 @@
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
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

View File

@@ -3,7 +3,7 @@
You can always install dokku straight from the latest - potentially unstable - master release via the following bash command:
```shell
wget -qO- https://raw.githubusercontent.com/progrium/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash
wget -qO- https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash
```
## Development
@@ -27,7 +27,7 @@ sudo SSHCOMMAND_URL=https://raw.githubusercontent.com/yourusername/sshcommand/ma
The bootstrap script allows the dokku repository URL to be overridden to bootstrap a host from your own clone of dokku using the `DOKKU_REPO` environment variable. Example:
```shell
wget https://raw.githubusercontent.com/progrium/dokku/master/bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
```
@@ -37,7 +37,7 @@ sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./
Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable.
```shell
git clone https://github.com/progrium/dokku.git
git clone https://github.com/dokku/dokku.git
cd dokku
sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
```

View File

@@ -100,6 +100,18 @@ This will prompt you to verify the application's name before destroying it. You
dokku --force apps:destroy APP
```
### Renaming a deployed app
> New as of 0.4.7
You can rename a deployed app using the `apps:rename` CLI tool:
```shell
dokku apps:rename OLD_NAME NEW_NAME
```
This will copy all of your app's contents into a new app directory with the name of your choice, delete your old app, then rebuild the new version of the app and deploy it. All of your config variables, including database urls, will be preserved.
### Adding deploy users
While it is possible to use password-based authorization to push to Dokku, it is preferable to use key-based authentication for security. You can add your public key to the dokku user's `authorized_keys` file with the following command:
@@ -116,6 +128,14 @@ Dokku only supports deploying from its master branch, so if you'd like to deploy
You can also support pushing multiple branches using the [receive-branch](/dokku/development/plugin-triggers/#receive-branch) plugin trigger in a custom plugin.
### Skipping deployment
If you only want to rebuild and tag a container, you can skip the deployment phase by setting `$DOKKU_SKIP_DEPLOY` to `true` by running:
``` shell
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
```
### Deploying with private git submodules
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
@@ -128,20 +148,6 @@ ssh -T git@github.com
Note that if the buildpack or dockerfile build process require ssh key access for other reasons, the above may not always apply.
### Specifying a custom buildpack
In certain cases you may want to specify a custom buildpack. While dokku uses herokuish to support all the [official heroku buildpacks](https://github.com/gliderlabs/herokuish#buildpacks), it is possible that the buildpack detection does not work well for your application. As well, you may wish to use a custom buildpack to handle specific application logic.
To use a specific buildpack, you can run the following dokku command:
```shell
# replace APP with the name of your application
# replace REPOSITORY_URL with your buildpack's url
dokku config:set APP BUILDPACK_URL=REPOSITORY_URL
```
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.
## Deploying to subdomains
The name of remote repository is used as the name of application to be deployed, as for example above:
@@ -176,7 +182,11 @@ This is in particular useful, then you want to deploy to root domain, as
## Dokku/Docker Container Management Compatibility
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/progrium/dokku/issues/1220), dokku executes a cleanup function prior to every deployment. This function removes all exited containers and all 'unattached' images.
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), dokku executes a cleanup function prior to every deployment. This function removes all exited containers and all 'unattached' images.
### Specifying a custom buildpack
See the [buildpack documentation](/dokku/deployment/buildpacks/).
## Default vhost

View File

@@ -2,10 +2,10 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-310x150.png"/>
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

@@ -2,37 +2,37 @@
"name": "Dokku",
"icons": [
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-36x36.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-48x48.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-72x72.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-96x96.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-144x144.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.3\/docs\/assets\/favicons\/android-chrome-192x192.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.9\/docs\/assets\/favicons\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"

View File

@@ -25,7 +25,7 @@ h1 {
padding: 0 0 0 1em;
}
.header a {
background-image: url(https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/dokku.png);
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/dokku.png);
color: #fff;
text-indent: 40px;
background-position: center left;
@@ -40,7 +40,7 @@ h1 {
.blurb {
color: #424242;
background-color: #ededed;
background-image: url(https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/gplaypattern.png);
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}
@@ -102,6 +102,9 @@ h1 {
.quickstart-code .command {
color: #ffffcc;
}
.quickstart-code .line .output {
color: #aaaaaa;
}
.marketing .col-lg-4 {
margin-bottom: 20px;
text-align: center;

View File

@@ -2,7 +2,7 @@
> New as of 0.3.0
Following a deploy, dokku will now wait `10` seconds before routing traffic to the new container. If the container is not running after this time, then the deploy is failed and your old container will continue serving traffic. You can configure this time using the following command:
Following a deploy, dokku will now wait `10` seconds before routing traffic to the new container. If the container is not running after this time, then the deploy is failed and your old container will continue serving traffic. You can modify this value using the following command:
```shell
dokku config:set --global DOKKU_DEFAULT_CHECKS_WAIT=30
@@ -18,13 +18,13 @@ A check is a relative URL and may be followed by expected content from the page,
/about Our Amazing Team
```
Dokku will wait `5` seconds before running the checks to give server time to start. This time can be overridden on a per-app basis in the `CHECKS` file by setting `WAIT=nn`. You may also override this for the global dokku installation:
Dokku will wait `5` seconds before running the checks to give the server time to start. This value can be overridden on a per-app basis in the `CHECKS` file by setting `WAIT=nn`. You may also override this for the global dokku installation:
```shell
dokku config:set --global DOKKU_CHECKS_WAIT=15
```
Dokku will wait `60` seconds before stopping the old container so that existing connections are given a chance to complete. This time is also configurable globally:
Dokku will wait `60` seconds before stopping the old container so that existing connections are given a chance to complete. This value is also configurable globally:
```shell
dokku config:set --global DOKKU_WAIT_TO_RETIRE=120

View File

@@ -11,7 +11,7 @@ Of all methods, this is the *most* official method of interacting with your dokk
To install, simply clone the dokku repository down and add the `dokku` alias pointing at the script:
```shell
git clone git@github.com:progrium/dokku.git ~/.dokku
git clone git@github.com:dokku/dokku.git ~/.dokku
# add the following to either your
# .bashrc, .bash_profile, or .profile file

View File

@@ -2,7 +2,7 @@
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
* [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder
* [plugn](https://github.com/progrium/plugn) - Shell based plugins and hooks
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH
* [plugn](https://github.com/dokku/plugn) - Shell based plugins and hooks
* [sshcommand](https://github.com/dokku/sshcommand) - Fixed commands over SSH
Looking to keep codebase as simple and hackable as possible, so try to keep your line count down.

View File

@@ -21,13 +21,13 @@ You can set multiple environment variables at once:
dokku config:set node-js-app ENV=prod COMPILE_ASSETS=1
```
When setting variables with whitespace, you need to escape the whitespace:
When setting variables with whitespaces, you need to escape them:
```shell
dokku config:set node-js-app KEY=\"VAL\ WITH\ SPACES\"
```
When setting or unsetting environment variables, you may wish sometimes to avoid an application restart. This is useful when developing plugins or when setting multiple environment variables in a scripted manner. To do so, use the `--no-restart` flag:
When setting or unsetting environment variables, you may wish to avoid an application restart. This is useful when developing plugins or when setting multiple environment variables in a scripted manner. To do so, use the `--no-restart` flag:
```shell
dokku --no-restart config:set node-js-app ENV=prod

View File

@@ -0,0 +1,72 @@
# Buildpack Deployment
Dokku normally defaults to using [heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, though this may be overridden by committing a valid `Dockerfile` to the root of your repository and pushing the repository to your Dokku installation. To avoid this automatic `Dockerfile` deployment detection, you may do one of the following:
- Use `dokku config:set` to set the `BUILDPACK_URL` environment variable.
- Add `BUILDPACK_URL` to a committed `.env` file in the root of your repository.
- Create a `.buildpacks` file in the root of your repository.
## Specifying a custom buildpack
In certain cases you may want to specify a custom buildpack. While dokku uses herokuish to support all the [official heroku buildpacks](https://github.com/gliderlabs/herokuish#buildpacks), it is possible that the buildpack detection does not work well for your application. As well, you may wish to use a custom buildpack to handle specific application logic.
To use a specific buildpack, you can run the following dokku command:
```shell
# replace APP with the name of your application
# replace REPOSITORY_URL with your buildpack's url
dokku config:set APP BUILDPACK_URL=REPOSITORY_URL
```
Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
## Using multiple buildpacks
You can only set a single buildpack using the `BUILDPACK_URL`, though there may be times when you wish to use multiple buildpacks. To do so, simply create a `.buildpacks` file in the base of your repository. This file should list all the buildpacks, one-per-line. For instance, if you wish to use both the `nodejs` and `ruby` buildpacks, your `.buildpacks` file should contain the following:
```shell
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-ruby.git
```
You may also choose to set just a single buildpack in this file, though that is up to you.
Please check the documentation for your particular buildpack(s) as you may need to include configuration files (such as a Procfile) in your project root.
## Using a specific buildpack version
As Dokku pins all buildpacks via herokuish releases, there may be occasions where a local buildpack version is out of date. If you wish to use a more recent version of the buildpack, you may use any of the above methods to specify a buildpack **without** the git sha attached like so:
```shell
# using the latest nodejs buildpack
# replace APP with the name of your application
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
```
You may also wish to use a **specific** version of a buildpack, which is also simple
```shell
# using v87 of the nodejs buildpack
# replace APP with the name of your application
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
```
## Clearing buildpack cache
Building containers with buildpacks currently results in a persistent `cache` directory between deploys. If you need to clear this cache directory for any reason, you may do so by running the following shell command:
```shell
# replace APP with the name of your application
sudo rm -rf /home/dokku/APP/cache/*
```
### Curl Build Timeouts
Certain buildpacks may time out in retrieving dependencies via curl. This can happen when your network connection is poor or if there is significant network congestion. You may see a message similar to `gzip: stdin: unexpected end of file` after a curl command.
If you see output similar this when deploying , you may need to override the curl timeouts to increase the length of time allotted to those tasks. You can do so via the `config` plugin:
```shell
dokku config:set --global CURL_TIMEOUT=600
dokku config:set --global CURL_CONNECT_TIMEOUT=30
```

View File

@@ -18,7 +18,7 @@ By default, Dokku will extract the first `EXPOSE` tcp port and use said port wit
dokku config:set APP DOKKU_DOCKERFILE_PORT=8000
```
Dokku will not expose other ports on your application without a [custom docker-option](/dokku/configuration/docker-options/).
Dokku will not expose other ports on your application without a [custom docker-option](/dokku/docker-options/).
If you do not have a port explicitly exposed, Dokku will automatically expose port `5000` for your application.

View File

@@ -33,7 +33,7 @@ root@dokku:~# dokku tags:deploy node-js-app v0.9.0
-----> Deploying node-js-app (dokku/node-js-app:v0.9.0)...
-----> Running pre-flight checks
For more efficient zero downtime deployments, create a file CHECKS.
See http://progrium.viewdocs.io/dokku/checks-examples.md for examples
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
-----> Default container check successful!

View File

@@ -26,7 +26,13 @@ The `certs:add` command can be used to push a `tar` containing a certificate `.c
```shell
tar cvf cert-key.tar server.crt server.key
# replace APP with the name of your application
dokku certs:add < cert-key.tar
dokku certs:add <app> < cert-key.tar
```
> Note: If your `.crt` file came alongside a `.ca-bundle`, you'll want to concatenate those into a single `.crt` file before adding it to the `.tar`.
```shell
cat yourdomain_com.crt yourdomain_com.ca-bundle > server.crt
```
### Certificate generation

View File

@@ -3,9 +3,9 @@
If you create your own plugin:
1. Take a look at the plugins shipped with dokku and hack away!
2. Check out the [list of triggers](http://progrium.viewdocs.io/dokku/development/plugin-triggers) your plugin can implement.
2. Check out the [list of triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) your plugin can implement.
3. Upload your plugin to github with a repository name in form of `dokku-<name>` (e.g. `dokku-mariadb`)
4. Edit [this page](http://progrium.viewdocs.io/dokku/plugins) and add a link to it.
4. Edit [this page](http://dokku.viewdocs.io/dokku/plugins) and add a link to it.
5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
### Sample plugin
@@ -89,4 +89,4 @@ A few notes:
dokku config:unset --no-restart APP KEY1 [KEY2 ...]
```
- From time to time you may want to allow other plugins access to (some of) your plugin's functionality. You can expose this by including a `functions` file in your plugin for others to source. Consider all functions in that file to be publicly accessible by other plugins. Any functions not wished to be made "public" should reside within your plugin trigger or commands files.
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](http://progrium.viewdocs.io/dokku/development/plugin-triggers) doc for examples.
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) doc for examples.

View File

@@ -1,6 +1,6 @@
# Plugin triggers
[Plugin triggers](https://github.com/progrium/plugn) (formerly [pluginhooks](https://github.com/progrium/pluginhook)) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration.
[Plugin triggers](https://github.com/dokku/plugn) (formerly [pluginhooks](https://github.com/progrium/pluginhook)) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration.
Plugin triggers are simply scripts that are executed by the system. You can use any language you want, so long as the script:
@@ -62,9 +62,10 @@ fi
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
export DEBIAN_FRONTEND=noninteractive
case "$DOKKU_DISTRO" in
ubuntu)
export DEBIAN_FRONTEND=noninteractive
debian|ubuntu)
apt-get install --force-yes -qq -y nginx
;;
@@ -379,6 +380,27 @@ docker commit $id $IMAGE > /dev/null
dokku_log_info1 "Building UI Complete"
```
### `post-create`
- Description: Can be used to run commands after an application is created.
- Invoked by: `dokku apps:create`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Runs a command to ensure that an app
# has a postgres database when it is starting
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
POSTGRES="$1"
dokku postgres:create $POSTGRES
dokku postgres:link $POSTGRES $APP
```
### `post-deploy`
- Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx.
@@ -436,11 +458,29 @@ APP="$1";
dokku postgres:destroy $APP
```
### `post-stop`
- Description: Can be used to run commands after an application is manually stopped
- Invoked by: `dokku ps:stop`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Marks an application as manually stopped
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
```
### `docker-args-build`
- Description:
- Invoked by: `dokku build`
- Arguments: `$APP`
- Arguments: `$APP $IMAGE_SOURCE_TYPE`
- Example:
```shell
@@ -506,9 +546,9 @@ echo false
### `post-domains-update`
- Description: Allows you to run commands once the domain for an application has been updated.
- Description: Allows you to run commands once the domain for an application has been updated. It also sends in the command that has been used. This can be "add", "clear" or "remove". The third argument will be the optional list of domains
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`
- Arguments: `$APP`
- Arguments: `$APP` `action name` `domains`
- Example:
```shell
@@ -591,7 +631,7 @@ nginx -t
- Description: Allows you to customize the contents of an application directory before they are processed for deployment. The `IMAGE_SOURCE_TYPE` can be any of `[herokuish, dockerfile]`
- Invoked by: `dokku git-hook`, `dokku tar-build-locked`
- Arguments: `$APP $IMAGE_SOURCE_TYPE $TMP_WORK_DIR`
- Arguments: `$APP $IMAGE_SOURCE_TYPE $TMP_WORK_DIR $REV`
- Example:
```shell
@@ -601,7 +641,7 @@ nginx -t
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; IMAGE_SOURCE_TYPE="$2"; TMP_WORK_DIR="$3"
APP="$1"; IMAGE_SOURCE_TYPE="$2"; TMP_WORK_DIR="$3"; REV="$4"
echo "$APP" > "$TMP_WORK_DIR/dokku-is-awesome"
```
@@ -693,9 +733,51 @@ some code to remove a docker hub tag because it's not implemented in the CLI....
```shell
#!/usr/bin/env bash
# Send an email when a container failed to retire
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; HOSTNAME=$(hostname -s)
mail -s "$APP containers on $HOSTNAME failed to retire" ops@co.com
mail -s "$APP containers on $HOSTNAME failed to retire" ops@example.com
```
### `user-auth`
This is a special plugin trigger that is executed on *every* command run. As dokku sometimes internally invokes the `dokku` command, special care should be taken to properly handle internal command redirects.
Note that the trigger should exit as follows:
- `0` to continue running as normal
- `1` to halt execution of the command
The `SSH_USER` is the original ssh user. If you are running remote commands, this user will typically be `dokku`, and as such should not be trusted when checking permissions. If you are connected via ssh as a different user who then invokes `dokku`, the value of this variable will be that user's name (`root`, `myuser`, etc.).
The `SSH_NAME` is the `NAME` variable set via the `sshcommand acl-add` command. If you have set a user via the `dokku-installer`, this value will be set to `admin`. For installs via debian package, this value *may* be `default`. For reference, the following command can be run as the root user to specify a specific `NAME` for a given ssh key:
```shell
sshcommand acl-add dokku NAME < $PATH_TO_SSH_KEY
```
Note that the `NAME` value is set at the first ssh key match. If an ssh key is set in the `/home/dokku/.ssh/authorized_keys` multiple times, the first match will decide the value.
- Description: Allows you to deny access to a dokku command by either ssh user or associated ssh-command NAME user.
- Invoked by `dokku`
- Arguments: `$SSH_USER $SSH_NAME $DOKKU_COMMAND`
- Example:
```shell
#!/usr/bin/env bash
# Allow root/admin users to do everything
# Deny plugin access to default users
# Allow access to all other commands
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
SSH_USER=$1
SSH_NAME=$2
shift 2
[[ "$SSH_USER" == "root" ]] && exit 0
[[ "$SSH_NAME" == "admin" ]] && exit 0
[[ "$SSH_NAME" == "default" && $1 == plugin:* ]] && exit 1
exit 0
```

View File

@@ -4,18 +4,19 @@ Dokku is released in intervals *at most* three weeks apart, though may be releas
To propose a release, the following tasks need to be performed:
- The installable version must be changed in the `docs/installation.md` file.
- The installable version must be changed in the `contrib/dokku-installer.py` file.
- The installable version must be changed in the `debian/control` file.
- The installable version must be changed in the `docs/home.html` file
- The installable version must be changed in the `docs/index.md` file
- The installable version must be changed in the `README.md` file.
- The installable version must be changed in the `contrib/dokku-installer.rb` file.
- The installable version must be changed in the `docs/installation.md` file.
- The installable version must be changed in the `docs/template.html` file.
- The installable version must be changed in the `README.md` file.
- The embedded css should be cleared in the `docs/template.html` file.
- The versioned links should be updated in the `docs/home.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- The versioned links should be updated in the `docs/assets/style.css` file.
- The versioned links should be updated in the `docs/assets/favicons/browserconfig.xml` file.
- The versioned links should be updated in the `docs/assets/favicons/manifest.json` file.
- The versioned links should be updated in the `docs/assets/style.css` file.
- The versioned links should be updated in the `docs/home.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- A list of changes must be made in the `HISTORY.md`.
- A tag must be created locally with your release version

View File

@@ -14,7 +14,7 @@ Example apps can be found here:
### Executing tests locally
- Setup dokku in a [vagrant vm](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant)
- Setup dokku in a [vagrant vm](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- Test setup and execution
```shell

View File

@@ -1,6 +1,6 @@
# DNS Configuration
This is a work in progress.
> Note: This is a work in progress.
### DNS Versions
@@ -14,21 +14,21 @@ Because there are so many different DNS server packages out there as well as a t
* We assume you have a passing familiarity with DNS. If not, you can read an [in-depth article](http://www.diaryofaninja.com/blog/2012/03/03/devops-dns-for-developers-ndash-now-therersquos-no-excuse-not-to-know) on DNS. But basically you need to know that DNS changes names (like example.tld) into addresses (like 127.0.0.1)
* We assume you already have a domain name registered and pointed to your favorite Managed DNS Provider or have your own BIND DNS server running.
* You have a server on the internet and are about to follow the instructions in the [README](https://github.com/progrium/dokku/blob/master/README.md) to get dokku installed. Don't do the install just yet though.
* You have a server on the internet and are about to follow the instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md) to get dokku installed. Don't do the install just yet though.
### HELP!
Don't be afraid to ask if you need help. Create a [new issue](https://github.com/progrium/dokku/issues) and someone will be glad to assist you.
Don't be afraid to ask if you need help. Create a [new issue](https://github.com/dokku/dokku/issues) and someone will be glad to assist you.
# Getting started
For the examples, we will use the domain name `example.tld` and the IP address `127.0.0.1`.
Dokku uses a DNS to differentiate between apps on your dokku-powered server. If you are using the domain `example.tld`, and you have two apps `myapp1` and `myapp2`, dokku will make them available at `myapp1.example.tld` and `myapp2.example.tld`.
Dokku uses DNS to differentiate between apps on your dokku-powered server. If you are using the domain `example.tld`, and you have two apps `myapp1` and `myapp2`, dokku will make them available at `myapp1.example.tld` and `myapp2.example.tld`.
To get started, you need to know the IP address of your dokku server. Connect in to it and run `ifconfig` or `ip addr` to see the IP address.
To get started, you need to know the IP address of your dokku server. Connect to it and run `ifconfig` or `ip addr` to see the IP address.
# Caching
@@ -73,7 +73,7 @@ If everything is working correctly, you should also be able to query for any oth
If they all return your IP address, you have set DNS up properly for dokku. You should also be able to `ssh root@myserver.example.tld` and access your server.
Proceed with the setup instructions in the [README](https://github.com/progrium/dokku/blob/master/README.md)
Proceed with the setup instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md)
### Using the root of your domain (myapp.example.tld)

View File

@@ -2,49 +2,58 @@
> New as of 0.3.17
```
docker-options <app> Display apps docker options for all phases
docker-options <app> <phase(s)> Display apps docker options for phase (comma-separated phase list)
docker-options:add <app> <phase(s)> OPTION Add docker option to app for phase (comma-separated phase list)
docker-options:remove <app> <phase(s)> OPTION Remove docker option from app for phase (comma-separated phase list)
```
Add some options (first, for the deployed/running app and second when executing `dokku run`):
Pass [options](http://docs.docker.io/en/latest/reference/run/) to Docker during Dokku's `build`, `deploy` and `run` phases
```
dokku docker-options:add myapp deploy "-v /host/path:/container/path"
dokku docker-options:add myapp run "-v /another/container/path"
docker-options <app> Display app's Docker options for all phases
docker-options <app> <phase(s)> Display app's Docker options for phase (comma-separated phase list)
docker-options:add <app> <phase(s)> OPTION Add Docker option to app for phase (comma-separated phase list)
docker-options:remove <app> <phase(s)> OPTION Remove Docker option from app for phase (comma-separated phase list)
```
Check what we added
## About Dokku phases
```shell
dokku docker-options myapp
# Deploy options:
# -v /host/path:/container/path
# Run options:
# -v /another/container/path
```
Remove an option
```shell
dokku docker-options:remove myapp run "--link container_name:alias"
```
### Note about `dokku` phases and `docker-options`
`dokku` deploys your application in multiple "phases" and the `docker-options` plugin allows you to pass arguments to the underlying docker container in the following 3 phases/containers:
Dokku deploys your application in multiple "phases" and the `docker-options` plugin allows you to pass arguments to their underlying docker container:
- `build`: the container that executes the appropriate buildpack
- `deploy`: the container that executes your running/deployed application
- `run`: the container that executes any arbitrary command via `dokku run myapp`
## Advanced Usage (avoid if possible)
## Examples
In your applications folder (`/home/dokku/app_name`) create a file called `DOCKER_OPTIONS_RUN` (or `DOCKER_OPTIONS_BUILD` or `DOCKER_OPTIONS_DEPLOY`).
### Add Docker options
Inside this file list one docker option per line. For example:
Add some options for the deployed/running app and when executing [`dokku run`](deployment/one-off-processes/):
```shell
# Mount a host volume in a Docker container: "-v /host/path:/container/path"
dokku docker-options:add myapp deploy "-v /home/dokku/logs/myapp:/app/logs"
dokku docker-options:add myapp run "-v /home/dokku/logs/myapp:/app/logs"
```
> Note: When [mounting a host directory](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems) in a Dokku app you should first create that directory as user `dokku` and then mount the directory under `/app` in the container using `docker-options` as above. Otherwise the app will lack write permission in the directory.
### Output Docker options
```shell
dokku docker-options myapp
# Deploy options:
# -v /home/dokku/logs/myapp:/app/logs
# Run options:
# -v /home/dokku/logs/myapp:/app/logs
```
### Remove a Docker option
```shell
dokku docker-options:remove myapp run "-v /home/dokku/logs/myapp:/app/logs"
```
## Advanced usage
In your applications folder `/home/dokku/app_name` create a file called `DOCKER_OPTIONS_RUN` (or `DOCKER_OPTIONS_BUILD` or `DOCKER_OPTIONS_DEPLOY`).
Inside this file list one Docker option per line. For example:
```shell
--link container_name:alias
@@ -52,7 +61,7 @@ Inside this file list one docker option per line. For example:
-v /another/container/path
```
The above example will result in the following options being passed to docker during `dokku run`:
The above example will result in the following options being passed to Docker during `dokku run`:
```shell
--link container_name:alias -v /host/path:/container/path -v /another/container/path
@@ -60,4 +69,4 @@ The above example will result in the following options being passed to docker du
You may also include comments (lines beginning with a #) and blank lines in the DOCKER_OPTIONS file.
Move information on docker options can be found here: http://docs.docker.io/en/latest/reference/run/ .
Move information on Docker options can be found here: http://docs.docker.io/en/latest/reference/run/ .

View File

@@ -0,0 +1,11 @@
# Microsoft Azure
- If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/).
- Go to the [dokku on azure deployment page](https://azure.microsoft.com/en-us/documentation/templates/dokku-vm/) and click **Deploy to Azure**.
- You'll be prompted to enter a few parameters, including a unique storage account name and a unique name for the sub-domain used for your public IP address. For the `sshKeyData` parameter, copy and paste the contents of the **public** key file you just created. After a few minutes the Dokku instance will be deployed.
- In your browser of choice, navigate to `http://[[dnsNameForPublicIP]].[[location]].cloudapp.azure.com`. Where `[[dnsNameForPublicIP]]` and `[[location]]` are template parameters you used to deploy the template.
- Finish your dokku setup like you normally would by creating a **new** public/private key pair for your deployments using `ssh-keygen` (don't use the same one as you created in the first step). You should select 'Use Virtual Host Naming' and set the `Hostname` to a **public dns name** that you own such as one you would purchase from [namecheap](http://namecheap.com). Alternatively thanks to [xip.io]( http://xip.io/) you can just use yourAzurePublicIP.xip.io for free. For example, if your public IP is `44.44.44.44` then you would set it to `44.44.44.44.xip.io`.

View File

@@ -5,13 +5,13 @@ As of 0.3.18, dokku defaults to being installed via debian package. While certai
```shell
# install prerequisites
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y apt-transport-https curl
sudo apt-get install -qq -y apt-transport-https
# install docker
curl -sSL https://get.docker.com/ | sh
wget -nv -O - https://get.docker.com/ | sh
# install dokku
curl -sSL https://packagecloud.io/gpg.key | apt-key add -
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
sudo apt-get install dokku

View File

@@ -36,4 +36,4 @@ __Warning__: These steps will delete *everything* on your Linode.
9. Lastly, reboot the Linode.
Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](http://progrium.viewdocs.io/dokku/installation) and `bootstrap.sh` will take care of everything else.
Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](http://dokku.viewdocs.io/dokku/installation) and `bootstrap.sh` will take care of everything else.

View File

@@ -5,7 +5,7 @@
- Clone Dokku
```
git clone https://github.com/progrium/dokku.git
git clone https://github.com/dokku/dokku.git
```
- Setup SSH hosts in your `/etc/hosts`

View File

@@ -4,7 +4,7 @@ If you’re stuck, there are a number of places you can get help:
## The Official Dokku Website
[http://progrium.viewdocs.io/dokku](http://progrium.viewdocs.io/dokku)
[http://dokku.viewdocs.io/dokku](http://dokku.viewdocs.io/dokku)
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using dokku.

View File

@@ -10,26 +10,26 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
@@ -45,6 +45,7 @@
.quickstart-code .shell{background-color:#171717;font-family:Menlo,Consolas,"Courier New",Courier,"Liberation Mono",monospace;margin:0 20px;padding:20px;text-shadow:none;border-radius:0 0 5px 5px;box-shadow:0 5px 30px rgba(0,0,0,0.3)}
.quickstart-code .line{display:block;margin:0;padding:0}
.quickstart-code .line span{display:inline-block}
.quickstart-code .line .output{color:#aaaaaa;}
.quickstart-code .path{color:#2a8fbd;user-select:none}
.quickstart-code .prompt{color:#f90;user-select:none}
.quickstart-code .command{color:#ffc}
@@ -86,12 +87,12 @@
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/progrium/dokku/v0.4.3/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.9/bootstrap.sh</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.3 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.4.9 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -15,12 +15,12 @@
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/progrium/dokku/v0.4.3/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.9/bootstrap.sh</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.3 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.4.9 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -19,8 +19,8 @@ To install the latest stable version of dokku, you can run the following shell c
```shell
# installs dokku via apt-get
wget https://raw.githubusercontent.com/progrium/dokku/v0.4.3/bootstrap.sh
sudo DOKKU_TAG=v0.4.3 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.9/bootstrap.sh
sudo DOKKU_TAG=v0.4.9 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.
@@ -33,16 +33,17 @@ Once you save your settings, the web admin will self-terminate and you should be
For various reasons, certain hosting providers may have other steps that should be preferred to the above. If hosted on any of the following popular hosts, please follow the linked to instructions:
- [Digital Ocean Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/digitalocean)
- [Linode Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/linode)
- [Digital Ocean Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/digitalocean)
- [Linode Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/linode/)
- [Microsoft Azure Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/azure/)
As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started:
- [Debian Package Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/debian)
- [Vagrant Installation Notes](http://progrium.viewdocs.io/dokku/getting-started/install/vagrant)
- [Advanced Install Customization](http://progrium.viewdocs.io/dokku/advanced-installation)
- [Debian Package Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/debian)
- [Vagrant Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- [Advanced Install Customization](http://dokku.viewdocs.io/dokku/advanced-installation)
---
- <sup>[1]: To check whether your system has an fqdn set, run `sudo hostname -f`</sup>
- <sup>[2]: If your system has less than 1GB of memory, you can use ([this workaround](http://progrium.viewdocs.io/dokku/advanced-installation)).</sup>
- <sup>[2]: If your system has less than 1GB of memory, you can use ([this workaround](http://dokku.viewdocs.io/dokku/advanced-installation)).</sup>

View File

@@ -1,6 +1,6 @@
# Nginx Configuration
Dokku uses nginx as it's server for routing requests to specific applications. By default, access and error logs are written for each app to `/var/log/nginx/${APP}-access.log` and `/var/log/nginx/${APP}-error.log` respectively
Dokku uses nginx as its server for routing requests to specific applications. By default, access and error logs are written for each app to `/var/log/nginx/${APP}-access.log` and `/var/log/nginx/${APP}-error.log` respectively
```
nginx:access-logs <app> [-t] Show the nginx access logs for an application (-t follows)
@@ -16,13 +16,12 @@ nginx:error-logs <app> [-t] Show the nginx error logs for a
Dokku currently templates out an nginx configuration that is included in the `nginx-vhosts` plugin. If you'd like to provide a custom template for your application, there are a few options:
- Copy the existing template - ssl or non-ssl - into your application repository's root directory as the file `nginx.conf.template`.
- Create a template file in `/home/dokku/APP` named one of the following:
- Copy the existing pertinent (ssl or non-ssl) template found (by default) in `/var/lib/dokku/plugins/available/nginx-vhosts/templates`, place it either in `/home/dokku/APP` or check it into the root of your app repo, and name it one of the following:
- `nginx.conf.template` (since 0.3.10)
- `nginx.conf.ssl_terminated.template` (since 0.4.0)
- `nginx.ssl.conf.template` (since 0.4.2)
> If placed on disk on the dokku server, the template file **must** be owned by the user `dokku:dokku`.
> If placed on the dokku server, the template file **must** be owned by user and group `dokku:dokku`.
For instance - assuming defaults - to customize the nginx template in use for the `myapp` application, create the file `nginx.conf.template` in your repo or on disk with the with the following contents:
@@ -70,7 +69,7 @@ The default nginx.conf- templates will include everything from your apps `nginx.
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
```
. That means you can put additional configuration in separate files, for example to limit the uploaded body size to 50 megabytes, do
That means you can put additional configuration in separate files, for example to limit the uploaded body size to 50 megabytes, do
```shell
mkdir /home/dokku/myapp/nginx.conf.d/

View File

@@ -1,6 +1,6 @@
# Plugins
Dokku itself is built out of plugins and uses [plugn](https://github.com/progrium/plugn) for its plugin system. In essence a plugin is a collection of scripts that will be run based on naming convention.
Dokku itself is built out of plugins and uses [plugn](https://github.com/dokku/plugn) for its plugin system. In essence a plugin is a collection of scripts that will be run based on naming convention.
Let's take a quick look at the current dokku nginx plugin that's shipped with dokku by default.
@@ -26,7 +26,7 @@ dokku plugins-install
## Creating your own plugin
[See the full documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation).
[See the full documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation).
## Official Plugins (Beta)
@@ -40,49 +40,62 @@ The following plugins are available and provided by dokku maintainers. Where not
| [Memcached (beta)](https://github.com/dokku/dokku-memcached-plugin) | [dokku][] | 0.4.0+ |
| [Mongo (beta)](https://github.com/dokku/dokku-mongo-plugin) | [dokku][] | 0.4.0+ |
| [MySQL (beta)](https://github.com/dokku/dokku-mysql-plugin) | [dokku][] | 0.4.0+ |
| [Nats (beta)](https://github.com/dokku/dokku-nats) | [dokku][] | 0.4.0+ |
| [Postgres (beta)](https://github.com/dokku/dokku-postgres-plugin) | [dokku][] | 0.4.0+ |
| [RabbitMQ (beta)](https://github.com/dokku/dokku-rabbitmq-plugin) | [dokku][] | 0.4.0+ |
| [Redis (beta)](https://github.com/dokku/dokku-redis-plugin) | [dokku][] | 0.4.0+ |
| [RethinkDB (beta)](https://github.com/dokku/dokku-rethinkdb-plugin) | [dokku][] | 0.4.0+ |
| [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ |
| [Copy Files to Image](https://github.com/dokku/dokku-copyfiles-to-image) | [dokku][] | 0.4.0+ |
| [HTTP Auth (beta)](https://github.com/dokku/dokku-http-auth) | [dokku][] | 0.4.0+ |
| [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ |
| [Redirect (beta)](https://github.com/dokku/dokku-redirect) | [dokku][] | 0.4.0+ |
## Community plugins
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
[agco-adm]: https://github.com/agco-adm
[256dpi]: https://github.com/256dpi
[abossard]: https://github.com/dudagroup
[ademuk]: https://github.com/ademuk
[agco-adm]: https://github.com/agco-adm
[alessio]: https://github.com/alessio
[alex-sherwin]: https://github.com/alex-sherwin
[alexanderbeletsky]: https://github.com/alexanderbeletsky
[alexkruegger]: https://github.com/alexkruegger
[Aomitayo]: https://github.com/Aomitayo
[apmorton]: https://github.com/apmorton
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
[blag]: https://github.com/blag
[cameron-martin]: https://github.com/cameron-martin
[cedricziel]: https://github.com/cedricziel
[cef]: https://github.com/cef
[cjblomqvist]: https://github.com/cjblomqvist
[darkpixel]: https://github.com/darkpixel
[dokku]: https://github.com/dokku
[dyson]: https://github.com/dyson
[F4-Group]: https://github.com/F4-Group
[fermuch]: https://github.com/fermuch
[fgrehm]: https://github.com/fgrehm
[Flink]: https://github.com/Flink
[gdi2290]: https://github.com/gdi2290
[heichblatt]: https://github.com/heichblatt
[hughfletcher]: https://github.com/hughfletcher
[ignlg]: https://github.com/ignlg
[iskandar]: https://github.com/iskandar
[jagandecapri]: https://github.com/jagandecapri
[jeffutter]: https://github.com/jeffutter
[jlachowski]: https://github.com/jlachowski
[krisrang]: https://github.com/krisrang
[Kloadut]: https://github.com/Kloadut
[krisrang]: https://github.com/krisrang
[luxifer]: https://github.com/luxifer
[mlebkowski]: https://github.com/mlebkowski
[Maciej Łebkowski]: https://github.com/mlebkowski
[matto1990]: https://github.com/matto1990
[mbriskar]: https://github.com/mbriskar
[michaelshobbs]: https://github.com/michaelshobbs
[mikecsh]: https://github.com/mikecsh
[mikexstudios]: https://github.com/mikexstudios
[mixxorz]: https://github.com/mixxorz
[mlebkowski]: https://github.com/mlebkowski
[motin]: https://github.com/motin
[musicglue]: https://github.com/musicglue
[neam]: https://github.com/neam
@@ -92,25 +105,19 @@ Note: The following plugins have been supplied by our community and may not have
[pauldub]: https://github.com/pauldub
[pnegahdar]: https://github.com/pnegahdar
[RaceHub]: https://github.com/racehub
[ribot]: https://github.com/ribot
[rlaneve]: https://github.com/rlaneve
[robv]: https://github.com/robv
[scottatron]: https://github.com/scottatron
[sehrope]: https://github.com/sehrope
[sekjun9878]: https://github.com/sekjun9878
[sgulseth]: https://github.com/sgulseth
[sseemayer]: https://github.com/sseemayer
[statianzo]: https://github.com/statianzo
[stuartpb]: https://github.com/stuartpb
[thrashr888]: https://github.com/thrashr888
[wmluke]: https://github.com/wmluke
[Zenedith]: https://github.com/Zenedith
[sekjun9878]: https://github.com/sekjun9878
[Flink]: https://github.com/Flink
[ribot]: https://github.com/ribot
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
[jagandecapri]: https://github.com/jagandecapri
[mixxorz]: https://github.com/mixxorz
[Maciej Łebkowski]: https://github.com/mlebkowski
[abossard]: https://github.com/dudagroup
[alexkruegger]: https://github.com/alexkruegger
[dokku]: https://github.com/dokku
### Datastores
@@ -137,8 +144,8 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | 0.3.x |
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | 0.3.x |
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | 0.3.x |
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | 0.3.x |
#### Other
@@ -160,22 +167,25 @@ Note: The following plugins have been supplied by our community and may not have
| [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | 0.3.x |
| [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | 0.3.x |
[c77cbf1]: https://github.com/progrium/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
[28de3ec]: https://github.com/progrium/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
[c77cbf1]: https://github.com/dokku/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
[28de3ec]: https://github.com/dokku/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
### Dokku Features
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [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)<sup>1</sup> | [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+ |
| [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ |
| [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+ |
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
| [Nuke Containers](https://github.com/heichblatt/dokku-nuke) | [heichblatt][] | |
| [Open App Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
@@ -184,7 +194,7 @@ Note: The following plugins have been supplied by our community and may not have
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 0.3.x |
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | 0.3.x |
[217d00a]: https://github.com/progrium/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
<sup>1</sup> On Heroku similar functionality is offered by the [heroku-labs pipeline feature](https://devcenter.heroku.com/articles/labs-pipelines), which allows you to promote builds across multiple environments (staging -> production)
@@ -203,16 +213,19 @@ Note: The following plugins have been supplied by our community and may not have
| [Bower/Grunt](https://github.com/thrashr888/dokku-bower-grunt-build-plugin) | [thrashr888][] | |
| [Bower/Gulp](https://github.com/gdi2290/dokku-bower-gulp-build-plugin) | [gdi2290][] | |
| [Bower/Gulp](https://github.com/jagandecapri/dokku-bower-gulp-build-plugin) | [jagandecapri][] | |
| [Docker auto persist volumes](https://github.com/Flink/dokku-docker-auto-volumes) | [Flink][] | 0.4.0+ |
| [Builders: bower, compass, gulp, grunt](https://github.com/ignlg/dokku-builders-plugin) | [ignlg][] | 0.4.0+ |
| [Docker auto persist volumes](https://github.com/Flink/dokku-docker-auto-volumes) | [Flink][] | 0.4.0+ |
| [HipChat Notifications](https://github.com/cef/dokku-hipchat) | [cef][] | |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski][] | |
| [Logspout](https://github.com/michaelshobbs/dokku-logspout) | [michaelshobbs][] | 0.3.26+ |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski] | <0.4.0 |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-grafana) | [jlachowski] | 0.4.0+, graphite & statsd plugin with grafana dashboard frontend |
| [Logspout](https://github.com/michaelshobbs/dokku-logspout) | [michaelshobbs][] | 0.3.26+ |
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | |
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | |
| [Reset mtime](https://github.com/mixxorz/dokku-docker-reset-mtime) | [mixxorz][] | 0.3.15+, Dockerfile support |
| [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][] | |
| [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains |
<sup>1</sup> 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.
@@ -224,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)<sup>1</sup> | [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)<sup>2</sup> | [cameron-martin][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>2</sup> | [musicglue][] | v0.3.9 (build-env plugin) |
| [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>2</sup> | [motin][] | v0.3.9 (build-env plugin) |
@@ -254,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)<sup>1</sup> | [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][] | |

View File

@@ -18,7 +18,7 @@ in order to avoid ssh interpretting dokku arguments for itself.
--quiet suppress output headers
--trace enable DOKKU_TRACE for current execution only
--rm|--rm-container remove docker container after successful dokku run <app> <command>
--force force flag. currently used in apps:destroy
--force force flag. currently used in apps:destroy and other ":destroy" commands
```
## Clients

View File

@@ -10,32 +10,31 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400:sans-serif|Open+Sans:400:sans-serif" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/progrium/dokku/v0.4.3/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/dokku/dokku/v0.4.9/docs/assets/style.css" rel="stylesheet">
<style>
</style>
</head>
<body>
@@ -44,7 +43,7 @@
<div class="row">
<div class="col-md-offset-2">
<h1 class="heading navbar-brand">
<a href="http://progrium.viewdocs.io/dokku/">Dokku</a>
<a href="http://dokku.viewdocs.io/dokku/">Dokku</a>
</h1>
</div>
</div>
@@ -67,6 +66,7 @@
<a href="#" class="list-group-item disabled">Deployment</a>
<a href="/dokku/application-deployment/" class="list-group-item">Deploying an Application</a>
<a href="/dokku/deployment/buildpacks/" class="list-group-item">Buildpack Deployment</a>
<a href="/dokku/deployment/dockerfiles/" class="list-group-item">Dockerfile Deployment</a>
<a href="/dokku/deployment/images/" class="list-group-item">Image Tagging</a>
<a href="/dokku/remote-commands/" class="list-group-item">Remote Commands</a>

View File

@@ -46,7 +46,7 @@ The `remote rejected` error does not give enough information. Anything could hav
To enable dokku tracing, simply run the following command:
# Since 0.3.9
dokku trace
dokku trace on
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following :
@@ -87,7 +87,7 @@ __Solution (Less solution, more helpful troubleshooting steps):__
root@dokku:~# resolvconf -u
```
Please see https://github.com/progrium/dokku/issues/841 and https://github.com/progrium/dokku/issues/649
Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649
***
@@ -105,7 +105,7 @@ You have to point ssh to the correct secret key for your domain name. Add the fo
Host DOKKU_HOSTNAME
IdentityFile "~/.ssh/KEYNAME"
Also see [issue #116](https://github.com/progrium/dokku/issues/116)
Also see [issue #116](https://github.com/dokku/dokku/issues/116)
***
@@ -119,7 +119,7 @@ When specifying your port you may want to use something similar to:
var port = process.env.PORT || 3000
Please see https://github.com/progrium/dokku/issues/282
Please see https://github.com/dokku/dokku/issues/282
***
@@ -138,14 +138,13 @@ If you see output similar this when deploying:
! tar: Error is not recoverable: exiting now
```
it might that the curl command that is supposed to fetch the buildpack (anything in the low megabyte file size range) takes too long to finish, due to slowish connection. To overwrite the default values (connection timeout: 3 seconds, total maximum time for operation: 30 seconds), edit `/home/dokku/ENV` like the following:
it might that the curl command that is supposed to fetch the buildpack (anything in the low megabyte file size range) takes too long to finish, due to slowish connection. To overwrite the default values (connection timeout: 3 seconds, total maximum time for operation: 30 seconds), set the following environment variables:
```
#/home/dokku/ENV
export CURL_TIMEOUT=600
export CURL_CONNECT_TIMEOUT=30
```shell
dokku config:set --global CURL_TIMEOUT=600
dokku config:set --global CURL_CONNECT_TIMEOUT=30
```
References
* https://github.com/progrium/dokku/issues/509
* https://github.com/dokku/dokku/issues/509
* https://github.com/dokku-alt/dokku-alt/issues/169

View File

@@ -1,6 +1,6 @@
# Upgrading
This document covers upgrades for the 0.3.0 series and up. If upgrading from older versions, we recommend [a fresh install](http://progrium.viewdocs.io/dokku/installation) on a new server.
This document covers upgrades for the 0.3.0 series and up. If upgrading from older versions, we recommend [a fresh install](http://dokku.viewdocs.io/dokku/installation) on a new server.
> As of 0.3.18, dokku is installed by default via a debian package. Source-based installations are still available, though not recommended.

35
dokku
View File

@@ -2,7 +2,15 @@
set -eo pipefail
shopt -s nullglob
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
case "$(lsb_release -si)" in
Debian)
export DOKKU_DISTRO=${DOKKU_DISTRO:="debian"}
;;
*)
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
;;
esac
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
@@ -41,9 +49,14 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
fi
! has_tty && DOKKU_QUIET_OUTPUT=1
if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" ]]; then
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]]; then
export SSH_USER=$(id -un)
sudo -u dokku -E -H $0 "$@"
exit
exit $?
fi
if [[ $(id -un) != "root" && $1 =~ plugin:.* ]]; then
dokku_log_fail "plugin:* commands must be run as root"
fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
@@ -52,11 +65,18 @@ if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
xargs $0 <<<$SSH_ORIGINAL_COMMAND
exit $?
else
set -f
$0 $SSH_ORIGINAL_COMMAND
set +f
exit $?
fi
fi
if ! dokku_auth "$@" ; then
dokku_log_fail "Access denied"
exit 1
fi
case "$1" in
receive)
APP="$2"; IMAGE=$(get_app_image_name $APP); IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4"
@@ -87,7 +107,8 @@ case "$1" in
DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
[[ "$line" =~ ^#.* ]] && continue
TRIM=${line%#*}
PROC_TYPE=${TRIM%%=*}
PROC_COUNT=${TRIM#*=}
@@ -120,7 +141,11 @@ case "$1" in
ipaddr=127.0.0.1
else
id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
ipaddr=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $id)
# Docker < 1.9 compatibility
if [[ -z $ipaddr ]]; then
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
fi
fi
else
id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD)

View File

@@ -23,7 +23,7 @@ case "$1" in
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
plugn trigger pre-build-buildpack "$APP"
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP)
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id
@@ -40,7 +40,7 @@ case "$1" in
plugn trigger pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP)
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE)
docker build $DOCKER_ARGS $DOKKU_DOCKER_BUILD_OPTS -t "$IMAGE" .
plugn trigger post-build-dockerfile "$APP"
@@ -106,11 +106,11 @@ case "$1" in
;;
ls)
dokku_apps=$(ls -d $DOKKU_ROOT/*/ 2>/dev/null) || (dokku_log_fail "You haven't deployed any applications yet")
installed_apps=$(dokku_apps)
dokku_col_log_info1_quiet "App Name" "Container Type" "Container Id" "Status"
for dokku_app in $dokku_apps; do
for dokku_app in $installed_apps; do
APP=$(basename $dokku_app)
DOKKU_APP_CIDS=$(get_app_container_ids $APP)
DOCKER_RUNNING_CONTAINERS=$(docker ps -q --no-trunc)
@@ -134,9 +134,13 @@ case "$1" in
shift 2
DOKKU_APP_RM_CONTAINER=$(dokku config:get $APP DOKKU_RM_CONTAINER || true)
DOKKU_GLOBAL_RM_CONTAINER=$(dokku config:get --global DOKKU_RM_CONTAINER || true)
DOKKU_RM_CONTAINER=${DOKKU_APP_RM_CONTAINER:="$DOKKU_GLOBAL_RM_CONTAINER"}
DOCKER_ARGS=$(: | plugn trigger docker-args-run $APP $IMAGE_TAG)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
[[ "$DOKKU_RM_CONTAINER" ]] && DOKKU_RUN_OPTS="--rm"
has_tty && DOKKU_RUN_OPTS+=" -i -t"
is_image_herokuish_based "$IMAGE" && EXEC_CMD="/exec"
@@ -167,9 +171,11 @@ case "$1" in
fi
if [[ "$(is_app_vhost_enabled $APP)" == "false" ]]; then
shopt -s nullglob
for PORT_FILE in $DOKKU_ROOT/$APP/PORT.*; do
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$(< "$PORT_FILE") (container)"
done
shopt -u nullglob
DOKKU_NGINX_PORT=$(config_get $APP DOKKU_NGINX_PORT || true)
DOKKU_NGINX_SSL_PORT=$(config_get $APP DOKKU_NGINX_SSL_PORT || true)
@@ -193,6 +199,7 @@ case "$1" in
cat<<EOF
ls, Pretty listing of deployed applications and containers
run <app> <cmd>, Run a command in the environment of an application
trace [on/off], Enable dokku tracing
url <app>, Show the first URL for an application (compatibility)
urls <app>, Show all URLs for an application
version, Print dokku's version

View File

@@ -9,24 +9,23 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi
# temporary hack for https://github.com/progrium/dokku/issues/82
# temporary hack for https://github.com/dokku/dokku/issues/82
# redeploys all apps after a reboot
case "$DOKKU_DISTRO" in
ubuntu)
cat<<EOF > /etc/init/dokku-redeploy.conf
if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
cat<<EOF > /etc/init/dokku-redeploy.conf
description "Dokku app redeploy service"
start on filesystem and started docker
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restartall
sudo -i -u dokku /usr/local/bin/dokku ps:restore
end script
EOF
;;
fi
opensuse)
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
if [[ $(systemctl 2> /dev/null) =~ -\.mount ]]; then
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
[Unit]
Description=Dokku app redeploy service
After=docker.target
@@ -34,15 +33,17 @@ After=docker.target
[Service]
Type=simple
User=dokku
ExecStart=/usr/local/bin/dokku ps:restartall
ExecStart=/usr/local/bin/dokku ps:restore
[Install]
WantedBy=multi-user.target
EOF
;;
esac
if command -v systemctl &>/dev/null; then
systemctl enable dokku-redeploy
fi
fi
mkdir -p /etc/update-motd.d
cat<<EOF > /etc/update-motd.d/99-dokku
#!/bin/sh

View File

@@ -7,7 +7,7 @@ case "$1" in
events)
if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then
if [[ $2 == "-t" ]]; then
tail -f $DOKKU_EVENTS_LOGFILE
tail -F $DOKKU_EVENTS_LOGFILE
else
tail -n 100 $DOKKU_EVENTS_LOGFILE
fi

View File

@@ -10,12 +10,26 @@ flag_rsyslog_needs_restart=n
# This can be done unconditionally as mkdir -p
# exits gracefully if the path already exists
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
chown syslog:dokku "$DOKKU_LOGS_DIR"
case "$DOKKU_DISTRO" in
debian)
chgrp dokku "$DOKKU_LOGS_DIR"
;;
*)
chown syslog:dokku "$DOKKU_LOGS_DIR"
;;
esac
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
touch "$DOKKU_EVENTS_LOGFILE"
# chown syslog:root might not work on SUSE
chown syslog:dokku "$DOKKU_EVENTS_LOGFILE"
case "$DOKKU_DISTRO" in
debian)
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
;;
*)
# chown syslog:root might not work on SUSE
chown syslog:dokku "$DOKKU_EVENTS_LOGFILE"
;;
esac
chmod 664 "$DOKKU_EVENTS_LOGFILE"
fi

View File

@@ -1,21 +1,35 @@
#!/usr/bin/env bash
[[ " apps apps:create apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
[[ " apps apps:create apps:rename apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
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)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -d "$DOKKU_ROOT/$2" ]] && dokku_log_fail "Name is already taken"
APP="$2"
apps_create $2
;;
mkdir -p "$DOKKU_ROOT/$APP"
echo "Creating $APP... done"
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"
OLD_APP="$2"
NEW_APP="$3"
mkdir -p "$DOKKU_ROOT/$NEW_APP"
docker run --rm -v "$DOKKU_ROOT/$OLD_APP/cache:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
rm -rf "$DOKKU_ROOT/$OLD_APP/cache"
cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP"
dokku apps:destroy $OLD_APP --force
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS"
sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST"
dokku ps:rebuild $NEW_APP
plugn trigger post-app-rename $OLD_APP $NEW_APP
echo "Renaming $OLD_APP to $NEW_APP... done"
;;
apps:destroy)
@@ -31,7 +45,7 @@ case "$1" in
dokku_log_warn "To proceed, type \"$APP\""
echo ""
read -p "> " app_name
read -rp "> " app_name
if [[ "$app_name" != "$APP" ]]; then
dokku_log_fail "Confirmation did not match $APP. Aborted."
fi
@@ -56,6 +70,7 @@ case "$1" in
apps, List your apps
apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app
apps:rename <old-app> <new-app>, Rename an app
EOF
;;

14
plugins/apps/functions Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
apps_create() {
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ ! "$1" =~ ^[a-z].* && ! "$1" =~ ^[0-9].* ]] && dokku_log_fail "App name must begin with lowercase alphanumeric character"
[[ -d "$DOKKU_ROOT/$1" ]] && dokku_log_fail "Name is already taken"
local APP="$1"
mkdir -p "$DOKKU_ROOT/$APP"
echo "Creating $APP... done"
plugn trigger post-create $APP
}

View File

@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; IMAGE_REPO=$(get_app_image_repo $APP)
[[ -n $APP ]] && rm -rf "$DOKKU_ROOT/$APP" > /dev/null
[[ -n $APP ]] && rm -rf "${DOKKU_ROOT:?}/$APP" > /dev/null
# remove all application containers & images
# shellcheck disable=SC2046

View File

@@ -72,7 +72,7 @@ case "$1" in
fi
# create all the app directories
while read app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
while read -r app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
# have the plugins import their stuff
plugn trigger backup-import $VERSION "$BACKUP_ROOT" $TARGET_DIR "$BACKUP_TMP_DIR/.dokku_backup_apps"

View File

@@ -11,11 +11,17 @@ is_tar_import() {
}
is_file_import() {
local CRT_FILE="$3"
local KEY_FILE="$4"
local CRT_FILE="$1"
local KEY_FILE="$2"
if [[ -f $CRT_FILE ]] && [[ -f $KEY_FILE ]]; then
return 0
if [[ $CRT_FILE ]] && [[ $KEY_FILE ]]; then
if [[ ! -f $CRT_FILE ]]; then
dokku_log_fail "CRT file specified not found, please check file paths"
elif [[ ! -f $KEY_FILE ]]; then
dokku_log_fail "KEY file specified not found, please check file paths"
else
return 0
fi
fi
return 1
@@ -24,7 +30,7 @@ is_file_import() {
certs_set() {
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2"
APP="$2"; CRT_FILE="$3"; KEY_FILE="$4"
local APP="$2"; local CRT_FILE="$3"; local KEY_FILE="$4"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
is_file_import $CRT_FILE $KEY_FILE || is_tar_import || dokku_log_fail "Tar archive containing server.crt and server.key expected on stdin"
@@ -54,9 +60,11 @@ certs_set() {
fi
fi
mkdir -p "$DOKKU_ROOT/$APP/tls"
mv "$CRT_FILE" "$DOKKU_ROOT/$APP/tls/server.crt"
mv "$KEY_FILE" "$DOKKU_ROOT/$APP/tls/server.key"
mkdir -p "$APP_SSL_PATH"
cp "$CRT_FILE" "$APP_SSL_PATH/server.crt"
cp "$KEY_FILE" "$APP_SSL_PATH/server.key"
chmod 750 $APP_SSL_PATH
chmod 640 $APP_SSL_PATH/server.crt $APP_SSL_PATH/server.key
cd $DOKKU_ROOT
rm -rf $TEMP_DIR
nginx_build_config $APP
@@ -70,9 +78,9 @@ case "$1" in
certs:generate)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2"
APP="$2"; DOMAIN="$3"; SSL_PATH="$DOKKU_ROOT/$APP/tls"
APP="$2"; DOMAIN="$3"; APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
if [[ ! -f "$SSL_PATH/server.key" ]] && [[ ! -f "$SSL_PATH/server.crt" ]]; then
if [[ ! -f "$APP_SSL_PATH/server.key" ]] && [[ ! -f "$APP_SSL_PATH/server.crt" ]]; then
TMP_WORK_DIR=$(mktemp -d -t "dokku_certs.XXXXXXXXX")
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' INT TERM EXIT
@@ -83,9 +91,11 @@ case "$1" in
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
mkdir -p "$DOKKU_ROOT/$APP/tls"
mkdir -p "$APP_SSL_PATH"
dokku_log_info1 "Installing certificate and key..."
mv -f $TMP_WORK_DIR/server.key $TMP_WORK_DIR/server.crt $SSL_PATH
mv -f $TMP_WORK_DIR/server.key $TMP_WORK_DIR/server.crt $APP_SSL_PATH
chmod 750 $APP_SSL_PATH
chmod 640 $APP_SSL_PATH/server.key $APP_SSL_PATH/server.crt
[[ -n "$DOMAIN" ]] && (dokku domains:add $APP $DOMAIN || nginx_build_config $APP)
dokku_log_info1 "The following is a certificate signing request that can be used"
dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN"
@@ -148,7 +158,7 @@ case "$1" in
rm -rf $APP_SSL_PATH
plugn trigger post-domains-update $APP
else
dokku_log_info1 "An app-specific SSL endpoint is not defined"
dokku_log_fail "An app-specific SSL endpoint is not defined"
fi
;;

View File

@@ -85,7 +85,7 @@ if [[ ! -s "${TMPDIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]];
exit 0
fi
dokku_log_verbose "For more efficient zero downtime deployments, create a file CHECKS."
dokku_log_verbose "See http://progrium.viewdocs.io/dokku/checks-examples.md for examples"
dokku_log_verbose "See http://dokku.viewdocs.io/dokku/checks-examples.md for examples"
dokku_log_verbose "CHECKS file not found in container: Running simple container check..."
rm -rf $TMPDIR
@@ -108,7 +108,7 @@ fi
# Reads name/value pairs, sets the WAIT and TIMEOUT variables
exec < "$FILENAME"
while read LINE; do
while read -r LINE; do
# Name/value pair
if [[ "$LINE" =~ ^.+= ]]; then
TRIM=${LINE%#*}
@@ -143,7 +143,7 @@ do
fi
exec < "$FILENAME"
while read CHECK_URL EXPECTED; do
while read -r CHECK_URL EXPECTED; do
# Ignore empty lines and lines starting with #
# shellcheck disable=SC1001
[[ -z "$CHECK_URL" || "$CHECK_URL" =~ ^\# ]] && continue

View File

@@ -9,17 +9,22 @@ has_tty() {
fi
}
dokku_apps() {
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
}
dokku_log_info1() {
echo "-----> $@"
echo "-----> $*"
}
dokku_log_info2() {
echo "=====> $@"
echo "=====> $*"
}
dokku_log_info1_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
echo "-----> $@"
echo "-----> $*"
else
return 0
fi
@@ -27,31 +32,31 @@ dokku_log_info1_quiet() {
dokku_log_info2_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
echo "=====> $@"
echo "=====> $*"
else
return 0
fi
}
dokku_col_log_info1() {
printf "%-25s %-25s %-25s %-25s\n" "-----> $@"
printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@"
}
dokku_col_log_info1_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
printf "%-25s %-25s %-25s %-25s\n" "-----> $@"
printf "%-6s %-18s %-25s %-25s %-25s\n" "----->" "$@"
else
return 0
fi
}
dokku_col_log_info2() {
printf "%-25s %-25s %-25s %-25s\n" "=====> $@"
printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@"
}
dokku_col_log_info2_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
printf "%-25s %-25s %-25s %-25s\n" "=====> $@"
printf "%-6s %-18s %-25s %-25s %-25s\n" "=====>" "$@"
else
return 0
fi
@@ -71,18 +76,18 @@ dokku_col_log_msg_quiet() {
dokku_log_verbose_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
echo " $@"
echo " $*"
else
return 0
fi
}
dokku_log_verbose() {
echo " $@"
echo " $*"
}
dokku_log_warn() {
echo " ! $@"
echo " ! $*"
}
dokku_log_fail() {
@@ -98,7 +103,7 @@ dokku_log_plugn_trigger_call() {
local l_hook
l_hook="$1" ; shift
dokku_log_event "INVOKED: ${l_hook}( $@ ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
}
dokku_container_log_verbose_quiet() {
@@ -116,6 +121,10 @@ dokku_container_log_verbose_quiet() {
verify_app_name() {
local APP="$1"
[[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null"
if [[ ! "$APP" =~ ^[a-z].* && ! "$APP" =~ ^[0-9].* ]]; then
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "$DOKKU_ROOT/$APP"
dokku_log_fail "App name must begin with lowercase alphanumeric character"
fi
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
return 0
@@ -311,12 +320,23 @@ release_and_deploy() {
IMAGE_SOURCE_TYPE="dockerfile"
fi
DOKKU_APP_SKIP_DEPLOY="$(dokku config:get $APP DOKKU_SKIP_DEPLOY || true)"
DOKKU_GLOBAL_SKIP_DEPLOY="$(dokku config:get --global DOKKU_SKIP_DEPLOY || true)"
DOKKU_SKIP_DEPLOY=${DOKKU_APP_SKIP_DEPLOY:="$DOKKU_GLOBAL_SKIP_DEPLOY"}
dokku_log_info1 "Releasing $APP ($IMAGE)..."
dokku release "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG"
dokku_log_info1 "Deploying $APP ($IMAGE)..."
dokku deploy "$APP" "$IMAGE_TAG"
dokku_log_info2 "Application deployed:"
dokku urls $APP | sed "s/^/ /"
if [[ "$DOKKU_SKIP_DEPLOY" != "true" ]]; then
dokku_log_info1 "Deploying $APP ($IMAGE)..."
dokku deploy "$APP" "$IMAGE_TAG"
dokku_log_info2 "Application deployed:"
dokku urls $APP | sed "s/^/ /"
else
dokku_log_info1 "Skipping deployment"
fi
echo
fi
}
@@ -346,3 +366,47 @@ get_available_port() {
fi
done
}
dokku_auth() {
export SSH_USER=${SSH_USER:=$USER}
export SSH_NAME=${NAME:="default"}
if ! plugn trigger user-auth $SSH_USER $SSH_NAME "$@" ; then
return 1
fi
return 0
}
_ipv4_regex() {
echo "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
}
_ipv6_regex() {
local RE_IPV4="$(_ipv4_regex)"
local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7::
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index)
RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
echo "$RE_IPV6"
}
get_ipv4_regex() {
local RE_IPV4="$(_ipv4_regex)"
# Ensure the ip address continues to the end of the line
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
echo "${RE_IPV4}\$"
}
get_ipv6_regex() {
local RE_IPV6="$(_ipv4_regex)"
# Ensure the ip address continues to the end of the line
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
echo "${RE_IPV6}\$"
}

View File

@@ -1,4 +1,3 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
@@ -188,6 +187,7 @@ ${var}"
config_styled_hash "$ENV_ADD" " "
config_write "$ENV_TEMP"
plugn trigger post-config-update $APP "set" "$@"
fi
if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then
@@ -219,6 +219,8 @@ config_unset() {
[[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true
done
plugn trigger post-config-update $APP "unset" "$@"
if [[ "$DOKKU_CONFIG_RESTART" == "true" ]]; then
dokku_log_info1 "Restarting app $APP"
dokku ps:restart $APP

View File

@@ -28,7 +28,7 @@ verify_phase() {
return 0
fi
done
dokku_log_fail "Phase(s) must be one of [${phases[@]}]"
dokku_log_fail "Phase(s) must be one of [${phases[*]}]"
}
get_phase_file_path() {
@@ -141,10 +141,10 @@ case "$1" in
# Display usage help
help | docker-options:help)
cat<<EOF
docker-options <app>, Display apps docker options for all phases
docker-options <app> <phase(s)>, Display apps docker options for phase (comma separated phase list)
docker-options:add <app> <phase(s)> OPTION, Add docker option to app for phase (comma separated phase list)
docker-options:remove <app> <phase(s)> OPTION, Remove docker option from app for phase (comma separated phase list)
docker-options <app>, Display app's Docker options for all phases
docker-options <app> <phase(s)>, Display app's Docker options for phase (comma separated phase list)
docker-options:add <app> <phase(s)> OPTION, Add Docker option to app for phase (comma separated phase list)
docker-options:remove <app> <phase(s)> OPTION, Remove Docker option from app for phase (comma separated phase list)
EOF
;;

View File

@@ -2,7 +2,7 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
STDIN=$(cat)
APP="$1"
APP="$1"; IMAGE_SOURCE_TYPE="$2"
case "$0" in
*docker-args-build)
@@ -24,7 +24,7 @@ output=""
if [[ -f "$PHASE_FILE_PATH" ]]; then
DONE=false
until $DONE; do
read line || DONE=true
read -r line || DONE=true
[[ ! -n "$line" ]] && continue
@@ -34,7 +34,35 @@ if [[ -f "$PHASE_FILE_PATH" ]]; then
continue
;;
*)
output="$output $line"
case "$IMAGE_SOURCE_TYPE" in
dockerfile)
case "$line" in
--link*|-v*)
continue
;;
*)
output="$output $line"
;;
esac
;;
herokuish)
case "$line" in
--file*|--build-args*)
continue
;;
*)
output="$output $line"
;;
esac
;;
*)
output="$output $line"
;;
esac
;;
esac
done < $PHASE_FILE_PATH

View File

@@ -65,7 +65,7 @@ case "$1" in
exit 1
fi
if [[ $(egrep ^"$3"$ "$DOKKU_ROOT/$APP/VHOST" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
if [[ $(egrep -w "^{$3}$" "$DOKKU_ROOT/$APP/VHOST" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
echo "$3 is already defined for $APP"
exit 1
fi
@@ -75,9 +75,7 @@ case "$1" in
for DOMAIN in "$@"; do
echo "$DOMAIN" >> "$DOKKU_ROOT/$APP/VHOST"
done
# we need to restart the app to make sure we're binding to the appropriate network interface
nginx_build_config $APP
plugn trigger post-domains-update $APP
plugn trigger post-domains-update $APP "add" "$@"
for DOMAIN in "$@"; do
dokku_log_info1 "Added $DOMAIN to $APP"
done
@@ -91,7 +89,7 @@ case "$1" in
rm -f "$DOKKU_ROOT/$APP/VHOST"
dokku domains:setup $APP
plugn trigger post-domains-update $APP
plugn trigger post-domains-update $APP "clear"
dokku_log_info1 "Cleared domains in $APP"
;;
@@ -112,7 +110,7 @@ case "$1" in
for DOMAIN in "$@"; do
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
done
plugn trigger post-domains-update $APP
plugn trigger post-domains-update $APP "remove" "$@"
for DOMAIN in "$@"; do
dokku_log_info1 "Removed $DOMAIN from $APP"
done

View File

@@ -34,7 +34,7 @@ case "$1" in
help | enter:help)
cat && cat<<EOF
enter <app> [<container-type> || --container-id <container-id>], Connect to a specific app container
enter <app> [<container-type> || --container-id <container-id>], Connect to a specific app container
EOF
;;

View File

@@ -6,7 +6,7 @@ IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$4"
while read APP; do
while read -r APP; do
APP_PATH="$TARGET_DIR/$APP";
git init --bare $APP_PATH > /dev/null
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
git_build_app_repo() {
verify_app_name "$1"
@@ -10,21 +11,31 @@ git_build_app_repo() {
TMP_WORK_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_WORK_DIR" > /dev/null' RETURN
# git clone
# git clone - this method creates a new git repository and adds the primary
# repo as a remote, then does a fetch depth=1 to avoid cloning
# the entire repo
TMP_TAG="dokku/$REV"
chmod 755 $TMP_WORK_DIR
unset GIT_DIR GIT_WORK_TREE
pushd $TMP_WORK_DIR > /dev/null
git clone -q "$DOKKU_ROOT/$APP" "$TMP_WORK_DIR" &> /dev/null
[[ ! -d "$DOKKU_ROOT/$APP" ]] && apps_create $APP
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
GIT_DIR="$DOKKU_ROOT/$APP" git tag "$TMP_TAG" "$REV" &> /dev/null
git init &> /dev/null
git config advice.detachedHead false
git checkout "$REV" &> /dev/null
git remote add origin "$DOKKU_ROOT/$APP" &> /dev/null
git fetch --depth=1 origin "refs/tags/$TMP_TAG" &> /dev/null
git reset --hard FETCH_HEAD &> /dev/null
git submodule update --init --recursive &> /dev/null
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
find -name .git -prune -exec rm -rf {} \; > /dev/null
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then
plugn trigger pre-receive-app "$APP" "dockerfile" "$TMP_WORK_DIR"
plugn trigger pre-receive-app "$APP" "dockerfile" "$TMP_WORK_DIR" "$REV"
dokku receive "$APP" "dockerfile" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/"
else
plugn trigger pre-receive-app "$APP" "herokuish" "$TMP_WORK_DIR"
plugn trigger pre-receive-app "$APP" "herokuish" "$TMP_WORK_DIR" "$REV"
dokku receive "$APP" "herokuish" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/"
fi
}
@@ -33,7 +44,7 @@ case "$1" in
git-hook)
APP=$2
while read oldrev newrev refname; do
while read -r oldrev newrev refname; do
# Only run this script for the master branch. You can remove this
# if block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]]; then

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname "$0")/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
case "$1" in
logs)
@@ -11,34 +11,63 @@ case "$1" in
APP_ROOT="$DOKKU_ROOT/$APP"
COLORS=(36 33 32 35 31)
if (is_deployed "$APP"); then
CONTAINERS=("$APP_ROOT"/CONTAINER.*)
if [[ $3 == "-t" ]]; then
DOKKU_LOGS_ARGS="--follow --tail 100"
else
DOKKU_LOGS_ARGS="--tail 100"
fi
((MAX_INDEX=${#CONTAINERS[*]} - 1)) || true
for i in ${!CONTAINERS[*]}; do
DYNO=$(echo "${CONTAINERS[i]}" | sed -r 's/.*CONTAINER\.(.*)/\1/')
CID=$(< "${CONTAINERS[i]}")
COLOR=${COLORS[i % ${#COLORS[*]}]}
DOKKU_LOGS_CMD+="(docker logs -t $DOKKU_LOGS_ARGS $CID 2>&1 | sed -r 's/^([^Z]+Z )/\x1b[${COLOR}m\1$APP[$DYNO]:\x1b[0m /gm')"
if [[ $i != "$MAX_INDEX" ]]; then
DOKKU_LOGS_CMD+="& "
else
DOKKU_LOGS_CMD+="; "
fi
done
bash -c "($DOKKU_LOGS_CMD)"
else
if ! (is_deployed "$APP"); then
echo "Application's container not found"
exit 1
fi
shift 2;
TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@")
if [[ $? != 0 ]]; then usage >&2 ; exit 1 ; fi
eval set -- "$TEMP"
DOKKU_LOGS_LINE_NUMBERS="100"
while true; do
case "$1" in
-t|--tail) DOKKU_LOGS_ARGS+="--follow "; shift ;;
-n|--num) DOKKU_LOGS_LINE_NUMBERS="$2"; shift 2 ;;
-p|--ps) DOKKU_LOGS_ONLY_PROCESS="$2"; shift 2 ;;
-q|--quiet) DOKKU_LOGS_NO_PRETTY_PRINT="true"; shift ;;
--) shift; break ;;
*) echo "Internal error"; exit 1;;
esac
done
if [[ -n $DOKKU_LOGS_ONLY_PROCESS ]]; then
CONTAINERS=("$APP_ROOT/CONTAINER.$DOKKU_LOGS_ONLY_PROCESS".*)
else
CONTAINERS=("$APP_ROOT"/CONTAINER.*)
fi
[[ -z $(stat -t "${CONTAINERS[0]}" 2>/dev/null) ]] && exit 0
DOKKU_LOGS_ARGS+="--tail $DOKKU_LOGS_LINE_NUMBERS"
((MAX_INDEX=${#CONTAINERS[*]} - 1)) || true
for i in ${!CONTAINERS[*]}; do
DYNO=$(echo "${CONTAINERS[i]}" | sed -r 's/.*CONTAINER\.(.*)/\1/')
CID=$(< "${CONTAINERS[i]}")
COLOR=${COLORS[i % ${#COLORS[*]}]}
if [[ $DOKKU_LOGS_NO_PRETTY_PRINT == "true" ]]; then
DOKKU_LOGS_CMD+="(docker logs $DOKKU_LOGS_ARGS $CID 2>&1)"
else
DOKKU_LOGS_PRETTY_PRINT_CMD="sed -r 's/^([^Z]+Z )/\x1b[${COLOR}m\1app[$DYNO]:\x1b[0m /gm'"
DOKKU_LOGS_CMD+="(docker logs -t $DOKKU_LOGS_ARGS $CID 2>&1 | $DOKKU_LOGS_PRETTY_PRINT_CMD)"
fi
if [[ $i != "$MAX_INDEX" ]]; then
DOKKU_LOGS_CMD+="& "
else
DOKKU_LOGS_CMD+="; "
fi
done
bash -c "($DOKKU_LOGS_CMD)"
;;
logs:help)
usage
;;
help)
cat<<EOF
logs <app> [-t], Show the last logs for an application (-t follows)
logs <app> [-h] [-t] [-n num] [-q] [-p process], Show the last logs for an application
EOF
;;

12
plugins/logs/functions Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
usage() {
echo "Usage: dokku logs <app>"
echo " display recent log output"
echo ""
echo " -n, --num NUM # the number of lines to display"
echo " -p, --ps PS # only display logs from the given process"
echo " -t, --tail # continually stream logs"
echo " -q, --quiet # display raw logs without colors, time and names"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core named containers plugin"
version = "0.4.0"
version = "0.4.0.1"
[plugin.config]

View File

@@ -6,7 +6,7 @@ APP="$1"; APP_ROOT="$DOKKU_ROOT/$APP"
for container in "$APP_ROOT"/CONTAINER.*; do
DYNO=$(echo "$container" | sed -r 's/.*CONTAINER\.(.*)/\1/') || true
NAME="$APP.$DYNO"
PREVIOUS=$(docker ps -a -q -f name="$NAME") || true
PREVIOUS=$(docker ps -a -q -f name="^.?$NAME\$") || true
if [[ -n $PREVIOUS ]]; then
docker rename "$NAME" "$NAME.$(date +%s)" > /dev/null
fi

View File

@@ -66,8 +66,8 @@ case "$1" in
nginx:build-config <app>, (Re)builds nginx config for given app
nginx:access-logs <app> [-t], Show the nginx access logs for an application (-t follows)
nginx:error-logs <app> [-t], Show the nginx error logs for an application (-t follows)
nginx:disable <app>, disable nginx for an application (forces container binding to external interface)
nginx:enable <app>, enable nginx for an application
nginx:disable <app>, Disable nginx for an application (forces container binding to external interface)
nginx:enable <app>, Enable nginx for an application
EOF
;;

View File

@@ -2,10 +2,21 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
export DEBIAN_FRONTEND=noninteractive
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils
;;
ubuntu)
export DEBIAN_FRONTEND=noninteractive
[[ -z "$CIRCLECI" ]] && apt-get install -qq -y software-properties-common python-software-properties
[[ -n "$CIRCLECI" ]] && aptitude install -q -y software-properties-common python-software-properties
ubuntu_year=$(lsb_release -d | cut -d ' ' -f 2 | awk '{split($0,a,"."); print a[1]}')
ubuntu_month=$(lsb_release -d | cut -d ' ' -f 2 | awk '{split($0,a,"."); print a[2]}')
[[ "$ubuntu_year" -ge "16" ]] && exit 0
[[ "$ubuntu_year" -eq "15" ]] && [[ "$ubuntu_month" -eq "10" ]] && exit 0
add-apt-repository -y ppa:nginx/stable
apt-get update -qq > /dev/null
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils

View File

@@ -5,41 +5,6 @@ source "$PLUGIN_AVAILABLE_PATH/certs/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
_ipv4_regex() {
echo "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
}
_ipv6_regex() {
local RE_IPV4="$(_ipv4_regex)"
local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7::
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index)
RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
echo "$RE_IPV6"
}
get_ipv4_regex() {
local RE_IPV4="$(_ipv4_regex)"
# Ensure the ip address continues to the end of the line
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
echo "${RE_IPV4}\$"
}
get_ipv6_regex() {
local RE_IPV6="$(_ipv4_regex)"
# Ensure the ip address continues to the end of the line
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
echo "${RE_IPV6}\$"
}
is_app_nginx_enabled() {
local APP="$1"
verify_app_name "$APP"
@@ -114,6 +79,10 @@ validate_nginx() {
restart_nginx() {
case "$DOKKU_DISTRO" in
debian)
sudo /usr/sbin/invoke-rc.d nginx reload > /dev/null
;;
ubuntu)
sudo /etc/init.d/nginx reload > /dev/null
;;
@@ -141,7 +110,7 @@ nginx_build_config() {
if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -z "$DOKKU_APP_LISTEN_IP" ]]; then
shopt -s nullglob
for DOKKU_APP_IP_FILE in $DOKKU_ROOT/$APP/IP.web.*; do
DOKKU_APP_PORT_FILE=$(echo $DOKKU_APP_IP_FILE | sed -e "s:IP:PORT:g")
DOKKU_APP_PORT_FILE="${DOKKU_APP_IP_FILE//IP/PORT}"
DOKKU_APP_LISTENER_IP=$(< $DOKKU_APP_IP_FILE)
DOKKU_APP_LISTENER_PORT=$(< $DOKKU_APP_PORT_FILE)
@@ -153,7 +122,9 @@ nginx_build_config() {
fi
DOKKU_APP_CIDS=($(get_app_container_ids $APP))
docker cp "${DOKKU_APP_CIDS[0]}:/app/nginx.conf.template" "$DOKKU_ROOT/$APP/" 2> /dev/null || true
for file in nginx.conf.template nginx.ssl.conf.template; do
docker cp "${DOKKU_APP_CIDS[0]}:/app/${file}" "$DOKKU_ROOT/$APP/" 2> /dev/null || true
done
[[ -f "$APP_NGINX_TEMPLATE" ]] && NGINX_TEMPLATE="$APP_NGINX_TEMPLATE" && NGINX_CUSTOM_TEMPLATE="true" && dokku_log_info1 'Overriding default nginx.conf with detected nginx.conf.template'
@@ -229,9 +200,9 @@ EOF
local NGINX_SSL_PORT=$DOKKU_NGINX_SSL_PORT
fi
while read line; do
while read -r line; do
[[ -z "$line" ]] && continue
dokku_log_info1 "Configuring SSL for $line..."
dokku_log_info1 "Configuring SSL for $line...(using $NGINX_SSL_TEMPLATE)"
SSL_SERVER_NAME=$line
NOSSL_SERVER_NAME=$line
eval "cat <<< \"$(< $NGINX_SSL_TEMPLATE)\" >> $NGINX_CONF"
@@ -246,10 +217,11 @@ EOF
if [[ -n "$NONSSL_VHOSTS" ]]; then
NOSSL_SERVER_NAME=$(echo $NONSSL_VHOSTS | tr '\n' ' ')
xargs -i echo "-----> Configuring {}..." <<< "$NONSSL_VHOSTS"
xargs -i echo "-----> Configuring {}...(using $NGINX_TEMPLATE)" <<< "$NONSSL_VHOSTS"
eval "cat <<< \"$(< $NGINX_TEMPLATE)\" >> $NGINX_CONF"
fi
if [[ "$(is_app_vhost_enabled $APP)" == "false" ]] || ([[ -z "$NONSSL_VHOSTS" ]] && [[ -z "$SSL_VHOSTS" ]]); then
eval "cat <<< \"$(< $NGINX_TEMPLATE)\" >> $NGINX_CONF"
sed --in-place -n -e '/^.*server_name.*$/!p' $NGINX_CONF
fi

View File

@@ -2,6 +2,10 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
echo "%dokku ALL=(ALL) NOPASSWD:/usr/sbin/invoke-rc.d nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
ubuntu)
echo "%dokku ALL=(ALL) NOPASSWD:/etc/init.d/nginx reload, /usr/sbin/nginx -t" > /etc/sudoers.d/dokku-nginx
;;
@@ -32,15 +36,20 @@ fi
echo 'server_names_hash_bucket_size 512;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
# make sure dokku can read the default log dir
gpasswd -M "$(egrep ^adm /etc/group | awk -F ":" '{ print $4 }')" dokku
chgrp -R dokku /var/log/nginx
chmod g+r /var/log/nginx
# revert dokku group changes
gpasswd -a dokku adm
chgrp -R adm /var/log/nginx
gpasswd -M "" dokku
[[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/create 0640 www-data dokku/create 0640 www-data adm/g' /etc/logrotate.d/nginx
# patch broken nginx 1.8.0 logrotate
[[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/invoke-rc.d/service/g' /etc/logrotate.d/nginx
case "$DOKKU_DISTRO" in
debian)
/usr/sbin/invoke-rc.d nginx start
;;
ubuntu)
/etc/init.d/nginx start
;;

View File

@@ -2,6 +2,10 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$DOKKU_DISTRO" in
debian)
sudo /usr/sbin/invoke-rc.d nginx reload > /dev/null
;;
ubuntu)
sudo /etc/init.d/nginx reload > /dev/null
;;

View File

@@ -15,7 +15,7 @@ case "$1" in
[[ "$#" -gt 2 ]] && dokku_log_info1_quiet "Cannot install additional core plugins, running core plugin install trigger"
PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install
;;
https:*|git:*)
https:*|git:*|ssh:*)
PLUGIN_GIT_URL="$2"
download_and_enable_plugin "$PLUGIN_GIT_URL" "$3"
plugn trigger install

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
[[ " ps ps:start ps:stop ps:rebuild ps:rebuildall ps:restart ps:restartall ps:scale help ps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
[[ " ps ps:start ps:stop ps:rebuild ps:rebuildall ps:restart ps:restartall ps:restore ps:scale help ps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
@@ -41,6 +41,7 @@ case "$1" in
if [[ -n "$DOKKU_APP_RUNNING_CONTAINER_IDS" ]]; then
echo "Stopping $APP ..."
docker stop $DOKKU_APP_RUNNING_CONTAINER_IDS > /dev/null || true
plugn trigger post-stop $APP
else
echo "App $APP already stopped"
fi
@@ -55,10 +56,8 @@ case "$1" in
ps:rebuildall)
shopt -s nullglob
for app in $DOKKU_ROOT/*; do
[[ ! -d $app ]] && continue
APP=$(basename $app)
is_deployed $APP && dokku ps:rebuild $APP
for app in $(dokku_apps); do
is_deployed $app && dokku ps:rebuild $app
done
shopt -u nullglob
;;
@@ -75,14 +74,24 @@ case "$1" in
ps:restartall)
shopt -s nullglob
for app in $DOKKU_ROOT/*; do
[[ ! -d $app ]] && continue
APP=$(basename $app)
dokku ps:restart $APP
for app in $(dokku_apps); do
dokku ps:restart $app
done
shopt -u nullglob
;;
ps:restore)
shopt -s nullglob
for app in $(dokku_apps); do
DOKKU_APP_RESTORE=$(dokku config:get $app DOKKU_APP_RESTORE || true)
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
echo "Restoring app $app ..."
dokku ps:start $app
fi
done
shopt -u nullglob
;;
ps:scale)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; IMAGE_TAG=$(get_running_image_tag $APP)
@@ -96,7 +105,7 @@ case "$1" in
dokku_log_info1_quiet "Scaling for $APP"
dokku_col_log_info1_quiet "proctype" "qty"
dokku_col_log_info1_quiet "--------" "---"
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue
PROC_NAME=${line%%=*}
PROC_COUNT=${line#*=}
@@ -118,6 +127,7 @@ case "$1" in
ps:rebuildall, Rebuild all apps
ps:restart <app>, Restart app container(s)
ps:restartall, Restart all deployed app containers
ps:restore, Start previously running apps e.g. after reboot
EOF
;;

View File

@@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
print_dokku_scale_file() {
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
while read line || [[ -n "$line" ]]; do
while read -r line || [[ -n "$line" ]]; do
dokku_log_info2_quiet "$line"
done < "$DOKKU_SCALE_FILE"
}
@@ -25,17 +25,17 @@ generate_scale_file() {
if [[ ! -e "$PROCFILE" ]]; then
echo "web=1" >> $DOKKU_SCALE_FILE
else
while read line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue
while read -r line || [[ -n "$line" ]]; do
[[ "$line" =~ ^#.* ]] && continue
NAME=${line%%:*}
NUM_PROCS=0
[[ "$NAME" == "web" ]] && NUM_PROCS=1
echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE
[[ -n "$NAME" ]] && echo "$NAME=$NUM_PROCS" >> $DOKKU_SCALE_FILE
done < "$PROCFILE"
fi
dokku_log_info1_quiet "New DOKKU_SCALE file generated"
else
dokku_log_info1_quiet "DOKKU_SCALE file found"
dokku_log_info1_quiet "DOKKU_SCALE file found ($DOKKU_SCALE_FILE)"
fi
print_dokku_scale_file $APP
}

8
plugins/ps/post-deploy Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
APP="$1"
dokku config:set --no-restart $APP DOKKU_APP_RESTORE=1

8
plugins/ps/post-stop Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
APP="$1"
dokku config:set --no-restart $APP DOKKU_APP_RESTORE=0

View File

@@ -18,7 +18,7 @@ case "$1" in
while true; do
trap '' SIGINT
read -ep "dokku> " line || {
read -rep "dokku> " line || {
echo; true; break
}
trap - SIGINT

View File

@@ -1,10 +1,12 @@
SYSTEM := $(shell sh -c 'uname -s 2>/dev/null')
shellcheck:
ifeq ($(shell shellcheck > /dev/null 2>&1 ; echo $$?),127)
ifeq ($(shell uname),Darwin)
brew install shellcheck
ifneq ($(shell shellcheck --version > /dev/null 2>&1 ; echo $$?),0)
ifeq ($(SYSTEM),Darwin)
brew install shellcheck
else
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse'
sudo apt-get update && sudo apt-get install -y shellcheck
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse'
sudo apt-get update && sudo apt-get install -y shellcheck
endif
endif
@@ -53,19 +55,23 @@ ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),)
endif
bats:
ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0)
ifeq ($(SYSTEM),Darwin)
brew install bats
else
git clone https://github.com/sstephenson/bats.git /tmp/bats
cd /tmp/bats && sudo ./install.sh /usr/local
rm -rf /tmp/bats
endif
endif
lint:
# these are disabled due to their expansive existence in the codebase. we should clean it up though
# SC2034: VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034
# SC2086: Double quote to prevent globbing and word splitting - https://github.com/koalaman/shellcheck/wiki/SC2086
# SC2143: Instead of [ -n $(foo | grep bar) ], use foo | grep -q bar - https://github.com/koalaman/shellcheck/wiki/SC2143
# SC2001: See if you can use ${variable//search/replace} instead. - https://github.com/koalaman/shellcheck/wiki/SC2001
@echo linting...
@$(QUIET) shellcheck -e SC2029 ./contrib/dokku_client.sh
@$(QUIET) find . -not -path '*/\.*' | xargs file | egrep "shell|bash" | egrep -v "directory|toml" | awk '{ print $$1 }' | sed 's/://g' | grep -v dokku_client.sh | xargs shellcheck -e SC2034,SC2086,SC2143,SC2001
@$(QUIET) shellcheck ./contrib/dokku_client.sh
@$(QUIET) find . -not -path '*/\.*' | xargs file | egrep "shell|bash" | egrep -v "directory|toml" | awk '{ print $$1 }' | sed 's/://g' | grep -v dokku_client.sh | xargs shellcheck -e SC2034,SC2086
unit-tests:
@echo running unit tests...

View File

@@ -1 +1,2 @@
#!/usr/bin/env bash
set -e; sleep 5; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"

View File

@@ -1,3 +1,52 @@
###############################
# DEVELOPMENT #
###############################
# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job)
cron: node worker.js
web: node web.js
worker: node worker.js
# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec rails server
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run
###############################
# PRODUCTION #
###############################
# You need to copy or link config/unicorn.rb.example to config/unicorn.rb for both production versions.
# Have a look at the deployment guides, if you want to set up huginn on your server:
# https://github.com/cantino/huginn/doc
# Using the threaded worker (consumes less RAM but can run slower)
# web: bundle exec unicorn -c config/unicorn.rb
# jobs: bundle exec rails runner bin/threaded.rb
# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec unicorn -c config/unicorn.rb
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run
###############################
# Multiple DelayedJob workers #
###############################
# Per default Huginn can just run one agent at a time. Using a lot of agents or calling slow
# external services frequently might require more DelayedJob workers (an indicator for this is
# a backlog in your 'Job Management' page).
# Every uncommented line starts an additional DelayedJob worker. This works for development, production
# and for the threaded and separate worker processes. Keep in mind one worker needs about 300MB of RAM.
#
#dj2: bundle exec script/delayed_job -i 2 run
#dj3: bundle exec script/delayed_job -i 3 run
#dj4: bundle exec script/delayed_job -i 4 run
#dj5: bundle exec script/delayed_job -i 5 run
#dj6: bundle exec script/delayed_job -i 6 run
#dj7: bundle exec script/delayed_job -i 7 run
#dj8: bundle exec script/delayed_job -i 8 run
#dj9: bundle exec script/delayed_job -i 9 run
#dj10: bundle exec script/delayed_job -i 10 run

View File

@@ -1 +1 @@
export BUILDPACK_URL=https://github.com/yabawock/buildpack-nginx
export BUILDPACK_URL=https://github.com/dokku/buildpack-nginx

View File

@@ -4,6 +4,7 @@ set -eo pipefail
MODE="$1"; MODE=${MODE:="testing"}
# shellcheck disable=SC2120
setup_circle() {
echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E CI=true make -e sshcommand
@@ -21,36 +22,39 @@ setup_circle() {
}
if [[ -n "$CIRCLE_NODE_INDEX" ]] && [[ "$MODE" == "setup" ]]; then
case "$CIRCLE_NODE_INDEX" in
3)
setup_circle buildstack
exit $?
;;
*)
setup_circle
exit $?
;;
esac
# shellcheck disable=SC2119
setup_circle
exit $?
# case "$CIRCLE_NODE_INDEX" in
# 3)
# setup_circle buildstack
# exit $?
# ;;
# *)
# setup_circle
# exit $?
# ;;
# esac
fi
case "$CIRCLE_NODE_INDEX" in
0)
echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
echo "=====> make unit-tests (1/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
;;
1)
echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
echo "=====> make unit-tests (2/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
;;
2)
echo "=====> make deploy-tests (herokuish release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E make -e deploy-tests
echo "=====> make unit-tests (3/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=3 make -e unit-tests
;;
3)
echo "=====> make deploy-tests (herokuish master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E make -e deploy-tests
echo "=====> make unit-tests (4/4) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E UNIT_TEST_BATCH=4 make -e unit-tests
;;
esac

View File

@@ -22,6 +22,6 @@ exec /usr/local/bin/gitreceived -p 2022 -n /root/.ssh/id_rsa /tmp/receiver
EOF
cat<<EOF > /etc/rc.local
curl https://raw.githubusercontent.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver
curl https://raw.githubusercontent.com/dokku/dokku/master/tests/ci/receiver -s > /tmp/receiver
chmod +x /tmp/receiver
EOF

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
is_number() {
local NUMBER=$1; local NUM_RE='^[0-9]+$'
local NUMBER=$1; local NUM_RE='^[1-4]+$'
if [[ $NUMBER =~ $NUM_RE ]]; then
return 0
else
@@ -10,28 +10,13 @@ is_number() {
}
usage() {
echo "usage: $0 1|2"
echo "usage: $0 1|2|3|4"
exit 0
}
BATCH_NUM="$1"
is_number $BATCH_NUM || usage
TESTS=($(find "$(dirname $0)"/../unit -maxdepth 1 -name "*.bats"))
HALF_TESTS=$(( ${#TESTS[@]} / 2 ))
FIRST_HALF=("${TESTS[@]:0:${HALF_TESTS}}")
LAST_HALF=("${TESTS[@]:${HALF_TESTS}:${#TESTS[@]}}")
case "$BATCH_NUM" in
1)
bats "${FIRST_HALF[@]}"
;;
2)
bats "${LAST_HALF[@]}"
;;
*)
usage
;;
esac
TESTS=$(find "$(dirname $0)"/../unit -maxdepth 1 -name "${BATCH_NUM}0*.bats" | sort -n | xargs)
echo "running the following tests $TESTS"
bats $TESTS

59
tests/unit/10_apps.bats Normal file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bats
load test_helper
@test "(apps) apps" {
create_app
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output $TEST_APP
destroy_app
}
@test "(apps) apps:create" {
run dokku apps:create $TEST_APP
echo "output: "$output
echo "status: "$status
assert_success
destroy_app
run dokku apps:create 1994testapp
echo "output: "$output
echo "status: "$status
assert_success
dokku --force apps:destroy 1994testapp
run dokku apps:create TestApp
echo "output: "$output
echo "status: "$status
assert_failure
}
@test "(apps) apps:destroy" {
create_app
run bash -c "dokku --force apps:destroy $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(apps) apps:rename" {
deploy_app
run bash -c "dokku apps:rename $TEST_APP great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output ""
run bash -c "curl --silent --write-out '%{http_code}\n' `dokku url great-test-name` | grep 404"
echo "output: "$output
echo "status: "$status
assert_output ""
run bash -c "dokku --force apps:destroy great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
}

53
tests/unit/10_certs.bats Normal file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env bats
load test_helper
setup_local_tls() {
TLS=$BATS_TMPDIR/tls
mkdir -p $TLS
tar xf $BATS_TEST_DIRNAME/server_ssl.tar -C $TLS
sudo chown -R dokku:dokku $TLS
}
teardown_local_tls() {
TLS=$BATS_TMPDIR/tls
rm -R $TLS
}
setup() {
create_app
setup_local_tls
}
teardown() {
destroy_app
teardown_local_tls
}
@test "(certs) certs:add" {
run bash -c "dokku certs:add $TEST_APP $BATS_TMPDIR/tls/server.crt $BATS_TMPDIR/tls/server.key"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(certs) certs:add < tar" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(certs) certs:info" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(certs) certs:remove" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:remove $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
}

70
tests/unit/10_core_1.bats Normal file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bats
load test_helper
setup() {
create_app
}
teardown() {
rm -rf /home/dokku/$TEST_APP/tls /home/dokku/tls
destroy_app
disable_tls_wildcard
}
assert_urls() {
urls=$@
run dokku urls $TEST_APP
echo "output: "$output
echo "status: "$status
assert_output < <(tr ' ' '\n' <<< "${urls}")
}
build_nginx_config() {
# simulate nginx post-deploy
dokku domains:setup $TEST_APP
dokku nginx:build-config $TEST_APP
}
@test "(core) remove exited containers" {
deploy_app
# make sure we have many exited containers of the same 'type'
run bash -c "for cnt in 1 2 3; do dokku run $TEST_APP hostname; done"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_success
run dokku cleanup
echo "output: "$output
echo "status: "$status
assert_success
sleep 5 # wait for dokku cleanup to happen in the background
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
echo "output: "$output
echo "status: "$status
assert_failure
run bash -c "docker ps -a -f 'status=exited' -q --no-trunc=false"
echo "output: "$output
echo "status: "$status
assert_output ""
}
@test "(core) run (with tty)" {
deploy_app
run /bin/bash -c "dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(core) run (without tty)" {
deploy_app
run /bin/bash -c ": |dokku run $TEST_APP ls /app/package.json"
echo "output: "$output
echo "status: "$status
assert_success
}

Some files were not shown because too many files have changed in this diff Show More