Compare commits
354 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c35a024d39 | ||
|
|
a02f32e985 | ||
|
|
9164740117 | ||
|
|
371ba99540 | ||
|
|
6ad65dd9b4 | ||
|
|
72a58bbda3 | ||
|
|
30d660335f | ||
|
|
d891e2214a | ||
|
|
1c02ef9674 | ||
|
|
b48464a7e2 | ||
|
|
5fb30ab934 | ||
|
|
89df6eeded | ||
|
|
2a4caf95b4 | ||
|
|
edfb2ab990 | ||
|
|
bf7b44f215 | ||
|
|
955f95e899 | ||
|
|
14bff0679f | ||
|
|
2dad1afa57 | ||
|
|
e8118d1af8 | ||
|
|
9b6322e96b | ||
|
|
1b22f69b9e | ||
|
|
be8e4ab014 | ||
|
|
ce89c021ab | ||
|
|
c96d139f54 | ||
|
|
ef369eb02f | ||
|
|
9f985077c7 | ||
|
|
2a756ff3a4 | ||
|
|
4ad0c3022e | ||
|
|
013eafd8df | ||
|
|
d871d2f292 | ||
|
|
c5f0639267 | ||
|
|
f99915b682 | ||
|
|
a1acc5e1fd | ||
|
|
d8c564d926 | ||
|
|
55892d7743 | ||
|
|
3e100e3002 | ||
|
|
40d1f22d74 | ||
|
|
b81a6c398d | ||
|
|
b8851a66cf | ||
|
|
2ff2ca55c1 | ||
|
|
fb3492c824 | ||
|
|
32f47d31b2 | ||
|
|
fbc96d92b5 | ||
|
|
666f2d7434 | ||
|
|
d7830fa730 | ||
|
|
00babb5ff5 | ||
|
|
161111aab5 | ||
|
|
cb39110904 | ||
|
|
c7bd7119b8 | ||
|
|
fda3a08c83 | ||
|
|
55c2b0fd62 | ||
|
|
e35493e248 | ||
|
|
ca9443669f | ||
|
|
dc64759a97 | ||
|
|
45120c5e43 | ||
|
|
7f99fcb844 | ||
|
|
d8fa69c5f4 | ||
|
|
1eb01db8f9 | ||
|
|
aec4543b61 | ||
|
|
3e05a8c8ac | ||
|
|
0af71abe12 | ||
|
|
34895630fd | ||
|
|
cd65704c5e | ||
|
|
f293e9026d | ||
|
|
8f21a38160 | ||
|
|
077c6a1b89 | ||
|
|
3d49dbb1a7 | ||
|
|
4656e80ab8 | ||
|
|
87b7a74cf0 | ||
|
|
20bb7caef4 | ||
|
|
d9026a9974 | ||
|
|
2b9a31f06d | ||
|
|
3fdc1d20b6 | ||
|
|
0fcc541e4f | ||
|
|
8fba61e212 | ||
|
|
9c68bda9b4 | ||
|
|
9e396a1b42 | ||
|
|
92610f347f | ||
|
|
b6767f8efc | ||
|
|
8c8745ca4c | ||
|
|
992ac973cc | ||
|
|
7d9adaffc3 | ||
|
|
78238785ba | ||
|
|
6e7c887d5f | ||
|
|
6b80d1e0f2 | ||
|
|
19871fe81d | ||
|
|
514d66f40d | ||
|
|
22088f5d82 | ||
|
|
59baadef06 | ||
|
|
cb6213adee | ||
|
|
40e628778b | ||
|
|
6cd89fa72a | ||
|
|
2d96bd2939 | ||
|
|
cbba084cb8 | ||
|
|
31c6444dae | ||
|
|
d6ad9f0e85 | ||
|
|
e760e1cc92 | ||
|
|
9490889411 | ||
|
|
17d78856e0 | ||
|
|
376e1d3411 | ||
|
|
a0c5c4576e | ||
|
|
61e154899b | ||
|
|
c0028f122b | ||
|
|
22fd0aa7f0 | ||
|
|
08bcebbd17 | ||
|
|
78967eedd7 | ||
|
|
cc4fda235c | ||
|
|
d6c369cfdf | ||
|
|
55129cb9f6 | ||
|
|
2e220da491 | ||
|
|
e0c49ec724 | ||
|
|
938a16de53 | ||
|
|
80d13c0005 | ||
|
|
d1f358c6fb | ||
|
|
f5f7b8dd7e | ||
|
|
795da11d24 | ||
|
|
c63be44989 | ||
|
|
17271b6132 | ||
|
|
82b700d635 | ||
|
|
da465a61dd | ||
|
|
875da5211f | ||
|
|
fc8e8484c6 | ||
|
|
7ebdcaa2e5 | ||
|
|
8e5c8c0832 | ||
|
|
4abccf0119 | ||
|
|
dd9ef4866c | ||
|
|
8502881633 | ||
|
|
43e9e6ddb6 | ||
|
|
471a5fa087 | ||
|
|
f95ad79fc4 | ||
|
|
896ce50c93 | ||
|
|
cbbc63d0f8 | ||
|
|
1f73b58340 | ||
|
|
881a700e99 | ||
|
|
9d81dda524 | ||
|
|
566cc15081 | ||
|
|
f1827a86a4 | ||
|
|
fc1762156d | ||
|
|
343ee24c46 | ||
|
|
441d212ef2 | ||
|
|
bc072e1db3 | ||
|
|
ab7f9f1161 | ||
|
|
e95d1e8602 | ||
|
|
948d7902f2 | ||
|
|
8535900f9d | ||
|
|
152b060901 | ||
|
|
464ef4d879 | ||
|
|
156e987300 | ||
|
|
8abb9ec408 | ||
|
|
97734cc242 | ||
|
|
93a01fb763 | ||
|
|
2a51301a5d | ||
|
|
1d6d5755d4 | ||
|
|
6fed503024 | ||
|
|
95914d1c13 | ||
|
|
92c18fa664 | ||
|
|
7bd5df0e25 | ||
|
|
9b5abeac4d | ||
|
|
de09260c33 | ||
|
|
7cf28ee01f | ||
|
|
e04b90c416 | ||
|
|
5e1b5b2900 | ||
|
|
416dac6d2b | ||
|
|
9a04104bb9 | ||
|
|
43fe6edb04 | ||
|
|
3a850fa05e | ||
|
|
097bdecfac | ||
|
|
1d4cc0b991 | ||
|
|
3e62b1acce | ||
|
|
c2911c94a8 | ||
|
|
f5a5f7702b | ||
|
|
5f2a5fe2bc | ||
|
|
50208862b2 | ||
|
|
283432f214 | ||
|
|
d1e94f6c91 | ||
|
|
dbb6560b1e | ||
|
|
f3535292b3 | ||
|
|
568902302b | ||
|
|
cddcf997e1 | ||
|
|
f2bd2b8541 | ||
|
|
6bb01404ec | ||
|
|
e8b4bd5a89 | ||
|
|
2695d957ac | ||
|
|
051b286a62 | ||
|
|
67b7fa6263 | ||
|
|
c697c65508 | ||
|
|
85f9bb3aae | ||
|
|
c5c0ae00ba | ||
|
|
0dec01c324 | ||
|
|
3827e38caa | ||
|
|
14a7cac686 | ||
|
|
9322200eae | ||
|
|
ee32b05a36 | ||
|
|
3b41d6d16f | ||
|
|
8aef43b3ae | ||
|
|
e45455b73f | ||
|
|
356acdd08d | ||
|
|
f9b7d5378d | ||
|
|
58d0bc983a | ||
|
|
81aefba305 | ||
|
|
8f5c5d5ae2 | ||
|
|
8025657a38 | ||
|
|
779808f832 | ||
|
|
d3e18d3362 | ||
|
|
606bbda66c | ||
|
|
3706392e65 | ||
|
|
ab7c313411 | ||
|
|
f797ff77f4 | ||
|
|
c2736c7c7a | ||
|
|
af671b2aba | ||
|
|
45b2f87b15 | ||
|
|
3d6727a1b8 | ||
|
|
bf4781a5d7 | ||
|
|
2d48d81d09 | ||
|
|
294b419da5 | ||
|
|
f1bfb3ed3a | ||
|
|
56472bd08c | ||
|
|
e99e2201cb | ||
|
|
5bf1ba7ed7 | ||
|
|
5d014d0a8e | ||
|
|
59f047bb45 | ||
|
|
1b208778f3 | ||
|
|
a6cdae5abf | ||
|
|
50115d3640 | ||
|
|
78d3921a6f | ||
|
|
23d4224beb | ||
|
|
4e0670f1ac | ||
|
|
0bd8d71bb9 | ||
|
|
12ee9bc3e7 | ||
|
|
a991c450be | ||
|
|
a900aa45d6 | ||
|
|
3c8b3cedea | ||
|
|
2464bc0458 | ||
|
|
dec8056ef5 | ||
|
|
784e2cfd5e | ||
|
|
b9b9d6303a | ||
|
|
39912ce5db | ||
|
|
7d8ec62a86 | ||
|
|
8cd4863126 | ||
|
|
7c8feb9e0d | ||
|
|
d6ef5e3447 | ||
|
|
498e250e2e | ||
|
|
7d5e0ba5aa | ||
|
|
a7b8eb5581 | ||
|
|
79788e5690 | ||
|
|
ae61ef3f1e | ||
|
|
1d45ca0cdd | ||
|
|
b4c864bea7 | ||
|
|
01e7f1cdb6 | ||
|
|
0865ff3f79 | ||
|
|
11b126a845 | ||
|
|
605ba27eeb | ||
|
|
8109c9c569 | ||
|
|
9111902542 | ||
|
|
4955f9c600 | ||
|
|
976dc3009c | ||
|
|
0b4b2b29a8 | ||
|
|
e84526490e | ||
|
|
66171551d8 | ||
|
|
f23809e75f | ||
|
|
b967514c55 | ||
|
|
a6c34ddd6f | ||
|
|
8f0e794893 | ||
|
|
68a1d1af38 | ||
|
|
eeff3d52eb | ||
|
|
8aa196c660 | ||
|
|
d9d66c58ab | ||
|
|
155f4e9aba | ||
|
|
1bfbdb449b | ||
|
|
b3ca3368e8 | ||
|
|
04921d6876 | ||
|
|
a915b8888f | ||
|
|
129a5fd33d | ||
|
|
e567ce1a90 | ||
|
|
489f131ffc | ||
|
|
45ec8df7be | ||
|
|
469d1e3f49 | ||
|
|
7ca2f49d78 | ||
|
|
69176d2d9a | ||
|
|
ad030b21d4 | ||
|
|
8c8f5e17f1 | ||
|
|
e0b994c415 | ||
|
|
a12b1e2b56 | ||
|
|
590c5fc017 | ||
|
|
ee5c35dd9d | ||
|
|
42a1363996 | ||
|
|
4ae8cf8180 | ||
|
|
aef3a68d2b | ||
|
|
6ddc7275dd | ||
|
|
58ca13e838 | ||
|
|
7c2f21fd2a | ||
|
|
887637fb6b | ||
|
|
c706344a94 | ||
|
|
a1bbc1ec4d | ||
|
|
793f1b6058 | ||
|
|
20977fc2a2 | ||
|
|
6cad7ef8f4 | ||
|
|
407436b4cc | ||
|
|
04dbe31919 | ||
|
|
56185fc1c2 | ||
|
|
303bd77226 | ||
|
|
c6e39c08f0 | ||
|
|
12194e2cc8 | ||
|
|
a3b3a6a12a | ||
|
|
c6f80bcf55 | ||
|
|
4d8c7033a9 | ||
|
|
d2547c4233 | ||
|
|
4fa567dbe3 | ||
|
|
463f725872 | ||
|
|
aa1c7f6fa4 | ||
|
|
5f6f73ff22 | ||
|
|
ad497191df | ||
|
|
53c58ec8b9 | ||
|
|
9eab9ed1e1 | ||
|
|
3faa37b2e1 | ||
|
|
fd55e8d41b | ||
|
|
303bc18265 | ||
|
|
2141435ce1 | ||
|
|
03e5248256 | ||
|
|
d307a5b8ec | ||
|
|
1e5a904747 | ||
|
|
a46582225a | ||
|
|
8bc3d372ec | ||
|
|
14b1743c2a | ||
|
|
2d776292c3 | ||
|
|
f0fe32a9c6 | ||
|
|
c4f5b3e219 | ||
|
|
e7219c0346 | ||
|
|
842ae10b74 | ||
|
|
cfc7c41e47 | ||
|
|
c7af391c06 | ||
|
|
4754f241f2 | ||
|
|
fd1678b576 | ||
|
|
7f730d0697 | ||
|
|
69f360864f | ||
|
|
16fd7ebc6b | ||
|
|
19609f7078 | ||
|
|
a24c1bcc92 | ||
|
|
47811f60f4 | ||
|
|
ab01206351 | ||
|
|
fd0bafa7d9 | ||
|
|
ac84ef68cc | ||
|
|
5caf2ab6e3 | ||
|
|
11bff42180 | ||
|
|
bf4876107d | ||
|
|
2ec17a4033 | ||
|
|
d36249f51a | ||
|
|
b011e54dca | ||
|
|
b68a8da2ce | ||
|
|
a421dbf063 | ||
|
|
09df79cd8b | ||
|
|
9c0667c51a | ||
|
|
5fcba7e288 | ||
|
|
939a876348 |
@@ -4,3 +4,13 @@ root = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.mk]
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
.vagrant
|
||||
.DS_Store
|
||||
stack.tgz
|
||||
build
|
||||
tmp
|
||||
*.deb
|
||||
|
||||
2
AUTHORS
2
AUTHORS
@@ -4,6 +4,7 @@
|
||||
Alexander <iam.asm89@gmail.com>
|
||||
Alexander Beletsky <alexander.beletsky@gmail.com>
|
||||
Alexis Gavoty <kload@kload.fr>
|
||||
Christian Joudrey <cmallette@gmail.com>
|
||||
Felipe Coury <felipe.coury@gmail.com>
|
||||
Jeff Lindsay <progrium@gmail.com>
|
||||
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
@@ -11,6 +12,7 @@ Leo Unbekandt <leo@unbekandt.eu>
|
||||
Ludovic Perrine <jazzzz@gmail.com>
|
||||
Luigi Maselli <grigio.org@gmail.com>
|
||||
Martin Weiss <kornnflake@gmail.com>
|
||||
Michael Hobbs <github@psudo.net>
|
||||
Paul Lietar <paul@lietar.net>
|
||||
Rajiv Makhijani <rajiv@blue-tech.org>
|
||||
rhy-jot <rhy-jot@myeml.net>
|
||||
|
||||
135
HISTORY.md
135
HISTORY.md
@@ -1,5 +1,140 @@
|
||||
# History
|
||||
|
||||
## 0.3.14
|
||||
|
||||
- #891: @josegonzalez Keep existing configuration files when installing nginx. Refs #886
|
||||
- #892: @josegonzalez Change documentation on where the ssh config PORT is setup
|
||||
- #894: @josegonzalez Dokku client improvements
|
||||
- #895: @michaelhobbs Document deploying private git submodules. Closes #644
|
||||
- #896: @michaelhobbs Add docker-args pluginhook call to build phase. Closes #515
|
||||
- #897: @michaelhobbs Official PS plugin
|
||||
- #898: @joliv Update man page for 0.3.13
|
||||
- #899: @joliv Use help2man to automatically generate man pages
|
||||
- #900: @michaelhobbs Support extracting SANs from SSL certificates and adding them to nginx config
|
||||
- #901: @misto Pull new tags when upgrading to update VERSION
|
||||
- #904: @michaelhobbs Prevent error on restartall when no apps deployed
|
||||
- #905: @vincentfretin robv/dokku-elasticsearch not compatible with latest version
|
||||
- #907: @vincentfretin Don't use -o pipefail for plugin
|
||||
- #914: @michaelhobbs Conditionally set interactive and tty on dokku run. Closes #552. Closes #913
|
||||
- #915: @michaelhobbs Document default sites in nginx. Closes #650
|
||||
- #916: @michaelhobbs Document build phase troubleshooting suggestions. Closes #841. Closes #911.
|
||||
- #917: @michaelhobbs Document resolvconf troubleshooting step. Closes #649
|
||||
- #922: @michaelhobbs Use tty cmd to detect if we have one. Closes #921
|
||||
- #925: @michaelhobbs Implement rebuild command that reuses git_archive_all
|
||||
- #926: @dyson Update Troubleshooting link in README.md.
|
||||
- #927: @michaelhobbs Support both docker-args PHASE and docker-args-PHASE. Closes #906
|
||||
- #933: @michaelhobbs Remove references to .pem. Closes #930
|
||||
- #936: @michaelhobbs Only execute build stack if we have access to /var/run/docker.sock. Closes #929
|
||||
- #938: @vincentfretin Enable ssl_prefer_server_ciphers
|
||||
- #940: @michaelhobbs Use valid composer json with specified php runtime
|
||||
- #941: @michaelhobbs Source global env prior to app env. Closes #931
|
||||
- #942: @michaelhobbs Test clojure app
|
||||
- #949: @michaelhobbs Common functions library with simple argument parsing. Closes #932. Closes #945
|
||||
|
||||
## 0.3.13
|
||||
|
||||
- #815: @abossard Added wordpress installation helper to plugin index
|
||||
- #858: @josegonzalez Disable server tokens in nginx. Closes #857
|
||||
- #859: @josegonzalez Pass command being executed when retrieving DOCKER_ARGS via pluginhook.
|
||||
- #861: @josegonzalez Default DOKKU_ROOT to ~dokku if unspecified. Closes #587
|
||||
- #863: @josegonzalez Add missing properties to the php composer.json
|
||||
- #864: @michaelhobbs bind docker container to internal port if using vhosts
|
||||
- #867: @michaelhobbs silent grep stderr. closes #862
|
||||
- #868: @michaelhobbs use circleci for automated testing
|
||||
- #872: @michaelhobbs fix/enable multi buildpack test
|
||||
- #873: @michaelhobbs support pre deployment usage of domains plugin. fixes interface binding issue
|
||||
- #874: @josegonzalez Add advanced installation docs that were removed in #706. Closes #869
|
||||
- #876: @vincentfretin give CACHE_PATH env variable for forward compatibility with herokuish
|
||||
- #877: @michaelhobbs add MH to AUTHORS
|
||||
- #880: @michaelhobbs disable VHOST deployment if global VHOST file is missing and an app domain has not been added
|
||||
- #881: @jomo troubleshooting typo: 64 != 46
|
||||
- #884: @michaelhobbs IP and PORT are likely to get clobbered. rename them
|
||||
- #885: @michaelhobbs test deploy node app without procfile
|
||||
|
||||
## 0.3.12
|
||||
|
||||
- #846: @michaelhobbs add certificate CN to app VHOST if it's not already
|
||||
- #847: @leonardodino Update bootstrap.sh: new docs url
|
||||
- #849: @cjoudrey Add docs for CHECKS
|
||||
- #850: @michaelhobbs test scala deployment
|
||||
|
||||
## 0.3.11
|
||||
|
||||
- #821: @michaelhobbs use wercker for automated testing
|
||||
- #833: @michaelhobbs auto remove the cache dir cleanup container
|
||||
- #835: @michaelhobbs make sure we match the specific string in VHOST
|
||||
- #838: @michaelhobbs quote build_env vars to allow for spaces in config
|
||||
- #839: @michaelhobbs notify irc on builds
|
||||
- #844: @michaelhobbs build app urls based on wildcard ssl or app ssl
|
||||
|
||||
## 0.3.10
|
||||
|
||||
- #783: @josegonzalez New domains plugin and nginx extension
|
||||
- #818: @michaelhobbs rebuild nginx config on domain change
|
||||
- #827: @michaelhobbs Handle IP only access
|
||||
- #828: @michaelhobbs Display the port for an app when falling back to the ip address
|
||||
|
||||
## 0.3.9
|
||||
|
||||
- #787: @josegonzalez/@michaelhobbs Official user-env-compile plugin
|
||||
- Uses ENV and APP/ENV files
|
||||
- Supports old `BUILD_ENV` files (which are likely in wide-use)
|
||||
- Allows user's to override globals with app-specific configuration
|
||||
- Migrate `$DOKKU_ROOT/BUILD_ENV` to `$DOKKU_ROOT/ENV` if the former exists and the latter does not
|
||||
- Drop `BUILD_ENV` support in favor of just `ENV` via a `mv` command
|
||||
- Add default ENV with `CURL_TIMEOUT` and `CURL_CONNECT_TIMEOUT`
|
||||
- #811: @abossard Increased `server_names_hash_bucket_size` in nginx.conf to 512
|
||||
- #814: @josegonzalez Source files in $DOKKU_ROOT/.dokkurc directory and add `dokku trace` command
|
||||
- #816: @josegonzalez Add documentation for user-env feature
|
||||
|
||||
## 0.3.8
|
||||
|
||||
- #796: @josegonzalez Better vagrant documentation
|
||||
- #801: @joelvh Point users to upgrade guides
|
||||
- #805: @ademuk Fixed import-ssl server.crt/key check
|
||||
- #806: @josegonzalez Dokku pushes now happen as the dokku user, not git. Refs #796
|
||||
- #807: @josegonzalez Write proper nginx conf upon installation. Closes #799
|
||||
- #808: @josegonzalez Ensure makefiles are properly formatted
|
||||
|
||||
## 0.3.7
|
||||
|
||||
- #788: @mmerickel fix apps plugin issues in 0.3.6
|
||||
- #789: @mmerickel do not output message when creating ENV file
|
||||
|
||||
## 0.3.6
|
||||
|
||||
- #782: @josegonzalez Simplified config checking
|
||||
- #785: @lsde fix missing semicolon in nginx config
|
||||
|
||||
## 0.3.5
|
||||
|
||||
- #784: @josegonzalez Fix NO_VHOST check
|
||||
|
||||
## 0.3.4
|
||||
|
||||
- #780: @josegonzalez Output error message when a command is not found. Closes #778
|
||||
- #781: @michaelhobbs use DOKKU_IMAGE (i.e. progrium/buildstep)
|
||||
|
||||
## 0.3.3
|
||||
|
||||
- #659: @Xe contrib: add dokku client shell script
|
||||
- #669 @ohardy Handle dokku plugins-update command
|
||||
- #722: @wrboyce Add `git pull` support with git-pre-pull and git-post-pull hooks
|
||||
- #751: @tboerger Partial openSUSE support
|
||||
- #776: @joliv Update man page for new commands
|
||||
- #777: @tboerger Use PLUGINS_PATH env var and persist environment when running dokku with sudo
|
||||
- #779: @josegonzalez Minor bash formatting changes
|
||||
|
||||
## 0.3.2
|
||||
|
||||
- #675: @michaelhobbs port wait-to-retire from broadly/dokku
|
||||
- #765: @josegonzalez Ignore tls directory when listing apps
|
||||
- #766: @josegonzalez Sort output of apps command
|
||||
- #771: @josegonzalez Doc updates
|
||||
- #518 #772: @nickl- Import ssl certificates
|
||||
- #773: @alex-sherwin Support a way to not create nginx vhost
|
||||
- #774: @josegonzalez Add the ability to customize an app's hostname using nginx-hostname pluginhook
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- 647b2157: @josegonzalez Update HISTORY.md for 0.3.0
|
||||
|
||||
49
Makefile
49
Makefile
@@ -3,8 +3,8 @@ DOKKU_VERSION = master
|
||||
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
|
||||
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
|
||||
STACK_URL ?= https://github.com/progrium/buildstep.git
|
||||
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
|
||||
DOKKU_ROOT ?= /home/dokku
|
||||
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-12-16/2014-12-16_42bd9f4aab.tar.gz
|
||||
PLUGINS_PATH ?= /var/lib/dokku/plugins
|
||||
|
||||
# If the first argument is "vagrant-dokku"...
|
||||
ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
|
||||
@@ -16,28 +16,44 @@ endif
|
||||
|
||||
.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
|
||||
|
||||
include tests.mk
|
||||
include deb.mk
|
||||
|
||||
all:
|
||||
# Type "make install" to install.
|
||||
|
||||
install: dependencies stack copyfiles plugin-dependencies plugins version
|
||||
|
||||
copyfiles: addman
|
||||
release: deb-all package_cloud packer
|
||||
|
||||
package_cloud:
|
||||
package_cloud push dokku/dokku/ubuntu/trusty buildstep*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty pluginhook*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb
|
||||
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
|
||||
|
||||
packer:
|
||||
packer build contrib/packer.json
|
||||
|
||||
copyfiles:
|
||||
cp dokku /usr/local/bin/dokku
|
||||
mkdir -p /var/lib/dokku/plugins
|
||||
find /var/lib/dokku/plugins -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
|
||||
mkdir -p ${PLUGINS_PATH}
|
||||
find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
|
||||
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
|
||||
rm -Rf /var/lib/dokku/plugins/$$plugin && \
|
||||
cp -R plugins/$$plugin /var/lib/dokku/plugins && \
|
||||
touch /var/lib/dokku/plugins/$$plugin/.core; \
|
||||
done
|
||||
rm -Rf ${PLUGINS_PATH}/$$plugin && \
|
||||
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
|
||||
touch ${PLUGINS_PATH}/$$plugin/.core; \
|
||||
done
|
||||
$(MAKE) addman
|
||||
|
||||
addman:
|
||||
mkdir -p /usr/local/share/man/man1
|
||||
cp dokku.1 /usr/local/share/man/man1/dokku.1
|
||||
help2man -Nh help -v version -n "configure and get information from your dokku installation" -o /usr/local/share/man/man1/dokku.1 dokku
|
||||
mandb
|
||||
|
||||
version:
|
||||
git describe --tags > ${DOKKU_ROOT}/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ${DOKKU_ROOT}/VERSION
|
||||
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
|
||||
|
||||
plugin-dependencies: pluginhook
|
||||
dokku plugins-install-dependencies
|
||||
@@ -45,7 +61,10 @@ plugin-dependencies: pluginhook
|
||||
plugins: pluginhook docker
|
||||
dokku plugins-install
|
||||
|
||||
dependencies: sshcommand pluginhook docker stack
|
||||
dependencies: sshcommand pluginhook docker stack help2man
|
||||
|
||||
help2man:
|
||||
apt-get install -qq -y help2man
|
||||
|
||||
sshcommand:
|
||||
wget -qO /usr/local/bin/sshcommand ${SSHCOMMAND_URL}
|
||||
@@ -71,15 +90,19 @@ endif
|
||||
sleep 2 # give docker a moment i guess
|
||||
|
||||
aufs:
|
||||
ifndef CI
|
||||
lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null
|
||||
endif
|
||||
|
||||
stack:
|
||||
ifeq ($(shell test -e /var/run/docker.sock && touch -a -c /var/run/docker.sock && echo $$?),0)
|
||||
@echo "Start building buildstep"
|
||||
ifdef BUILD_STACK
|
||||
@docker images | grep progrium/buildstep || (git clone ${STACK_URL} /tmp/buildstep && docker build -t progrium/buildstep /tmp/buildstep && rm -rf /tmp/buildstep)
|
||||
else
|
||||
@docker images | grep progrium/buildstep || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep
|
||||
endif
|
||||
endif
|
||||
|
||||
count:
|
||||
@echo "Core lines:"
|
||||
@@ -90,6 +113,7 @@ count:
|
||||
@find tests -type f | xargs cat | wc -l
|
||||
|
||||
dokku-installer:
|
||||
apt-get install -qq -y ruby
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install rack -v 1.5.2 --no-rdoc --no-ri
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install rack-protection -v 1.5.3 --no-rdoc --no-ri
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install sinatra -v 1.4.5 --no-rdoc --no-ri
|
||||
@@ -104,3 +128,4 @@ vagrant-acl-add:
|
||||
|
||||
vagrant-dokku:
|
||||
vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
# Dokku [](https://travis-ci.org/progrium/dokku)
|
||||
# Dokku [](https://circleci.com/gh/progrium/dokku/tree/master) [](https://packagecloud.io/dokku/dokku)
|
||||
|
||||
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/).
|
||||
|
||||
@@ -10,7 +10,11 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
|
||||
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.1/bootstrap.sh | sudo DOKKU_TAG=v0.3.1 bash
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.14/bootstrap.sh | sudo DOKKU_TAG=v0.3.14 bash
|
||||
|
||||
### Upgrading
|
||||
|
||||
[View the docs for upgrading](http://progrium.viewdocs.io/dokku/upgrading) from an older version of Dokku.
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -18,7 +22,7 @@ Full documentation - including advanced installation docs - are available online
|
||||
|
||||
## Support
|
||||
|
||||
You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Troubleshooting](https://github.com/progrium/dokku/wiki/Troubleshooting) on the wiki, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku)
|
||||
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)
|
||||
|
||||
## Sponsors
|
||||
|
||||
|
||||
35
Vagrantfile
vendored
35
Vagrantfile
vendored
@@ -3,10 +3,11 @@
|
||||
|
||||
BOX_NAME = ENV["BOX_NAME"] || "trusty"
|
||||
BOX_URI = ENV["BOX_URI"] || "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
|
||||
BOX_MEMORY = ENV["BOX_MEMORY"] || "512"
|
||||
BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
|
||||
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
|
||||
DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2"
|
||||
PREBUILT_STACK_URL = File.exist?("#{File.dirname(__FILE__)}/stack.tgz") ? 'file:///root/dokku/stack.tgz' : nil
|
||||
PUBLIC_KEY_PATH = "#{Dir.home}/.ssh/id_rsa.pub"
|
||||
|
||||
make_cmd = "make install"
|
||||
if PREBUILT_STACK_URL
|
||||
@@ -14,12 +15,11 @@ if PREBUILT_STACK_URL
|
||||
end
|
||||
|
||||
Vagrant::configure("2") do |config|
|
||||
config.ssh.forward_agent = true
|
||||
|
||||
config.vm.box = BOX_NAME
|
||||
config.vm.box_url = BOX_URI
|
||||
config.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
|
||||
config.vm.network :forwarded_port, guest: 80, host: 8080
|
||||
config.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
config.vm.network :private_network, ip: DOKKU_IP
|
||||
|
||||
config.vm.provider :virtualbox do |vb|
|
||||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
@@ -29,6 +29,29 @@ Vagrant::configure("2") do |config|
|
||||
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :inline => "apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
|
||||
config.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
config.vm.define "empty", autostart: false
|
||||
|
||||
config.vm.define "dokku", primary: true do |vm|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: 8080
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
end
|
||||
|
||||
config.vm.define "dokku-deb", autostart: false do |vm|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: 8080
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make install-from-deb"
|
||||
end
|
||||
|
||||
config.vm.define "build", autostart: false do |vm|
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make deb-all"
|
||||
end
|
||||
|
||||
if Pathname.new(PUBLIC_KEY_PATH).exist?
|
||||
config.vm.provision :file, source: PUBLIC_KEY_PATH, destination: '/tmp/id_rsa.pub'
|
||||
config.vm.provision :shell, :inline => "rm /root/.ssh/authorized_keys && mv /tmp/id_rsa.pub /root/.ssh/authorized_keys"
|
||||
end
|
||||
end
|
||||
|
||||
11
bootstrap.sh
11
bootstrap.sh
@@ -9,16 +9,17 @@ export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
|
||||
|
||||
if ! command -v apt-get &>/dev/null
|
||||
then
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult https://github.com/progrium/dokku ."
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult http://progrium.viewdocs.io/dokku/advanced-installation ."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install -qq -y git make curl software-properties-common man-db
|
||||
apt-get install -qq -y git make curl software-properties-common man-db help2man
|
||||
|
||||
[[ `lsb_release -sr` == "12.04" ]] && apt-get install -qq -y python-software-properties
|
||||
[[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties
|
||||
|
||||
cd ~ && test -d dokku || git clone $DOKKU_REPO
|
||||
cd ~
|
||||
test -d dokku || git clone $DOKKU_REPO
|
||||
cd dokku
|
||||
git fetch origin
|
||||
|
||||
@@ -32,4 +33,4 @@ make install
|
||||
|
||||
echo
|
||||
echo "Almost done! For next steps on configuration:"
|
||||
echo " https://github.com/progrium/dokku#configuring"
|
||||
echo " http://progrium.viewdocs.io/dokku/installation#user-content-configuring"
|
||||
|
||||
29
circle.yml
Normal file
29
circle.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
machine:
|
||||
services:
|
||||
- docker
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/docker"
|
||||
override:
|
||||
# need to add the dokku user to the docker group
|
||||
- sudo -E CI=true make -e sshcommand
|
||||
- sudo usermod -G docker dokku
|
||||
- sudo -E CI=true DOCKER_VERSION=1.4.1 make -e install: { timeout: 300 }
|
||||
- make -e ci-dependencies
|
||||
#### circle does some weird *expletive* with regards to root and gh auth (needed for gitsubmodules test)
|
||||
- sudo rsync -a ~ubuntu/.ssh/ ~root/.ssh/
|
||||
- sudo chown -R root:root ~root/.ssh/
|
||||
- sudo sed -e 's:/home/ubuntu:/root:g' ~root/.ssh/config
|
||||
####
|
||||
- sudo -E make -e setup-deploy-tests
|
||||
post:
|
||||
- sudo -E make -e lint
|
||||
- sudo -E make -e unit-tests
|
||||
test:
|
||||
override:
|
||||
### deploy tests (against buildstep release) ####
|
||||
- sudo -E make -e deploy-tests: { timeout: 1800 }
|
||||
### deploy tests (against buildstep master) ####
|
||||
- sudo docker rmi -f progrium/buildstep
|
||||
- sudo -E BUILD_STACK=true make -e stack
|
||||
- sudo -E make -e deploy-tests: { timeout: 1800 }
|
||||
@@ -16,12 +16,12 @@ if ARGV[0] == "onboot"
|
||||
f.puts " }"
|
||||
f.puts "}"
|
||||
end
|
||||
`rm /etc/nginx/sites-enabled/*`
|
||||
`rm -f /etc/nginx/sites-enabled/*`
|
||||
puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot."
|
||||
exit
|
||||
end
|
||||
|
||||
version = "v0.3.1"
|
||||
version = "v0.3.14"
|
||||
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
|
||||
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
|
||||
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
|
||||
|
||||
112
contrib/dokku_client.sh
Executable file
112
contrib/dokku_client.sh
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
MOVES=(ABLE ABNORMA AGAIN AIREXPL ANG ANGER ASAIL ATTACK AURORA AWL BAN BAND BARE BEAT BEATED BELLY BIND BITE BLOC BLOOD BODY BOOK BREATH BUMP CAST CHAM CLAMP CLAP CLAW CLEAR CLI CLIP CLOUD CONTRO CONVY COOLHIT CRASH CRY CUT DESCRI D-FIGHT DIG DITCH DIV DOZ DRE DUL DU-PIN DYE EARTH EDU EG-BOMB EGG ELEGY ELE-HIT EMBODY EMPLI ENGL ERUPT EVENS EXPLOR EYES FALL FAST F-CAR F-DANCE FEARS F-FIGHT FIGHT FIR FIRE FIREHIT FLAME FLAP FLASH FLEW FORCE FRA FREEZE FROG G-BIRD GENKISS GIFT G-KISS G-MOUSE GRADE GROW HAMMER HARD HAT HATE H-BOMB HELL-R HEMP HINT HIT HU HUNT HYPNOSI INHA IRO IRONBAR IR-WING J-GUN KEE KICK KNIF KNIFE KNOCK LEVEL LIGH LIGHHIT LIGHT LIVE L-WALL MAD MAJUS MEL MELO MESS MILK MIMI MISS MIXING MOVE MUD NI-BED NOISY NOONLI NULL N-WAVE PAT PEACE PIN PLAN PLANE POIS POL POWDE POWE POWER PRIZE PROTECT PROUD RAGE RECOR REFLAC REFREC REGR RELIV RENEW R-FIGHT RING RKICK ROCK ROUND RUS RUSH SAND SAW SCISSOR SCRA SCRIPT SEEN SERVER SHADOW SHELL SHINE SHO SIGHT SIN SMALL SMELT SMOK SNAKE SNO SNOW SOU SO-WAVE SPAR SPEC SPID S-PIN SPRA STAM STARE STEA STONE STORM STRU STRUG STUDEN SUBS SUCID SUN-LIG SUNRIS SUPLY S-WAVE TAILS TANGL TASTE TELLI THANK TONKICK TOOTH TORL TRAIN TRIKICK TUNGE VOLT WA-GUN WATCH WAVE W-BOMB WFALL WFING WHIP WHIRL WIND WOLF WOOD WOR YUJA)
|
||||
NAMES=(SEED GRASS FLOWE SHAD CABR SNAKE GOLD COW GUIKI PEDAL DELAN B-FLY BIDE KEYU FORK LAP PIGE PIJIA CAML LAT BIRD BABOO VIV ABOKE PIKAQ RYE SAN BREAD LIDEL LIDE PIP PIKEX ROK JUGEN PUD BUDE ZHIB GELU GRAS FLOW LAFUL ATH BALA CORN MOLUF DESP DAKED MIMI BOLUX KODA GELUD MONK SUMOY GEDI WENDI NILEM NILE NILEC KEZI YONGL HUDE WANLI GELI GUAIL MADAQ WUCI WUCI MUJEF JELLY SICIB GELU NELUO BOLI JIALE YED YEDE CLO SCARE AOCO DEDE DEDEI BAWU JIUG BADEB BADEB HOLE BALUX GES FANT QUAR YIHE SWAB SLIPP CLU DEPOS BILIY YUANO SOME NO YELA EMPT ZECUN XIAHE BOLEL DEJI MACID XIHON XITO LUCK MENJI GELU DECI XIDE DASAJ DONGN RICUL MINXI BALIY ZENDA LUZEL HELE5 0FENB KAIL JIAND CARP JINDE LAPU MUDE YIFU LINLI SANDI HUSI JINC OUMU OUMUX CAP KUIZA PUD TIAO FRMAN CLAU SPARK DRAGO BOLIU GUAIL MIYOU MIY QIAOK BEIL MUKEI RIDED MADAM BAGEP CROC ALIGE OUDAL OUD DADA HEHE YEDEA NUXI NUXIN ROUY ALIAD STICK QIANG LAAND PIQI PI PUPI DEKE DEKEJ NADI NADIO MALI PEA ELECT FLOWE MAL MALI HUSHU NILEE YUZI POPOZ DUZI HEBA XIAN SHAN YEYEA WUY LUO KEFE HULA CROW YADEH MOW ANNAN SUONI KYLI HULU HUDEL YEHE GULAE YEHE BLU GELAN BOAT NIP POIT HELAK XINL BEAR LINB MAGEH MAGEJ WULI YIDE RIVE FISH AOGU DELIE MANTE KONMU DELU HELU HUAN HUMA DONGF JINCA HEDE DEFU LIBY JIAPA MEJI HELE BUHU MILK HABI THUN GARD DON YANGQ SANAQ BANQ LUJ PHIX SIEI EGG)
|
||||
|
||||
function random_number() {
|
||||
[[ -n "$1" ]] && RANGE="$1"
|
||||
if [[ -n "$RANGE" ]];then
|
||||
number=$RANDOM
|
||||
let "number %= $RANGE"
|
||||
else
|
||||
number=$RANDOM
|
||||
fi
|
||||
echo $number
|
||||
}
|
||||
|
||||
function random_name() {
|
||||
NUM1=$(random_number ${#MOVES[@]})
|
||||
NUM2=$(random_number ${#MOVES[@]})
|
||||
NUM3=$(random_number ${#NAMES[@]})
|
||||
|
||||
UPPER_APPNAME="${MOVES[${NUM1}]}-${MOVES[${NUM2}]}-${NAMES[${NUM3}]}"
|
||||
|
||||
[[ "$BASH_VERSION" =~ 4.* ]] && lower_appname=${UPPER_APPNAME,,}
|
||||
[[ -z "$lower_appname" ]] && lower_appname=$(echo $UPPER_APPNAME | tr '[:upper:]' '[:lower:]')
|
||||
echo "$lower_appname"
|
||||
}
|
||||
|
||||
function client_help_msg() {
|
||||
echo "==> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku"
|
||||
echo "--> i.e. git remote add dokku dokku@<dokku-host>:<app-name>"
|
||||
exit 20 # exit with specific status. only used in units tests for now
|
||||
}
|
||||
|
||||
if [[ -z $DOKKU_HOST ]]; then
|
||||
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
|
||||
else
|
||||
client_help_msg
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -z $DOKKU_HOST ]]; then
|
||||
function _dokku {
|
||||
appname=""
|
||||
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
set +e
|
||||
appname=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
|
||||
set -e
|
||||
else
|
||||
echo "This is not a git repository"
|
||||
fi
|
||||
|
||||
if [[ "$appname" != "" ]] && [[ -n "$*" ]]; then
|
||||
case "$1" in
|
||||
apps|backup*|help|plugins*|ps:restartall|trace|version)
|
||||
true
|
||||
;;
|
||||
apps:destroy)
|
||||
if [[ -z "$2" ]] || [[ "$2" == "force" ]];then
|
||||
donotshift="YES"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
donotshift="YES"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ "$1" = "apps:create" ]] && [[ -z "$2" ]]; then
|
||||
appname=$(random_name)
|
||||
counter=0
|
||||
while ssh "dokku@$DOKKU_HOST" apps 2>/dev/null| grep -q "$appname"; do
|
||||
if [[ $counter -ge 100 ]];then
|
||||
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
|
||||
ssh "dokku@$DOKKU_HOST" apps
|
||||
exit 1
|
||||
else
|
||||
appname=$(random_name)
|
||||
counter=$((counter+1))
|
||||
fi
|
||||
done
|
||||
if git remote add dokku "dokku@$DOKKU_HOST:$appname"
|
||||
then
|
||||
echo "-----> Dokku remote added at $DOKKU_HOST"
|
||||
echo "-----> Application name is $appname"
|
||||
else
|
||||
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
||||
return
|
||||
fi
|
||||
git push dokku master
|
||||
return $?
|
||||
fi
|
||||
|
||||
if [[ -z "$donotshift" ]]; then
|
||||
ssh "dokku@$DOKKU_HOST" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
[[ -z "$verb" ]] && verb=$1
|
||||
shift
|
||||
ssh "dokku@$DOKKU_HOST" "$verb" "$appname" "$@"
|
||||
}
|
||||
|
||||
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]]; then
|
||||
_dokku "$@"
|
||||
exit $?
|
||||
fi
|
||||
else
|
||||
client_help_msg
|
||||
fi
|
||||
32
contrib/packer.json
Normal file
32
contrib/packer.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"type": "digitalocean",
|
||||
"region": "nyc3",
|
||||
"image": "ubuntu-14-04-x64"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "file",
|
||||
"source": "deb.mk",
|
||||
"destination": "/tmp/Makefile"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"echo '--> Waiting 30 seconds for core services to be available'",
|
||||
"sleep 30",
|
||||
|
||||
"echo '--> Updating apt repositories'",
|
||||
"sudo apt-get update > /dev/null",
|
||||
|
||||
"echo '--> Installing make requirement'",
|
||||
"sudo apt-get -qq -y install build-essential",
|
||||
|
||||
"cd /tmp && make install-from-deb",
|
||||
"rm /root/.ssh/authorized_keys"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
159
deb.mk
Normal file
159
deb.mk
Normal file
@@ -0,0 +1,159 @@
|
||||
BUILDSTEP_DESCRIPTION = 'Buildstep uses Docker and Buildpacks to build applications like Heroku'
|
||||
BUILDSTEP_REPO_NAME ?= progrium/buildstep
|
||||
BUILDSTEP_VERSION ?= 0.0.1
|
||||
BUILDSTEP_ARCHITECTURE = amd64
|
||||
BUILDSTEP_PACKAGE_NAME = buildstep_$(BUILDSTEP_VERSION)_$(BUILDSTEP_ARCHITECTURE).deb
|
||||
|
||||
DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash'
|
||||
DOKKU_REPO_NAME ?= progrium/dokku
|
||||
DOKKU_ARCHITECTURE = amd64
|
||||
|
||||
PLUGINHOOK_DESCRIPTION = 'Simple dispatcher and protocol for shell-based plugins, an improvement to hook scripts'
|
||||
PLUGINHOOK_REPO_NAME ?= progrium/pluginhook
|
||||
PLUGINHOOK_VERSION ?= 0.0.1
|
||||
PLUGINHOOK_ARCHITECTURE = amd64
|
||||
PLUGINHOOK_PACKAGE_NAME = pluginhook_$(PLUGINHOOK_VERSION)_$(PLUGINHOOK_ARCHITECTURE).deb
|
||||
|
||||
SSHCOMMAND_DESCRIPTION = 'Turn SSH into a thin client specifically for your app'
|
||||
SSHCOMMAND_REPO_NAME ?= progrium/sshcommand
|
||||
SSHCOMMAND_VERSION ?= 0.0.1
|
||||
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-buildstep deb-dokku deb-gems deb-pluginhook deb-setup deb-sshcommand
|
||||
|
||||
install-from-deb:
|
||||
echo "--> Installing docker gpg key"
|
||||
curl --silent https://get.docker.io/gpg 2> /dev/null | apt-key add - 2>&1 >/dev/null
|
||||
|
||||
echo "--> Installing dokku gpg key"
|
||||
curl --silent https://packagecloud.io/gpg.key 2> /dev/null | apt-key add - 2>&1 >/dev/null
|
||||
|
||||
echo "--> Setting up apt repositories"
|
||||
echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
|
||||
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list
|
||||
|
||||
echo "--> Running apt-get update"
|
||||
sudo apt-get update > /dev/null
|
||||
|
||||
echo "--> Installing pre-requisites"
|
||||
sudo apt-get install -y linux-image-extra-`uname -r` apt-transport-https
|
||||
|
||||
echo "--> Installing dokku"
|
||||
sudo apt-get install -y dokku
|
||||
|
||||
echo "--> Done!"
|
||||
|
||||
deb-all: deb-buildstep deb-dokku deb-gems deb-pluginhook deb-sshcommand
|
||||
mv /tmp/*.deb .
|
||||
echo "Done"
|
||||
|
||||
deb-setup:
|
||||
echo "-> Updating deb repository and installing build requirements"
|
||||
sudo apt-get update > /dev/null
|
||||
sudo apt-get install -qq -y git ruby1.9.1-dev 2>&1 > /dev/null
|
||||
command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
ssh -o StrictHostKeyChecking=no git@github.com || true
|
||||
|
||||
deb-buildstep: deb-setup
|
||||
rm -rf /tmp/tmp /tmp/build $(BUILDSTEP_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
echo "-> Creating deb files"
|
||||
echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
|
||||
echo "sleep 5" >> /tmp/tmp/post-install
|
||||
echo "count=\`sudo docker images | grep progrium/buildstep | wc -l\`" >> /tmp/tmp/post-install
|
||||
echo 'if [ "$$count" -ne 0 ]; then' >> /tmp/tmp/post-install
|
||||
echo " echo 'Removing old buildstep image'" >> /tmp/tmp/post-install
|
||||
echo " sudo docker rmi progrium/buildstep" >> /tmp/tmp/post-install
|
||||
echo "fi" >> /tmp/tmp/post-install
|
||||
echo "echo 'Importing buildstep into docker (around 5 minutes)'" >> /tmp/tmp/post-install
|
||||
echo "sudo docker build -t progrium/buildstep /var/lib/buildstep 1> /dev/null" >> /tmp/tmp/post-install
|
||||
|
||||
echo "-> Cloning repository"
|
||||
git clone -q "git@github.com:$(BUILDSTEP_REPO_NAME).git" /tmp/tmp/buildstep > /dev/null
|
||||
rm -rf /tmp/tmp/buildstep/.git /tmp/tmp/buildstep/.gitignore
|
||||
|
||||
echo "-> Copying files into place"
|
||||
mkdir -p "/tmp/build/var/lib"
|
||||
cp -rf /tmp/tmp/buildstep /tmp/build/var/lib/buildstep
|
||||
|
||||
echo "-> Creating $(BUILDSTEP_PACKAGE_NAME)"
|
||||
sudo fpm -t deb -s dir -C /tmp/build -n buildstep -v $(BUILDSTEP_VERSION) -a $(BUILDSTEP_ARCHITECTURE) -p $(BUILDSTEP_PACKAGE_NAME) --deb-pre-depends 'lxc-docker >= 1.4.0' --after-install /tmp/tmp/post-install --url "https://github.com/$(BUILDSTEP_REPO_NAME)" --description $(BUILDSTEP_DESCRIPTION) --license 'MIT License' .
|
||||
mv *.deb /tmp
|
||||
|
||||
deb-dokku: deb-setup
|
||||
rm -rf /tmp/tmp /tmp/build dokku_*_$(DOKKU_ARCHITECTURE).deb
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
cp -r debian /tmp/build/DEBIAN
|
||||
mkdir -p /tmp/build/usr/local/bin
|
||||
mkdir -p /tmp/build/var/lib/dokku
|
||||
mkdir -p /tmp/build/usr/local/share/man/man1
|
||||
mkdir -p /tmp/build/usr/local/share/dokku/contrib
|
||||
|
||||
cp dokku /tmp/build/usr/local/bin
|
||||
cp -r plugins /tmp/build/var/lib/dokku
|
||||
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/plugins/$$plugin/.core; done
|
||||
cp dokku.1 /tmp/build/usr/local/share/man/man1/dokku.1
|
||||
cp contrib/dokku-installer.rb /tmp/build/usr/local/share/dokku/contrib
|
||||
git describe --tags > /tmp/build/var/lib/dokku/VERSION
|
||||
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
|
||||
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
|
||||
sed -i "s/^Version: .*/Version: `cat /tmp/build/var/lib/dokku/STABLE_VERSION`/g" /tmp/build/DEBIAN/control
|
||||
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-pluginhook: deb-setup
|
||||
rm -rf /tmp/tmp /tmp/build $(PLUGINHOOK_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
echo "-> Cloning repository"
|
||||
git clone -q "git@github.com:$(PLUGINHOOK_REPO_NAME).git" /tmp/tmp/pluginhook > /dev/null
|
||||
rm -rf /tmp/tmp/pluginhook/.git /tmp/tmp/pluginhook/.gitignore
|
||||
|
||||
echo "-> Copying files into place"
|
||||
mkdir -p /tmp/build/usr/local/bin $(GOPATH)
|
||||
sudo apt-get install -qq -y git golang mercurial 2>&1 > /dev/null
|
||||
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH) && go get "code.google.com/p/go.crypto/ssh/terminal"
|
||||
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH) && cd /tmp/tmp/pluginhook && go build -o pluginhook
|
||||
mv /tmp/tmp/pluginhook/pluginhook /tmp/build/usr/local/bin/pluginhook
|
||||
|
||||
echo "-> Creating $(PLUGINHOOK_PACKAGE_NAME)"
|
||||
sudo fpm -t deb -s dir -C /tmp/build -n pluginhook -v $(PLUGINHOOK_VERSION) -a $(PLUGINHOOK_ARCHITECTURE) -p $(PLUGINHOOK_PACKAGE_NAME) --url "https://github.com/$(PLUGINHOOK_REPO_NAME)" --description $(PLUGINHOOK_DESCRIPTION) --license 'MIT License' .
|
||||
mv *.deb /tmp
|
||||
|
||||
deb-sshcommand: deb-setup
|
||||
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build
|
||||
|
||||
echo "-> Cloning repository"
|
||||
git clone -q "git@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"
|
||||
mkdir -p "/tmp/build/usr/local/bin"
|
||||
cp /tmp/tmp/sshcommand/sshcommand /tmp/build/usr/local/bin/sshcommand
|
||||
chmod +x /tmp/build/usr/local/bin/sshcommand
|
||||
|
||||
echo "-> Creating $(SSHCOMMAND_PACKAGE_NAME)"
|
||||
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand -v $(SSHCOMMAND_VERSION) -a $(SSHCOMMAND_ARCHITECTURE) -p $(SSHCOMMAND_PACKAGE_NAME) --url "https://github.com/$(SSHCOMMAND_REPO_NAME)" --description $(SSHCOMMAND_DESCRIPTION) --license 'MIT License' .
|
||||
mv *.deb /tmp
|
||||
10
debian/control
vendored
Normal file
10
debian/control
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
Package: dokku
|
||||
Version: 0.3.12
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: locales, git, make, curl, software-properties-common, lxc-docker (>= 1.4.0), gcc, python-software-properties, man-db, buildstep, sshcommand, pluginhook
|
||||
Pre-Depends: nginx, dnsutils, ruby, ruby-dev, rubygem-rack, rubygem-rack-protection, rubygem-sinatra, rubygem-tilt
|
||||
Provides: dokku
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
Description: Docker powered mini-Heroku in around 100 lines of Bash
|
||||
28
debian/postinst
vendored
Executable file
28
debian/postinst
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
configure)
|
||||
mandb
|
||||
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
|
||||
modprobe aufs || echo "WARNING: Restart server to finish installing dokku!"
|
||||
sshcommand create dokku /usr/local/bin/dokku
|
||||
egrep -i "^docker" /etc/group || groupadd docker
|
||||
usermod -aG docker dokku
|
||||
dokku plugins-install
|
||||
|
||||
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then
|
||||
sudo service dokku-installer start
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
37
debian/preinst
vendored
Executable file
37
debian/preinst
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
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
|
||||
echo 'upstream dokku-installer { server 127.0.0.1:2000; }' >> $NGINX_CONF
|
||||
echo 'server {' >> $NGINX_CONF
|
||||
echo ' listen 80;' >> $NGINX_CONF
|
||||
echo ' location / {' >> $NGINX_CONF
|
||||
echo ' proxy_pass http://dokku-installer;' >> $NGINX_CONF
|
||||
echo ' }' >> $NGINX_CONF
|
||||
echo '}' >> $NGINX_CONF
|
||||
|
||||
rm -f /etc/nginx/sites-enabled/*
|
||||
service nginx reload
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
37
docs/advanced-installation.md
Normal file
37
docs/advanced-installation.md
Normal file
@@ -0,0 +1,37 @@
|
||||
#Advanced installation
|
||||
|
||||
## Development
|
||||
|
||||
If you plan on developing dokku, the easiest way to install from your own repository is cloning the repository and calling the install script. Example:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/yourusername/dokku.git
|
||||
cd dokku
|
||||
sudo make install
|
||||
```
|
||||
|
||||
The `Makefile` allows source URLs to be overridden to include customizations from your own repositories. The `DOCKER_URL`, `PLUGINHOOK_URL`, `SSHCOMMAND_URL` and `STACK_URL` environment variables may be set to override the defaults (see the `Makefile` for how these apply). Example:
|
||||
|
||||
```shell
|
||||
sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/gitreceive make install
|
||||
```
|
||||
|
||||
## Bootstrap a server from your own repository
|
||||
|
||||
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.github.com/progrium/dokku/master/bootstrap.sh
|
||||
chmod +x bootstrap.sh
|
||||
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh
|
||||
```
|
||||
|
||||
## Custom buildstep build
|
||||
|
||||
Dokku ships with a pre-built version of version of the [buildstep](https://github.com/progrium/buildstep) 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
|
||||
cd dokku
|
||||
sudo BUILD_STACK=true make install
|
||||
```
|
||||
@@ -4,8 +4,8 @@ Now you can deploy apps on your Dokku. Let's deploy the [Heroku Node.js sample a
|
||||
|
||||
```
|
||||
$ cd node-js-sample
|
||||
$ git remote add progrium dokku@progriumapp.com:node-js-app
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:node-js-app
|
||||
$ git push dokku master
|
||||
Counting objects: 296, done.
|
||||
Delta compression using up to 4 threads.
|
||||
Compressing objects: 100% (254/254), done.
|
||||
@@ -18,16 +18,26 @@ Total 296 (delta 25), reused 276 (delta 13)
|
||||
... blah blah blah ...
|
||||
|
||||
-----> Application deployed:
|
||||
http://node-js-app.progriumapp.com
|
||||
http://node-js-app.dokku.me
|
||||
```
|
||||
|
||||
You're done!
|
||||
|
||||
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push progrium <local branch>:master```
|
||||
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
|
||||
|
||||
Right now Buildstep supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/progrium/buildstep#supported-buildpacks). It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)!
|
||||
Please check the documentation for your particular build pack as you may need to include configuration files (such as a Procfile) in your project root.
|
||||
|
||||
## 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 `~dokku/.ssh` and potentially add github.com (or your VCS host key) into `~dokku/.ssh/known_hosts`. A decent test like this should help confirm you've done it correctly.
|
||||
|
||||
```
|
||||
su - dokku
|
||||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
||||
ssh -T git@github.com
|
||||
```
|
||||
|
||||
## Specifying a custom buildpack
|
||||
|
||||
If buildpack detection isn't working well for you or you want to specify a custom buildpack for one repository you can create & commit a file in the root of your git repository named `.env` containing `export BUILDPACK_URL=<repository>` before pushing. This will tell buildstep to fetch the specified buildpack and use it instead of relying on the built-in buildpacks & their detection methods.
|
||||
@@ -53,38 +63,58 @@ Alternatively, you may push an app to your dokku host with a name like "00-defau
|
||||
|
||||
The name of remote repository is used as the name of application to be deployed, as for example above:
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:node-js-app
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:node-js-app
|
||||
$ git push dokku master
|
||||
|
||||
Is deployed to,
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://node-js-app.progriumapp.com
|
||||
remote: http://node-js-app.dokku.me
|
||||
|
||||
You can also specify fully qualified names, say `app.progrium.com`, as
|
||||
You can also specify fully qualified names, say `app.dokku.me`, as
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:app.progrium.com
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:app.dokku.me
|
||||
$ git push dokku master
|
||||
|
||||
So, after deployment the application will be available at,
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://app.progrium.com
|
||||
remote: http://app.dokku.me
|
||||
|
||||
This is in particular useful, then you want to deploy to root domain, as
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:progrium.com
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:dokku.me
|
||||
$ git push dokku master
|
||||
|
||||
... deployment ...
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://progrium.com
|
||||
remote: http://dokku.me
|
||||
|
||||
# Zero downtime deploy
|
||||
|
||||
Following a deploy Dokku's default behaviour is to switch new traffic over to the new container immediately.
|
||||
|
||||
This can be problematic for applications that take some time to boot up and can lead to `502 Bad Gateway` errors.
|
||||
|
||||
Dokku provides a way to run a set of checks against the new container, and only switch traffic over if all checks complete successfully.
|
||||
|
||||
To specify checks, add a `CHECKS` file to the root of your project directory. This is a text file with one line per check. Empty lines and lines starting with `#` are ignored.
|
||||
|
||||
A check is a relative URL and may be followed by expected content from the page, for example:
|
||||
|
||||
```
|
||||
/about Our Amazing Team
|
||||
```
|
||||
|
||||
Dokku will wait `DOKKU_CHECKS_WAIT` seconds (default: `5`) before running the checks to give server time to start. For shorter/longer wait, change the `DOKKU_CHECKS_WAIT` environment variable.
|
||||
|
||||
Dokku will wait `DOKKU_WAIT_TO_RETIRE` seconds (default: `60`) before stopping the old container such that no existing connections to it are dropped.
|
||||
|
||||
# Removing a deployed app
|
||||
|
||||
SSH onto the server, then execute:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
dokku delete myapp
|
||||
```
|
||||
|
||||
@@ -11,4 +11,6 @@ config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] - set one or more config vars
|
||||
config:unset <app> KEY1 [KEY2 ...] - unset one or more config vars
|
||||
```
|
||||
|
||||
The variables are by default available only at run time, i.e. not when the application is being built/compiled. However there are [plugins](http://progrium.viewdocs.io/dokku/plugins) that can change that.
|
||||
The variables are available both at at run time and during the application build/compilation step. You no longer need a `user-env` plugin as Dokku handles this functionality in a way equivalent to how Heroku handles it.
|
||||
|
||||
> Note: Global `BUILD_ENV` files are currently migrated into a global `ENV` file and sourced before app-specific variables. This means that app-specific variables will take precedence over global variables. Configuring your global `ENV` file is manual, and should be considered potentially dangerous as configuration applies to all applications.
|
||||
|
||||
@@ -12,13 +12,13 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
|
||||
- [Remote commands](http://progrium.viewdocs.io/dokku/remote-commands)
|
||||
- [Plugins](http://progrium.viewdocs.io/dokku/plugins)
|
||||
- [Configuration management](http://progrium.viewdocs.io/dokku/configuration-management)
|
||||
- [TLS/SPDY support](http://progrium.viewdocs.io/dokku/tls-spdy-support)
|
||||
- [Nginx Configuration](http://progrium.viewdocs.io/dokku/nginx)
|
||||
- [DNS](http://progrium.viewdocs.io/dokku/dns)
|
||||
|
||||
## Things this project won't do
|
||||
|
||||
* **Multi-host.** Not a huge leap, but this isn't the project for it. Have a look at [Deis](http://deis.io/).
|
||||
* **Multitenancy.** It's ready for it, but again, have a look at [Deis](http://deis.io/).
|
||||
* **Multi-host.** It runs on one host. If you need more, have a look at [Deis](http://deis.io/).
|
||||
* **Multitenancy.** Multi-app, and loosely multi-user based on SSH keys, but that's it.
|
||||
* **Client app.** Given the constraints, running commands remotely via SSH is fine.
|
||||
|
||||
## Sponsors
|
||||
|
||||
@@ -10,8 +10,8 @@ Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's de
|
||||
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
```bash
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.1/bootstrap.sh | sudo DOKKU_TAG=v0.3.1 bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.14/bootstrap.sh | sudo DOKKU_TAG=v0.3.14 bash
|
||||
```
|
||||
|
||||
## Configuring
|
||||
@@ -20,7 +20,7 @@ Set up a domain and a wildcard domain pointing to that host. Make sure `/home/do
|
||||
|
||||
You'll have to add a public key associated with a username by doing something like this from your local machine:
|
||||
|
||||
$ cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku progrium"
|
||||
$ cat ~/.ssh/id_rsa.pub | ssh dokku.me "sudo sshcommand acl-add dokku $USER"
|
||||
|
||||
That's it!
|
||||
|
||||
@@ -28,7 +28,7 @@ That's it!
|
||||
|
||||
### Development via bash script
|
||||
|
||||
```bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
|
||||
```
|
||||
|
||||
@@ -41,7 +41,7 @@ You may also wish to take a look at the [advanced installation](http://progrium.
|
||||
If you plan on developing dokku, the easiest way to install from your own repository is cloning
|
||||
the repository and calling the install script. Example:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/yourusername/dokku.git
|
||||
cd dokku
|
||||
sudo make install
|
||||
@@ -52,7 +52,7 @@ repositories. The `DOCKER_URL`, `PLUGINHOOK_URL`, `SSHCOMMAND_URL` and `STACK_UR
|
||||
environment variables may be set to override the defaults (see the `Makefile` for how these
|
||||
apply). Example:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcommand make install
|
||||
```
|
||||
|
||||
@@ -61,7 +61,7 @@ sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcom
|
||||
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:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
wget https://raw.github.com/progrium/dokku/master/bootstrap.sh
|
||||
chmod +x bootstrap.sh
|
||||
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh
|
||||
@@ -73,7 +73,7 @@ Dokku ships with a pre-built version of the [buildstep](https://github.com/progr
|
||||
default. If you want to build your own version you can specify that with an env
|
||||
variable.
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/progrium/dokku.git
|
||||
cd dokku
|
||||
sudo BUILD_STACK=true make install
|
||||
@@ -95,13 +95,6 @@ sudo BUILD_STACK=true make install
|
||||
10.0.0.2 dokku.me
|
||||
```
|
||||
|
||||
- Setup SSH Config in `~/.ssh/config`
|
||||
|
||||
```
|
||||
Host dokku.me
|
||||
Port 2222
|
||||
```
|
||||
|
||||
- Create VM
|
||||
```
|
||||
# Optional ENV arguments:
|
||||
@@ -110,8 +103,15 @@ sudo BUILD_STACK=true make install
|
||||
# - `BOX_MEMORY`
|
||||
# - `DOKKU_DOMAIN`
|
||||
# - `DOKKU_IP`.
|
||||
cd path/to/dokku
|
||||
vagrant up
|
||||
```
|
||||
- Setup SSH Config in `~/.ssh/config`. The port listed here is usually correct, though you may want to verify that it is the same as the one listed in the output of `vagrant ssh-config`
|
||||
|
||||
```
|
||||
Host dokku.me
|
||||
Port 2222
|
||||
```
|
||||
|
||||
- Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says `Use virtualhost naming`. Then click *Finish Setup* to install your key. You'll be directed to application deployment instructions from here.
|
||||
|
||||
@@ -140,7 +140,7 @@ Deploy using the following StackScript:
|
||||
|
||||
* Run the following commands:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
apt-get update
|
||||
|
||||
apt-get install lxc wget bsdtar linux-image-extra-$(uname -r)
|
||||
@@ -149,6 +149,6 @@ Deploy using the following StackScript:
|
||||
```
|
||||
* After this, you can install dokku the default way:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
|
||||
```
|
||||
|
||||
175
docs/nginx.md
Normal file
175
docs/nginx.md
Normal file
@@ -0,0 +1,175 @@
|
||||
# Nginx
|
||||
|
||||
Dokku uses nginx as it's server for routing requests to specific applications.
|
||||
|
||||
## TLS/SPDY support
|
||||
|
||||
Dokku provides easy TLS/SPDY support out of the box. This can be done app-by-app or for all subdomains at once. Note that whenever TLS support is enabled SPDY is also enabled.
|
||||
|
||||
### Per App
|
||||
|
||||
To enable TLS connection to to one of your applications, copy or symlink the `.crt` and `.key` files into the application's `/home/dokku/:app/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively.
|
||||
|
||||
Redeployment of the application will be needed to apply TLS configuration. Once it is redeployed, the application will be accessible by `https://` (redirection from `http://` is applied as well).
|
||||
|
||||
### All Subdomains
|
||||
|
||||
To enable TLS connections for all your applications at once you will need a wildcard TLS certificate.
|
||||
|
||||
To enable TLS across all apps, copy or symlink the `.crt` and `.key` files into the `/home/dokku/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively. Then, enable the certificates by editing `/etc/nginx/conf.d/dokku.conf` and uncommenting these two lines (remove the #):
|
||||
|
||||
```
|
||||
ssl_certificate /home/dokku/tls/server.crt;
|
||||
ssl_certificate_key /home/dokku/tls/server.key;
|
||||
```
|
||||
|
||||
The nginx configuration will need to be reloaded in order for the updated TLS configuration to be applied. This can be done either via the init system or by re-deploying the application. Once TLS is enabled, the application will be accessible by `https://` (redirection from `http://` is applied as well).
|
||||
|
||||
**Note**: TLS will not be enabled unless the application's VHOST matches the certificate's name. (i.e. if you have a cert for *.example.com TLS won't be enabled for something.example.org or example.net)
|
||||
|
||||
### HSTS Header
|
||||
|
||||
The [HSTS header](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) is an HTTP header that can inform browsers that all requests to a given site should be made via HTTPS. dokku does not, by default, enable this header. It is thus left up to you, the user, to enable it for your site.
|
||||
|
||||
Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails.
|
||||
|
||||
### Importing ssl certificates
|
||||
|
||||
You can import ssl certificates via tarball using the following command:
|
||||
|
||||
``` bash
|
||||
dokku nginx:import-ssl myapp < archive-of-certs.tar
|
||||
```
|
||||
|
||||
This archive should is expanded via `tar xvf`. It should contain `server.crt` and `server.key`.
|
||||
|
||||
## Customizing the nginx configuration
|
||||
|
||||
> New as of 0.3.10
|
||||
|
||||
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, you should copy the existing template - ssl or non-ssl - into your `$DOKKU_ROOT/$APP` directory at the file `nginx.conf.template`.
|
||||
|
||||
For instance - assuming defaults - to customize the nginx template in use for the `myapp` application, create a file at `/home/dokku/myapp/nginx.conf.template` with the following contents:
|
||||
|
||||
```
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
|
||||
# set a custom header for requests
|
||||
add_header X-Served-By www-ec2-01;
|
||||
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
```
|
||||
|
||||
The above is a sample, http configuration that adds an `X-Served-By` header to requests. The template is manually uploaded this template file and **must** it owned by `dokku:dokku`.
|
||||
|
||||
## Customizing hostnames
|
||||
|
||||
Applications typically have the following structure for their hostname:
|
||||
|
||||
```
|
||||
scheme://subdomain.domain.tld
|
||||
```
|
||||
|
||||
The `subdomain` is inferred from the pushed application name, while the `domain` is set during initial configuration in the `$DOKKU_ROOT/VHOST` file.
|
||||
|
||||
You can optionally override this in a plugin by implementing the `nginx-hostname` pluginhook. For example, you can reverse the subdomain with the following sample `nginx-hostname` pluginhook:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; SUBDOMAIN="$2"; VHOST="$3"
|
||||
|
||||
NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev`
|
||||
echo "$NEW_SUBDOMAIN.$VHOST"
|
||||
```
|
||||
|
||||
If the `nginx-hostname` has no output, the normal hostname algorithm will be executed.
|
||||
|
||||
You can also use the built-in `domains` plugin to handle:
|
||||
|
||||
### Disabling VHOSTS
|
||||
|
||||
If desired, it is possible to disable vhosts by setting the `NO_VHOST` environment variable:
|
||||
|
||||
```shell
|
||||
dokku config:set myapp NO_VHOST=1
|
||||
```
|
||||
|
||||
On subsequent deploys, the nginx virtualhost will be discarded. This is useful when deploying internal-facing services that should not be publicly routeable.
|
||||
|
||||
### Domains plugin
|
||||
|
||||
> New as of 0.3.10
|
||||
|
||||
The domains plugin allows you to specify custom domains for applications. This plugin is aware of any ssl certificates that are imported via `nginx:import-ssl`. Be aware that setting `NO_VHOST` will override any custom domains.
|
||||
|
||||
Custom domains are also backed up via the built-in `backup` plugin
|
||||
|
||||
```shell
|
||||
# where `myapp` is the name of your app
|
||||
|
||||
# add a domain to an app
|
||||
dokku domains:add myapp example.com
|
||||
|
||||
# list custom domains for app
|
||||
dokku domains myapp
|
||||
|
||||
# clear all custom domains for app
|
||||
dokku domains:clear myapp
|
||||
|
||||
# remove a custom domain from app
|
||||
dokku domains:remove myapp example.com
|
||||
```
|
||||
|
||||
### Container network interface binding
|
||||
|
||||
> New as of 0.3.13
|
||||
|
||||
The deployed docker container running your app's web process will bind to either the internal docker network interface (i.e. `docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CONTAINER_ID`) or an external interface (i.e. 0.0.0.0) depending on dokku's VHOST configuration. Dokku will attempt to bind to the internal docker network interface unless you specifically set NO_VHOST for the given app or your dokku installation is not setup to use VHOSTS (i.e. $DOKKU_ROOT/VHOST is missing or $DOKKU_ROOT/HOSTNAME is set to an IPv4 or IPv6 address)
|
||||
|
||||
```shell
|
||||
# container bound to docker interface
|
||||
root@dokku:~/dokku# docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
1b88d8aec3d1 dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute goofy_albattani
|
||||
|
||||
root@dokku:~/dokku# docker inspect --format '{{ .NetworkSettings.IPAddress }}' goofy_albattani
|
||||
172.17.0.6
|
||||
|
||||
# container bound to all interfaces (previous default)
|
||||
root@dokku:/home/dokku# docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp nostalgic_tesla
|
||||
|
||||
```
|
||||
|
||||
# Default site
|
||||
|
||||
By default, dokku will route any received request with an unknown HOST header value to the lexicographically first site in the nginx config stack. If this is not the desired behavior, you may want to add the following configuration to nginx. This will catch all unknown HOST header values and return a `410 Gone` response.
|
||||
|
||||
```
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
server_name _;
|
||||
return 410;
|
||||
log_not_found off;
|
||||
}
|
||||
```
|
||||
312
docs/plugins.md
312
docs/plugins.md
@@ -11,7 +11,7 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
|
||||
|
||||
## Installing a plugin
|
||||
|
||||
```bash
|
||||
```shell
|
||||
cd /var/lib/dokku/plugins
|
||||
git clone <git url>
|
||||
dokku plugins-install
|
||||
@@ -28,133 +28,218 @@ If you create your own plugin:
|
||||
3. edit this page and add a link to it below!
|
||||
4. subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
|
||||
|
||||
### Sample plugin
|
||||
|
||||
The below plugin is a dummy `dokku hello` plugin. If your plugin exposes commands, this is a good template for your `commands` file:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
case "$1" in
|
||||
hello)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2";
|
||||
|
||||
echo "Hello $APP"
|
||||
;;
|
||||
|
||||
hello:world)
|
||||
echo "Hello world"
|
||||
;;
|
||||
|
||||
help)
|
||||
cat && cat<<EOF
|
||||
hello <app> Says "Hello <app>"
|
||||
hello:world Says "Hello world"
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
```
|
||||
|
||||
A few notes:
|
||||
|
||||
- You should always support `DOKKU_TRACE` as specified on the 2nd line of the plugin.
|
||||
- If your command requires that an application exists, ensure you check for it's existence in the manner prescribed above.
|
||||
- A `help` command is required, though it is allowed to be empty.
|
||||
- Commands *should* be namespaced.
|
||||
- As of 0.3.3, a catch-all should be implemented which exits with a `DOKKU_NOT_IMPLEMENTED_EXIT` code. This allows dokku to output a `command not found` message.
|
||||
- Be sure you want the "set -eo pipefail" option. Look at the following example :
|
||||
|
||||
```shell
|
||||
IMAGE=$(docker images | grep "user/repo" | awk '{print $3}')
|
||||
if [[ -z $IMAGE ]]; then
|
||||
echo "user/repo image not found... Did you run 'dokku plugins-install'?"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
In the case where the "user/repo" is not installed, dokku exits just before the awk command,
|
||||
you will never see the message printed with echo. You just want "set -e" in this case.
|
||||
|
||||
Here is the documentation of the 'set -eo pipefail' option:
|
||||
```
|
||||
help set
|
||||
Options:
|
||||
-e Exit immediately if a command exits with a non-zero status.
|
||||
-o option-name
|
||||
pipefail the return value of a pipeline is the status of
|
||||
the last command to exit with a non-zero status,
|
||||
or zero if no command exited with a non-zero status
|
||||
```
|
||||
|
||||
## Community plugins
|
||||
|
||||
Note: The following plugins have been supplied by our community and may not have been tested by dokku maintainers.
|
||||
|
||||
[Kloadut]: https://github.com/Kloadut
|
||||
[jeffutter]: https://github.com/jeffutter
|
||||
[jezdez]: https://github.com/jezdez
|
||||
[blag]: https://github.com/blag
|
||||
[luxifer]: https://github.com/luxifer
|
||||
[stuartpb]: https://github.com/stuartpb
|
||||
[hughfletcher]: https://github.com/hughfletcher
|
||||
[Aomitayo]: https://github.com/Aomitayo
|
||||
[jlachowski]: https://github.com/jlachowski
|
||||
[apmorton]: https://github.com/apmorton
|
||||
[statianzo]: https://github.com/statianzo
|
||||
[sehrope]: https://github.com/sehrope
|
||||
[wmluke]: https://github.com/wmluke
|
||||
[krisrang]: https://github.com/krisrang
|
||||
[scottatron]: https://github.com/scottatron
|
||||
[pauldub]: https://github.com/pauldub
|
||||
[dyson]: https://github.com/dyson
|
||||
[musicglue]: https://github.com/musicglue
|
||||
[motin]: https://github.com/motin
|
||||
[neam]: https://github.com/neam
|
||||
[cedricziel]: https://github.com/cedricziel
|
||||
[pnegahdar]: https://github.com/pnegahdar
|
||||
[fgrehm]: https://github.com/fgrehm
|
||||
[alexanderbeletsky]: https://github.com/alexanderbeletsky
|
||||
[thrashr888]: https://github.com/thrashr888
|
||||
[robv]: https://github.com/robv
|
||||
[rlaneve]: https://github.com/rlaneve
|
||||
[cef]: https://github.com/cef
|
||||
[agco-adm]: https://github.com/agco-adm
|
||||
[ademuk]: https://github.com/ademuk
|
||||
[alex-sherwin]: https://github.com/alex-sherwin
|
||||
[alexanderbeletsky]: https://github.com/alexanderbeletsky
|
||||
[Aomitayo]: https://github.com/Aomitayo
|
||||
[apmorton]: https://github.com/apmorton
|
||||
[blag]: https://github.com/blag
|
||||
[cameron-martin]: https://github.com/cameron-martin
|
||||
[cedricziel]: https://github.com/cedricziel
|
||||
[cef]: https://github.com/cef
|
||||
[darkpixel]: https://github.com/darkpixel
|
||||
[dyson]: https://github.com/dyson
|
||||
[F4-Group]: https://github.com/F4-Group
|
||||
[fermuch]: https://github.com/fermuch
|
||||
[Zenedith]: https://github.com/Zenedith
|
||||
[fgrehm]: https://github.com/fgrehm
|
||||
[gdi2290]: https://github.com/gdi2290
|
||||
[heichblatt]: https://github.com/heichblatt
|
||||
[michaelshobbs]: https://github.com/michaelshobbs
|
||||
[hughfletcher]: https://github.com/hughfletcher
|
||||
[iskandar]: https://github.com/iskandar
|
||||
[mikexstudios]: https://github.com/mikexstudios
|
||||
[cameron-martin]: https://github.com/cameron-martin
|
||||
[jeffutter]: https://github.com/jeffutter
|
||||
[jezdez]: https://github.com/jezdez
|
||||
[jlachowski]: https://github.com/jlachowski
|
||||
[krisrang]: https://github.com/krisrang
|
||||
[Kloadut]: https://github.com/Kloadut
|
||||
[luxifer]: https://github.com/luxifer
|
||||
[mlebkowski]: https://github.com/mlebkowski
|
||||
[matto1990]: https://github.com/matto1990
|
||||
[michaelshobbs]: https://github.com/michaelshobbs
|
||||
[mikecsh]: https://github.com/mikecsh
|
||||
[mikexstudios]: https://github.com/mikexstudios
|
||||
[motin]: https://github.com/motin
|
||||
[musicglue]: https://github.com/musicglue
|
||||
[neam]: https://github.com/neam
|
||||
[nornagon]: https://github.com/nornagon
|
||||
[ohardy]: https://github.com/ohardy
|
||||
[agco-adm]: https://github.com/agco-adm
|
||||
[pauldub]: https://github.com/pauldub
|
||||
[pnegahdar]: https://github.com/pnegahdar
|
||||
[RaceHub]: https://github.com/racehub
|
||||
[rlaneve]: https://github.com/rlaneve
|
||||
[robv]: https://github.com/robv
|
||||
[scottatron]: https://github.com/scottatron
|
||||
[sehrope]: https://github.com/sehrope
|
||||
[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
|
||||
|
||||
### Datastores
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| --- | --- | --- |
|
||||
| [CouchDB](https://github.com/racehub/dokku-couchdb-plugin) | [RaceHub](https://github.com/racehub) | Compatible with 0.2.0 |
|
||||
| [MariaDB](https://github.com/Kloadut/dokku-md-plugin) | [Kloadut][] | Compatible with 0.2.0 |
|
||||
| [MariaDB (single container)](https://github.com/ohardy/dokku-mariadb) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [MongoDB (single container)](https://github.com/jeffutter/dokku-mongodb-plugin) | [jeffutter][] | |
|
||||
| [PostgreSQL](https://github.com/Kloadut/dokku-pg-plugin) | [Kloadut][] | Compatible with 0.2.0 |
|
||||
| [PostgreSQL (single container)](https://github.com/jeffutter/dokku-postgresql-plugin) | [jeffutter][] | This plugin creates a single postgresql container that all your apps can use. Thus only one instance of postgresql running (good for servers without a ton of memory). |
|
||||
| [PostgreSQL](https://github.com/jezdez/dokku-postgres-plugin) | [jezdez][] | Compatible with 0.2.0 |
|
||||
| [PostgreSQL (single container)](https://github.com/ohardy/dokku-psql) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [PostGIS](https://github.com/fermuch/dokku-pg-plugin) | [fermuch][] | |
|
||||
| [Redis](https://github.com/jezdez/dokku-redis-plugin) | [jezdez][] | Requires https://github.com/rlaneve/dokku-link; compatible with 0.2.0 |
|
||||
| [Redis](https://github.com/luxifer/dokku-redis-plugin) | [luxifer][] | |
|
||||
| [Redis (single container)](https://github.com/ohardy/dokku-redis) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [RethinkDB](https://github.com/stuartpb/dokku-rethinkdb-plugin) | [stuartpb][] | 2014-02-22: targeting dokku @ [latest][217d00a]; will fail with Dokku earlier than [28de3ec][]. |
|
||||
| [RiakCS (single container)](https://github.com/jeffutter/dokku-riakcs-plugin) | [jeffutter][] | Incompatible with 0.2.0 (checked at [dccee02][]) |
|
||||
| [MySQL](https://github.com/hughfletcher/dokku-mysql-plugin) | [hughfletcher][] | |
|
||||
| [Memcached](https://github.com/jezdez/dokku-memcached-plugin) | [jezdez][] | Compatible with 0.2.0 |
|
||||
| [Neo4j](https://github.com/Aomitayo/dokku-neo4j-plugin) | [Aomitayo][] | |
|
||||
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [Postgresql](https://github.com/jlachowski/dokku-pg-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [Memcached](https://github.com/jlachowski/dokku-memcached-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [Varnish](https://github.com/Zenedith/dokku-varnish-plugin) | [Zenedith][] | Varnish cache between nginx and application with base configuration|
|
||||
#### Relational
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [MariaDB](https://github.com/Kloadut/dokku-md-plugin) | [Kloadut][] | Compatible with 0.2.0 |
|
||||
| [MariaDB (single container)](https://github.com/ohardy/dokku-mariadb) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [MySQL](https://github.com/hughfletcher/dokku-mysql-plugin) | [hughfletcher][] | |
|
||||
| [PostgreSQL](https://github.com/Kloadut/dokku-pg-plugin) | [Kloadut][] | Compatible with 0.2.0 |
|
||||
| [PostgreSQL](https://github.com/jezdez/dokku-postgres-plugin) | [jezdez][] | Compatible with 0.2.0 |
|
||||
| [PostgreSQL](https://github.com/jlachowski/dokku-pg-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [PostgreSQL (single container)](https://github.com/jeffutter/dokku-postgresql-plugin) | [jeffutter][] | This plugin creates a single postgresql container that all your apps can use. Thus only one instance of postgresql running (good for servers without a ton of memory). |
|
||||
| [PostgreSQL (single container)](https://github.com/ohardy/dokku-psql) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [PostGIS](https://github.com/fermuch/dokku-pg-plugin) | [fermuch][] | |
|
||||
|
||||
#### Caching
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [Memcached](https://github.com/jezdez/dokku-memcached-plugin) | [jezdez][] | Compatible with 0.2.0 |
|
||||
| [Memcached](https://github.com/jlachowski/dokku-memcached-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [Redis](https://github.com/jezdez/dokku-redis-plugin) | [jezdez][] | Requires https://github.com/rlaneve/dokku-link; compatible with 0.2.0 |
|
||||
| [Redis](https://github.com/luxifer/dokku-redis-plugin) | [luxifer][] | |
|
||||
| [Redis (single container)](https://github.com/ohardy/dokku-redis) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [Varnish](https://github.com/Zenedith/dokku-varnish-plugin) | [Zenedith][] | Varnish cache between nginx and application with base configuration|
|
||||
|
||||
#### Queuing
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | IP & PORT available directly in linked app container env variables (requires link plugin)|
|
||||
|
||||
#### Other
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [CouchDB](https://github.com/racehub/dokku-couchdb-plugin) | [RaceHub][] | Compatible with 0.2.0 |
|
||||
| [MongoDB (single container)](https://github.com/jeffutter/dokku-mongodb-plugin) | [jeffutter][] | |
|
||||
| [RethinkDB](https://github.com/stuartpb/dokku-rethinkdb-plugin) | [stuartpb][] | 2014-02-22: targeting dokku @ [latest][217d00a]; will fail with Dokku earlier than [28de3ec][]. |
|
||||
| [RiakCS (single container)](https://github.com/jeffutter/dokku-riakcs-plugin) | [jeffutter][] | Incompatible with 0.2.0 (checked at [dccee02][]) |
|
||||
| [Neo4j](https://github.com/Aomitayo/dokku-neo4j-plugin) | [Aomitayo][] | |
|
||||
|
||||
[dccee02]: https://github.com/jeffutter/dokku-riakcs-plugin/commit/dccee02702e7001851917b7814e78a99148fb709
|
||||
|
||||
### Process Managers
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| --- | --- | --- |
|
||||
| [Circus](https://github.com/apmorton/dokku-circus) | [apmorton][] | |
|
||||
| [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | Compatible with 0.2.0 |
|
||||
| [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | Compatible with 0.2.0 |
|
||||
| [Logging Supervisord](https://github.com/sehrope/dokku-logging-supervisord) | [sehrope][] | Works with dokku @ [c77cbf1][] - no 0.2.0 compatibility |
|
||||
| [Forego](https://github.com/iskandar/dokku-forego) | [iskandar][] | Compatible with 0.2.x |
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [Circus](https://github.com/apmorton/dokku-circus) | [apmorton][] | |
|
||||
| [Shoreman ](https://github.com/statianzo/dokku-shoreman) | [statianzo][] | Compatible with 0.2.0 |
|
||||
| [Supervisord](https://github.com/statianzo/dokku-supervisord) | [statianzo][] | Compatible with 0.2.0 |
|
||||
| [Logging Supervisord](https://github.com/sehrope/dokku-logging-supervisord) | [sehrope][] | Works with dokku @ [c77cbf1][] - no 0.2.0 compatibility |
|
||||
| [Forego](https://github.com/iskandar/dokku-forego) | [iskandar][] | Compatible with 0.2.x |
|
||||
|
||||
[c77cbf1]: https://github.com/progrium/dokku/commit/c77cbf1d3ae07f0eafb85082ed7edcae9e836147
|
||||
[28de3ec]: https://github.com/progrium/dokku/commit/28de3ecaa3231a223f83fd8d03f373308673bc40
|
||||
|
||||
### Dokku Features
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| --- | --- | --- |
|
||||
| [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | Compatible with 0.2.* and master |
|
||||
| [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)<sup>4</sup> | [wmluke][] | Compatible with 0.2.0 . |
|
||||
| [git rev-parse HEAD in env](https://github.com/nornagon/dokku-git-rev) | [nornagon](https://github.com/nornagon) | Compatible with 0.2.0 |
|
||||
| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | Compatible with 0.2.x |
|
||||
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
|
||||
| [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | Requires dokku >= [c77cbf1][] |
|
||||
| [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | Requires dokku >= [c77cbf1][] |
|
||||
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | Compatible with 0.2.0 |
|
||||
| [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>1</sup> | [musicglue][] | Compatible with dokku master branch |
|
||||
| [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>1</sup> | [motin][] | Compatible with 0.2.1 |
|
||||
| [registry](https://github.com/agco-adm/dokku-registry)<sup>5</sup> | [agco-adm](https://github.com/agco-adm) | |
|
||||
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>2</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | Requires dokku >= [c77cbf1][] |
|
||||
| [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | Requires dokku >= [c77cbf1][]. 2014-02-17: [a043e98][] targeting dokku @ [latest][217d00a] |
|
||||
| [Docker name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | Requires dokku >= [c77cbf1][] |
|
||||
| [No VHOST](https://github.com/alex-sherwin/dokku-novhost) | [alex-sherwin][] | Requires dokku >= [c77cbf1][] |
|
||||
| [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | |
|
||||
| [Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
|
||||
| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | |
|
||||
| [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | |
|
||||
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | |
|
||||
| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | Compatible with 0.3.1+ |
|
||||
| [Multiple domains and per-app custom nginx.conf](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | Works with v0.2.3 |
|
||||
| [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env)| [cameron-martin][] | Works with v0.2.3 |
|
||||
| [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | Works with v0.2.3 |
|
||||
| [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh](https://github.com/mikecsh) | Works with 0.2.0 |
|
||||
| [dokku-registry](https://github.com/agco-adm/dokku-registry) | [agco-adm][] | |
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [app-url](https://github.com/mikecsh/dokku-app-url) | [mikecsh][] | Works with 0.2.0 |
|
||||
| [Custom Domains](https://github.com/neam/dokku-custom-domains) | [motin][] | Compatible with 0.2.* |
|
||||
| [Debug](https://github.com/heichblatt/dokku-debug) | [heichblatt][] | |
|
||||
| [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | |
|
||||
| [Docker Options](https://github.com/dyson/dokku-docker-options) | [dyson][] | dokku >= [c77cbf1][] |
|
||||
| [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] |
|
||||
| [Dokku Registry](https://github.com/agco-adm/dokku-registry) | [agco-adm][] | |
|
||||
| [git rev-parse HEAD in env](https://github.com/nornagon/dokku-git-rev) | [nornagon][] | Compatible with 0.2.0 |
|
||||
| [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | Works with v0.2.3 |
|
||||
| [Host Port binding](https://github.com/stuartpb/dokku-bind-port) | [stuartpb][] | dokku >= [c77cbf1][]. 2014-02-17: [a043e98][] targeting dokku @ [latest][217d00a] |
|
||||
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | |
|
||||
| [Link Containers](https://github.com/rlaneve/dokku-link) | [rlaneve][] | dokku >= [c77cbf1][] |
|
||||
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
|
||||
| [Multiple Domains](https://github.com/wmluke/dokku-domains-plugin)<sup>4</sup> | [wmluke][] | Compatible with 0.2.0 |
|
||||
| [Nginx-Alt](https://github.com/mikexstudios/dokku-nginx-alt) | [mikexstudios][] | Works with v0.2.3 |
|
||||
| [Persistent Storage](https://github.com/dyson/dokku-persistent-storage) | [dyson][] | Requires dokku >= [c77cbf1][] |
|
||||
| [Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
|
||||
| [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | |
|
||||
| [Rebuild application](https://github.com/scottatron/dokku-rebuild) | [scottatron][] | Compatible with 0.2.x |
|
||||
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>2</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env) | [cameron-martin][] | Works with v0.2.3 |
|
||||
| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | Compatible with 0.3.1 |
|
||||
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | Compatible with 0.2.0 |
|
||||
|
||||
[8fca220]: https://github.com/progrium/dokku/commit/8fca2204edb0017796d6915ca9157c05b1238e28
|
||||
[217d00a]: https://github.com/progrium/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
|
||||
[98332de]: https://github.com/dyson/dokku-persistent-storage/commit/98332de4b5b640610bee535f4d5260263074e18b
|
||||
[a043e98]: https://github.com/stuartpb/dokku-bind-port/commit/a043e9892f4815b6525c850131e09fd64db5c1fa
|
||||
|
||||
<sup>1</sup> Similar to the heroku-labs feature (see https://devcenter.heroku.com/articles/labs-user-env-compile)
|
||||
|
||||
<sup>2</sup> Adds the possibility to add SSH deployment keys to receive private hosted packages
|
||||
|
||||
<sup>3</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
|
||||
@@ -165,21 +250,22 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
|
||||
### Other Add-ons
|
||||
|
||||
| Plugin | Author | Compatibility |
|
||||
| --- | --- | --- |
|
||||
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar](https://github.com/pnegahdar) | |
|
||||
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk](https://github.com/ademuk) | |
|
||||
| [Chef cookbooks](https://github.com/fgrehm/chef-dokku) | [fgrehm][] | |
|
||||
| [Bower install](https://github.com/alexanderbeletsky/dokku-bower-install) | [alexanderbeletsky][] | |
|
||||
| [Bower/Grunt](https://github.com/thrashr888/dokku-bower-grunt-build-plugin) | [thrashr888][] | |
|
||||
| [Bower/Gulp](https://github.com/gdi2290/dokku-bower-gulp-build-plugin) | [gdi2290](https://github.com/gdi2290) | |
|
||||
| [Elasticsearch](https://github.com/robv/dokku-elasticsearch) | [robv][] | |
|
||||
| [Elasticsearch](https://github.com/jezdez/dokku-elasticsearch-plugin) | [jezdez][] | Compatible with 0.2.0 |
|
||||
| [Elasticsearch](https://github.com/blag/dokku-elasticsearch-plugin)<sup>1</sup> | [blag][] | Compatible with 0.2.0 |
|
||||
| [HipChat Notifications](https://github.com/cef/dokku-hipchat) | [cef][] | |
|
||||
| [Graphite/statsd] (https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski][] | |
|
||||
| [APT](https://github.com/F4-Group/dokku-apt) | [F4-Group][] | |
|
||||
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski](https://github.com/mlebkowski) | |
|
||||
| [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel](https://github.com/darkpixel/) | |
|
||||
| Plugin | Author | Compatibility |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains |
|
||||
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | |
|
||||
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | |
|
||||
| [Chef cookbooks](https://github.com/fgrehm/chef-dokku) | [fgrehm][] | |
|
||||
| [Bower install](https://github.com/alexanderbeletsky/dokku-bower-install) | [alexanderbeletsky][] | |
|
||||
| [Bower/Grunt](https://github.com/thrashr888/dokku-bower-grunt-build-plugin) | [thrashr888][] | |
|
||||
| [Bower/Gulp](https://github.com/gdi2290/dokku-bower-gulp-build-plugin) | [gdi2290][] | |
|
||||
| [Elasticsearch](https://github.com/robv/dokku-elasticsearch) | [robv][] | Not compatible with >= 0.3.0 (still uses /home/git) |
|
||||
| [Elasticsearch](https://github.com/jezdez/dokku-elasticsearch-plugin) | [jezdez][] | Compatible with 0.2.0 to 0.3.13 |
|
||||
| [Elasticsearch](https://github.com/blag/dokku-elasticsearch-plugin)<sup>1</sup> | [blag][] | Compatible with 0.2.0 |
|
||||
| [HipChat Notifications](https://github.com/cef/dokku-hipchat) | [cef][] | |
|
||||
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski][] | |
|
||||
| [APT](https://github.com/F4-Group/dokku-apt) | [F4-Group][] | |
|
||||
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | |
|
||||
| [PrimeCache](https://github.com/darkpixel/dokku-prime-cache) | [darkpixel][] | |
|
||||
|
||||
<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.
|
||||
|
||||
13
docs/process-management.md
Normal file
13
docs/process-management.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Process/Container management
|
||||
|
||||
Dokku supports rudimentary process (really container) management via the `ps` plugin.
|
||||
|
||||
```
|
||||
ps <app> List processes running in app container(s)
|
||||
ps:start <app> Start app container(s)
|
||||
ps:stop <app> Stop app container(s)
|
||||
ps:restart <app> Restart app container(s)
|
||||
ps:restartall Restart all deployed app containers
|
||||
```
|
||||
|
||||
*NOTE*: As of v0.3.14, `dokku deploy:all` in now deprecated by `ps:restartall` and will be removed in a future version.
|
||||
@@ -1,11 +1,11 @@
|
||||
# Remote commands
|
||||
|
||||
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@progriumapp.com <command>`
|
||||
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@dokku.me <command>`
|
||||
The `-t` is used to request a pty. It is highly recommended to do so.
|
||||
To avoid the need to type the `-t` option each time, simply create/modify a section in the `.ssh/config` on the client side, as follows:
|
||||
|
||||
```
|
||||
Host progriumapp.com
|
||||
Host dokku.me
|
||||
RequestTTY yes
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ RequestTTY yes
|
||||
|
||||
It's possible to run commands in the environment of the deployed application:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
dokku run node-js-app ls -alh
|
||||
dokku run <app> <cmd>
|
||||
```
|
||||
|
||||
@@ -54,8 +54,15 @@
|
||||
list-style-position: outside;
|
||||
padding-left: 20px;
|
||||
}
|
||||
th:nth-of-type(1) {
|
||||
width: 230px;
|
||||
}
|
||||
th:nth-of-type(2) {
|
||||
width: 140px;
|
||||
}
|
||||
tr, td {
|
||||
text-align: center;
|
||||
line-height: 24px;
|
||||
text-align: left;
|
||||
}
|
||||
#gistbody h1:first-child {
|
||||
border-bottom: 1px solid #dadada;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# TLS/SPDY support
|
||||
|
||||
Dokku provides easy TLS/SPDY support out of the box. This can be done app-by-app or for all subdomains at once. Note that whenever TLS support is enabled SPDY is also enabled.
|
||||
|
||||
## Per App
|
||||
|
||||
To enable TLS connection to to one of your applications, copy or symlink the `.crt`/`.pem` and `.key` files into the application's `/home/dokku/:app/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively.
|
||||
|
||||
Redeployment of the application will be needed to apply TLS configuration. Once it is redeployed, the application will be accessible by `https://` (redirection from `http://` is applied as well).
|
||||
|
||||
## All Subdomains
|
||||
|
||||
To enable TLS connections for all your applications at once you will need a wildcard TLS certificate.
|
||||
|
||||
To enable TLS across all apps, copy or symlink the `.crt`/`.pem` and `.key` files into the `/home/dokku/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively. Then, enable the certificates by editing `/etc/nginx/conf.d/dokku.conf` and uncommenting these two lines (remove the #):
|
||||
|
||||
```
|
||||
ssl_certificate /home/dokku/tls/server.crt;
|
||||
ssl_certificate_key /home/dokku/tls/server.key;
|
||||
```
|
||||
|
||||
The nginx configuration will need to be reloaded in order for the updated TLS configuration to be applied. This can be done either via the init system or by re-deploying the application. Once TLS is enabled, the application will be accessible by `https://` (redirection from `http://` is applied as well).
|
||||
|
||||
**Note**: TLS will not be enabled unless the application's VHOST matches the certificate's name. (i.e. if you have a cert for *.example.com TLS won't be enabled for something.example.org or example.net)
|
||||
|
||||
## HSTS Header
|
||||
|
||||
The [HSTS header](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) is an HTTP header that can inform browsers that all requests to a given site should be made via HTTPS. dokku does not, by default, enable this header. It is thus left up to you, the user, to enable it for your site.
|
||||
|
||||
Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails.
|
||||
@@ -22,7 +22,7 @@ http {
|
||||
```
|
||||
|
||||
Note that the `server_names_hash_bucket_size` setting defines the maximum domain name length.
|
||||
A value of 64 would allow domains with up to 46 characters. Set it to 128 if you need longer ones.
|
||||
A value of 64 would allow domains with up to 64 characters. Set it to 128 if you need longer ones.
|
||||
|
||||
Save the file and try stopping nginx and starting it again:
|
||||
|
||||
@@ -43,11 +43,51 @@ __Solution:__
|
||||
|
||||
The `remote rejected` error does not give enough information. Anything could have failed.
|
||||
|
||||
Create a `/home/dokku/dokkurc` file containing the following :
|
||||
To enable dokku tracing, simply run the following command:
|
||||
|
||||
# Since 0.3.9
|
||||
dokku trace
|
||||
|
||||
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following :
|
||||
|
||||
export DOKKU_TRACE=1
|
||||
|
||||
This will trace all of dokku's activity. If this does not help you create a pastebin or a gist containing the full log, and create an issue.
|
||||
This will trace all of dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
|
||||
|
||||
***
|
||||
|
||||
__Symptom:__ I get the aforementioned error in the build phase (after turning on dokku tracing)
|
||||
|
||||
Most errors that happen in this phase are due to transient network issues (either locally or remotely) buildpack bugs.
|
||||
|
||||
__Solution (Less solution, more helpful troubleshooting steps):__
|
||||
|
||||
Find the failed phase's container image (*077581956a92* in this example)
|
||||
|
||||
```
|
||||
root@dokku:~# docker ps -a | grep builder
|
||||
94d9515e6d93 077581956a92 "/build/builder" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
|
||||
```
|
||||
|
||||
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
|
||||
|
||||
```
|
||||
root@dokku:~# docker run -ti 077581956a92 /bin/bash
|
||||
root@9763ab86e1b4:/# curl -s -S icanhazip.com
|
||||
192.168.0.1
|
||||
curl http://s3pository.heroku.com/node/v0.10.30/node-v0.10.30-linux-x64.tar.gz -o node-v0.10.30-linux-x64.tar.gz
|
||||
tar tzf node-v0.10.30-linux-x64.tar.gz
|
||||
...
|
||||
```
|
||||
|
||||
Sometimes (especially on DO) deploying again seems to get past these seemingly transient issues
|
||||
Additionally we've seen issues if changing networks that have different DNS resolvers. In this case, you can run the following to update your resolv.conf
|
||||
|
||||
```
|
||||
root@dokku:~# resolvconf -u
|
||||
```
|
||||
|
||||
Please see https://github.com/progrium/dokku/issues/841 and https://github.com/progrium/dokku/issues/649
|
||||
|
||||
***
|
||||
|
||||
@@ -100,3 +140,4 @@ 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
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ Dokku is in active development. You can update the deployment step and the build
|
||||
|
||||
To update the deploy step (this is updated less frequently):
|
||||
|
||||
```bash
|
||||
```shell
|
||||
cd ~/dokku
|
||||
git pull origin master
|
||||
git pull --tags origin master
|
||||
sudo make install
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@ Nothing needs to be restarted. Changes will take effect on the next push / deplo
|
||||
|
||||
To update the build step:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/progrium/buildstep.git
|
||||
cd buildstep
|
||||
git pull origin master
|
||||
@@ -34,7 +34,7 @@ This should be summary of breaking changes between 0.1 and 0.2 version with inst
|
||||
|
||||
software-properties-common is now a dependency for plugins. Before running dokku install script, make sure it is installed.
|
||||
|
||||
```bash
|
||||
```shell
|
||||
> sudo apt-get install software-properties-common
|
||||
```
|
||||
|
||||
@@ -60,7 +60,7 @@ There is an upgrade [script](https://gist.github.com/plietar/7201430), which is
|
||||
1. run the script as root
|
||||
2. `git pull` to get the latest version of dokku
|
||||
3. make install
|
||||
4. `dokku deploy:all`
|
||||
4. `dokku ps:restartall`
|
||||
|
||||
TDB.
|
||||
|
||||
|
||||
140
dokku
140
dokku
@@ -1,59 +1,91 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
export DOKKU_ROOT=${DOKKU_ROOT:="/home/dokku"}
|
||||
shopt -s nullglob
|
||||
|
||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
|
||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="progrium/buildstep"}
|
||||
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
|
||||
|
||||
export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
|
||||
export DOKKU_NOT_IMPLEMENTED_EXIT=10
|
||||
export DOKKU_VALID_EXIT=0
|
||||
|
||||
source "$PLUGIN_PATH/common/functions"
|
||||
|
||||
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
|
||||
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done
|
||||
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
if [[ $(id -un) != "dokku" && $1 != plugins-install* ]]; then
|
||||
sudo -u dokku -H $0 "$@"
|
||||
parse_args "$@"
|
||||
for arg in "$@"; do
|
||||
[[ "$arg" =~ ^-.* ]] && shift 1
|
||||
done
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then
|
||||
sudo -u dokku -E -H $0 "$@"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
||||
export -n SSH_ORIGINAL_COMMAND
|
||||
$0 $SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
if [[ $1 =~ config-* ]];then
|
||||
xargs $0 <<<$SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
else
|
||||
$0 $SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
receive)
|
||||
APP="$2"; IMAGE="dokku/$APP"
|
||||
echo "-----> Cleaning up ..."
|
||||
dokku_log_info1 "Cleaning up ..."
|
||||
dokku cleanup
|
||||
echo "-----> Building $APP ..."
|
||||
dokku_log_info1 "Building $APP ..."
|
||||
cat | dokku build $APP
|
||||
echo "-----> Releasing $APP ..."
|
||||
dokku_log_info1 "Releasing $APP ..."
|
||||
dokku release $APP
|
||||
echo "-----> Deploying $APP ..."
|
||||
dokku_log_info1 "Deploying $APP ..."
|
||||
dokku deploy $APP
|
||||
echo "=====> Application deployed:"
|
||||
echo " $(dokku url $APP)"
|
||||
dokku_log_info2 "Application deployed:"
|
||||
dokku urls $APP | sed "s/^/ /"
|
||||
echo
|
||||
;;
|
||||
|
||||
build)
|
||||
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
id=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
test $(docker wait $id) -eq 0
|
||||
id=$(cat | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
|
||||
pluginhook pre-build $APP
|
||||
id=$(docker run -d -v $CACHE_DIR:/cache $IMAGE /build/builder)
|
||||
|
||||
# *DEPRECATED* in v0.4.0: `pluginhook docker-args` will be removed in future releases
|
||||
# https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP build)
|
||||
DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP)
|
||||
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build/builder)
|
||||
docker attach $id
|
||||
test $(docker wait $id) -eq 0
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
|
||||
pluginhook post-build $APP
|
||||
;;
|
||||
|
||||
release)
|
||||
APP="$2"; IMAGE="dokku/$APP"
|
||||
pluginhook pre-release $APP
|
||||
if [[ -f "$DOKKU_ROOT/ENV" ]]; then
|
||||
id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh" < "$DOKKU_ROOT/ENV")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then
|
||||
id=$(cat "$DOKKU_ROOT/$APP/ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/app-env.sh")
|
||||
test $(docker wait $id) -eq 0
|
||||
id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh" < "$DOKKU_ROOT/$APP/ENV")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
pluginhook post-release $APP
|
||||
@@ -68,9 +100,20 @@ case "$1" in
|
||||
fi
|
||||
|
||||
# start the app
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
|
||||
id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web")
|
||||
port=$(docker port $id 5000 | sed 's/[0-9.]*://')
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP deploy)
|
||||
DOCKER_ARGS+=$(: | pluginhook docker-args-deploy $APP)
|
||||
BIND_EXTERNAL=$(pluginhook bind-external-ip $APP)
|
||||
|
||||
if [[ "$BIND_EXTERNAL" = "false" ]];then
|
||||
port=5000
|
||||
id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE /bin/bash -c "/start web")
|
||||
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
|
||||
else
|
||||
id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web")
|
||||
port=$(docker port $id 5000 | sed 's/[0-9.]*://')
|
||||
ipaddr=127.0.0.1
|
||||
fi
|
||||
echo $ipaddr > "$DOKKU_ROOT/$APP/IP"
|
||||
|
||||
# if we can't post-deploy successfully, kill new container
|
||||
function kill_new {
|
||||
@@ -81,21 +124,32 @@ case "$1" in
|
||||
|
||||
# run checks first, then post-deploy hooks, which switches Nginx traffic
|
||||
trap kill_new INT TERM EXIT
|
||||
echo "-----> Running pre-flight checks"
|
||||
pluginhook check-deploy $id $APP $port
|
||||
dokku_log_info1 "Running pre-flight checks"
|
||||
pluginhook check-deploy $id $APP $port ${ipaddr:-localhost}
|
||||
|
||||
# now using the new container
|
||||
echo $id > "$DOKKU_ROOT/$APP/CONTAINER"
|
||||
echo $port > "$DOKKU_ROOT/$APP/PORT"
|
||||
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL"
|
||||
|
||||
echo "-----> Running post-deploy"
|
||||
pluginhook post-deploy $APP $port
|
||||
dokku_log_info1 "Running post-deploy"
|
||||
pluginhook post-deploy $APP $port $ipaddr
|
||||
trap - INT TERM EXIT
|
||||
|
||||
# kill the old container
|
||||
if [[ -n "$oldid" ]]; then
|
||||
docker inspect $oldid &> /dev/null && docker kill $oldid > /dev/null
|
||||
# Let the old container finish processing requests, before terminating it
|
||||
WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
|
||||
dokku_log_info1 "Shutting down old container in $WAIT seconds"
|
||||
(
|
||||
exec >/dev/null 2>/dev/null </dev/null
|
||||
trap '' INT HUP
|
||||
sleep $WAIT
|
||||
docker kill $oldid
|
||||
) & disown -a
|
||||
# Use trap since disown/nohup don't seem to keep child alive
|
||||
# Give child process just enough time to set the traps
|
||||
sleep 0.1
|
||||
fi
|
||||
|
||||
;;
|
||||
@@ -119,26 +173,48 @@ case "$1" in
|
||||
pluginhook dependencies
|
||||
;;
|
||||
|
||||
# temporary hack for https://github.com/progrium/dokku/issues/82
|
||||
plugins-update)
|
||||
pluginhook update
|
||||
;;
|
||||
|
||||
# DEPRECATED as of v0.3.14
|
||||
deploy:all)
|
||||
for app in $(ls -d $DOKKU_ROOT/*/); do
|
||||
APP=$(basename $app);
|
||||
dokku deploy $APP
|
||||
done
|
||||
echo "*DEPRECATED* in v0.3.14: deploy:all will be removed in future versions"
|
||||
dokku ps:restartall
|
||||
;;
|
||||
|
||||
help|'')
|
||||
echo "Usage: dokku [-q|--quiet|-t|--trace|--rm-container|-rm] COMMAND <app> [command-specific-options]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
|
||||
cat<<EOF | pluginhook commands help | sort
|
||||
help Print the list of commands
|
||||
plugins Print active plugins
|
||||
plugins-install Install active plugins
|
||||
plugins-update Update active plugins
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
for script in $(ls -d $PLUGIN_PATH/*/commands); do
|
||||
$script "$@"
|
||||
implemented=0
|
||||
for script in $PLUGIN_PATH/*/commands; do
|
||||
set +e; $script "$@" ; exit_code=$? ; set -e
|
||||
if [ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
implemented=1
|
||||
if [ "$exit_code" -ne "$DOKKU_VALID_EXIT" ]; then
|
||||
exit $exit_code
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$implemented" -eq 0 ]; then
|
||||
dokku_log_warn "\`$*\` is not a dokku command."
|
||||
dokku_log_warn "See \`dokku help\` for a list of available commands."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
64
dokku.1
64
dokku.1
@@ -1,64 +0,0 @@
|
||||
.TH DOKKU 1 2014-05-10
|
||||
.\"Make sure to change that date when you commit a change!
|
||||
.\"
|
||||
.SH NAME
|
||||
dokku \- configure and get information from your dokku installation
|
||||
.\"
|
||||
.SH SYNOPSIS
|
||||
.B dokku
|
||||
.I <command>
|
||||
.\"
|
||||
.SH DESCRIPTION
|
||||
.B dokku
|
||||
is a catch-all command to configure your apps,
|
||||
work with plugins and inspect the current state of your server.
|
||||
.\"
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI backup:import " file"
|
||||
Import dokku config files.
|
||||
.TP
|
||||
.BI backup:export " file"
|
||||
Export dokku config files.
|
||||
.TP
|
||||
.BI config " <app>"
|
||||
Display the config vars for an app.
|
||||
.TP
|
||||
.BI config:get " <app> KEY"
|
||||
Display a specific config var for an app.
|
||||
.TP
|
||||
.BI config:set " <app> KEY1=VAL1" \fR\ (KEY2=VAL2\ \.\.\.)
|
||||
Set one or more config vars for an app.
|
||||
.TP
|
||||
.BI config:unset " <app> KEY1" \fR\ (KEY2\ \.\.\.)
|
||||
Remove one or more config vars from an app.
|
||||
.TP
|
||||
.BI delete " <app>"
|
||||
Delete an application.
|
||||
.TP
|
||||
.B help
|
||||
Print the list of commands.
|
||||
.TP
|
||||
.B logs \ \fI<app> \fR[\fI-t\fR]
|
||||
Show the last logs for an application (-t follows)
|
||||
.TP
|
||||
.B plugins-install
|
||||
Install active plugins.
|
||||
.TP
|
||||
.B plugins
|
||||
Print active plugins.
|
||||
.TP
|
||||
.BI run " <app> command"
|
||||
Run a command in the environment of an app.
|
||||
.TP
|
||||
.BI url " <app>"
|
||||
Show the url for an app.
|
||||
.TP
|
||||
.B version
|
||||
Print dokku's version.
|
||||
.\"
|
||||
.SH NOTES
|
||||
This man page does not include commands added
|
||||
by non-default plugins. To see the full list
|
||||
of commands available to your current dokku
|
||||
installation, run \fBdokku help\fR.
|
||||
@@ -8,7 +8,7 @@ TARGET_DIR="$3"
|
||||
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
|
||||
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
|
||||
mkdir -p $TARGET_DIR/.ssh
|
||||
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys
|
||||
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > tmpfile && mv tmpfile $TARGET_DIR/.ssh/authorized_keys
|
||||
chmod 0700 $TARGET_DIR/.ssh
|
||||
chmod 0600 $TARGET_DIR/.ssh/*
|
||||
fi
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
case "$1" in
|
||||
trace)
|
||||
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p $DOKKU_ROOT/.dokkurc
|
||||
[[ "$2" == "on" ]] || [[ "$2" == "off" ]] || {
|
||||
echo "Valid trace options are [on/off]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ "$2" == "on" ]]; then
|
||||
echo "Enabling dokku trace"
|
||||
echo "export DOKKU_TRACE=1" > $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
|
||||
fi
|
||||
|
||||
if [[ "$2" == "off" ]]; then
|
||||
echo "Disabling dokku trace"
|
||||
rm -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
|
||||
fi
|
||||
;;
|
||||
|
||||
delete)
|
||||
dokku apps:destroy $2
|
||||
;;
|
||||
|
||||
logs)
|
||||
if [[ -z $2 ]]; then
|
||||
echo "Please specify an app to run the command on"
|
||||
exit 1
|
||||
fi
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2";
|
||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
||||
echo "App $APP does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
|
||||
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
|
||||
@@ -30,32 +43,46 @@ case "$1" in
|
||||
;;
|
||||
|
||||
run)
|
||||
if [[ -z $2 ]]; then
|
||||
echo "Please specify an app to run the command on"
|
||||
exit 1
|
||||
fi
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"; IMAGE="dokku/$APP"
|
||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
||||
echo "App $APP does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shift 2
|
||||
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
|
||||
docker run -i -t $DOCKER_ARGS $IMAGE /exec "$@"
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP run)
|
||||
DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP)
|
||||
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
|
||||
has_tty && DOKKU_RUN_OPTS+=" -i -t"
|
||||
|
||||
docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE /exec "$@"
|
||||
;;
|
||||
|
||||
url)
|
||||
APP="$2";
|
||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
||||
echo "App $APP does not exist"
|
||||
exit 1
|
||||
url | urls)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"; SCHEME="http"; SSL="$DOKKU_ROOT/$APP/tls"; WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
|
||||
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]] || [[ -e "$WILDCARD_SSL/server.crt" && -e "$WILDCARD_SSL/server.key" ]]; then
|
||||
SCHEME="https"
|
||||
fi
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||
echo $(< "$DOKKU_ROOT/$APP/URL")
|
||||
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
case "$1" in
|
||||
url)
|
||||
echo "$SCHEME://$(head -n1 "$DOKKU_ROOT/$APP/VHOST")"
|
||||
;;
|
||||
urls)
|
||||
for vhost in $(< "$DOKKU_ROOT/$APP/VHOST"); do
|
||||
echo "$SCHEME://$vhost"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
elif [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
echo "$SCHEME://$(< "$DOKKU_ROOT/VHOST")"
|
||||
else
|
||||
echo "$SCHEME://$(< "$DOKKU_ROOT/HOSTNAME"):$(< "$DOKKU_ROOT/$APP/PORT")"
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
|
||||
version)
|
||||
cat "$DOKKU_ROOT/VERSION" || {
|
||||
@@ -68,9 +95,14 @@ case "$1" in
|
||||
cat && cat<<EOF
|
||||
logs <app> [-t] Show the last logs for an application (-t follows)
|
||||
run <app> <cmd> Run a command in the environment of an application
|
||||
url <app> Show the URL for an application
|
||||
url <app> Show the first URL for an application (compatibility)
|
||||
urls <app> Show all URLs for an application
|
||||
version Print dokku's version
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -2,18 +2,42 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME
|
||||
hostname -f > $DOKKU_ROOT/HOSTNAME
|
||||
fi
|
||||
|
||||
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
|
||||
# redeploys all apps after a reboot
|
||||
cat<<EOF > /etc/init/dokku-redeploy.conf
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
cat<<EOF > /etc/init/dokku-redeploy.conf
|
||||
description "Dokku app redeploy service"
|
||||
|
||||
start on (started docker)
|
||||
|
||||
script
|
||||
sleep 2 # give docker some time
|
||||
sudo -i -u dokku /usr/local/bin/dokku deploy:all
|
||||
sudo -i -u dokku /usr/local/bin/dokku ps:restartall
|
||||
end script
|
||||
EOF
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
cat<<EOF > /etc/systemd/system/dokku-redeploy.service
|
||||
[Unit]
|
||||
Description=Dokku app redeploy service
|
||||
After=docker.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=dokku
|
||||
ExecStart=/usr/local/bin/dokku ps:restartall
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,47 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
case "$1" in
|
||||
apps)
|
||||
echo "=== My Apps"
|
||||
find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2
|
||||
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
|
||||
;;
|
||||
|
||||
apps:create)
|
||||
if [[ -z $2 ]]; then
|
||||
echo "Please specify an app to create"
|
||||
exit 1
|
||||
fi
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ -d "$DOKKU_ROOT/$2" ]] && dokku_log_warn "Name is already taken" && exit 1
|
||||
APP="$2"
|
||||
if [[ -d "$DOKKU_ROOT/$APP" ]]; then
|
||||
echo " ! Name is already taken"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP"
|
||||
echo "Creating $APP... done"
|
||||
;;
|
||||
|
||||
apps:destroy)
|
||||
if [[ -z $2 ]]; then
|
||||
echo "Please specify an app to delete"
|
||||
exit 1
|
||||
fi
|
||||
APP="$2"; IMAGE="dokku/$APP";
|
||||
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
|
||||
echo "App $APP does not exist"
|
||||
exit 1
|
||||
fi
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
|
||||
APP="$2"; IMAGE="dokku/$APP"
|
||||
|
||||
echo " ! WARNING: Potentially Destructive Action"
|
||||
echo " ! This command will destroy $APP (including all add-ons)."
|
||||
echo " ! To proceed, type \"$APP\""
|
||||
echo ""
|
||||
[[ "$3" == "force" ]] && DOKKU_APPS_FORCE_DELETE=1
|
||||
if [[ -z "$DOKKU_APPS_FORCE_DELETE" ]]; then
|
||||
dokku_log_warn "WARNING: Potentially Destructive Action"
|
||||
dokku_log_warn "This command will destroy $APP (including all add-ons)."
|
||||
dokku_log_warn "To proceed, type \"$APP\""
|
||||
echo ""
|
||||
|
||||
read -p "> " app_name
|
||||
if [[ "$app_name" != "$APP" ]]; then
|
||||
echo " ! Confirmation did not match $APP. Aborted."
|
||||
exit 1
|
||||
read -p "> " app_name
|
||||
if [[ "$app_name" != "$APP" ]]; then
|
||||
dokku_log_warn "Confirmation did not match $APP. Aborted."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Destroying $APP (including all add-ons)"
|
||||
@@ -59,7 +52,7 @@ case "$1" in
|
||||
pluginhook post-delete $APP
|
||||
;;
|
||||
|
||||
help)
|
||||
help | apps:help)
|
||||
cat && cat<<EOF
|
||||
apps List your apps
|
||||
apps:create <app> Create a new app
|
||||
@@ -67,4 +60,8 @@ case "$1" in
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -3,5 +3,5 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
if [[ -d $CACHE_DIR ]]; then
|
||||
docker run -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \;
|
||||
docker run --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||
fi
|
||||
|
||||
@@ -14,7 +14,7 @@ case "$1" in
|
||||
: | pluginhook backup-export 1 $BACKUP_DIR | tar -cf $BACKUP_TMP_FILE --files-from -
|
||||
|
||||
pushd $BACKUP_DIR > /dev/null
|
||||
ls -d */ | grep -oE '[^/]+' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
|
||||
find . -maxdepth 1 -type d -not -name . | sed 's:./::g' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
|
||||
popd > /dev/null
|
||||
|
||||
# we want to insert the files in the root of the tar
|
||||
@@ -85,11 +85,15 @@ case "$1" in
|
||||
echo "Import complete."
|
||||
;;
|
||||
|
||||
help)
|
||||
help | backup:help)
|
||||
cat && cat<<EOF
|
||||
backup:export [file] Export dokku configuration files
|
||||
backup:import [file] Import dokku configuration files
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
32
plugins/build-env/pre-build
Executable file
32
plugins/build-env/pre-build
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
APP="$1"; IMAGE="dokku/$APP"; BUILD_ENV=""
|
||||
|
||||
[[ -f "$DOKKU_ROOT/BUILD_ENV" ]] && cat "$DOKKU_ROOT/BUILD_ENV" >> "$DOKKU_ROOT/ENV" && rm "$DOKKU_ROOT/BUILD_ENV"
|
||||
|
||||
! (grep -q CURL_CONNECT_TIMEOUT "$DOKKU_ROOT/ENV" > /dev/null 2>&1) && echo "export CURL_CONNECT_TIMEOUT=5" >> "$DOKKU_ROOT/ENV"
|
||||
! (grep -q CURL_TIMEOUT "$DOKKU_ROOT/ENV" > /dev/null 2>&1) && echo "export CURL_TIMEOUT=30" >> "$DOKKU_ROOT/ENV"
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/ENV" ]]; then
|
||||
BUILD_ENV+=$(< "$DOKKU_ROOT/ENV")
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then
|
||||
BUILD_ENV+=" "
|
||||
BUILD_ENV+=$(< "$DOKKU_ROOT/$APP/ENV")
|
||||
fi
|
||||
|
||||
if [[ ! -z "$BUILD_ENV" ]]; then
|
||||
dokku_log_info1 "Adding BUILD_ENV to build environment..."
|
||||
# create build env files for use in buildpacks like this:
|
||||
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
|
||||
id=$(echo $BUILD_ENV |sed 's@export @@g'| docker run -i -a stdin $IMAGE /bin/bash -c "for ENV_VAR in $(cat); do echo \$ENV_VAR |sed 's@^\([^=]*\)=\(.*\)\$@echo \\\"\2\\\" >/tmp/env/\1@g' >>/tmp/set_env.sh; done && mkdir -p /tmp/env && /bin/bash /tmp/set_env.sh")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
|
||||
# create build env for 'old style' buildpacks and dokku plugins
|
||||
id=$(echo "$BUILD_ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "cat >> /app/.env")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
@@ -18,6 +18,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
CONTAINERID="$1"; APP="$2"; PORT="$3" ; HOSTNAME="${4:-localhost}"
|
||||
|
||||
# source in app env to get DOKKU_CHECKS_WAIT and any other necessary vars
|
||||
[[ -f "$DOKKU_ROOT/ENV" ]] && source $DOKKU_ROOT/ENV
|
||||
[[ -f "$DOKKU_ROOT/$APP/ENV" ]] && source $DOKKU_ROOT/$APP/ENV
|
||||
# echo "DOKKU_CHECKS_WAIT is $DOKKU_CHECKS_WAIT"
|
||||
FILENAME="$DOKKU_ROOT/$APP/CHECKS"
|
||||
@@ -56,20 +57,20 @@ sleep $WAIT
|
||||
# --location Follow redirects
|
||||
CURL_OPTIONS="-q --compressed --fail --location --max-time 30"
|
||||
|
||||
cat "$FILENAME" | while read PATHNAME EXPECTED ; do
|
||||
while read PATHNAME EXPECTED; do
|
||||
# Ignore empty lines and lines starting with #
|
||||
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^\# ]] && continue
|
||||
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^# ]] && continue
|
||||
|
||||
URL="http://$HOSTNAME:$PORT$PATHNAME"
|
||||
|
||||
echo "checking with: curl $CURL_OPTIONS $URL"
|
||||
HTML=$(curl $CURL_OPTIONS $URL)
|
||||
if [[ -n "$EXPECTED" && ! "$HTML" =~ "$EXPECTED" ]] ; then
|
||||
if [[ -n "$EXPECTED" && ! "$HTML" =~ $EXPECTED ]] ; then
|
||||
echo -e "\033[31m\033[1m$URL: expected to but did not find: \"$EXPECTED\"\033[0m"
|
||||
exit 1
|
||||
else
|
||||
echo -e "\033[32m\033[1m$URL => \"$EXPECTED\"\033[0m"
|
||||
fi
|
||||
done
|
||||
done < "$FILENAME"
|
||||
|
||||
echo -e "\033[32m\033[1mAll checks successful!\033[0m"
|
||||
|
||||
73
plugins/common/functions
Normal file
73
plugins/common/functions
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
function has_tty() {
|
||||
if [[ "$(/usr/bin/tty || true)" == "not a tty" ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function dokku_log_info1() {
|
||||
echo "-----> $@"
|
||||
}
|
||||
|
||||
function dokku_log_info2() {
|
||||
echo "=====> $@"
|
||||
}
|
||||
|
||||
function dokku_log_info1_quiet() {
|
||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then
|
||||
echo "-----> $@"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function dokku_log_info2_quiet() {
|
||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then
|
||||
echo "=====> $@"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function dokku_log_verbose() {
|
||||
echo " $@"
|
||||
}
|
||||
|
||||
function dokku_log_warn() {
|
||||
echo " ! $@"
|
||||
}
|
||||
|
||||
function dokku_log_fail() {
|
||||
echo "$@" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function verify_app_name() {
|
||||
local APP="$1"
|
||||
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
|
||||
return 0
|
||||
}
|
||||
|
||||
function parse_args() {
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--quiet|-q)
|
||||
export DOKKU_QUIET_OUTPUT=1
|
||||
;;
|
||||
--trace|-t)
|
||||
export DOKKU_TRACE=1
|
||||
;;
|
||||
--rm-container|-rm)
|
||||
export DOKKU_RM_CONTAINER=1
|
||||
;;
|
||||
--force|-f)
|
||||
export DOKKU_APPS_FORCE_DELETE=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return 0
|
||||
}
|
||||
@@ -1,28 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
# Check if name is specified
|
||||
if [[ $1 == config ]] || [[ $1 == config:* ]]; then
|
||||
if [[ -z $2 ]]; then
|
||||
echo "You must specify an app name"
|
||||
exit 1
|
||||
else
|
||||
APP="$2"
|
||||
ENV_FILE="$DOKKU_ROOT/$APP/ENV"
|
||||
ENV_FILE_TEMP="$DOKKU_ROOT/$APP/ENV.tmp"
|
||||
|
||||
# Check if app exists with the same name
|
||||
if [ ! -d "$DOKKU_ROOT/$APP" ]; then
|
||||
echo "App $APP does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f $ENV_FILE ] || {
|
||||
echo "-----> Creating $ENV_FILE"
|
||||
touch $ENV_FILE
|
||||
}
|
||||
fi
|
||||
fi
|
||||
ENV_FILE="$DOKKU_ROOT/$2/ENV"
|
||||
ENV_FILE_TEMP="$DOKKU_ROOT/$2/ENV.tmp"
|
||||
config_create () {
|
||||
[ -f $ENV_FILE ] || {
|
||||
touch $ENV_FILE
|
||||
}
|
||||
}
|
||||
|
||||
config_styled_hash () {
|
||||
vars="$1"
|
||||
@@ -30,60 +16,47 @@ config_styled_hash () {
|
||||
|
||||
longest=""
|
||||
while read -r word; do
|
||||
KEY=`echo $word | cut -d"=" -f1`
|
||||
KEY=$(echo $word | cut -d"=" -f1)
|
||||
if [ ${#KEY} -gt ${#longest} ]; then
|
||||
longest=$KEY
|
||||
fi
|
||||
done <<< "$vars"
|
||||
|
||||
while read -r word; do
|
||||
KEY=`echo $word | cut -d"=" -f1`
|
||||
VALUE=`echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"`
|
||||
KEY=$(echo $word | cut -d"=" -f1)
|
||||
VALUE=$(echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//")
|
||||
|
||||
num_zeros=$((${#longest} - ${#KEY}))
|
||||
zeros=" "
|
||||
while [ $num_zeros -gt 0 ]; do
|
||||
zeros="$zeros "
|
||||
num_zeros=$(($num_zeros - 1))
|
||||
num_zeros=$((num_zeros - 1))
|
||||
done
|
||||
echo "$prefix$KEY:$zeros$VALUE"
|
||||
done <<< "$vars"
|
||||
}
|
||||
|
||||
config_restart_app() {
|
||||
APP="$1";
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
|
||||
echo "-----> Releasing $APP ..."
|
||||
dokku release $APP
|
||||
echo "-----> Release complete!"
|
||||
echo "-----> Deploying $APP ..."
|
||||
dokku deploy $APP
|
||||
echo "-----> Deploy complete!"
|
||||
fi
|
||||
}
|
||||
|
||||
config_write() {
|
||||
ENV_TEMP="$1"
|
||||
echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE_TEMP
|
||||
if ! cmp -s $ENV_FILE $ENV_FILE_TEMP; then
|
||||
cp -f $ENV_FILE_TEMP $ENV_FILE
|
||||
chmod 600 $ENV_FILE
|
||||
config_restart_app $APP
|
||||
dokku ps:restart $APP
|
||||
fi
|
||||
rm -f $ENV_FILE_TEMP
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
config)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
|
||||
echo "$APP has no config vars"
|
||||
exit 1
|
||||
fi
|
||||
config_create
|
||||
[[ ! -s $ENV_FILE ]] && echo "$APP has no config vars" && exit 1
|
||||
|
||||
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
|
||||
VARS=$(grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | cut -d" " -f2-)
|
||||
|
||||
for var in "$@"; do
|
||||
if [[ "$var" == "--shell" ]]; then
|
||||
@@ -92,36 +65,45 @@ case "$1" in
|
||||
fi
|
||||
done
|
||||
|
||||
echo "=== $APP config vars ==="
|
||||
dokku_log_info2_quiet "$APP config vars"
|
||||
config_styled_hash "$VARS"
|
||||
;;
|
||||
;;
|
||||
|
||||
config:get)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku config:get APP KEY"
|
||||
echo "Must specify KEY."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
|
||||
exit 1
|
||||
config_create
|
||||
if [[ ! -s $ENV_FILE ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
KEY="$3"
|
||||
|
||||
cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
|
||||
;;
|
||||
grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
|
||||
;;
|
||||
|
||||
config:set)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [[ -z "${*:3}" ]]; then
|
||||
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
|
||||
echo "Must specify KEY and VALUE to set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
|
||||
config_create
|
||||
ENV_ADD=""
|
||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||
ENV_TEMP=$(cat "${ENV_FILE}")
|
||||
RESTART_APP=false
|
||||
shift 2
|
||||
|
||||
@@ -134,8 +116,8 @@ case "$1" in
|
||||
done
|
||||
|
||||
for var; do
|
||||
KEY=`echo ${var} | cut -d"=" -f1`
|
||||
VALUE=`echo ${var} | cut -d"=" -f2-`
|
||||
KEY=$(echo ${var} | cut -d"=" -f1)
|
||||
VALUE=$(echo ${var} | cut -d"=" -f2-)
|
||||
|
||||
if [[ $KEY =~ [a-zA-Z_][a-zA-Z0-9_]* ]]; then
|
||||
RESTART_APP=true
|
||||
@@ -149,39 +131,47 @@ ${var}"
|
||||
ENV_ADD=$(echo "$ENV_ADD" | tail -n +2) #remove first empty line
|
||||
|
||||
if [ $RESTART_APP ]; then
|
||||
echo "-----> Setting config vars and restarting $APP"
|
||||
dokku_log_info1 "Setting config vars and restarting $APP"
|
||||
config_styled_hash "$ENV_ADD" " "
|
||||
|
||||
config_write "$ENV_TEMP"
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
|
||||
config:unset)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku config:unset APP KEY1 [KEY2 ...]"
|
||||
echo "Must specify KEY to unset."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
|
||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||
config_create
|
||||
ENV_TEMP=$(cat "${ENV_FILE}")
|
||||
VARS="${*:3}"
|
||||
|
||||
for var in $VARS; do
|
||||
echo "-----> Unsetting $var and restarting $APP"
|
||||
dokku_log_info1 "Unsetting $var and restarting $APP"
|
||||
ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $var=/ d")
|
||||
|
||||
config_write "$ENV_TEMP"
|
||||
done
|
||||
;;
|
||||
;;
|
||||
|
||||
help)
|
||||
help | config:help)
|
||||
cat && cat<<EOF
|
||||
config <app> Display the config vars for an app
|
||||
config:get <app> KEY Display a config value for an app
|
||||
config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
|
||||
config:unset <app> KEY1 [KEY2 ...] Unset one or more config vars
|
||||
EOF
|
||||
;;
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
9
plugins/domains/backup-export
Executable file
9
plugins/domains/backup-export
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
shopt -s nullglob
|
||||
VERSION="$1"
|
||||
BASE_DIR="$2"
|
||||
|
||||
cat; for i in $BASE_DIR/*/VHOST; do echo $i; done
|
||||
cat; for i in $BASE_DIR/*/nginx.conf.template; do echo $i; done
|
||||
15
plugins/domains/backup-import
Executable file
15
plugins/domains/backup-import
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
shopt -s nullglob
|
||||
VERSION="$1"
|
||||
IMPORT_DIR="$2"
|
||||
TARGET_DIR="$3"
|
||||
|
||||
cd $IMPORT_DIR
|
||||
for file in */VHOST; do
|
||||
cp $file "$TARGET_DIR/$file"
|
||||
done
|
||||
for file in */nginx.conf.template; do
|
||||
cp $file "$TARGET_DIR/$file"
|
||||
done
|
||||
132
plugins/domains/commands
Executable file
132
plugins/domains/commands
Executable file
@@ -0,0 +1,132 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}"
|
||||
|
||||
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
|
||||
|
||||
case "$1" in
|
||||
domains)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
dokku domains:setup $APP
|
||||
dokku_log_info2_quiet "$APP Domain Names"
|
||||
cat "$DOKKU_ROOT/$APP/VHOST"
|
||||
;;
|
||||
|
||||
domains:setup)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"; VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
if [[ ! -f $VHOST_PATH ]]; then
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" ]];then
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
else
|
||||
VHOST=$(< "$DOKKU_ROOT/HOSTNAME")
|
||||
fi
|
||||
if [[ "$VHOST" =~ $RE_IPV4 ]] || [[ "$VHOST" =~ $RE_IPV6 ]];then
|
||||
echo "unsupported vhost config found. disabling vhost support"
|
||||
[[ ! $(grep -q NO_VHOST "$DOKKU_ROOT/$APP/ENV") ]] && echo "export NO_VHOST='1'" >> "$DOKKU_ROOT/$APP/ENV"
|
||||
else
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
dokku_log_info1 "Creating new $VHOST_PATH..."
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
if [[ ! -n $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$hostname" > $VHOST_PATH
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
domains:add)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku $1 $APP DOMAIN"
|
||||
echo "Must specify DOMAIN."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $(egrep ^"$3"$ "$DOKKU_ROOT/$APP/VHOST" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
||||
echo "$3 is already defined for $APP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dokku domains:setup $APP
|
||||
echo "$3" >> "$DOKKU_ROOT/$APP/VHOST"
|
||||
# we need to restart the app to make sure we're binding to the appropriate network interface
|
||||
dokku ps:restart $APP
|
||||
pluginhook post-domains-update $APP
|
||||
dokku_log_info1 "Added $3 to $APP"
|
||||
|
||||
;;
|
||||
|
||||
domains:clear)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
rm -f "$DOKKU_ROOT/$APP/VHOST"
|
||||
dokku domains:setup $APP
|
||||
pluginhook post-domains-update $APP
|
||||
dokku_log_info1 "Cleared domains in $APP"
|
||||
|
||||
;;
|
||||
|
||||
domains:remove)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku $1 $2 DOMAIN"
|
||||
echo "Must specify DOMAIN."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dokku domains:setup $APP
|
||||
sed -i "/^$3$/d" "$DOKKU_ROOT/$APP/VHOST"
|
||||
pluginhook post-domains-update $APP
|
||||
dokku_log_info1 "Removed $3 from $APP"
|
||||
|
||||
;;
|
||||
|
||||
help | domains:help)
|
||||
cat && cat<<EOF
|
||||
domains <app> List custom domains for app
|
||||
domains:add <app> DOMAIN Add a custom domain to app
|
||||
domains:clear <app> Clear all custom domains for app
|
||||
domains:remove <app> DOMAIN Remove a custom domain from app
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
8
plugins/domains/install
Executable file
8
plugins/domains/install
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
shopt -s nullglob
|
||||
|
||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||
APP=$(basename "$(dirname $app)");
|
||||
dokku domains:setup $APP
|
||||
done
|
||||
@@ -6,14 +6,13 @@ git_archive_all() {
|
||||
TMP_WORK_DIR=$(mktemp -d)
|
||||
chmod 755 $TMP_WORK_DIR
|
||||
unset GIT_DIR GIT_WORK_TREE
|
||||
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
|
||||
pushd $TMP_WORK_DIR > /dev/null
|
||||
git clone -q $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null
|
||||
git config advice.detachedHead false
|
||||
git checkout $REV &> /dev/null
|
||||
git submodule update --init --recursive &> /dev/null
|
||||
find -name .git -prune -exec rm -rf {} \; > /dev/null
|
||||
tar c .
|
||||
popd > /dev/null
|
||||
rm -rf $TMP_WORK_DIR > /dev/null
|
||||
}
|
||||
|
||||
@@ -26,7 +25,7 @@ case "$1" in
|
||||
# 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
|
||||
git_archive_all $APP $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
|
||||
dokku git-build $APP $newrev
|
||||
else
|
||||
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
|
||||
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"
|
||||
@@ -34,6 +33,32 @@ case "$1" in
|
||||
done
|
||||
;;
|
||||
|
||||
git-upload-pack)
|
||||
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
||||
pluginhook git-pre-pull $APP
|
||||
cat | git-upload-pack "$DOKKU_ROOT/$APP"
|
||||
pluginhook git-post-pull $APP
|
||||
;;
|
||||
|
||||
git-build)
|
||||
APP="$2"; APP_BUILD_LOCK="$DOKKU_ROOT/$APP/.build.lock"
|
||||
APP_BUILD_LOCK_MSG="$APP is currently being deployed or locked. Waiting..."
|
||||
[[ $(flock -n "$APP_BUILD_LOCK" true &>/dev/null ; echo $?) -ne 0 ]] && echo "$APP_BUILD_LOCK_MSG"
|
||||
|
||||
shift 1
|
||||
flock -o "$APP_BUILD_LOCK" dokku git-build-locked "$@"
|
||||
;;
|
||||
|
||||
git-build-locked)
|
||||
APP="$2"
|
||||
if [[ $# -ge 3 ]];then
|
||||
REF="$3"
|
||||
else
|
||||
REF=$(< "$DOKKU_ROOT/$APP/refs/heads/master")
|
||||
fi
|
||||
git_archive_all $APP $REF | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
|
||||
;;
|
||||
|
||||
git-*)
|
||||
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
|
||||
APP_PATH=$DOKKU_ROOT/$APP
|
||||
@@ -50,12 +75,16 @@ EOF
|
||||
chmod +x $PRERECEIVE_HOOK
|
||||
fi
|
||||
|
||||
args=$@
|
||||
args=$*
|
||||
git-shell -c "$args"
|
||||
;;
|
||||
|
||||
help)
|
||||
help | git:help)
|
||||
cat
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -9,6 +9,6 @@ TARGET_DIR="$3"
|
||||
cd $IMPORT_DIR
|
||||
|
||||
for file in */tls/server.*; do
|
||||
mkdir -p $(dirname $TARGET_DIR$file)
|
||||
mkdir -p "$(dirname $TARGET_DIR$file)"
|
||||
cp $file $TARGET_DIR$file
|
||||
done
|
||||
|
||||
34
plugins/nginx-vhosts/bind-external-ip
Executable file
34
plugins/nginx-vhosts/bind-external-ip
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"
|
||||
set +e; NO_VHOST=$(dokku config:get $APP NO_VHOST); set -e
|
||||
|
||||
RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}"
|
||||
|
||||
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
|
||||
|
||||
[[ -f "$DOKKU_ROOT/VHOST" ]] && GLOBAL_VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
|
||||
if [[ -n "$NO_VHOST" ]]; then
|
||||
echo true # bind to external ip. VHOST is disabled
|
||||
elif [[ "$GLOBAL_VHOST" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV6 ]]; then
|
||||
echo true # bind to external ip. GLOBAL_VHOST is somehow an IPv4 or IPv6 address
|
||||
elif [[ -z "$GLOBAL_VHOST" ]] && [[ ! -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
echo true # bind to external ip. no GLOBAL_VHOST and no app vhost
|
||||
elif [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
echo false # bind to docker ip. this app has a vhost defined
|
||||
else
|
||||
echo false
|
||||
fi
|
||||
139
plugins/nginx-vhosts/commands
Executable file
139
plugins/nginx-vhosts/commands
Executable file
@@ -0,0 +1,139 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
restart_nginx () {
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
nginx:build-config)
|
||||
APP="$2"; DOKKU_APP_LISTEN_PORT="$3"; DOKKU_APP_LISTEN_IP="${4}"
|
||||
VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
SSL="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then
|
||||
DOKKU_APP_LISTEN_PORT=$(< "$DOKKU_ROOT/$APP/PORT")
|
||||
fi
|
||||
if [[ -z "$DOKKU_APP_LISTEN_IP" ]] && [[ -f "$DOKKU_ROOT/$APP/IP" ]]; then
|
||||
DOKKU_APP_LISTEN_IP=$(< "$DOKKU_ROOT/$APP/IP")
|
||||
fi
|
||||
|
||||
[[ -f "$DOKKU_ROOT/ENV" ]] && source $DOKKU_ROOT/ENV
|
||||
[[ -f "$DOKKU_ROOT/$APP/ENV" ]] && source $DOKKU_ROOT/$APP/ENV
|
||||
|
||||
if [[ ! -n "$NO_VHOST" ]] && [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
NONSSL_VHOSTS=$(cat $VHOST_PATH)
|
||||
if [[ -e "$SSL/server.crt" ]] && [[ -e "$SSL/server.key" ]]; then
|
||||
SSL_INUSE="$SSL"
|
||||
SSL_DIRECTIVES=$(cat <<EOF
|
||||
ssl_certificate $SSL_INUSE/server.crt;
|
||||
ssl_certificate_key $SSL_INUSE/server.key;
|
||||
EOF
|
||||
)
|
||||
elif [[ -e "$WILDCARD_SSL/server.crt" ]] && [[ -e "$WILDCARD_SSL/server.key" ]]; then
|
||||
SSL_INUSE="$WILDCARD_SSL"
|
||||
SSL_DIRECTIVES=""
|
||||
fi
|
||||
|
||||
NGINX_CONF="$PLUGIN_PATH/nginx-vhosts/templates/nginx.conf"
|
||||
SCHEME="http"
|
||||
if [[ -n "$SSL_INUSE" ]]; then
|
||||
NGINX_CONF="$PLUGIN_PATH/nginx-vhosts/templates/nginx.ssl.conf"
|
||||
SCHEME="https"
|
||||
|
||||
SSL_HOSTNAME=$(openssl x509 -in $SSL_INUSE/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-)
|
||||
SSL_HOSTNAME=$(echo "$SSL_HOSTNAME" | sed 's|\.|\\.|g' | sed 's/\*/\.\*/g')
|
||||
[[ -z "$(egrep ^"$SSL_HOSTNAME"$ $VHOST_PATH)" ]] && echo "$SSL_HOSTNAME" | sed 's/\\./\./g' >> $VHOST_PATH
|
||||
|
||||
SSL_HOSTNAME_ALT=$(openssl x509 -in $SSL_INUSE/server.crt -noout -text | grep --after-context=1 '509v3 Subject Alternative Name:' | tail -n 1 | sed -e "s/[[:space:]]*DNS://g" | tr ',' '\n' || true)
|
||||
SSL_HOSTNAME_ALT=$(echo "$SSL_HOSTNAME_ALT" | sed 's|\.|\\.|g' | sed 's/\*/\.\*/g')
|
||||
[[ -z "$(egrep ^"$SSL_HOSTNAME_ALT"$ $VHOST_PATH)" ]] && echo "$SSL_HOSTNAME_ALT" | sed 's/\\./\./g' >> $VHOST_PATH
|
||||
|
||||
SSL_VHOSTS=$(egrep "^${SSL_HOSTNAME}$|^${SSL_HOSTNAME_ALT}$" $VHOST_PATH || exit 0)
|
||||
NONSSL_VHOSTS=$(egrep -v "^${SSL_HOSTNAME}$|^${SSL_HOSTNAME_ALT}$" $VHOST_PATH || exit 0)
|
||||
|
||||
while read line; do
|
||||
dokku_log_info1 "Configuring SSL for $line..."
|
||||
SSL_SERVER_NAME=$line
|
||||
eval "cat <<< \"$(< $NGINX_CONF)\" >> $DOKKU_ROOT/$APP/nginx.conf"
|
||||
done <<< "$SSL_VHOSTS"
|
||||
fi
|
||||
|
||||
APP_NGINX_TEMPLATE="$DOKKU_ROOT/$APP/nginx.conf.template"
|
||||
if [[ -f $APP_NGINX_TEMPLATE ]]; then
|
||||
dokku_log_info1 "Overriding default nginx.conf with detected nginx.conf.template"
|
||||
NGINX_CONF=$APP_NGINX_TEMPLATE
|
||||
fi
|
||||
|
||||
xargs -i echo "-----> Configuring {}..." < $VHOST_PATH
|
||||
# Include SSL_VHOSTS so we can redirect http to https on that hostname as well
|
||||
NOSSL_SERVER_NAME=$(echo $NONSSL_VHOSTS $SSL_VHOSTS| tr '\n' ' ')
|
||||
|
||||
if [[ -n "$DOKKU_APP_LISTEN_PORT" ]] && [[ -n "$DOKKU_APP_LISTEN_IP" ]]; then
|
||||
dokku_log_info1 "Creating $SCHEME nginx.conf"
|
||||
echo "upstream $APP { server $DOKKU_APP_LISTEN_IP:$DOKKU_APP_LISTEN_PORT; }" > $DOKKU_ROOT/$APP/nginx.conf
|
||||
eval "cat <<< \"$(< $NGINX_CONF)\" >> $DOKKU_ROOT/$APP/nginx.conf"
|
||||
|
||||
dokku_log_info1 "Running nginx-pre-reload"
|
||||
pluginhook nginx-pre-reload $APP $DOKKU_APP_LISTEN_PORT $DOKKU_APP_LISTEN_IP
|
||||
|
||||
echo " Reloading nginx"
|
||||
restart_nginx
|
||||
fi
|
||||
else
|
||||
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
dokku_log_info1 "VHOST support disabled, deleting $APP/VHOST"
|
||||
rm "$DOKKU_ROOT/$APP/VHOST"
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
|
||||
dokku_log_info1 "VHOST support disabled, deleting nginx.conf"
|
||||
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
||||
|
||||
dokku_log_info1 "VHOST support disabled, reloading nginx after nginx.conf deletion"
|
||||
restart_nginx
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
nginx:import-ssl)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
[[ -t 0 ]] && echo "Tar archive containing server.crt and server.key expected on stdin" && exit 1
|
||||
APP="$2"
|
||||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
cd $TEMP_DIR
|
||||
tar xvf - <&0
|
||||
[[ ! -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1
|
||||
[[ ! -f "$TEMP_DIR/server.key" ]] && echo "Tar archive missing server.key" && exit 1
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP/tls"
|
||||
mv "$TEMP_DIR/server.crt" "$DOKKU_ROOT/$APP/tls/server.crt"
|
||||
mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key"
|
||||
cd $DOKKU_ROOT
|
||||
rm -rf $TEMP_DIR
|
||||
dokku nginx:build-config $APP
|
||||
;;
|
||||
|
||||
help | nginx:help)
|
||||
cat && cat<<EOF
|
||||
nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key
|
||||
nginx:build-config <app> (Re)builds nginx config for given app
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
@@ -1,8 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# latest stable NGINX 1.4.x with websocket support
|
||||
apt-get install -qq -y software-properties-common python-software-properties
|
||||
add-apt-repository -y ppa:nginx/stable
|
||||
apt-get update
|
||||
apt-get install -qq -y nginx dnsutils
|
||||
case "$DOKKU_DISTRO" in
|
||||
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
|
||||
add-apt-repository -y ppa:nginx/stable
|
||||
apt-get update
|
||||
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y nginx dnsutils
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
zypper -q in -y nginx bind-utils
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
||||
touch /etc/sudoers.tmp
|
||||
cp /etc/sudoers /tmp/sudoers.new
|
||||
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
||||
EDITOR="cp /tmp/sudoers.new" visudo
|
||||
rm /tmp/sudoers.new
|
||||
if [[ ! -f /etc/sudoers.d/dokku-nginx ]]; then
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/etc/init.d/nginx reload" >> /etc/sudoers.d/dokku-nginx
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/sbin/service nginx reload" >> /etc/sudoers.d/dokku-nginx
|
||||
;;
|
||||
esac
|
||||
|
||||
chmod 0440 /etc/sudoers.d/dokku-nginx
|
||||
fi
|
||||
|
||||
# if dokku.conf has not been created, create it
|
||||
@@ -21,14 +27,50 @@ ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:
|
||||
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
#ssl_certificate $DOKKU_ROOT/tls/server.crt;
|
||||
#ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
||||
# ssl_certificate $DOKKU_ROOT/tls/server.crt;
|
||||
# ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
||||
EOF
|
||||
fi
|
||||
sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||
fi
|
||||
cat<<EOF > /etc/nginx/nginx.conf
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
/etc/init.d/nginx start
|
||||
events {
|
||||
worker_connections 768;
|
||||
}
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
echo 'server_names_hash_bucket_size 512;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
/etc/init.d/nginx start
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
/sbin/service nginx start
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,94 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
APP="$1"; PORT="$2"
|
||||
WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
SSL="$DOKKU_ROOT/$APP/tls"
|
||||
APP="$1"; PORT="$2"; IP="$3"
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
set +e; NO_VHOST=$(dokku config:get $APP NO_VHOST); set -e
|
||||
|
||||
if [[ -e "$SSL/server.crt" ]] && [[ -e "$SSL/server.key" ]]; then
|
||||
SSL_INUSE="$SSL"
|
||||
SSL_DIRECTIVES=$(cat <<EOF
|
||||
ssl_certificate $SSL_INUSE/server.crt;
|
||||
ssl_certificate_key $SSL_INUSE/server.key;
|
||||
EOF
|
||||
)
|
||||
elif [[ -e "$WILDCARD_SSL/server.crt" ]] && [[ -e "$WILDCARD_SSL/server.key" ]] && [[ $hostname = `openssl x509 -in $WILDCARD_SSL/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-` ]]; then
|
||||
SSL_INUSE="$WILDCARD_SSL"
|
||||
SSL_DIRECTIVES=""
|
||||
fi
|
||||
|
||||
# ssl based nginx.conf
|
||||
if [[ -n "$SSL_INUSE" ]]; then
|
||||
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf
|
||||
upstream $APP { server 127.0.0.1:$PORT; }
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $hostname;
|
||||
return 301 https://\$host\$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen [::]:443 ssl spdy;
|
||||
listen 443 ssl spdy;
|
||||
server_name $hostname;
|
||||
$SSL_DIRECTIVES
|
||||
|
||||
keepalive_timeout 70;
|
||||
add_header Alternate-Protocol 443:npn-spdy/2;
|
||||
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "https://$hostname" > "$DOKKU_ROOT/$APP/URL"
|
||||
else
|
||||
# default nginx.conf
|
||||
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf
|
||||
upstream $APP { server 127.0.0.1:$PORT; }
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $hostname;
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "http://$hostname" > "$DOKKU_ROOT/$APP/URL"
|
||||
fi
|
||||
echo "-----> Running nginx-pre-reload"
|
||||
pluginhook nginx-pre-reload $APP $PORT
|
||||
echo " Reloading nginx"
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
if [[ -n "$NO_VHOST" ]]; then
|
||||
dokku_log_info1 "NO_VHOST config detected"
|
||||
elif [[ ! -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
dokku domains:setup $APP
|
||||
fi
|
||||
|
||||
dokku nginx:build-config $APP $PORT $IP
|
||||
|
||||
7
plugins/nginx-vhosts/post-domains-update
Executable file
7
plugins/nginx-vhosts/post-domains-update
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
APP="$1"
|
||||
|
||||
dokku nginx:build-config $APP
|
||||
17
plugins/nginx-vhosts/templates/nginx.conf
Normal file
17
plugins/nginx-vhosts/templates/nginx.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
28
plugins/nginx-vhosts/templates/nginx.ssl.conf
Normal file
28
plugins/nginx-vhosts/templates/nginx.ssl.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
return 301 https://$SSL_SERVER_NAME\$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen [::]:443 ssl spdy;
|
||||
listen 443 ssl spdy;
|
||||
server_name $SSL_SERVER_NAME;
|
||||
$SSL_DIRECTIVES
|
||||
|
||||
keepalive_timeout 70;
|
||||
add_header Alternate-Protocol 443:npn-spdy/2;
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header X-Forwarded-Port \$server_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
111
plugins/ps/commands
Executable file
111
plugins/ps/commands
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$(dirname $0)/../common/functions"
|
||||
|
||||
release_and_deploy() {
|
||||
source "$(dirname $0)/../common/functions"
|
||||
local APP="$1";
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
|
||||
dokku_log_info1 "Releasing $APP ..."
|
||||
dokku release $APP
|
||||
dokku_log_info1 "Release complete!"
|
||||
dokku_log_info1 "Deploying $APP ..."
|
||||
dokku deploy $APP
|
||||
dokku_log_info2 "Application deployed:"
|
||||
dokku urls $APP | sed "s/^/ /"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
ps)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] && CONTAINER_ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
|
||||
[[ -z "$CONTAINER_ID" ]] && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
docker exec -ti "$CONTAINER_ID" /bin/bash -c "ps auxwww"
|
||||
;;
|
||||
|
||||
ps:start)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] && CONTAINER_ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
|
||||
[[ -z "$CONTAINER_ID" ]] && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
if [[ "$(docker ps -q --no-trunc| grep -q $CONTAINER_ID; echo $?)" != "0" ]]; then
|
||||
release_and_deploy $APP
|
||||
else
|
||||
echo "App $APP already running"
|
||||
fi
|
||||
;;
|
||||
|
||||
ps:stop)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] && CONTAINER_ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
|
||||
[[ -z "$CONTAINER_ID" ]] && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
if [[ "$(docker ps -q --no-trunc| grep -q $CONTAINER_ID; echo $?)" = "0" ]]; then
|
||||
echo "Stopping $APP ..."
|
||||
docker stop $CONTAINER_ID > /dev/null
|
||||
else
|
||||
echo "App $APP already stopped"
|
||||
fi
|
||||
;;
|
||||
|
||||
ps:rebuild)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
APP="$2"
|
||||
|
||||
dokku git-build $APP
|
||||
;;
|
||||
|
||||
ps:rebuildall)
|
||||
shopt -s nullglob
|
||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||
APP=$(basename "$(dirname $app)");
|
||||
dokku ps:rebuild $APP
|
||||
done
|
||||
;;
|
||||
|
||||
ps:restart)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] && CONTAINER_ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
|
||||
[[ -z "$CONTAINER_ID" ]] && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
release_and_deploy $APP
|
||||
;;
|
||||
|
||||
ps:restartall)
|
||||
shopt -s nullglob
|
||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||
APP=$(basename "$(dirname $app)");
|
||||
dokku ps:restart $APP
|
||||
done
|
||||
;;
|
||||
|
||||
help | ps:help)
|
||||
cat && cat<<EOF
|
||||
ps <app> List processes running in app container(s)
|
||||
ps:start <app> Start app container(s)
|
||||
ps:stop <app> Stop app container(s)
|
||||
ps:rebuild <app> Rebuild an app
|
||||
ps:rebuildall Rebuild all apps
|
||||
ps:restart <app> Restart app container(s)
|
||||
ps:restartall Restart all deployed app containers
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
130
tests.mk
Normal file
130
tests.mk
Normal file
@@ -0,0 +1,130 @@
|
||||
shellcheck:
|
||||
ifeq ($(shell shellcheck > /dev/null 2>&1 ; echo $$?),127)
|
||||
ifeq ($(shell uname),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
|
||||
endif
|
||||
endif
|
||||
|
||||
ci-dependencies: shellcheck bats
|
||||
|
||||
setup-deploy-tests:
|
||||
mkdir -p /home/dokku
|
||||
ifdef ENABLE_DOKKU_TRACE
|
||||
echo "-----> Enabling tracing"
|
||||
echo "export DOKKU_TRACE=1" >> /home/dokku/dokkurc
|
||||
endif
|
||||
@echo "Setting dokku.me in /etc/hosts"
|
||||
sudo /bin/bash -c "[[ `ping -c1 dokku.me > /dev/null 2>&1; echo $$?` -eq 0 ]] || echo \"127.0.0.1 dokku.me *.dokku.me www.test.app.dokku.me\" >> /etc/hosts"
|
||||
|
||||
@echo "-----> Generating keypair..."
|
||||
mkdir -p /root/.ssh
|
||||
rm -f /root/.ssh/dokku_test_rsa*
|
||||
echo -e "y\n" | ssh-keygen -f /root/.ssh/dokku_test_rsa -t rsa -N ''
|
||||
chmod 600 /root/.ssh/dokku_test_rsa*
|
||||
|
||||
@echo "-----> Setting up ssh config..."
|
||||
ifneq ($(shell ls /root/.ssh/config > /dev/null 2>&1 ; echo $$?),0)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
else ifeq ($(shell grep dokku.me /root/.ssh/config),)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
endif
|
||||
|
||||
@echo "-----> Installing SSH public key..."
|
||||
sudo sshcommand acl-remove dokku test
|
||||
cat /root/.ssh/dokku_test_rsa.pub | sudo sshcommand acl-add dokku test
|
||||
|
||||
@echo "-----> Intitial SSH connection to populate known_hosts..."
|
||||
ssh -o StrictHostKeyChecking=no dokku@dokku.me help > /dev/null
|
||||
|
||||
ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),)
|
||||
@echo "-----> Setting default VHOST to dokku.me..."
|
||||
echo "dokku.me" > /home/dokku/VHOST
|
||||
endif
|
||||
|
||||
bats:
|
||||
git clone https://github.com/sstephenson/bats.git /tmp/bats
|
||||
cd /tmp/bats && sudo ./install.sh /usr/local
|
||||
rm -rf /tmp/bats
|
||||
|
||||
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" | awk '{ print $$1 }' | sed 's/://g' | grep -v dokku_client.sh | xargs shellcheck -e SC2034,SC2086,SC2143,SC2001
|
||||
|
||||
unit-tests:
|
||||
@echo running unit tests...
|
||||
@$(QUIET) bats tests/unit
|
||||
|
||||
deploy-test-clojure:
|
||||
@echo deploying config app...
|
||||
cd tests && ./test_deploy ./apps/clojure dokku.me
|
||||
|
||||
deploy-test-config:
|
||||
@echo deploying config app...
|
||||
cd tests && ./test_deploy ./apps/config dokku.me
|
||||
|
||||
deploy-test-gitsubmodules:
|
||||
@echo deploying gitsubmodules app...
|
||||
cd tests && ./test_deploy ./apps/gitsubmodules dokku.me
|
||||
|
||||
deploy-test-go:
|
||||
@echo deploying go app...
|
||||
cd tests && ./test_deploy ./apps/go dokku.me
|
||||
|
||||
deploy-test-java:
|
||||
@echo deploying java app...
|
||||
cd tests && ./test_deploy ./apps/java dokku.me
|
||||
|
||||
deploy-test-multi:
|
||||
@echo deploying multi app...
|
||||
cd tests && ./test_deploy ./apps/multi dokku.me
|
||||
|
||||
deploy-test-nodejs-express:
|
||||
@echo deploying nodejs-express app...
|
||||
cd tests && ./test_deploy ./apps/nodejs-express dokku.me
|
||||
|
||||
deploy-test-nodejs-express-noprocfile:
|
||||
@echo deploying nodejs-express app with no Procfile...
|
||||
cd tests && ./test_deploy ./apps/nodejs-express-noprocfile dokku.me
|
||||
|
||||
deploy-test-php:
|
||||
@echo deploying php app...
|
||||
cd tests && ./test_deploy ./apps/php dokku.me
|
||||
|
||||
deploy-test-python-flask:
|
||||
@echo deploying python-flask app...
|
||||
cd tests && ./test_deploy ./apps/python-flask dokku.me
|
||||
|
||||
deploy-test-scala:
|
||||
@echo deploying scala app...
|
||||
cd tests && ./test_deploy ./apps/scala dokku.me
|
||||
|
||||
deploy-test-static:
|
||||
@echo deploying static app...
|
||||
cd tests && ./test_deploy ./apps/static dokku.me
|
||||
|
||||
deploy-tests:
|
||||
@echo running deploy tests...
|
||||
# @$(QUIET) bats tests/deploy
|
||||
@$(QUIET) $(MAKE) deploy-test-config
|
||||
@$(QUIET) $(MAKE) deploy-test-clojure
|
||||
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
||||
@$(QUIET) $(MAKE) deploy-test-go
|
||||
@$(QUIET) $(MAKE) deploy-test-java
|
||||
@$(QUIET) $(MAKE) deploy-test-multi
|
||||
@$(QUIET) $(MAKE) deploy-test-nodejs-express
|
||||
@$(QUIET) $(MAKE) deploy-test-nodejs-express-noprocfile
|
||||
@$(QUIET) $(MAKE) deploy-test-php
|
||||
@$(QUIET) $(MAKE) deploy-test-python-flask
|
||||
@$(QUIET) $(MAKE) deploy-test-scala
|
||||
@$(QUIET) $(MAKE) deploy-test-static
|
||||
|
||||
test: setup-deploy-tests lint unit-tests deploy-tests
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"; echo $output; test "$output" == "bazingaa"
|
||||
set -e; output="$(curl -s -S -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"; echo $output; test "$output" == "bazingaa"
|
||||
|
||||
1
tests/apps/clojure/Procfile
Normal file
1
tests/apps/clojure/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: lein run
|
||||
4
tests/apps/clojure/README.md
Normal file
4
tests/apps/clojure/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Hello Clojure/Compojure
|
||||
=======================
|
||||
|
||||
A minimal Hello World web app in [Clojure](http://clojure.org/), using the [Compojure](https://github.com/weavejester/compojure) web framework.
|
||||
1
tests/apps/clojure/check_deploy
Executable file
1
tests/apps/clojure/check_deploy
Executable file
@@ -0,0 +1 @@
|
||||
set -e; sleep 5; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"
|
||||
7
tests/apps/clojure/project.clj
Normal file
7
tests/apps/clojure/project.clj
Normal file
@@ -0,0 +1,7 @@
|
||||
(defproject clojure-sample "1.0.1"
|
||||
:description "Hello World Clojure Web App"
|
||||
:dependencies [[org.clojure/clojure "1.6.0"]
|
||||
[compojure "1.3.1"]
|
||||
[ring/ring-jetty-adapter "1.3.2"]]
|
||||
:main ^:skip-aot sample.app
|
||||
:min-lein-version "2.0.0")
|
||||
13
tests/apps/clojure/src/sample/app.clj
Normal file
13
tests/apps/clojure/src/sample/app.clj
Normal file
@@ -0,0 +1,13 @@
|
||||
(ns sample.app
|
||||
(:require [ring.adapter.jetty :as jetty]
|
||||
[compojure.core :refer [defroutes GET]]))
|
||||
|
||||
(defroutes handler
|
||||
(GET "/" []
|
||||
{:headers {"Content-type" "text/plain; charset=UTF-8"}
|
||||
:body "Hello World!"}))
|
||||
|
||||
(defn -main []
|
||||
(jetty/run-jetty handler
|
||||
{:port (Integer. (or (System/getenv "PORT") "5000"))
|
||||
:join? false}))
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
base_url="$1"
|
||||
test_url / "config-test"
|
||||
test_url /hello "Hello world"
|
||||
|
||||
test_url () {
|
||||
path="$1"
|
||||
expected_output="$2"
|
||||
url="$base_url$path"
|
||||
output="$(curl -s $url)"
|
||||
echo $output
|
||||
output="$(curl -s -S "$url")"
|
||||
echo "$output"
|
||||
test "$output" == "$expected_output"
|
||||
}
|
||||
}
|
||||
|
||||
base_url="$1"
|
||||
test_url / "config-test"
|
||||
test_url /hello "Hello world"
|
||||
|
||||
@@ -4,5 +4,6 @@ set -ex;
|
||||
REMOTE=$1
|
||||
REPO=$2
|
||||
|
||||
ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO=\"Hello world\"
|
||||
|
||||
# setting config variables with spaces is broken at the moment. ref: 820
|
||||
# ssh "$REMOTE" config:set "$REPO" CONFTEST=config-test HELLO=\"Hello world\"
|
||||
dokku config:set "$REPO" CONFTEST=config-test HELLO="Hello world"
|
||||
|
||||
1
tests/apps/gitsubmodules/CHECKS
Normal file
1
tests/apps/gitsubmodules/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Hello
|
||||
@@ -1 +1 @@
|
||||
web: node node-js-sample/web.js
|
||||
web: node node-js-sample/index.js
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello World!"
|
||||
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"
|
||||
|
||||
1
tests/apps/go/CHECKS
Normal file
1
tests/apps/go/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ go
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; test "$(curl -s $1)" == "go"
|
||||
set -e; test "$(curl -s -S "$1")" == "go"
|
||||
|
||||
1
tests/apps/java/CHECKS
Normal file
1
tests/apps/java/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Hello from Java
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello from Java!"
|
||||
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello from Java!"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
https://github.com/heroku/heroku-buildpack-ruby
|
||||
https://github.com/heroku/heroku-buildpack-nodejs
|
||||
https://github.com/heroku/heroku-buildpack-python
|
||||
https://github.com/heroku/heroku-buildpack-python.git
|
||||
|
||||
1
tests/apps/multi/CHECKS
Normal file
1
tests/apps/multi/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Heroku Multi Buildpack on Dokku
|
||||
@@ -2,5 +2,5 @@ source "https://rubygems.org"
|
||||
|
||||
ruby '1.9.3'
|
||||
|
||||
gem 'compass'
|
||||
gem 'compass', ">= 1.0.1"
|
||||
gem 'sass-globbing'
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
chunky_png (1.3.0)
|
||||
compass (0.12.3)
|
||||
chunky_png (1.3.3)
|
||||
compass (1.0.1)
|
||||
chunky_png (~> 1.2)
|
||||
fssm (>= 0.2.7)
|
||||
sass (= 3.2.14)
|
||||
fssm (0.2.10)
|
||||
sass (3.2.14)
|
||||
sass-globbing (1.1.0)
|
||||
compass-core (~> 1.0.1)
|
||||
compass-import-once (~> 1.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.13, < 3.5)
|
||||
compass-core (1.0.1)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
ffi (1.9.6)
|
||||
multi_json (1.10.1)
|
||||
rb-fsevent (0.9.4)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
sass (3.4.9)
|
||||
sass-globbing (1.1.1)
|
||||
sass (>= 3.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
compass
|
||||
compass (>= 1.0.1)
|
||||
sass-globbing
|
||||
|
||||
@@ -1 +1 @@
|
||||
web: python app.py
|
||||
web: gunicorn app:app
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; curl -s $1 | grep -q "Heroku Multi Buildpack on Dokku"
|
||||
set -e; curl -s -S "$1" | grep -q "Heroku Multi Buildpack on Dokku"
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
{
|
||||
"name": "test-buildpack-multi",
|
||||
"version": "0.0.0",
|
||||
"description": "Test application for heroku multi buildpack.",
|
||||
"author": "Al Johri",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bower": "~1.2.8",
|
||||
"grunt": "~0.4.1",
|
||||
"bower": "^1.3.1",
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-cli": "~0.1.13",
|
||||
"load-grunt-tasks": "~0.2.0",
|
||||
"grunt-contrib-compass": "~0.6.0"
|
||||
"grunt-contrib-compass": "~1.0.1",
|
||||
"load-grunt-tasks": "~1.0.0",
|
||||
"tmp": "0.0.23"
|
||||
},
|
||||
"description": "Test application for heroku multi buildpack.",
|
||||
"engines": {
|
||||
"node": "~0.10.30"
|
||||
},
|
||||
"license": "ISC",
|
||||
"name": "test-buildpack-multi",
|
||||
"scripts": {
|
||||
"postinstall": "./node_modules/bower/bin/bower --allow-root install && ./node_modules/grunt-cli/bin/grunt heroku"
|
||||
}
|
||||
"postinstall": "echo $PATH && ./node_modules/bower/bin/bower install --allow-root && ./node_modules/grunt-cli/bin/grunt --verbose --debug heroku"
|
||||
},
|
||||
"version": "0.0.0"
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Flask==0.10.1
|
||||
gunicorn==18.0
|
||||
|
||||
1
tests/apps/nodejs-express-noprocfile/CHECKS
Normal file
1
tests/apps/nodejs-express-noprocfile/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ nodejs/express
|
||||
2
tests/apps/nodejs-express-noprocfile/check_deploy
Executable file
2
tests/apps/nodejs-express-noprocfile/check_deploy
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "nodejs/express"
|
||||
14
tests/apps/nodejs-express-noprocfile/package.json
Normal file
14
tests/apps/nodejs-express-noprocfile/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "node-example",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"express": "2.5.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": "0.8.x",
|
||||
"npm": "1.1.x"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node web.js"
|
||||
}
|
||||
}
|
||||
12
tests/apps/nodejs-express-noprocfile/web.js
Normal file
12
tests/apps/nodejs-express-noprocfile/web.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var express = require('express');
|
||||
|
||||
var app = express.createServer(express.logger());
|
||||
|
||||
app.get('/', function(request, response) {
|
||||
response.send('nodejs/express');
|
||||
});
|
||||
|
||||
var port = process.env.PORT || 5000;
|
||||
app.listen(port, function() {
|
||||
console.log("Listening on " + port);
|
||||
});
|
||||
1
tests/apps/nodejs-express/CHECKS
Normal file
1
tests/apps/nodejs-express/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ nodejs/express
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "nodejs/express"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "nodejs/express"
|
||||
|
||||
1
tests/apps/php/CHECKS
Normal file
1
tests/apps/php/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ <html><h3>php</h3></html>
|
||||
1
tests/apps/php/Procfile
Normal file
1
tests/apps/php/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: vendor/heroku/heroku-buildpack-php/bin/heroku-php-apache2 web/
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "<html><h3>php</h3></html>"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "<html><h3>php</h3></html>"
|
||||
|
||||
13
tests/apps/php/composer.json
Normal file
13
tests/apps/php/composer.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"description": "a test php app for dokku",
|
||||
"name": "test-php-app/0.1",
|
||||
"require": {
|
||||
"monolog/monolog": "~1.7",
|
||||
"php": ">=5.5.9",
|
||||
"silex/silex": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"heroku/heroku-buildpack-php": "*"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
619
tests/apps/php/composer.lock
generated
Normal file
619
tests/apps/php/composer.lock
generated
Normal file
@@ -0,0 +1,619 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "a5fc7cc479f4ffde4f838b4dbae3583c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/1fbe8c2641f2b163addf49cc5e18f144bec6b19f",
|
||||
"reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "~2.4, >2.4.8",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"graylog2/gelf-php": "~1.0",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"raven/raven": "~0.5",
|
||||
"ruflin/elastica": "0.90.*",
|
||||
"videlalvaro/php-amqplib": "~2.4"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||
"ext-mongo": "Allow sending log messages to a MongoDB server",
|
||||
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||
"raven/raven": "Allow sending log messages to a Sentry server",
|
||||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
|
||||
"videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.12.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Monolog\\": "src/Monolog"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be"
|
||||
}
|
||||
],
|
||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||
"homepage": "http://github.com/Seldaek/monolog",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2014-12-29 21:29:35"
|
||||
},
|
||||
{
|
||||
"name": "pimple/pimple",
|
||||
"version": "v1.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/silexphp/Pimple.git",
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Pimple": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
||||
"homepage": "http://pimple.sensiolabs.org",
|
||||
"keywords": [
|
||||
"container",
|
||||
"dependency injection"
|
||||
],
|
||||
"time": "2013-11-22 08:30:29"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2012-12-21 11:40:51"
|
||||
},
|
||||
{
|
||||
"name": "silex/silex",
|
||||
"version": "v1.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/silexphp/Silex.git",
|
||||
"reference": "57c98ea0cb47664096094912920951fde1f4631a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/silexphp/Silex/zipball/57c98ea0cb47664096094912920951fde1f4631a",
|
||||
"reference": "57c98ea0cb47664096094912920951fde1f4631a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"pimple/pimple": "~1.0",
|
||||
"symfony/event-dispatcher": "~2.3,<3.0",
|
||||
"symfony/http-foundation": "~2.3,<3.0",
|
||||
"symfony/http-kernel": "~2.3,<3.0",
|
||||
"symfony/routing": "~2.3,<3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "~2.2",
|
||||
"monolog/monolog": "~1.4,>=1.4.1",
|
||||
"swiftmailer/swiftmailer": "5.*",
|
||||
"symfony/browser-kit": "~2.3,<3.0",
|
||||
"symfony/config": "~2.3,<3.0",
|
||||
"symfony/css-selector": "~2.3,<3.0",
|
||||
"symfony/debug": "~2.3,<3.0",
|
||||
"symfony/dom-crawler": "~2.3,<3.0",
|
||||
"symfony/finder": "~2.3,<3.0",
|
||||
"symfony/form": "~2.3,<3.0",
|
||||
"symfony/locale": "~2.3,<3.0",
|
||||
"symfony/monolog-bridge": "~2.3,<3.0",
|
||||
"symfony/options-resolver": "~2.3,<3.0",
|
||||
"symfony/process": "~2.3,<3.0",
|
||||
"symfony/security": "~2.3,<3.0",
|
||||
"symfony/serializer": "~2.3,<3.0",
|
||||
"symfony/translation": "~2.3,<3.0",
|
||||
"symfony/twig-bridge": "~2.3,<3.0",
|
||||
"symfony/validator": "~2.3,<3.0",
|
||||
"twig/twig": ">=1.8.0,<2.0-dev"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": "~2.3",
|
||||
"symfony/css-selector": "~2.3",
|
||||
"symfony/dom-crawler": "~2.3",
|
||||
"symfony/form": "~2.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Silex": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Igor Wiedler",
|
||||
"email": "igor@wiedler.ch"
|
||||
}
|
||||
],
|
||||
"description": "The PHP micro-framework based on the Symfony2 Components",
|
||||
"homepage": "http://silex.sensiolabs.org",
|
||||
"keywords": [
|
||||
"microframework"
|
||||
],
|
||||
"time": "2015-01-20 16:45:58"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v2.6.4",
|
||||
"target-dir": "Symfony/Component/Debug",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Debug.git",
|
||||
"reference": "150c80059c3ccf68f96a4fceb513eb6b41f23300"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Debug/zipball/150c80059c3ccf68f96a4fceb513eb6b41f23300",
|
||||
"reference": "150c80059c3ccf68f96a4fceb513eb6b41f23300",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/class-loader": "~2.2",
|
||||
"symfony/http-foundation": "~2.1",
|
||||
"symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/http-foundation": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Debug\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2015-01-21 20:57:55"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v2.6.4",
|
||||
"target-dir": "Symfony/Component/EventDispatcher",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/EventDispatcher.git",
|
||||
"reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f75989f3ab2743a82fe0b03ded2598a2b1546813",
|
||||
"reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.0,>=2.0.5",
|
||||
"symfony/dependency-injection": "~2.6",
|
||||
"symfony/expression-language": "~2.6",
|
||||
"symfony/stopwatch": "~2.3"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\EventDispatcher\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2015-02-01 16:10:57"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v2.6.4",
|
||||
"target-dir": "Symfony/Component/HttpFoundation",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/HttpFoundation.git",
|
||||
"reference": "8fa63d614d56ccfe033e30411d90913cfc483ff6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8fa63d614d56ccfe033e30411d90913cfc483ff6",
|
||||
"reference": "8fa63d614d56ccfe033e30411d90913cfc483ff6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/expression-language": "~2.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\HttpFoundation\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Symfony/Component/HttpFoundation/Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2015-02-01 16:10:57"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v2.6.4",
|
||||
"target-dir": "Symfony/Component/HttpKernel",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/HttpKernel.git",
|
||||
"reference": "27abf3106d8bd08562070dd4e2438c279792c434"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/27abf3106d8bd08562070dd4e2438c279792c434",
|
||||
"reference": "27abf3106d8bd08562070dd4e2438c279792c434",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/debug": "~2.6,>=2.6.2",
|
||||
"symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2",
|
||||
"symfony/http-foundation": "~2.5,>=2.5.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "~2.3",
|
||||
"symfony/class-loader": "~2.1",
|
||||
"symfony/config": "~2.0,>=2.0.5",
|
||||
"symfony/console": "~2.3",
|
||||
"symfony/css-selector": "~2.0,>=2.0.5",
|
||||
"symfony/dependency-injection": "~2.2",
|
||||
"symfony/dom-crawler": "~2.0,>=2.0.5",
|
||||
"symfony/expression-language": "~2.4",
|
||||
"symfony/finder": "~2.0,>=2.0.5",
|
||||
"symfony/process": "~2.0,>=2.0.5",
|
||||
"symfony/routing": "~2.2",
|
||||
"symfony/stopwatch": "~2.3",
|
||||
"symfony/templating": "~2.2",
|
||||
"symfony/translation": "~2.0,>=2.0.5",
|
||||
"symfony/var-dumper": "~2.6"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": "",
|
||||
"symfony/class-loader": "",
|
||||
"symfony/config": "",
|
||||
"symfony/console": "",
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/finder": "",
|
||||
"symfony/var-dumper": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\HttpKernel\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2015-02-02 18:02:30"
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v2.6.4",
|
||||
"target-dir": "Symfony/Component/Routing",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Routing.git",
|
||||
"reference": "bda1c3c67f2a33bbeabb1d321feaf626a0ca5698"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Routing/zipball/bda1c3c67f2a33bbeabb1d321feaf626a0ca5698",
|
||||
"reference": "bda1c3c67f2a33bbeabb1d321feaf626a0ca5698",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/common": "~2.2",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.2",
|
||||
"symfony/expression-language": "~2.4",
|
||||
"symfony/http-foundation": "~2.3",
|
||||
"symfony/yaml": "~2.0,>=2.0.5"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/annotations": "For using the annotation loader",
|
||||
"symfony/config": "For using the all-in-one router or any loader",
|
||||
"symfony/expression-language": "For using expression matching",
|
||||
"symfony/yaml": "For using the YAML loader"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Routing\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Routing Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"keywords": [
|
||||
"router",
|
||||
"routing",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2015-01-15 12:15:12"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "heroku/heroku-buildpack-php",
|
||||
"version": "v59",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/heroku/heroku-buildpack-php.git",
|
||||
"reference": "1746ff03c4c7e44a9c882efd1c90d30baa99f7d4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/1746ff03c4c7e44a9c882efd1c90d30baa99f7d4",
|
||||
"reference": "1746ff03c4c7e44a9c882efd1c90d30baa99f7d4",
|
||||
"shasum": ""
|
||||
},
|
||||
"bin": [
|
||||
"bin/heroku-hhvm-apache2",
|
||||
"bin/heroku-hhvm-nginx",
|
||||
"bin/heroku-php-apache2",
|
||||
"bin/heroku-php-nginx"
|
||||
],
|
||||
"type": "library",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "David Zuelke",
|
||||
"email": "dz@heroku.com"
|
||||
}
|
||||
],
|
||||
"description": "Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP/HHVM and Apache2/Nginx as on Heroku",
|
||||
"homepage": "http://github.com/heroku/heroku-buildpack-php",
|
||||
"keywords": [
|
||||
"apache",
|
||||
"apache2",
|
||||
"foreman",
|
||||
"heroku",
|
||||
"hhvm",
|
||||
"nginx",
|
||||
"php"
|
||||
],
|
||||
"time": "2015-01-29 23:14:14"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
1
tests/apps/python-flask/CHECKS
Normal file
1
tests/apps/python-flask/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ python/flask
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "python/flask"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "python/flask"
|
||||
|
||||
21
tests/apps/scala/LICENSE
Normal file
21
tests/apps/scala/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Joe Kutner
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1
tests/apps/scala/Procfile
Normal file
1
tests/apps/scala/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: target/universal/stage/bin/scala-getting-started
|
||||
33
tests/apps/scala/README.md
Normal file
33
tests/apps/scala/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# scala-getting-started
|
||||
|
||||
A barebones Scala app, which can easily be deployed to Heroku.
|
||||
|
||||
This application support the [Getting Started with Scala on Heroku](https://devcenter.heroku.com/articles/getting-started-with-scala) article - check it out.
|
||||
|
||||
## Running Locally
|
||||
|
||||
Make sure you have Scala and sbt installed. Also, install the [Heroku Toolbelt](https://toolbelt.heroku.com/).
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/heroku/scala-getting-started.git
|
||||
$ cd scala-getting-started
|
||||
$ sbt compile stage
|
||||
$ foreman start web
|
||||
```
|
||||
|
||||
Your app should now be running on [localhost:5000](http://localhost:5000/).
|
||||
|
||||
## Deploying to Heroku
|
||||
|
||||
```sh
|
||||
$ heroku create
|
||||
$ git push heroku master
|
||||
$ heroku open
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
For more information about using Scala on Heroku, see these Dev Center articles:
|
||||
|
||||
- [Scala on Heroku](https://devcenter.heroku.com/categories/scala)
|
||||
|
||||
14
tests/apps/scala/build.sbt
Normal file
14
tests/apps/scala/build.sbt
Normal file
@@ -0,0 +1,14 @@
|
||||
import NativePackagerKeys._
|
||||
|
||||
packageArchetype.java_application
|
||||
|
||||
name := """scala-getting-started"""
|
||||
|
||||
version := "1.0"
|
||||
|
||||
scalaVersion := "2.10.4"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.twitter" % "finagle-http_2.10" % "6.18.0",
|
||||
"postgresql" % "postgresql" % "9.0-801.jdbc4"
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user