Compare commits
111 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a2bdd83f8 | ||
|
|
625424de68 | ||
|
|
0d71293fca | ||
|
|
b6128dc54e | ||
|
|
919ba7ed93 | ||
|
|
f80788147c | ||
|
|
eb7deedd65 | ||
|
|
eb8347bcc1 | ||
|
|
48752a762c | ||
|
|
42a405355f | ||
|
|
b921aed073 | ||
|
|
73b8c3df55 | ||
|
|
1b92f4a97e | ||
|
|
c8a491ed7f | ||
|
|
da4361583b | ||
|
|
0087296bd3 | ||
|
|
6221b7bf4a | ||
|
|
f977edabb2 | ||
|
|
980ffab600 | ||
|
|
a34d36c5d2 | ||
|
|
b2a0b69ed5 | ||
|
|
2315a127ea | ||
|
|
1c1ff64c67 | ||
|
|
9e2a129854 | ||
|
|
a475af1974 | ||
|
|
4264380e15 | ||
|
|
676aa1a05b | ||
|
|
94c06bbdd2 | ||
|
|
1c600b8846 | ||
|
|
7dd9007607 | ||
|
|
e71ad53b0e | ||
|
|
a92687d3e8 | ||
|
|
2aac9c71fc | ||
|
|
ceac86b58f | ||
|
|
3fb8a576a0 | ||
|
|
c786b9e45e | ||
|
|
68fcd67327 | ||
|
|
a54fa57136 | ||
|
|
343a6a159f | ||
|
|
dc2a680a29 | ||
|
|
72fce08e87 | ||
|
|
b60934629e | ||
|
|
e59f115311 | ||
|
|
19dd92e6c7 | ||
|
|
aab390edb6 | ||
|
|
0c11068129 | ||
|
|
ad804f6d3f | ||
|
|
de43eb1e3d | ||
|
|
5d9daa9367 | ||
|
|
0d9e424ede | ||
|
|
603dc0fad6 | ||
|
|
0cf03baa78 | ||
|
|
ba3af25423 | ||
|
|
a084c62e3f | ||
|
|
b429af8ff2 | ||
|
|
287f383f6c | ||
|
|
aefb24082d | ||
|
|
dee0144c7c | ||
|
|
6ca4813247 | ||
|
|
a717cb99a3 | ||
|
|
8551dfb297 | ||
|
|
6a5bbd63a3 | ||
|
|
ca0b2937b9 | ||
|
|
948d507909 | ||
|
|
037324d850 | ||
|
|
6006303409 | ||
|
|
d1b1841034 | ||
|
|
bc70a24e1d | ||
|
|
acc2e84eda | ||
|
|
4f23dd2dd6 | ||
|
|
3a5f68e4d1 | ||
|
|
d30a948be0 | ||
|
|
c44db3f2cf | ||
|
|
1272287d62 | ||
|
|
f4b96cc688 | ||
|
|
65fb016bc3 | ||
|
|
2eccb95477 | ||
|
|
b9152ee77e | ||
|
|
99ec1c0606 | ||
|
|
5373cf2989 | ||
|
|
b85b4c6e99 | ||
|
|
7be4a3ee48 | ||
|
|
2f83b29f1a | ||
|
|
7709a3a2ec | ||
|
|
06d0b07f36 | ||
|
|
0275c65b8a | ||
|
|
1617796bc6 | ||
|
|
6869fda75b | ||
|
|
06017d17ae | ||
|
|
9fc26aeb41 | ||
|
|
dad5db4e9b | ||
|
|
d356cef183 | ||
|
|
c49d849917 | ||
|
|
b36a2a9154 | ||
|
|
252092c73a | ||
|
|
f6cc77bc3a | ||
|
|
cb16cae09b | ||
|
|
bb494b69ea | ||
|
|
f13a660698 | ||
|
|
ce1ca5cc17 | ||
|
|
e700ad32a3 | ||
|
|
0fd829ed3b | ||
|
|
f9a59180f2 | ||
|
|
04c9fe974e | ||
|
|
4b63c96434 | ||
|
|
ef55ce8919 | ||
|
|
0ba6e26788 | ||
|
|
1b481d214c | ||
|
|
d33ea360ac | ||
|
|
8e07d70070 | ||
|
|
06b4585a62 |
@@ -9,3 +9,5 @@ tests
|
|||||||
!contrib/dokku-installer.py
|
!contrib/dokku-installer.py
|
||||||
!contrib/dokku-update
|
!contrib/dokku-update
|
||||||
!contrib/bash-completion
|
!contrib/bash-completion
|
||||||
|
!contrib/docker
|
||||||
|
vendor
|
||||||
|
|||||||
180
HISTORY.md
180
HISTORY.md
@@ -1,5 +1,185 @@
|
|||||||
# History
|
# History
|
||||||
|
|
||||||
|
## 0.17.2
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3568: @josegonzalez Correct issue with clearing global domains
|
||||||
|
|
||||||
|
## 0.17.1
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.1/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.17.1 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3567: @josegonzalez Ignore SC2064
|
||||||
|
|
||||||
|
## 0.17.0
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.0/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.17.0 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3565: @josegonzalez Properly cleanup temp files
|
||||||
|
- #3563: @josegonzalez Properly split strings in sanitized ps:inspect
|
||||||
|
- #3560: @josegonzalez Resource setting fixes
|
||||||
|
- #3556: @josegonzalez Add missing domains:clear-global command
|
||||||
|
- #3554: @znz Switch from rawgit to jsdelivr in manifest.json too
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3566: @josegonzalez Allow users to specify wildcard domains
|
||||||
|
- #3564: @josegonzalez Add config:clear command
|
||||||
|
- #3477: @alexquick Allow specifying environment variables for dokku run
|
||||||
|
- #3540: @josegonzalez Do not append the global domain for matching subdomains
|
||||||
|
- #3559: @josegonzalez Add trace:on and trace:off
|
||||||
|
- #3561: @josegonzalez feat: disable scaling if app contains DOKKU_SCALE file
|
||||||
|
- #3558: @josegonzalez Add nginx:show-conf command
|
||||||
|
- #3549: @josegonzalez Add message indicating that the user is looking at default limits/reservations
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3557: @josegonzalez Standardize on node-js-app in examples
|
||||||
|
- #3548: @josegonzalez Remove outdated global resource setting
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
- #3562: @josegonzalez Proxy ports manipulation updates
|
||||||
|
|
||||||
|
## 0.16.4
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.4/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.16.4 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3547: @josegonzalez Correct retrieval of resource values for alternative schedulers
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3546: @josegonzalez Add ability to trigger an arbitrary plugin hook
|
||||||
|
|
||||||
|
## 0.16.3
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.3/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.16.3 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3541: @josegonzalez Handle case where image is null on first deploy
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3543: @josegonzalez Add ability to clear global domains
|
||||||
|
- #3517: @josegonzalez SSH key updates
|
||||||
|
- #3538: @josegonzalez Silence dokku run 'errors'
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3523: @MarcDiethelm Add an example how to specify a Dockerfile for deployment
|
||||||
|
- #3539: @josegonzalez Warn users when ufw is enabled
|
||||||
|
|
||||||
|
## 0.16.2
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.2/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.16.2 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3536: @josegonzalez docs: Add documentation for nginx-pre-reload limitation
|
||||||
|
- #3535: @josegonzalez Add help output for apps:exists
|
||||||
|
|
||||||
|
## 0.16.1
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.1/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.16.1 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3532: @josegonzalez refactor: allow the scheduler to decide if an app is deployed
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3530: @jhstatewide Updated info about supported Ubuntu versions
|
||||||
|
|
||||||
|
## 0.16.0
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.16.0/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.16.0 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #3527: @josegonzalez Use DOKKU_IMAGE for report command
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3528: @josegonzalez feat: add support for quiet ps:scale output
|
||||||
|
- #3516: @ape-box fix nginx template with Connection header to http_connection
|
||||||
|
- #3513: @Mayeu Support installing plugins via file:// scheme
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3525: @artofrawr add multi dockerfile plugin to plugins.md
|
||||||
|
- #3518: @renestalder Add GitLab GIT_STRATEGY for stop_preview_app
|
||||||
|
- #3506: @vanastassiou Clarify application deployment documentation
|
||||||
|
- #3512: @Mayeu Update example app in deploy tutorial
|
||||||
|
|
||||||
|
## 0.15.5
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.5/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.15.5 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #3511: @josegonzalez Add json output to config:export
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #3510: @josegonzalez Remove SPONSORS doc in favor of OpenCollective
|
||||||
|
- #3509: @Neamar Missing space in markdown formatting
|
||||||
|
- #3507: @renestalder Fix GitLab CI examples
|
||||||
|
|
||||||
## 0.15.4
|
## 0.15.4
|
||||||
|
|
||||||
Install/update via the bootstrap script:
|
Install/update via the bootstrap script:
|
||||||
|
|||||||
@@ -29,9 +29,7 @@
|
|||||||
|
|
||||||
### Additional information
|
### Additional information
|
||||||
|
|
||||||
- Container Inspect Output (if applicable):
|
- Container Inspect Output (if applicable) via `dokku inspect APP_NAME`
|
||||||
- 0.13.0+: `dokku inspect APP_NAME`
|
|
||||||
- <0.13.0: `docker inspect CONTAINER_ID`: WARNING, `docker inspect` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX.
|
|
||||||
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
|
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
|
||||||
- Link to the exact repository being deployed (if possible/applicable):
|
- Link to the exact repository being deployed (if possible/applicable):
|
||||||
- If a deploy is failing or behaving unexpectedly:
|
- If a deploy is failing or behaving unexpectedly:
|
||||||
@@ -40,5 +38,5 @@
|
|||||||
- If using buildpacks, which custom buildpacks are in use
|
- If using buildpacks, which custom buildpacks are in use
|
||||||
- If using a `Dockerfile`, the contents of that file
|
- If using a `Dockerfile`, the contents of that file
|
||||||
- If it exists, the contents of your `Procfile`.
|
- If it exists, the contents of your `Procfile`.
|
||||||
- Output of failing Dokku commands after running `dokku trace on`
|
- Output of failing Dokku commands after running `dokku trace:on`
|
||||||
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
|
(BEWARE: `trace:on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ A fresh VM running any of the following operating systems:
|
|||||||
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.4/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh
|
||||||
sudo DOKKU_TAG=v0.15.4 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
#Sponsors
|
|
||||||
|
|
||||||
[Deis](http://deis.io)
|
|
||||||
|
|
||||||
[DigitalOcean](https://www.digitalocean.com/)
|
|
||||||
|
|
||||||
[Melvin Lammerts](http://dokku.net)
|
|
||||||
@@ -10,7 +10,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
VERSION = 'v0.15.4'
|
VERSION = 'v0.17.2'
|
||||||
|
|
||||||
hostname = ''
|
hostname = ''
|
||||||
try:
|
try:
|
||||||
@@ -37,6 +37,15 @@ if os.path.isfile(key_file):
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
ufw_display = 'block'
|
||||||
|
try:
|
||||||
|
command = "sudo ufw status"
|
||||||
|
ufw_output = subprocess.check_output(command, shell=True).strip()
|
||||||
|
if "inactive" in ufw_output:
|
||||||
|
ufw_display = 'none'
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
ufw_display = 'none'
|
||||||
|
|
||||||
|
|
||||||
def check_boot():
|
def check_boot():
|
||||||
if 'onboot' not in sys.argv:
|
if 'onboot' not in sys.argv:
|
||||||
@@ -77,6 +86,7 @@ def check_boot():
|
|||||||
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
content = PAGE.replace('{VERSION}', VERSION)
|
content = PAGE.replace('{VERSION}', VERSION)
|
||||||
|
content = content.replace('{UFW_DISPLAY}', ufw_display)
|
||||||
content = content.replace('{HOSTNAME}', hostname)
|
content = content.replace('{HOSTNAME}', hostname)
|
||||||
content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file)
|
content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file)
|
||||||
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
|
content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys))
|
||||||
@@ -294,6 +304,9 @@ PAGE = """
|
|||||||
<small class="form-text text-muted">When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname.</small>
|
<small class="form-text text-muted">When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname.</small>
|
||||||
<small class="form-text text-muted">When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app.</small>
|
<small class="form-text text-muted">When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app.</small>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="alert alert-warning small mt-3 d-{UFW_DISPLAY}" role="alert">
|
||||||
|
<strong>Warning:</strong> UFW is active. To allow traffic to specific ports, run <code>sudo ufw allow PORT</code> for the port in question.
|
||||||
|
</div>
|
||||||
<div class="bd-callout bd-callout-info">
|
<div class="bd-callout bd-callout-info">
|
||||||
<h5>What will app URLs look like?</h5>
|
<h5>What will app URLs look like?</h5>
|
||||||
<pre><code id="example">http://hostname:port</code></pre>
|
<pre><code id="example">http://hostname:port</code></pre>
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@@ -1,5 +1,5 @@
|
|||||||
Package: dokku
|
Package: dokku
|
||||||
Version: 0.15.4
|
Version: 0.17.2
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ plugin:enable <name> # Enable a previously disabled plugin
|
|||||||
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
|
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
|
||||||
plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones)
|
plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones)
|
||||||
plugin:list # Print active plugins
|
plugin:list # Print active plugins
|
||||||
|
plugin:trigger <args...>. # Trigger an arbitrary plugin hook
|
||||||
plugin:uninstall <name> # Uninstall a plugin (third-party only)
|
plugin:uninstall <name> # Uninstall a plugin (third-party only)
|
||||||
plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
|
plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
|
||||||
```
|
```
|
||||||
@@ -31,31 +32,31 @@ dokku plugin
|
|||||||
|
|
||||||
```
|
```
|
||||||
plugn: dev
|
plugn: dev
|
||||||
00_dokku-standard 0.15.4 enabled dokku core standard plugin
|
00_dokku-standard 0.17.2 enabled dokku core standard plugin
|
||||||
20_events 0.15.4 enabled dokku core events logging plugin
|
20_events 0.17.2 enabled dokku core events logging plugin
|
||||||
apps 0.15.4 enabled dokku core apps plugin
|
apps 0.17.2 enabled dokku core apps plugin
|
||||||
build-env 0.15.4 enabled dokku core build-env plugin
|
build-env 0.17.2 enabled dokku core build-env plugin
|
||||||
certs 0.15.4 enabled dokku core certificate management plugin
|
certs 0.17.2 enabled dokku core certificate management plugin
|
||||||
checks 0.15.4 enabled dokku core checks plugin
|
checks 0.17.2 enabled dokku core checks plugin
|
||||||
common 0.15.4 enabled dokku core common plugin
|
common 0.17.2 enabled dokku core common plugin
|
||||||
config 0.15.4 enabled dokku core config plugin
|
config 0.17.2 enabled dokku core config plugin
|
||||||
docker-options 0.15.4 enabled dokku core docker-options plugin
|
docker-options 0.17.2 enabled dokku core docker-options plugin
|
||||||
domains 0.15.4 enabled dokku core domains plugin
|
domains 0.17.2 enabled dokku core domains plugin
|
||||||
enter 0.15.4 enabled dokku core enter plugin
|
enter 0.17.2 enabled dokku core enter plugin
|
||||||
git 0.15.4 enabled dokku core git plugin
|
git 0.17.2 enabled dokku core git plugin
|
||||||
logs 0.15.4 enabled dokku core logs plugin
|
logs 0.17.2 enabled dokku core logs plugin
|
||||||
named-containers 0.15.4 enabled dokku core named containers plugin
|
named-containers 0.17.2 enabled dokku core named containers plugin
|
||||||
network 0.15.4 enabled dokku core network plugin
|
network 0.17.2 enabled dokku core network plugin
|
||||||
nginx-vhosts 0.15.4 enabled dokku core nginx-vhosts plugin
|
nginx-vhosts 0.17.2 enabled dokku core nginx-vhosts plugin
|
||||||
plugin 0.15.4 enabled dokku core plugin plugin
|
plugin 0.17.2 enabled dokku core plugin plugin
|
||||||
proxy 0.15.4 enabled dokku core proxy plugin
|
proxy 0.17.2 enabled dokku core proxy plugin
|
||||||
ps 0.15.4 enabled dokku core ps plugin
|
ps 0.17.2 enabled dokku core ps plugin
|
||||||
repo 0.15.4 enabled dokku core repo plugin
|
repo 0.17.2 enabled dokku core repo plugin
|
||||||
shell 0.15.4 enabled dokku core shell plugin
|
shell 0.17.2 enabled dokku core shell plugin
|
||||||
ssh-keys 0.15.4 enabled dokku core ssh-keys plugin
|
ssh-keys 0.17.2 enabled dokku core ssh-keys plugin
|
||||||
storage 0.15.4 enabled dokku core storage plugin
|
storage 0.17.2 enabled dokku core storage plugin
|
||||||
tags 0.15.4 enabled dokku core tags plugin
|
tags 0.17.2 enabled dokku core tags plugin
|
||||||
tar 0.15.4 enabled dokku core tar plugin
|
tar 0.17.2 enabled dokku core tar plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
||||||
|
|||||||
@@ -70,11 +70,31 @@ dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
|
|||||||
|
|
||||||
#### Displaying Resource Limits
|
#### Displaying Resource Limits
|
||||||
|
|
||||||
Running the `resource:limits` command without any flags will display the currently configured app reservation.
|
Running the `resource:limit` command without any flags will display the currently configured default app limits.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku resource:limits node-js-app
|
dokku resource:limit node-js-app
|
||||||
=====> resource limits node-js-app information
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
=====> resource limits node-js-app information [defaults]
|
||||||
|
cpu:
|
||||||
|
memory:
|
||||||
|
memory-swap: 100
|
||||||
|
network: 100
|
||||||
|
network-ingress:
|
||||||
|
network-egress:
|
||||||
|
```
|
||||||
|
|
||||||
|
This may also be combined with the `--process-type` flag to see app limits on a process-type level. Note that the displayed values are not merged with the defaults.
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku resource:limit --process-type web node-js-app
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
=====> resource limits node-js-app information (web)
|
||||||
cpu: 100
|
cpu: 100
|
||||||
memory: 100
|
memory: 100
|
||||||
memory-swap:
|
memory-swap:
|
||||||
@@ -83,64 +103,6 @@ dokku resource:limits node-js-app
|
|||||||
network-egress:
|
network-egress:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Global Resource Limits
|
|
||||||
|
|
||||||
By default, Dokku does not limit any resources, though these can be specified at the server level via the `--global` flag on the `resource:limit` command.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:limit --global --memory 200
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> Setting default resource limits
|
|
||||||
memory: 200
|
|
||||||
```
|
|
||||||
|
|
||||||
This may also be combined with the `--process-type` flag to set global limits on a process-type level:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:limit --global --memory 150 --process-type web node-js-app
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> Setting default resource limits (web)
|
|
||||||
memory: 150
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Displaying Global Resource Limits
|
|
||||||
|
|
||||||
Running the `resource:limit` command with only the `--global` flag will display the currently configured default limits.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:limit --global
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> resource limits default information
|
|
||||||
cpu:
|
|
||||||
memory: 200
|
|
||||||
memory-swap:
|
|
||||||
network:
|
|
||||||
network-ingress:
|
|
||||||
network-egress:
|
|
||||||
```
|
|
||||||
|
|
||||||
This may also be combined with the `--process-type` flag to see global limits on a process-type level:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:limit --global --process-type web
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> resource limits default information (web)
|
|
||||||
cpu:
|
|
||||||
memory-swap:
|
|
||||||
memory: 150
|
|
||||||
network-egress:
|
|
||||||
network-ingress:
|
|
||||||
network:
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Clearing Resource Limits
|
#### Clearing Resource Limits
|
||||||
|
|
||||||
In cases where the values are incorrect - or there is no desire to limit resources - resource limits may be cleared using the `resource:limit-clear` command.
|
In cases where the values are incorrect - or there is no desire to limit resources - resource limits may be cleared using the `resource:limit-clear` command.
|
||||||
@@ -204,11 +166,14 @@ dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
|
|||||||
|
|
||||||
#### Displaying Resource Reservations
|
#### Displaying Resource Reservations
|
||||||
|
|
||||||
Running the `resource:reserve` command without any flags will display the currently configured app reservation.
|
Running the `resource:reserve` command without any flags will display the currently configured default app reservations.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku resource:reserve node-js-app
|
dokku resource:reserve node-js-app
|
||||||
=====> resource reservation node-js-app information
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
=====> resource reservation node-js-app information [defaults]
|
||||||
cpu: 100
|
cpu: 100
|
||||||
memory: 100
|
memory: 100
|
||||||
memory-swap:
|
memory-swap:
|
||||||
@@ -217,64 +182,22 @@ dokku resource:reserve node-js-app
|
|||||||
network-egress:
|
network-egress:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Global Resource Reservations
|
This may also be combined with the `--process-type` flag to see app reservations on a process-type level. Note that the displayed values are not merged with the defaults.
|
||||||
|
|
||||||
By default, Dokku does not reserve any resources, though these can be specified at the server level via the `--global` flag on the `resource:reserve` command.
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku resource:reserve --global --memory 200
|
dokku resource:reserve --process-type web node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
=====> Setting default resource reservation
|
=====> resource reservation node-js-app information (web)
|
||||||
memory: 200
|
cpu: 100
|
||||||
```
|
memory: 100
|
||||||
|
|
||||||
This may also be combined with the `--process-type` flag to set global reservations on a process-type level:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:reserve --global --memory 150 --process-type web node-js-app
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> Setting default resource reservation (web)
|
|
||||||
memory: 150
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Displaying Global Resource Reservations
|
|
||||||
|
|
||||||
Running the `resource:reserve` command with only the `--global` flag will display the currently configured default reservation.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:reserve --global
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> resource reservation default information
|
|
||||||
cpu:
|
|
||||||
memory: 200
|
|
||||||
memory-swap:
|
memory-swap:
|
||||||
network:
|
network:
|
||||||
network-ingress:
|
network-ingress:
|
||||||
network-egress:
|
network-egress:
|
||||||
```
|
```
|
||||||
|
|
||||||
This may also be combined with the `--process-type` flag to see global reservations on a process-type level:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku resource:reserve --global --process-type web
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
=====> resource reservation default information (web)
|
|
||||||
cpu:
|
|
||||||
memory-swap:
|
|
||||||
memory: 150
|
|
||||||
network-egress:
|
|
||||||
network-ingress:
|
|
||||||
network:
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Clearing Resource Reservations
|
#### Clearing Resource Reservations
|
||||||
|
|
||||||
In cases where the values are incorrect - or there is no desire to reserve resources - resource reservations may be cleared using the `resource:reserve-clear` command.
|
In cases where the values are incorrect - or there is no desire to reserve resources - resource reservations may be cleared using the `resource:reserve-clear` command.
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<browserconfig>
|
<browserconfig>
|
||||||
<msapplication>
|
<msapplication>
|
||||||
<tile>
|
<tile>
|
||||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-70x70.png"/>
|
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-70x70.png"/>
|
||||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-150x150.png"/>
|
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-150x150.png"/>
|
||||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-310x310.png"/>
|
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-310x310.png"/>
|
||||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-310x150.png"/>
|
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-310x150.png"/>
|
||||||
<TileColor>#da532c</TileColor>
|
<TileColor>#da532c</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
|
|||||||
@@ -2,37 +2,37 @@
|
|||||||
"name": "Dokku",
|
"name": "Dokku",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||||
"sizes": "36x36",
|
"sizes": "36x36",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "0.75"
|
"density": "0.75"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||||
"sizes": "48x48",
|
"sizes": "48x48",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.0"
|
"density": "1.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||||
"sizes": "72x72",
|
"sizes": "72x72",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.5"
|
"density": "1.5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||||
"sizes": "96x96",
|
"sizes": "96x96",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "2.0"
|
"density": "2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||||
"sizes": "144x144",
|
"sizes": "144x144",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "3.0"
|
"density": "3.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.15.4\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.17.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "4.0"
|
"density": "4.0"
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ h1 {
|
|||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
}
|
}
|
||||||
.header .navbar-brand a {
|
.header .navbar-brand a {
|
||||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/dokku.png);
|
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/dokku.png);
|
||||||
text-indent: 40px;
|
text-indent: 40px;
|
||||||
}
|
}
|
||||||
.blurb {
|
.blurb {
|
||||||
color: #424242;
|
color: #424242;
|
||||||
background-color: #ededed;
|
background-color: #ededed;
|
||||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/gplaypattern.png);
|
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/gplaypattern.png);
|
||||||
padding: 45px 0;
|
padding: 45px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
"0.12.13",
|
"0.12.13",
|
||||||
"0.13.4",
|
"0.13.4",
|
||||||
"0.14.6",
|
"0.14.6",
|
||||||
"0.15.4"
|
"0.15.5",
|
||||||
|
"0.16.4",
|
||||||
|
"0.17.2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ The following plugins are available and provided by Dokku maintainers. Where not
|
|||||||
[Aluxian]: https://github.com/Aluxian
|
[Aluxian]: https://github.com/Aluxian
|
||||||
[Aomitayo]: https://github.com/Aomitayo
|
[Aomitayo]: https://github.com/Aomitayo
|
||||||
[apmorton]: https://github.com/apmorton
|
[apmorton]: https://github.com/apmorton
|
||||||
|
[artofrawr]: https://github.com/artofrawr
|
||||||
[basgys]: https://github.com/basgys
|
[basgys]: https://github.com/basgys
|
||||||
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
|
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
|
||||||
[blag]: https://github.com/blag
|
[blag]: https://github.com/blag
|
||||||
@@ -229,6 +230,7 @@ The following plugins are available and provided by Dokku maintainers. Where not
|
|||||||
| [Long Timeout](https://github.com/investtools/dokku-long-timeout-plugin) | [investtools][] | 0.4.0+ |
|
| [Long Timeout](https://github.com/investtools/dokku-long-timeout-plugin) | [investtools][] | 0.4.0+ |
|
||||||
| [Monit](https://github.com/cjblomqvist/dokku-monit) | [cjblomqvist][] | 0.3.x |
|
| [Monit](https://github.com/cjblomqvist/dokku-monit) | [cjblomqvist][] | 0.3.x |
|
||||||
| [Monorepo](https://github.com/iamale/dokku-monorepo) | [iamale][] | 0.4.0+ |
|
| [Monorepo](https://github.com/iamale/dokku-monorepo) | [iamale][] | 0.4.0+ |
|
||||||
|
| [Multi Dockerfile](https://github.com/artofrawr/dokku-multi-dockerfile) | [artofrawr][] | 0.4.0+ |
|
||||||
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | 0.3.x |
|
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | 0.3.x |
|
||||||
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | 0.3.x |
|
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | 0.3.x |
|
||||||
| [Rollbar](https://github.com/iloveitaly/dokku-rollbar) | [iloveitaly][] | 0.5.0+ |
|
| [Rollbar](https://github.com/iloveitaly/dokku-rollbar) | [iloveitaly][] | 0.5.0+ |
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ review_app:
|
|||||||
image: ilyasemenov/gitlab-ci-git-push
|
image: ilyasemenov/gitlab-ci-git-push
|
||||||
stage: deploy
|
stage: deploy
|
||||||
environment:
|
environment:
|
||||||
name: review/$CI_ENVIRONMENT_SLUG
|
name: review/$CI_COMMIT_REF_NAME
|
||||||
url: https://$CI_ENVIRONMENT_SLUG.dokku.me/
|
url: https://$CI_ENVIRONMENT_SLUG.dokku.me/
|
||||||
on_stop: stop_review_app
|
on_stop: stop_review_app
|
||||||
only:
|
only:
|
||||||
@@ -87,8 +87,10 @@ The above only runs for non-master branches, and will _also_ trigger an `on_stop
|
|||||||
stop_review_app:
|
stop_review_app:
|
||||||
image: ilyasemenov/gitlab-ci-git-push
|
image: ilyasemenov/gitlab-ci-git-push
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
environment:
|
environment:
|
||||||
name: review/$CI_ENVIRONMENT_SLUG
|
name: review/$CI_COMMIT_REF_NAME
|
||||||
action: stop
|
action: stop
|
||||||
when: manual
|
when: manual
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
domains:add <app> <domain> [<domain> ...] # Add domains to app
|
domains:add <app> <domain> [<domain> ...] # Add domains to app
|
||||||
domains:add-global <domain> [<domain> ...] # Add global domain names
|
domains:add-global <domain> [<domain> ...] # Add global domain names
|
||||||
domains:clear <app> # Clear all domains for app
|
domains:clear <app> # Clear all domains for app
|
||||||
|
domains:clear-global # Clear global domain names
|
||||||
domains:disable <app> # Disable VHOST support
|
domains:disable <app> # Disable VHOST support
|
||||||
domains:enable <app> # Enable VHOST support
|
domains:enable <app> # Enable VHOST support
|
||||||
domains:remove <app> <domain> [<domain> ...] # Remove domains from app
|
domains:remove <app> <domain> [<domain> ...] # Remove domains from app
|
||||||
@@ -27,21 +28,10 @@ scheme://subdomain.domain.tld
|
|||||||
|
|
||||||
The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial dokku configuration. It can then be modified with `dokku domains:add-global` and `dokku domains:remove-global`. This value is used as a default TLD for all applications on a host.
|
The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial dokku configuration. It can then be modified with `dokku domains:add-global` and `dokku domains:remove-global`. This value is used as a default TLD for all applications on a host.
|
||||||
|
|
||||||
If a FQDN such as `other.tld` is used as the application name, the global virtualhost will be ignored and the resulting vhost URL for that application will be `other.tld`. The exception to this rule being that if the FQDN has the same ending as the default vhost (such as `subdomain.domain.tld`), then the entire FQDN will be treated as a subdomain. The application will therefore be deployed at `subdomain.domain.tld.domain.tld`.
|
If an FQDN such as `dokku.org` is used as the application name, the global virtualhost will be ignored and the resulting vhost URL for that application will be `dokku.org`.
|
||||||
|
|
||||||
You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. For example, you can reverse the subdomain with the following sample `nginx-hostname` plugin trigger:
|
You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. If the `nginx-hostname` plugin has no output, the normal hostname algorithm will be executed. See the [plugin trigger documentation](/docs/development/plugin-triggers.md#nginx-hostname) for more information.
|
||||||
|
|
||||||
```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` plugin has no output, the normal hostname algorithm will be executed.
|
|
||||||
|
|
||||||
## Disabling VHOSTS
|
## Disabling VHOSTS
|
||||||
|
|
||||||
@@ -88,17 +78,17 @@ dokku domains:report
|
|||||||
```
|
```
|
||||||
=====> node-js-app domains information
|
=====> node-js-app domains information
|
||||||
Domains app enabled: true
|
Domains app enabled: true
|
||||||
Domains app vhosts: node-js-sample.dokku.org
|
Domains app vhosts: node-js-app.dokku.org
|
||||||
Domains global enabled: true
|
Domains global enabled: true
|
||||||
Domains global vhosts: dokku.org
|
Domains global vhosts: dokku.org
|
||||||
=====> python-sample domains information
|
=====> python-app domains information
|
||||||
Domains app enabled: true
|
Domains app enabled: true
|
||||||
Domains app vhosts: python-sample.dokku.org
|
Domains app vhosts: python-app.dokku.org
|
||||||
Domains global enabled: true
|
Domains global enabled: true
|
||||||
Domains global vhosts: dokku.org
|
Domains global vhosts: dokku.org
|
||||||
=====> ruby-sample domains information
|
=====> ruby-app domains information
|
||||||
Domains app enabled: true
|
Domains app enabled: true
|
||||||
Domains app vhosts: ruby-sample.dokku.org
|
Domains app vhosts: ruby-app.dokku.org
|
||||||
Domains global enabled: true
|
Domains global enabled: true
|
||||||
Domains global vhosts: dokku.org
|
Domains global vhosts: dokku.org
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ The `config` plugin provides the following commands to manage your variables:
|
|||||||
|
|
||||||
```
|
```
|
||||||
config (<app>|--global) Pretty-print an app or global environment
|
config (<app>|--global) Pretty-print an app or global environment
|
||||||
|
config:bundle (<app>|--global) [--merged] Bundle environment into tarfile
|
||||||
|
config:clear (<app>|--global) Clears environment variables
|
||||||
|
config:export (<app>|--global) [--envfile] Export a global or app environment
|
||||||
config:get (<app>|--global) KEY Display a global or app-specific config value
|
config:get (<app>|--global) KEY Display a global or app-specific config value
|
||||||
|
config:keys (<app>|--global) [--merged] Show keys set in environment
|
||||||
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
|
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
|
||||||
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
|
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
|
||||||
config:export (<app>|--global) [--envfile] Export a global or app environment
|
|
||||||
config:keys (<app>|--global) [--merged] Show keys set in environment
|
|
||||||
config:bundle (<app>|--global) [--merged] Bundle environment into tarfile
|
|
||||||
```
|
```
|
||||||
> For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
|
> For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ The following list config variables have special meaning and can be set in a var
|
|||||||
| `DOKKU_DETACH_CONTAINER` | none | `--detach` flag | Whether to detach a container started via `dokku run`. |
|
| `DOKKU_DETACH_CONTAINER` | none | `--detach` flag | Whether to detach a container started via `dokku run`. |
|
||||||
| `DOKKU_QUIET_OUTPUT` | none | `--quiet` flag | Silences certain header output for `dokku` commands. |
|
| `DOKKU_QUIET_OUTPUT` | none | `--quiet` flag | Silences certain header output for `dokku` commands. |
|
||||||
| `DOKKU_RM_CONTAINER` | none | `dokku config:set` <br /> `--rm-container` flag <br /> `--rm` flag | Whether to keep `dokku run` containers around or not. |
|
| `DOKKU_RM_CONTAINER` | none | `dokku config:set` <br /> `--rm-container` flag <br /> `--rm` flag | Whether to keep `dokku run` containers around or not. |
|
||||||
| `DOKKU_TRACE` | none | `dokku trace on` <br /> `dokku trace false` <br /> `--trace` flag | Turn on very verbose debugging. |
|
| `DOKKU_TRACE` | none | `dokku trace:on` <br /> `dokku trace:off` <br /> `--trace` flag | Turn on very verbose debugging. |
|
||||||
| `DOKKU_APP_PROXY_TYPE` | `nginx` | `dokku proxy:set` | |
|
| `DOKKU_APP_PROXY_TYPE` | `nginx` | `dokku proxy:set` | |
|
||||||
| `DOKKU_APP_RESTORE` | `1` | `dokku config:set` <br /> `dokku ps:stop` | |
|
| `DOKKU_APP_RESTORE` | `1` | `dokku config:set` <br /> `dokku ps:stop` | |
|
||||||
| `DOKKU_APP_SHELL` | `/bin/bash` | `dokku config:set` | Allows users to change the default shell used by Dokku for `dokku enter` and execution of deployment tasks. |
|
| `DOKKU_APP_SHELL` | `/bin/bash` | `dokku config:set` | Allows users to change the default shell used by Dokku for `dokku enter` and execution of deployment tasks. |
|
||||||
|
|||||||
@@ -67,17 +67,17 @@ dokku certs:report
|
|||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
=====> node-js-sample
|
=====> node-js-app
|
||||||
Ssl dir: /home/dokku/node-js-sample/tls
|
Ssl dir: /home/dokku/node-js-app/tls
|
||||||
Ssl enabled: true
|
Ssl enabled: true
|
||||||
Ssl hostnames: *.node-js-sample.org node-js-sample.org
|
Ssl hostnames: *.node-js-app.org node-js-app.org
|
||||||
Ssl expires at: Oct 5 23:59:59 2019 GMT
|
Ssl expires at: Oct 5 23:59:59 2019 GMT
|
||||||
Ssl issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
|
Ssl issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
|
||||||
Ssl starts at: Oct 5 00:00:00 2016 GMT
|
Ssl starts at: Oct 5 00:00:00 2016 GMT
|
||||||
Ssl subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.node-js-sample.org
|
Ssl subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.node-js-app.org
|
||||||
Ssl verified: self signed.
|
Ssl verified: self signed.
|
||||||
=====> python-sample
|
=====> python-app
|
||||||
Ssl dir: /home/dokku/python-sample/tls
|
Ssl dir: /home/dokku/python-app/tls
|
||||||
Ssl enabled: false
|
Ssl enabled: false
|
||||||
Ssl hostnames:
|
Ssl hostnames:
|
||||||
Ssl expires at:
|
Ssl expires at:
|
||||||
@@ -90,12 +90,12 @@ dokku certs:report
|
|||||||
You can run the command for a specific app also.
|
You can run the command for a specific app also.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku certs:report node-js-sample
|
dokku certs:report node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
=====> node-js-sample ssl information
|
=====> node-js-app ssl information
|
||||||
Ssl dir: /home/dokku/node-js-sample/tls
|
Ssl dir: /home/dokku/node-js-app/tls
|
||||||
Ssl enabled: true
|
Ssl enabled: true
|
||||||
Ssl hostnames: *.dokku.org dokku.org
|
Ssl hostnames: *.dokku.org dokku.org
|
||||||
Ssl expires at: Oct 5 23:59:59 2019 GMT
|
Ssl expires at: Oct 5 23:59:59 2019 GMT
|
||||||
@@ -108,7 +108,7 @@ dokku certs:report node-js-sample
|
|||||||
You can pass flags which will output only the value of the specific information you want. For example:
|
You can pass flags which will output only the value of the specific information you want. For example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku certs:report node-js-sample --ssl-enabled
|
dokku certs:report node-js-app --ssl-enabled
|
||||||
```
|
```
|
||||||
|
|
||||||
## HSTS Header
|
## HSTS Header
|
||||||
|
|||||||
@@ -1,30 +1,31 @@
|
|||||||
# Deploying to Dokku
|
# Deploying to Dokku
|
||||||
|
|
||||||
> Note: This document uses the hostname `dokku.me` in commands. For your server, please
|
> Note: This walkthrough uses the hostname `dokku.me` in commands. When deploying to your own server, you should set the `DOKKU_DOMAIN` value in the `Vagrantfile` before you initialize the Vagrant VM.
|
||||||
> substitute your server's hostname instead.
|
|
||||||
|
|
||||||
## Deploy tutorial
|
## Deploy tutorial
|
||||||
|
|
||||||
Once Dokku has been configured with at least one user, applications can be deployed via a `git push` command. To quickly see Dokku deployment in action, you can use the Heroku Ruby on Rails example app.
|
Once you have configured Dokku with at least one user, you can deploy applications using `git push`. To quickly see Dokku deployment in action, try using [the Heroku Ruby on Rails "Getting Started" app](https://github.com/heroku/ruby-getting-started).
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# from your local machine
|
# from your local machine
|
||||||
# SSH access to github must be enabled on this host
|
# SSH access to github must be enabled on this host
|
||||||
git clone git@github.com:heroku/ruby-rails-sample.git
|
git clone git@github.com:heroku/ruby-getting-started.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create the app
|
### Create the app
|
||||||
|
|
||||||
Create the application on the Dokku host. You will need to SSH onto the host to run this command.
|
SSH into the Dokku host and create the application as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
dokku apps:create ruby-rails-sample
|
dokku apps:create ruby-getting-started
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create the backing services
|
### Create the backing services
|
||||||
|
|
||||||
When you create a new app, Dokku by default *does not* provide any datastores such as MySQL or PostgreSQL. You will need to install plugins to handle that, but fortunately [Dokku has official plugins](/docs/community/plugins.md#official-plugins-beta) for common datastores. Our sample app requires a PostgreSQL service:
|
Dokku by default **does not** provide datastores (e.g. MySQL, PostgreSQL) on a newly created app. You can add datastore support by installing plugins, and the Dokku project [provides official plugins](/docs/community/plugins.md#official-plugins-beta) for common datastores.
|
||||||
|
|
||||||
|
The Getting Started app requires a PostgreSQL service, so install the plugin and create the related service as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
@@ -36,42 +37,41 @@ sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
|
|||||||
dokku postgres:create railsdatabase
|
dokku postgres:create railsdatabase
|
||||||
```
|
```
|
||||||
|
|
||||||
> Each service may take a few moments to create.
|
Each service may take a few moments to create.
|
||||||
|
|
||||||
### Linking backing services to applications
|
### Linking backing services to applications
|
||||||
|
|
||||||
Once the service creation is complete, set the `DATABASE_URL` environment variable by linking the service.
|
Once the services have been created, you then set the `DATABASE_URL` environment variable by linking the service, as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
# each official datastore offers a `link` method to link a service to any application
|
# each official datastore offers a `link` method to link a service to any application
|
||||||
dokku postgres:link railsdatabase ruby-rails-sample
|
dokku postgres:link railsdatabase ruby-getting-started
|
||||||
```
|
```
|
||||||
|
|
||||||
> You can link a single service to multiple applications or use one service per application.
|
Dokku supports linking a single service to multiple applications as well as linking only one service per application.
|
||||||
|
|
||||||
### Deploy the app
|
### Deploy the app
|
||||||
|
|
||||||
> Warning: Your application *should* respect the `PORT` environment variable or it may not respond to web requests.
|
> Warning: Your app should respect the `PORT` environment variable, otherwise it may not respond to web requests. You can find more information in the [port management documentation](/docs/networking/port-management.md).**
|
||||||
> Please see the [port management documentation](/docs/networking/port-management.md) for details.
|
|
||||||
|
|
||||||
Now you can deploy the `ruby-rails-sample` app to your Dokku server. All you have to do is add a remote to name the app. Applications are created on-the-fly on the Dokku server.
|
Now you can deploy the `ruby-getting-started` app to your Dokku server. All you have to do is add a remote to name the app. Applications are created on-the-fly on the Dokku server.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# from your local machine
|
# from your local machine
|
||||||
# the remote username *must* be dokku or pushes will fail
|
# the remote username *must* be dokku or pushes will fail
|
||||||
cd ruby-rails-sample
|
cd ruby-getting-started
|
||||||
git remote add dokku dokku@dokku.me:ruby-rails-sample
|
git remote add dokku dokku@dokku.me:ruby-getting-started
|
||||||
git push dokku master
|
git push dokku master
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: Some tools may not support the short-upstream syntax referenced above, and you may need to prefix
|
> Note: Some tools may not support the short-upstream syntax referenced above, and you may need to prefix
|
||||||
> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me:ruby-rails-sample`
|
> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me:ruby-getting-started`
|
||||||
> Please see the [Git](https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a) documentation for more details.
|
> Please see the [Git](https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a) documentation for more details.
|
||||||
|
|
||||||
> Note: Your private key should be registered with ssh-agent in local development. If you get a
|
> Note: Your private key should be registered with `ssh-agent` in your local development environment. If you get a `permission denied` error when pushing, you can register your private key as follows: `ssh-add -k ~/<your private key>`.
|
||||||
> permission denied error when pushing you can register your private key by running
|
|
||||||
> `ssh-add -k ~/<your private key>`.
|
After running `git push dokku master`, you should have output similar to this in your terminal:
|
||||||
|
|
||||||
```
|
```
|
||||||
Counting objects: 231, done.
|
Counting objects: 231, done.
|
||||||
@@ -80,7 +80,7 @@ Compressing objects: 100% (162/162), done.
|
|||||||
Writing objects: 100% (231/231), 36.96 KiB | 0 bytes/s, done.
|
Writing objects: 100% (231/231), 36.96 KiB | 0 bytes/s, done.
|
||||||
Total 231 (delta 93), reused 147 (delta 53)
|
Total 231 (delta 93), reused 147 (delta 53)
|
||||||
-----> Cleaning up...
|
-----> Cleaning up...
|
||||||
-----> Building ruby-rails-sample from herokuish...
|
-----> Building ruby-getting-started from herokuish...
|
||||||
-----> Adding BUILD_ENV to build environment...
|
-----> Adding BUILD_ENV to build environment...
|
||||||
-----> Ruby app detected
|
-----> Ruby app detected
|
||||||
-----> Compiling Ruby/Rails
|
-----> Compiling Ruby/Rails
|
||||||
@@ -95,12 +95,12 @@ Total 231 (delta 93), reused 147 (delta 53)
|
|||||||
...
|
...
|
||||||
|
|
||||||
=====> Application deployed:
|
=====> Application deployed:
|
||||||
http://ruby-rails-sample.dokku.me
|
http://ruby-getting-started.dokku.me
|
||||||
```
|
```
|
||||||
|
|
||||||
When the deploy finishes, the application's URL will be shown as seen above.
|
Once the deploy is complete, the application's web URL will be generated as above.
|
||||||
|
|
||||||
Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) with [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks) or using a project's [Dockerfile](https://docs.docker.com/reference/builder/).
|
Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) with [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks), as well as by using a project's [Dockerfile](https://docs.docker.com/reference/builder/).
|
||||||
|
|
||||||
|
|
||||||
### Skipping deployment
|
### Skipping deployment
|
||||||
@@ -109,23 +109,23 @@ If you only want to rebuild and tag a container, you can skip the deployment pha
|
|||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
|
dokku config:set ruby-getting-started DOKKU_SKIP_DEPLOY=true
|
||||||
```
|
```
|
||||||
|
|
||||||
### Redeploying or restarting
|
### Redeploying or restarting
|
||||||
|
|
||||||
If you need to redeploy (or restart) your app:
|
If you need to redeploy or restart your app:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
dokku ps:rebuild ruby-rails-sample
|
dokku ps:rebuild ruby-getting-started
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [process scaling documentation](/docs/deployment/process-management.md) for more information.
|
See the [process scaling documentation](/docs/deployment/process-management.md) for more information.
|
||||||
|
|
||||||
### Deploying with private git submodules
|
### Deploying with private Git submodules
|
||||||
|
|
||||||
Dokku uses Git locally (i.e. not a Docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private Git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add `github.com` (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
|
Dokku uses Git locally (i.e. not a Docker image) to build its own copy of your app repo, including submodules, as the `dokku` user. This means that in order to deploy private Git submodules, you need to put your deploy key in `/home/dokku/.ssh/` and potentially add `github.com` (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. You can use the following test to confirm your setup is correct:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on the Dokku host
|
# on the Dokku host
|
||||||
@@ -134,25 +134,25 @@ ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
|||||||
ssh -T git@github.com
|
ssh -T git@github.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if the buildpack or Dockerfile build process require SSH key access for other reasons, the above may not always apply.
|
> Warning: if the buildpack or Dockerfile build process require SSH key access for other reasons, the above may not always apply.
|
||||||
|
|
||||||
## Deploying to subdomains
|
## Deploying to subdomains
|
||||||
|
|
||||||
The name of remote repository is used as the name of application to be deployed, as for example above:
|
If you do not enter a fully qualified domain name when pushing your app, Dokku deploys the app to `<remotename>.yourdomain.tld` as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# from your local machine
|
# from your local machine
|
||||||
# the remote username *must* be dokku or pushes will fail
|
# the remote username *must* be dokku or pushes will fail
|
||||||
git remote add dokku dokku@dokku.me:ruby-rails-sample
|
git remote add dokku dokku@dokku.me:ruby-getting-started
|
||||||
git push dokku master
|
git push dokku master
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
remote: -----> Application deployed:
|
remote: -----> Application deployed:
|
||||||
remote: http://ruby-rails-sample.dokku.me
|
remote: http://ruby-getting-started.dokku.me
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also specify fully qualified names, say `app.dokku.me`, as
|
You can also specify the fully qualified name as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# from your local machine
|
# from your local machine
|
||||||
@@ -166,7 +166,7 @@ remote: -----> Application deployed:
|
|||||||
remote: http://app.dokku.me
|
remote: http://app.dokku.me
|
||||||
```
|
```
|
||||||
|
|
||||||
This is in particular useful, then you want to deploy to root domain, as
|
This is useful when you want to deploy to the root domain:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# from your local machine
|
# from your local machine
|
||||||
@@ -182,9 +182,9 @@ git push dokku master
|
|||||||
|
|
||||||
## Dokku/Docker container management compatibility
|
## Dokku/Docker container management compatibility
|
||||||
|
|
||||||
Dokku is, at its core, a Docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the Docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), Dokku executes a cleanup function prior to every deployment.
|
Dokku is, at its core, a Docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the Docker daemon.
|
||||||
|
|
||||||
As of 0.5.x, this function removes all containers with the label `dokku` where the status is either `dead` or `exited`, as well as all `dangling` images. Previous versions would remove `dead` or `exited` containers, regardless of their label.
|
Prior to every deployment, Dokku will execute a cleanup function. As of 0.5.x, the cleanup removes all containers with the `dokku` label where the status is either `dead` or `exited` (previous versions would remove _all_ `dead` or `exited` containers). The cleanup function also removes all images with `dangling` status.
|
||||||
|
|
||||||
## Adding deploy users
|
## Adding deploy users
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ For users that require customization in the `build` phase, you may use build arg
|
|||||||
dokku docker-options:add node-js-app build '--build-arg NODE_ENV=production'
|
dokku docker-options:add node-js-app build '--build-arg NODE_ENV=production'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The location of the `Dockerfile` may also be specified. If the location is changed, the repository **must also** have a `Dockerfile` in the root directory in order to trigger a dockerfile-based deploy.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku docker-options:add node-js-app build '--file Dockerfile.dokku'
|
||||||
|
```
|
||||||
|
|
||||||
Once set, the Dockerfile usage would be as follows:
|
Once set, the Dockerfile usage would be as follows:
|
||||||
|
|
||||||
```Dockerfile
|
```Dockerfile
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Sometimes you need to either inspect running containers or run a one-off command
|
|||||||
## Run a command in an app environment
|
## Run a command in an app environment
|
||||||
|
|
||||||
```
|
```
|
||||||
run <app> <cmd> # Run a command in a new container using the current application image
|
run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
|
||||||
```
|
```
|
||||||
|
|
||||||
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
||||||
@@ -13,6 +13,9 @@ The `run` command can be used to run a one-off process for a specific command. T
|
|||||||
```shell
|
```shell
|
||||||
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
||||||
dokku run node-js-app ls -lah
|
dokku run node-js-app ls -lah
|
||||||
|
|
||||||
|
# optionally, run can be passed custom environment variables
|
||||||
|
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
|
||||||
```
|
```
|
||||||
|
|
||||||
The `run` command can also be used to run a command defined in your Procfile:
|
The `run` command can also be used to run a command defined in your Procfile:
|
||||||
|
|||||||
@@ -81,13 +81,13 @@ dokku checks:report
|
|||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
=====> search checks information
|
=====> node-js-app checks information
|
||||||
Checks disabled list: none
|
Checks disabled list: none
|
||||||
Checks skipped list: none
|
Checks skipped list: none
|
||||||
=====> python-sample checks information
|
=====> python-app checks information
|
||||||
Checks disabled list: none
|
Checks disabled list: none
|
||||||
Checks skipped list: none
|
Checks skipped list: none
|
||||||
=====> ruby-sample checks information
|
=====> ruby-app checks information
|
||||||
Checks disabled list: _all_
|
Checks disabled list: _all_
|
||||||
Checks skipped list: none
|
Checks skipped list: none
|
||||||
```
|
```
|
||||||
@@ -95,11 +95,11 @@ dokku checks:report
|
|||||||
You can run the command for a specific app also.
|
You can run the command for a specific app also.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku checks:report node-js-sample
|
dokku checks:report node-js-app
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
=====> node-js-sample checks information
|
=====> node-js-app checks information
|
||||||
Checks disabled list: none
|
Checks disabled list: none
|
||||||
Checks skipped list: none
|
Checks skipped list: none
|
||||||
```
|
```
|
||||||
@@ -107,7 +107,7 @@ dokku checks:report node-js-sample
|
|||||||
You can pass flags which will output only the value of the specific information you want. For example:
|
You can pass flags which will output only the value of the specific information you want. For example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku checks:report node-js-sample --checks-disabled-list
|
dokku checks:report node-js-app --checks-disabled-list
|
||||||
```
|
```
|
||||||
|
|
||||||
## Customizing checks
|
## Customizing checks
|
||||||
|
|||||||
@@ -311,6 +311,24 @@ verify_app_name "$APP"
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `docker-args-process-build`
|
||||||
|
|
||||||
|
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
|
||||||
|
- Invoked by: `dokku ps:rebuild`
|
||||||
|
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `docker-args-process-deploy`
|
### `docker-args-process-deploy`
|
||||||
|
|
||||||
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
|
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker deploy options.
|
||||||
@@ -333,7 +351,7 @@ verify_app_name "$APP"
|
|||||||
|
|
||||||
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker run options.
|
- Description: `$PROC_TYPE` may be set to magic `_all_` process type to signify global docker run options.
|
||||||
- Invoked by: `dokku run`
|
- Invoked by: `dokku run`
|
||||||
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE [$PROC_TYPE $CONTAINER_INDEX]`
|
- Arguments: `$APP $IMAGE_TAG $IMAGE_SOURCE_TYPE`
|
||||||
- Example:
|
- Example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -586,6 +604,8 @@ echo "$NEW_SUBDOMAIN.$VHOST"
|
|||||||
|
|
||||||
### `nginx-pre-reload`
|
### `nginx-pre-reload`
|
||||||
|
|
||||||
|
> Warning: The arguments INTERNAL_PORT and INTERNAL_IP_ADDRESS are no longer sufficient to retrieve all app listeners. Please run `plugn trigger network-get-listeners APP` within any implementation of `nginx-pre-reload` in order to retrieve all application listeners.
|
||||||
|
|
||||||
- Description: Run before nginx reloads hosts
|
- Description: Run before nginx reloads hosts
|
||||||
- Invoked by: `dokku nginx:build-config`
|
- Invoked by: `dokku nginx:build-config`
|
||||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS`
|
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS`
|
||||||
@@ -1320,6 +1340,24 @@ DOKKU_SCHEDULER="$1"; APP="$2";
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `scheduler-is-deployed`
|
||||||
|
|
||||||
|
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||||
|
> between minor releases until the 1.0 release.
|
||||||
|
|
||||||
|
- Description: Allows you to check if an app has been deployed
|
||||||
|
- Invoked by: `dokku ps:rebuild`
|
||||||
|
- Arguments: `$DOKKU_SCHEDULER $APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
DOKKU_SCHEDULER="$1"; APP="$2";
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
### `scheduler-logs`
|
### `scheduler-logs`
|
||||||
|
|
||||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ The workflow looks like this:
|
|||||||
```shell
|
```shell
|
||||||
# having dokku-arch in ../dokku-arch
|
# having dokku-arch in ../dokku-arch
|
||||||
vagrant up build-arch
|
vagrant up build-arch
|
||||||
# wait for "==> build-arch: ==> Finished making: dokku 0.15.4-2 (Mon Feb 22 23:20:37 CET 2016)"
|
# wait for "==> build-arch: ==> Finished making: dokku 0.17.2-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||||
cd ../dokku-arch
|
cd ../dokku-arch
|
||||||
git add PKGBUILD .SRCINFO
|
git add PKGBUILD .SRCINFO
|
||||||
git commit -m 'Update to dokku 0.9.9'
|
git commit -m 'Update to dokku 0.9.9'
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ While we do provide official packages for a variety of platforms, as our test su
|
|||||||
# run linter & update vagrant Dokku install from local git clone
|
# run linter & update vagrant Dokku install from local git clone
|
||||||
make lint copyfiles
|
make lint copyfiles
|
||||||
|
|
||||||
|
# build a specific plugin
|
||||||
|
make go-build-plugin copyplugin PLUGIN_NAME=apps
|
||||||
|
|
||||||
# execute all bats tests
|
# execute all bats tests
|
||||||
make unit-tests
|
make unit-tests
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Dokku is an extensible, open source Platform as a Service that runs on a single
|
|||||||
|
|
||||||
To start using Dokku, you'll need a system that meets the following minimum requirements:
|
To start using Dokku, you'll need a system that meets the following minimum requirements:
|
||||||
|
|
||||||
- A fresh installation of [Ubuntu 16.04 x64](https://www.ubuntu.com/download), [Ubuntu 14.04 x64](https://www.ubuntu.com/download), [Debian 8.2 x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
|
- A fresh installation of [Ubuntu x64 - Any currently supported release](https://www.ubuntu.com/download), [Debian 8.2 x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
|
||||||
- At least 1 GB of system memory <sup>[2]</sup>
|
- At least 1 GB of system memory <sup>[2]</sup>
|
||||||
|
|
||||||
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
|
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
|
||||||
@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# for debian systems, installs Dokku via apt-get
|
# for debian systems, installs Dokku via apt-get
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.15.4/bootstrap.sh;
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh;
|
||||||
sudo DOKKU_TAG=v0.15.4 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||||
|
|||||||
@@ -1,5 +1,38 @@
|
|||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
|
> New as of 0.17.0
|
||||||
|
|
||||||
|
```
|
||||||
|
trace:on # Enables trace mode
|
||||||
|
trace:off # Disables trace mode
|
||||||
|
```
|
||||||
|
|
||||||
|
## Trace Mode
|
||||||
|
|
||||||
|
By default, Dokku will constrain the amount of output displayed for any given command run. The verbosity of output can be increased by enabling trace mode. Trace mode will turn on the `set -x` flag for bash plugins, while other plugins are free to respect the environment variable `DOKKU_TRACE` and log differently as approprate. Trace mode can be useful to see _where_ plugins are running commands that would otherwise be unexpected.
|
||||||
|
|
||||||
|
To enable trace mode, run `trace:on`
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku trace:on
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
-----> Enabling trace mode
|
||||||
|
```
|
||||||
|
|
||||||
|
Trace mode can be disabled with `trace:off`
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku trace:off
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
-----> Disabling trace mode
|
||||||
|
```
|
||||||
|
|
||||||
|
## Common Problems
|
||||||
|
|
||||||
__Symptom:__ I deployed my app but I am getting the default nginx page.
|
__Symptom:__ I deployed my app but I am getting the default nginx page.
|
||||||
|
|
||||||
__Solution:__
|
__Solution:__
|
||||||
@@ -41,22 +74,7 @@ __Symptom:__ I want to deploy my app, but while pushing I get the following erro
|
|||||||
|
|
||||||
__Solution:__
|
__Solution:__
|
||||||
|
|
||||||
The `remote rejected` error does not give enough information. Anything could have failed.
|
The `remote rejected` error does not give enough information. Anything could have failed. Enable trace mode and begin debugging. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
|
||||||
|
|
||||||
To enable Dokku tracing, simply run the following command:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# since 0.3.9
|
|
||||||
dokku trace on
|
|
||||||
```
|
|
||||||
|
|
||||||
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
export DOKKU_TRACE=1
|
|
||||||
```
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|||||||
@@ -10,30 +10,30 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<style>
|
<style>
|
||||||
.sponsors {
|
.sponsors {
|
||||||
@@ -127,12 +127,12 @@
|
|||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.15.4/bootstrap.sh</span>
|
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.17.2/bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">sudo DOKKU_TAG=v0.15.4 bash bootstrap.sh</span>
|
<span class="command">sudo DOKKU_TAG=v0.17.2 bash bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||||
|
|||||||
@@ -3,17 +3,19 @@
|
|||||||
> New as of 0.5.0, Enhanced in 0.6.0
|
> New as of 0.5.0, Enhanced in 0.6.0
|
||||||
|
|
||||||
```
|
```
|
||||||
proxy:ports <app> # List proxy port mappings for app
|
proxy:ports <app> # List proxy port mappings for an app
|
||||||
proxy:ports-set <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Set proxy port mappings for app
|
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Add proxy port mappings to an app
|
||||||
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Add proxy port mappings for app
|
proxy:ports-clear <app> # Clear all proxy port mappings for an app
|
||||||
proxy:ports-clear <app> # Clear all proxy port mappings for app
|
proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...] # Remove specific proxy port mappings from an app
|
||||||
proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...] # Unset proxy port mappings for app
|
proxy:ports-set <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] # Set proxy port mappings for an app
|
||||||
```
|
```
|
||||||
|
|
||||||
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
|
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
> Warning: Mapping alternative ports may conflict with the active firewall installed on your server or hosting provider. Such software includes - but is not limited to - AWS Security Groups, iptables, and UFW. Please consult the documentation for those softwares as applicable.
|
||||||
|
|
||||||
### Proxy port mapping
|
### Proxy port mapping
|
||||||
|
|
||||||
> New as of 0.6.0
|
> New as of 0.6.0
|
||||||
|
|||||||
@@ -9,26 +9,26 @@
|
|||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.15.4/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.17.2/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
2
dokku
2
dokku
@@ -36,7 +36,7 @@ DOKKU_DISTRO=$(
|
|||||||
echo "$ID"
|
echo "$ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
|
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish:latest"}
|
||||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||||
|
|
||||||
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
|
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ case "$1" in
|
|||||||
help_content_func() {
|
help_content_func() {
|
||||||
declare desc="return standard plugin help content"
|
declare desc="return standard plugin help content"
|
||||||
cat <<help_content
|
cat <<help_content
|
||||||
run <app> <cmd>, Run a command in a new container using the current application image
|
run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image
|
||||||
trace [on/off], Enable dokku tracing
|
trace [on/off], Enable dokku tracing
|
||||||
url <app>, Show the first URL for an application (compatibility)
|
url <app>, Show the first URL for an application (compatibility)
|
||||||
urls <app>, Show all URLs for an application
|
urls <app>, Show all URLs for an application
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core standard plugin"
|
description = "dokku core standard plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ dokku_report_cmd() {
|
|||||||
docker -D info | sed "s/^/ /"
|
docker -D info | sed "s/^/ /"
|
||||||
dokku_log_info1 "sigil version: $(sigil -v)"
|
dokku_log_info1 "sigil version: $(sigil -v)"
|
||||||
dokku_log_info1 "herokuish version: "
|
dokku_log_info1 "herokuish version: "
|
||||||
docker run --rm gliderlabs/herokuish:latest herokuish version | sed "s/^/ /"
|
docker run --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
|
||||||
dokku_log_info1 "dokku version: $(dokku version)"
|
dokku_log_info1 "dokku version: $(dokku version)"
|
||||||
dokku_log_info1 "dokku plugins: "
|
dokku_log_info1 "dokku plugins: "
|
||||||
dokku plugin:list | sed "s/^/ /"
|
dokku plugin:list | sed "s/^/ /"
|
||||||
|
|||||||
@@ -6,12 +6,38 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
|||||||
|
|
||||||
dokku_run_cmd() {
|
dokku_run_cmd() {
|
||||||
declare desc="runs command in container based on app image"
|
declare desc="runs command in container based on app image"
|
||||||
declare cmd="run" APP="$2"
|
declare cmd="run" APP=""
|
||||||
|
shift
|
||||||
|
|
||||||
|
declare -a RUN_ENV
|
||||||
|
RUN_ENV=()
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
-e=* | --env=*)
|
||||||
|
local arg=$(printf "%s" "$1" | sed -E 's/(^-e=)|(^--env=)//g')
|
||||||
|
RUN_ENV+=("$arg")
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-e | --env)
|
||||||
|
if [[ ! $2 ]]; then
|
||||||
|
dokku_log_warn "expected $1 to have an argument"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
RUN_ENV+=("$2")
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
APP="$1"
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
shift 2
|
|
||||||
|
|
||||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "$@"
|
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
dokku_run_cmd "$@"
|
dokku_run_cmd "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core events logging plugin"
|
description = "dokku core events logging plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
|||||||
get_phase_script() {
|
get_phase_script() {
|
||||||
declare desc="extracts app.json from app image and returns the appropriate json key/value"
|
declare desc="extracts app.json from app image and returns the appropriate json key/value"
|
||||||
declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2"
|
declare IMAGE_TAG="$1" PHASE_SCRIPT_KEY="$2"
|
||||||
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX")
|
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
|
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
|
||||||
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" >/dev/null' RETURN INT TERM
|
trap "rm -rf '$GET_PHASE_SCRIPT_TMP_WORK_DIR' >/dev/null" RETURN INT TERM
|
||||||
|
|
||||||
copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
|
copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ get_release_cmd() {
|
|||||||
declare APP="$1" IMAGE_TAG="$2"
|
declare APP="$1" IMAGE_TAG="$2"
|
||||||
|
|
||||||
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
|
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
|
||||||
trap 'remove_procfile $APP' RETURN INT TERM EXIT
|
trap "remove_procfile $APP" RETURN INT TERM EXIT
|
||||||
|
|
||||||
get_cmd_from_procfile "$APP" "release" "5000"
|
get_cmd_from_procfile "$APP" "release" "5000"
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ execute_script() {
|
|||||||
|
|
||||||
local IMAGE_SOURCE_TYPE="dockerfile"
|
local IMAGE_SOURCE_TYPE="dockerfile"
|
||||||
is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish"
|
is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish"
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
|
||||||
|
|
||||||
# eval args as array to respect escapes
|
# eval args as array to respect escapes
|
||||||
declare -a ARG_ARRAY
|
declare -a ARG_ARRAY
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core app-json plugin"
|
description = "dokku core app-json plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ apps_help_content_func() {
|
|||||||
apps:clone <old-app> <new-app>, Clones an app
|
apps:clone <old-app> <new-app>, Clones an app
|
||||||
apps:create <app>, Create a new app
|
apps:create <app>, Create a new app
|
||||||
apps:destroy <app>, Permanently destroy an app
|
apps:destroy <app>, Permanently destroy an app
|
||||||
|
apps:exists <app>, Checks if an app exists
|
||||||
apps:list, List your apps
|
apps:list, List your apps
|
||||||
apps:lock <app>, Locks an app for deployment
|
apps:lock <app>, Locks an app for deployment
|
||||||
apps:locked <app>, Checks if an app is locked for deployment
|
apps:locked <app>, Checks if an app is locked for deployment
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core apps plugin"
|
description = "dokku core apps plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core build-env plugin"
|
description = "dokku core build-env plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core buildpacks plugin"
|
description = "dokku core buildpacks plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core certificate management plugin"
|
description = "dokku core certificate management plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ certs_set() {
|
|||||||
# importing from file
|
# importing from file
|
||||||
true
|
true
|
||||||
elif is_tar_import; then
|
elif is_tar_import; then
|
||||||
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs_set.XXXX")
|
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
pushd "$CERTS_SET_TMP_WORK_DIR" &>/dev/null
|
pushd "$CERTS_SET_TMP_WORK_DIR" &>/dev/null
|
||||||
trap 'popd &>/dev/null || true; rm -rf $CERTS_SET_TMP_WORK_DIR >/dev/null' RETURN
|
trap "popd &>/dev/null || true; rm -rf '$CERTS_SET_TMP_WORK_DIR' >/dev/null" RETURN
|
||||||
tar xvf - <&0
|
tar xvf - <&0
|
||||||
|
|
||||||
local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f | grep ".crt$")
|
local CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f | grep ".crt$")
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ certs_generate_cmd() {
|
|||||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||||
|
|
||||||
if [[ ! -f "$APP_SSL_PATH/server.key" ]] && [[ ! -f "$APP_SSL_PATH/server.crt" ]]; then
|
if [[ ! -f "$APP_SSL_PATH/server.key" ]] && [[ ! -f "$APP_SSL_PATH/server.crt" ]]; then
|
||||||
local CERTS_GENERATE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs.XXXXXXXXX")
|
local CERTS_GENERATE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
pushd "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null
|
pushd "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null
|
||||||
trap 'popd &>/dev/null || true; rm -rf "$CERTS_GENERATE_TMP_WORK_DIR" >/dev/null' INT TERM EXIT
|
trap "popd &>/dev/null || true; rm -rf '$CERTS_GENERATE_TMP_WORK_DIR' >/dev/null" INT TERM EXIT
|
||||||
|
|
||||||
openssl genrsa -out server.key 2048
|
openssl genrsa -out server.key 2048
|
||||||
openssl req -new -key server.key -out server.csr
|
openssl req -new -key server.key -out server.csr
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core checks plugin"
|
description = "dokku core checks plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -291,6 +291,10 @@ is_image_herokuish_based() {
|
|||||||
declare IMAGE="$1"
|
declare IMAGE="$1"
|
||||||
local USER_VALUE
|
local USER_VALUE
|
||||||
|
|
||||||
|
if [[ -z "$IMAGE" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
# due to how the build process works, all herokuish images have the Environment variable USER=herokuishuser
|
# due to how the build process works, all herokuish images have the Environment variable USER=herokuishuser
|
||||||
USER_VALUE="$(docker inspect -f '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")"
|
USER_VALUE="$(docker inspect -f '{{range .Config.Env}}{{if eq . "USER=herokuishuser" }}{{println .}}{{end}}{{end}}' "$IMAGE")"
|
||||||
[[ "$USER_VALUE" == "" ]] && return 1
|
[[ "$USER_VALUE" == "" ]] && return 1
|
||||||
@@ -380,7 +384,10 @@ copy_from_image() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
local CID=$(docker create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE")
|
local CID=$(docker create "$DOKKU_GLOBAL_RUN_ARGS" "$IMAGE")
|
||||||
docker cp "$CID:$SRC_FILE" "$DST_DIR"
|
if ! docker cp "$CID:$SRC_FILE" "$DST_DIR"; then
|
||||||
|
docker rm -f "$CID" &>/dev/null
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
docker rm -f "$CID" &>/dev/null
|
docker rm -f "$CID" &>/dev/null
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -450,14 +457,10 @@ get_app_running_container_types() {
|
|||||||
is_deployed() {
|
is_deployed() {
|
||||||
declare desc="return 0 if given app has a running container"
|
declare desc="return 0 if given app has a running container"
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
ls "$DOKKU_ROOT/$APP"/CONTAINER.* &>/dev/null
|
|
||||||
echo $?
|
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||||
) -eq 0 ]]; then
|
plugn trigger scheduler-is-deployed "$DOKKU_SCHEDULER" "$APP"
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is_container_running() {
|
is_container_running() {
|
||||||
@@ -535,7 +538,7 @@ dokku_build() {
|
|||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
||||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||||
local IMAGE_SOURCE_TYPE="herokuish"
|
local IMAGE_SOURCE_TYPE="herokuish"
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
|
||||||
|
|
||||||
declare -a ARG_ARRAY
|
declare -a ARG_ARRAY
|
||||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||||
@@ -563,7 +566,7 @@ dokku_build() {
|
|||||||
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
||||||
local IMAGE_SOURCE_TYPE="dockerfile"
|
local IMAGE_SOURCE_TYPE="dockerfile"
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
|
||||||
|
|
||||||
# strip --volume and -v args from DOCKER_ARGS
|
# strip --volume and -v args from DOCKER_ARGS
|
||||||
local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
|
local DOCKER_ARGS=$(sed -e "s/--volume=[[:graph:]]\+[[:blank:]]\?//g" -e "s/-v[[:blank:]]\?[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
|
||||||
@@ -1076,8 +1079,8 @@ release_advisory_lock() {
|
|||||||
suppress_output() {
|
suppress_output() {
|
||||||
declare desc="suppress all output from a given command unless there is an error"
|
declare desc="suppress all output from a given command unless there is an error"
|
||||||
local TMP_COMMAND_OUTPUT
|
local TMP_COMMAND_OUTPUT
|
||||||
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
|
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
trap 'rm -rf "$TMP_COMMAND_OUTPUT" >/dev/null' RETURN INT TERM EXIT
|
trap "rm -rf '$TMP_COMMAND_OUTPUT' >/dev/null" RETURN
|
||||||
|
|
||||||
"$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || {
|
"$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || {
|
||||||
local exit_code="$?"
|
local exit_code="$?"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core common plugin"
|
description = "dokku core common plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -92,6 +92,29 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//UnsetAll removes all config keys
|
||||||
|
func UnsetAll(appName string, restart bool) (err error) {
|
||||||
|
global := appName == ""
|
||||||
|
env, err := loadAppOrGlobalEnv(appName)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var changed = false
|
||||||
|
for k := range env.Map() {
|
||||||
|
common.LogInfo1Quiet(fmt.Sprintf("Unsetting %s", k))
|
||||||
|
env.Unset(k)
|
||||||
|
changed = true
|
||||||
|
}
|
||||||
|
if changed {
|
||||||
|
env.Write()
|
||||||
|
triggerUpdate(appName, "clear", []string{})
|
||||||
|
}
|
||||||
|
if !global && restart && env.GetBoolDefault("DOKKU_APP_RESTORE", true) {
|
||||||
|
triggerRestart(appName)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func triggerRestart(appName string) {
|
func triggerRestart(appName string) {
|
||||||
common.LogInfo1(fmt.Sprintf("Restarting app %s", appName))
|
common.LogInfo1(fmt.Sprintf("Restarting app %s", appName))
|
||||||
if err := common.PlugnTrigger("app-restart", appName); err != nil {
|
if err := common.PlugnTrigger("app-restart", appName); err != nil {
|
||||||
|
|||||||
@@ -80,6 +80,22 @@ func TestConfigSetMany(t *testing.T) {
|
|||||||
Expect(SetMany(testAppName+"does_not_exist", vals, false)).ToNot(Succeed())
|
Expect(SetMany(testAppName+"does_not_exist", vals, false)).ToNot(Succeed())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConfigUnsetAll(t *testing.T) {
|
||||||
|
RegisterTestingT(t)
|
||||||
|
Expect(setupTestApp()).To(Succeed())
|
||||||
|
defer teardownTestApp()
|
||||||
|
|
||||||
|
expectValue(testAppName, "testKey", "TESTING")
|
||||||
|
expectValue("", "testKey", "GLOBAL_TESTING")
|
||||||
|
|
||||||
|
Expect(UnsetAll(testAppName, false)).To(Succeed())
|
||||||
|
expectNoValue(testAppName, "testKey")
|
||||||
|
expectNoValue(testAppName, "noKey")
|
||||||
|
expectNoValue(testAppName, "globalKey")
|
||||||
|
|
||||||
|
Expect(UnsetAll(testAppName+"does-not-exist", false)).ToNot(Succeed())
|
||||||
|
}
|
||||||
|
|
||||||
func TestConfigUnsetMany(t *testing.T) {
|
func TestConfigUnsetMany(t *testing.T) {
|
||||||
RegisterTestingT(t)
|
RegisterTestingT(t)
|
||||||
Expect(setupTestApp()).To(Succeed())
|
Expect(setupTestApp()).To(Succeed())
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"archive/tar"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"archive/tar"
|
|
||||||
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/dokku/dokku/plugins/common"
|
"github.com/dokku/dokku/plugins/common"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/ryanuber/columnize"
|
"github.com/ryanuber/columnize"
|
||||||
@@ -31,6 +30,10 @@ const (
|
|||||||
ExportFormatShell
|
ExportFormatShell
|
||||||
//ExportFormatPretty format: pretty-printed in columns
|
//ExportFormatPretty format: pretty-printed in columns
|
||||||
ExportFormatPretty
|
ExportFormatPretty
|
||||||
|
//ExportFormatJSON format: json key/value output
|
||||||
|
ExportFormatJSON
|
||||||
|
//ExportFormatJSONList format: json output as a list of objects
|
||||||
|
ExportFormatJSONList
|
||||||
)
|
)
|
||||||
|
|
||||||
//Env is a representation for global or app environment
|
//Env is a representation for global or app environment
|
||||||
@@ -168,6 +171,10 @@ func (e *Env) Export(format ExportFormat) string {
|
|||||||
return e.ShellString()
|
return e.ShellString()
|
||||||
case ExportFormatPretty:
|
case ExportFormatPretty:
|
||||||
return prettyPrintEnvEntries("", e.Map())
|
return prettyPrintEnvEntries("", e.Map())
|
||||||
|
case ExportFormatJSON:
|
||||||
|
return e.JSONString()
|
||||||
|
case ExportFormatJSONList:
|
||||||
|
return e.JSONListString()
|
||||||
default:
|
default:
|
||||||
common.LogFail(fmt.Sprintf("Unknown export format: %v", format))
|
common.LogFail(fmt.Sprintf("Unknown export format: %v", format))
|
||||||
return ""
|
return ""
|
||||||
@@ -190,6 +197,35 @@ func (e *Env) DockerArgsString() string {
|
|||||||
return e.stringWithPrefixAndSeparator("--env=", " ")
|
return e.stringWithPrefixAndSeparator("--env=", " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//JSONString returns the contents of this Env as a key/value json object
|
||||||
|
func (e *Env) JSONString() string {
|
||||||
|
data, err := json.Marshal(e.Map())
|
||||||
|
if err != nil {
|
||||||
|
return "{}"
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
//JSONListString returns the contents of this Env as a json list of objects containing the name and the value of the env var
|
||||||
|
func (e *Env) JSONListString() string {
|
||||||
|
var list []map[string]string
|
||||||
|
for _, key := range e.Keys() {
|
||||||
|
value, _ := e.Get(key)
|
||||||
|
list = append(list, map[string]string{
|
||||||
|
"name": key,
|
||||||
|
"value": value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := json.Marshal(list)
|
||||||
|
if err != nil {
|
||||||
|
return "[]"
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(data)
|
||||||
|
}
|
||||||
|
|
||||||
//ShellString gets the contents of this Env in the form "KEY='value' KEY2='value'"
|
//ShellString gets the contents of this Env in the form "KEY='value' KEY2='value'"
|
||||||
// for passing the environment in the shell
|
// for passing the environment in the shell
|
||||||
func (e *Env) ShellString() string {
|
func (e *Env) ShellString() string {
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ config_get() {
|
|||||||
config_sub get "$@"
|
config_sub get "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config_clear() {
|
||||||
|
declare desc="clears config vars"
|
||||||
|
config_sub clear "$@"
|
||||||
|
}
|
||||||
|
|
||||||
config_set() {
|
config_set() {
|
||||||
declare desc="set value of given config var"
|
declare desc="set value of given config var"
|
||||||
config_sub set "$@"
|
config_sub set "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core config plugin"
|
description = "dokku core config plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -21,12 +21,13 @@ Additional commands:`
|
|||||||
|
|
||||||
helpContent = `
|
helpContent = `
|
||||||
config (<app>|--global), Pretty-print an app or global environment
|
config (<app>|--global), Pretty-print an app or global environment
|
||||||
|
config:bundle (<app>|--global) [--merged], Bundle environment into tarfile
|
||||||
|
config:clear (<app>|--global), Clears environment variables
|
||||||
|
config:export (<app>|--global) [--envfile], Export a global or app environment
|
||||||
config:get (<app>|--global) KEY, Display a global or app-specific config value
|
config:get (<app>|--global) KEY, Display a global or app-specific config value
|
||||||
|
config:keys (<app>|--global) [--merged], Show keys set in environment
|
||||||
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars
|
config:set [--encoded] [--no-restart] (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars
|
||||||
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...], Unset one or more config vars
|
config:unset [--no-restart] (<app>|--global) KEY1 [KEY2 ...], Unset one or more config vars
|
||||||
config:export (<app>|--global) [--envfile], Export a global or app environment
|
|
||||||
config:keys (<app>|--global) [--merged], Show keys set in environment
|
|
||||||
config:bundle (<app>|--global) [--merged], Bundle environment into tarfile
|
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
17
plugins/config/src/subcommands/clear/clear.go
Normal file
17
plugins/config/src/subcommands/clear/clear.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/dokku/dokku/plugins/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
//clear all entries from the given environment
|
||||||
|
func main() {
|
||||||
|
args := flag.NewFlagSet("config:clear", flag.ExitOnError)
|
||||||
|
global := args.Bool("global", false, "--global: use the global environment")
|
||||||
|
noRestart := args.Bool("no-restart", false, "--no-restart: no restart")
|
||||||
|
args.Parse(os.Args[2:])
|
||||||
|
config.CommandClear(args.Args(), *global, *noRestart)
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ func main() {
|
|||||||
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
||||||
global := args.Bool("global", false, "--global: use the global environment")
|
global := args.Bool("global", false, "--global: use the global environment")
|
||||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||||
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell ] which format to export as)")
|
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell | pretty | json | json-list ] which format to export as)")
|
||||||
args.Parse(os.Args[2:])
|
args.Parse(os.Args[2:])
|
||||||
config.CommandExport(args.Args(), *global, *merged, *format)
|
config.CommandExport(args.Args(), *global, *merged, *format)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,15 @@ func CommandGet(args []string, global bool, quoted bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CommandClear implements config:clear
|
||||||
|
func CommandClear(args []string, global bool, noRestart bool) {
|
||||||
|
appName, _ := getCommonArgs(global, args)
|
||||||
|
err := UnsetAll(appName, !noRestart)
|
||||||
|
if err != nil {
|
||||||
|
common.LogFail(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//CommandUnset implements config:unset
|
//CommandUnset implements config:unset
|
||||||
func CommandUnset(args []string, global bool, noRestart bool) {
|
func CommandUnset(args []string, global bool, noRestart bool) {
|
||||||
appName, keys := getCommonArgs(global, args)
|
appName, keys := getCommonArgs(global, args)
|
||||||
@@ -117,6 +126,10 @@ func CommandExport(args []string, global bool, merged bool, format string) {
|
|||||||
suffix = " "
|
suffix = " "
|
||||||
case "pretty":
|
case "pretty":
|
||||||
exportType = ExportFormatPretty
|
exportType = ExportFormatPretty
|
||||||
|
case "json":
|
||||||
|
exportType = ExportFormatJSON
|
||||||
|
case "json-list":
|
||||||
|
exportType = ExportFormatJSONList
|
||||||
default:
|
default:
|
||||||
common.LogFail(fmt.Sprintf("Unknown export format: %v", format))
|
common.LogFail(fmt.Sprintf("Unknown export format: %v", format))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core docker-options plugin"
|
description = "dokku core docker-options plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -170,12 +170,20 @@ domains_add_global() {
|
|||||||
) -eq 0 ]]; then
|
) -eq 0 ]]; then
|
||||||
dokku_log_info1 "Skipping: $DOMAIN already added"
|
dokku_log_info1 "Skipping: $DOMAIN already added"
|
||||||
else
|
else
|
||||||
sed -i -e "\$a\\$DOMAIN" "$GLOBAL_VHOST_PATH"
|
grep -qxF "$DOMAIN" "$GLOBAL_VHOST_PATH" || echo "$DOMAIN" >>"$GLOBAL_VHOST_PATH"
|
||||||
dokku_log_info1 "Added $DOMAIN"
|
dokku_log_info1 "Added $DOMAIN"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
domains_clear_global() {
|
||||||
|
declare desc="remove all domains"
|
||||||
|
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||||
|
|
||||||
|
rm "$GLOBAL_VHOST_PATH"
|
||||||
|
touch "$GLOBAL_VHOST_PATH"
|
||||||
|
}
|
||||||
|
|
||||||
domains_remove_global() {
|
domains_remove_global() {
|
||||||
declare desc="remove list of domains"
|
declare desc="remove list of domains"
|
||||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||||
@@ -249,7 +257,7 @@ get_default_vhosts() {
|
|||||||
local SUBDOMAIN=${APP/%\.${VHOST}/}
|
local SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||||
local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST")
|
local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST")
|
||||||
if [[ -z $hostname ]]; then
|
if [[ -z $hostname ]]; then
|
||||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
if [[ "$APP" == *.* ]]; then
|
||||||
local hostname="${APP/\//-}"
|
local hostname="${APP/\//-}"
|
||||||
else
|
else
|
||||||
local hostname="${APP/\//-}.$VHOST"
|
local hostname="${APP/\//-}.$VHOST"
|
||||||
@@ -304,7 +312,7 @@ is_global_vhost_enabled() {
|
|||||||
is_valid_hostname() {
|
is_valid_hostname() {
|
||||||
declare desc="return 0 if argument is a valid hostname; else return 1"
|
declare desc="return 0 if argument is a valid hostname; else return 1"
|
||||||
local hostname_string="${1,,}"
|
local hostname_string="${1,,}"
|
||||||
local hostname_regex='^([a-z0-9\*-]+\.)*[a-z0-9\*-]+$'
|
local hostname_regex='^([a-z0-9\.\*-]+\.)*[a-z0-9\*-]+$'
|
||||||
if [[ $hostname_string =~ $hostname_regex ]]; then
|
if [[ $hostname_string =~ $hostname_regex ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ cmd-domains-report-single() {
|
|||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
app_flags=(
|
app_flags=(
|
||||||
"--domains-app-enabled: $(fn-domains-app-enabled "$APP")"
|
"--domains-app-enabled: $(fn-domains-app-enabled "$APP")"
|
||||||
"--domains-app-vhosts: $(fn-domains-app-vhosts "$APP")"
|
"--domains-app-vhosts: $(fn-domains-app-vhosts "$APP" | awk '{$1=$1};1')"
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
global_flags=(
|
global_flags=(
|
||||||
"--domains-global-enabled: $(fn-domains-global-enabled)"
|
"--domains-global-enabled: $(fn-domains-global-enabled)"
|
||||||
"--domains-global-vhosts: $(fn-domains-global-vhosts)"
|
"--domains-global-vhosts: $(fn-domains-global-vhosts | awk '{$1=$1};1')"
|
||||||
)
|
)
|
||||||
|
|
||||||
flag_map=("${app_flags[@]}" "${global_flags[@]}")
|
flag_map=("${app_flags[@]}" "${global_flags[@]}")
|
||||||
@@ -91,6 +91,7 @@ domains_help_content_func() {
|
|||||||
domains:add <app> <domain> [<domain> ...], Add domains to app
|
domains:add <app> <domain> [<domain> ...], Add domains to app
|
||||||
domains:add-global <domain> [<domain> ...], Add global domain names
|
domains:add-global <domain> [<domain> ...], Add global domain names
|
||||||
domains:clear <app>, Clear all domains for app
|
domains:clear <app>, Clear all domains for app
|
||||||
|
domains:clear-global, Clear global domain names
|
||||||
domains:disable <app>, Disable VHOST support
|
domains:disable <app>, Disable VHOST support
|
||||||
domains:enable <app>, Enable VHOST support
|
domains:enable <app>, Enable VHOST support
|
||||||
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core domains plugin"
|
description = "dokku core domains plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
16
plugins/domains/subcommands/clear-global
Executable file
16
plugins/domains/subcommands/clear-global
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
domains_clear_global_cmd() {
|
||||||
|
declare desc="clear global domain names via command line"
|
||||||
|
local cmd="domains:clear-global"
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
dokku_log_info1_quiet "Clearing global domains"
|
||||||
|
domains_clear_global "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
domains_clear_global_cmd "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core enter plugin"
|
description = "dokku core enter plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ git_build_app_repo() {
|
|||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
# clean up after ourselves
|
# clean up after ourselves
|
||||||
local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_git.XXXX")
|
local GIT_BUILD_APP_REPO_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
trap 'rm -rf "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" >/dev/null' RETURN INT TERM EXIT
|
trap "rm -rf '$GIT_BUILD_APP_REPO_TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
|
||||||
|
|
||||||
local TMP_TAG="dokku/$REV"
|
local TMP_TAG="dokku/$REV"
|
||||||
chmod 755 "$GIT_BUILD_APP_REPO_TMP_WORK_DIR"
|
chmod 755 "$GIT_BUILD_APP_REPO_TMP_WORK_DIR"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core git plugin"
|
description = "dokku core git plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core logs plugin"
|
description = "dokku core logs plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core network plugin"
|
description = "dokku core network plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -300,11 +300,11 @@ nginx_build_config() {
|
|||||||
done
|
done
|
||||||
local PROXY_UPSTREAM_PORTS="$(echo "$PROXY_UPSTREAM_PORTS" | xargs)"
|
local PROXY_UPSTREAM_PORTS="$(echo "$PROXY_UPSTREAM_PORTS" | xargs)"
|
||||||
|
|
||||||
local NGINX_BUILD_CONFIG_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_nginx_template.XXXXX)
|
local NGINX_BUILD_CONFIG_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
local NGINX_CONF=$(mktemp --tmpdir="${NGINX_BUILD_CONFIG_TMP_WORK_DIR}" "nginx.conf.XXXXXX")
|
local NGINX_CONF=$(mktemp --tmpdir="${NGINX_BUILD_CONFIG_TMP_WORK_DIR}" "nginx.conf.XXXX")
|
||||||
local CUSTOM_NGINX_TEMPLATE="$NGINX_BUILD_CONFIG_TMP_WORK_DIR/$NGINX_TEMPLATE_NAME"
|
local CUSTOM_NGINX_TEMPLATE="$NGINX_BUILD_CONFIG_TMP_WORK_DIR/$NGINX_TEMPLATE_NAME"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
trap 'rm -rf $NGINX_CONF $NGINX_BUILD_CONFIG_TMP_WORK_DIR >/dev/null' RETURN INT TERM EXIT
|
trap "rm -rf '$NGINX_CONF' '$NGINX_BUILD_CONFIG_TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT
|
||||||
|
|
||||||
get_custom_nginx_template "$APP" "$CUSTOM_NGINX_TEMPLATE" 2>/dev/null
|
get_custom_nginx_template "$APP" "$CUSTOM_NGINX_TEMPLATE" 2>/dev/null
|
||||||
if [[ -f "$CUSTOM_NGINX_TEMPLATE" ]]; then
|
if [[ -f "$CUSTOM_NGINX_TEMPLATE" ]]; then
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ nginx_vhosts_is_valid_nginx_config_func() {
|
|||||||
declare desc="checks if an app has a valid nginx config"
|
declare desc="checks if an app has a valid nginx config"
|
||||||
declare APP="$1"
|
declare APP="$1"
|
||||||
local VALIDATE_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/validate.conf.sigil"
|
local VALIDATE_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/validate.conf.sigil"
|
||||||
local TMP_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
|
local TMP_OUTPUT=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
trap 'rm -rf "$TMP_OUTPUT" >/dev/null' RETURN INT TERM EXIT
|
trap "rm -rf '$TMP_OUTPUT' >/dev/null" RETURN INT TERM EXIT
|
||||||
|
|
||||||
sigil -f "$VALIDATE_TEMPLATE" NGINX_CONF="$DOKKU_ROOT/$APP/nginx.conf" | cat -s >"$TMP_OUTPUT"
|
sigil -f "$VALIDATE_TEMPLATE" NGINX_CONF="$DOKKU_ROOT/$APP/nginx.conf" | cat -s >"$TMP_OUTPUT"
|
||||||
sudo "$NGINX_LOCATION" -t -c "$TMP_OUTPUT" 2>/dev/null
|
sudo "$NGINX_LOCATION" -t -c "$TMP_OUTPUT" 2>/dev/null
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core nginx-vhosts plugin"
|
description = "dokku core nginx-vhosts plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
20
plugins/nginx-vhosts/subcommands/show-conf
Executable file
20
plugins/nginx-vhosts/subcommands/show-conf
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
|
nginx_show_conf_cmd() {
|
||||||
|
declare desc="display app nginx conf"
|
||||||
|
declare cmd="nginx:show-conf" argv=("$@")
|
||||||
|
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
|
declare APP="$1"
|
||||||
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
if [[ ! -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
|
||||||
|
dokku_log_fail "No nginx.conf exists for $APP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat "$DOKKU_ROOT/$APP/nginx.conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
nginx_show_conf_cmd "$@"
|
||||||
@@ -26,7 +26,7 @@ server {
|
|||||||
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
|
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection $http_connection;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
|||||||
@@ -8,13 +8,14 @@ case "$1" in
|
|||||||
help_content_func() {
|
help_content_func() {
|
||||||
declare desc="return plugin plugin help content"
|
declare desc="return plugin plugin help content"
|
||||||
cat <<help_content
|
cat <<help_content
|
||||||
plugin:list, Print active plugins
|
plugin:disable <name>, Disable an installed plugin (third-party only)
|
||||||
|
plugin:enable <name>, Enable a previously disabled plugin
|
||||||
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
|
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
|
||||||
plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones)
|
plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones)
|
||||||
plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
|
plugin:list, Print active plugins
|
||||||
plugin:enable <name>, Enable a previously disabled plugin
|
plugin:trigger <args...>, Trigger an arbitrary plugin hook
|
||||||
plugin:disable <name>, Disable an installed plugin (third-party only)
|
|
||||||
plugin:uninstall <name>, Uninstall a plugin (third-party only)
|
plugin:uninstall <name>, Uninstall a plugin (third-party only)
|
||||||
|
plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
|
||||||
help_content
|
help_content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core plugin plugin"
|
description = "dokku core plugin plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ plugin_install_cmd() {
|
|||||||
[[ "$#" -gt 2 ]] && dokku_log_info1_quiet "Cannot install additional core plugins, running core plugin install trigger"
|
[[ "$#" -gt 2 ]] && dokku_log_info1_quiet "Cannot install additional core plugins, running core plugin install trigger"
|
||||||
PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install
|
PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install
|
||||||
;;
|
;;
|
||||||
https:* | git* | ssh:* | *.tar.gz | *.tgz)
|
https:* | git* | ssh:* | file:* | *.tar.gz | *.tgz)
|
||||||
shift
|
shift
|
||||||
download_and_enable_plugin "$@"
|
download_and_enable_plugin "$@"
|
||||||
plugn trigger install
|
plugn trigger install
|
||||||
|
|||||||
13
plugins/plugin/subcommands/trigger
Executable file
13
plugins/plugin/subcommands/trigger
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
plugin_trigger_cmd() {
|
||||||
|
declare desc="trigger an arbitrary plugin hook"
|
||||||
|
local cmd="plugin:trigger"
|
||||||
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
|
|
||||||
|
plugn trigger "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin_trigger_cmd "$@"
|
||||||
@@ -80,12 +80,13 @@ proxy_help_content_func() {
|
|||||||
declare desc="return proxy plugin help content"
|
declare desc="return proxy plugin help content"
|
||||||
cat <<help_content
|
cat <<help_content
|
||||||
proxy <app>, [DEPRECATED] Show proxy settings for app
|
proxy <app>, [DEPRECATED] Show proxy settings for app
|
||||||
proxy:enable <app>, Enable proxy for app
|
|
||||||
proxy:disable <app>, Disable proxy for app
|
proxy:disable <app>, Disable proxy for app
|
||||||
|
proxy:enable <app>, Enable proxy for app
|
||||||
proxy:ports <app>, List proxy port mappings for app
|
proxy:ports <app>, List proxy port mappings for app
|
||||||
proxy:ports-clear <app>, Clear all proxy port mappings for app
|
proxy:ports-add <app> [<scheme>:<host-port>:<container-port>...], Add proxy port mappings to an app
|
||||||
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...], Set proxy port mappings for app
|
proxy:ports-clear <app>, Clear all proxy port mappings for an app
|
||||||
proxy:ports-remove <app> <host-port> [<host-port>|<scheme>:<host-port>:<container-port>...], Unset proxy port mappings for app
|
proxy:ports-remove <app> [<host-port>|<scheme>:<host-port>:<container-port>...], Remove specific proxy port mappings from an app
|
||||||
|
proxy:ports-set <app> [<scheme>:<host-port>:<container-port>...], Set proxy port mappings for an app
|
||||||
proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps
|
proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps
|
||||||
proxy:set <app> <proxy-type>, Set proxy type for app
|
proxy:set <app> <proxy-type>, Set proxy type for app
|
||||||
help_content
|
help_content
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core proxy plugin"
|
description = "dokku core proxy plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
|
|
||||||
proxy_ports_add_cmd() {
|
proxy_ports_add_cmd() {
|
||||||
declare desc="add proxy port mappings from an app"
|
declare desc="add proxy port mappings to an app"
|
||||||
local cmd="proxy:add"
|
local cmd="proxy:add"
|
||||||
local APP="$2"
|
local APP="$2"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
|
|
||||||
proxy_ports_set_cmd() {
|
proxy_ports_set_cmd() {
|
||||||
declare desc="add proxy port mappings from an app"
|
declare desc="set proxy port mappings for an app"
|
||||||
local cmd="proxy:add"
|
local cmd="proxy:set"
|
||||||
local APP="$2"
|
local APP="$2"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
set_proxy_ports "$APP" "$@"
|
set_proxy_ports "$APP" "$@"
|
||||||
plugn trigger post-proxy-ports-update "$APP" "add"
|
plugn trigger post-proxy-ports-update "$APP" "set"
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_ports_set_cmd "$@"
|
proxy_ports_set_cmd "$@"
|
||||||
|
|||||||
@@ -62,12 +62,17 @@ generate_scale_file() {
|
|||||||
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
copy_from_image "$IMAGE" "DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true
|
if copy_from_image "$IMAGE" "DOKKU_SCALE" "$DOKKU_ROOT/$APP" >/dev/null 2>&1; then
|
||||||
|
cp "$DOKKU_SCALE_FILE" "${DOKKU_SCALE_FILE}.extracted"
|
||||||
|
else
|
||||||
|
rm -f "${DOKKU_SCALE_FILE}.extracted"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -f $DOKKU_SCALE_FILE ]]; then
|
if [[ ! -f $DOKKU_SCALE_FILE ]]; then
|
||||||
dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Generating one based on Procfile..."
|
dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Generating one based on Procfile..."
|
||||||
|
|
||||||
local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_scale.XXXX")
|
local GENERATE_SCALE_FILE_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
trap 'rm -rf "$GENERATE_SCALE_FILE_TMP_WORK_DIR" >/dev/null' RETURN
|
trap "rm -rf '$GENERATE_SCALE_FILE_TMP_WORK_DIR' >/dev/null" RETURN
|
||||||
|
|
||||||
if [[ -f $DOKKU_PROCFILE ]]; then
|
if [[ -f $DOKKU_PROCFILE ]]; then
|
||||||
while read -r line || [[ -n "$line" ]]; do
|
while read -r line || [[ -n "$line" ]]; do
|
||||||
@@ -94,7 +99,7 @@ set_scale() {
|
|||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
|
extract_procfile "$APP" "$IMAGE_TAG" >/dev/null
|
||||||
trap 'remove_procfile $APP' RETURN INT TERM EXIT
|
trap "remove_procfile $APP" RETURN INT TERM EXIT
|
||||||
|
|
||||||
local SCALE_SETTINGS=("$@")
|
local SCALE_SETTINGS=("$@")
|
||||||
for procscale in "${SCALE_SETTINGS[@]}"; do
|
for procscale in "${SCALE_SETTINGS[@]}"; do
|
||||||
@@ -182,20 +187,24 @@ ps_scale() {
|
|||||||
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG"
|
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" >/dev/null 2>&1
|
||||||
if [[ -z "$@" ]]; then
|
if [[ -z "$@" ]]; then
|
||||||
dokku_log_info1_quiet "Scaling for $APP"
|
dokku_log_info1_quiet "Scaling for $APP"
|
||||||
dokku_col_log_info1_quiet "proctype" "qty"
|
dokku_col_log_msg_quiet "proctype" "qty"
|
||||||
dokku_col_log_info1_quiet "--------" "---"
|
dokku_col_log_msg_quiet "--------" "---"
|
||||||
while read -r line || [[ -n "$line" ]]; do
|
while read -r line || [[ -n "$line" ]]; do
|
||||||
[[ -z "$line" ]] && continue
|
[[ -z "$line" ]] && continue
|
||||||
local PROC_NAME=${line%%=*}
|
local PROC_NAME=${line%%=*}
|
||||||
local PROC_COUNT=${line#*=}
|
local PROC_COUNT=${line#*=}
|
||||||
dokku_col_log_info1 "$PROC_NAME" "$PROC_COUNT"
|
dokku_col_log_msg "${PROC_NAME}:" "$PROC_COUNT"
|
||||||
done <"$DOKKU_SCALE_FILE"
|
done <"$DOKKU_SCALE_FILE"
|
||||||
else
|
else
|
||||||
set_scale "$APP" "$@"
|
if [[ "$(fn-ps-can-scale "$APP")" == "true" ]]; then
|
||||||
release_and_deploy "$APP" "$IMAGE_TAG"
|
set_scale "$APP" "$@"
|
||||||
|
release_and_deploy "$APP" "$IMAGE_TAG"
|
||||||
|
else
|
||||||
|
dokku_log_fail "App contains DOKKU_SCALE file and cannot be manually scaled"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,3 +250,17 @@ fn-ps-is-app-running() {
|
|||||||
APP_STATUS=$(fn-ps-app-status "$APP")
|
APP_STATUS=$(fn-ps-app-status "$APP")
|
||||||
echo "$APP_STATUS" | cut -d ' ' -f 2
|
echo "$APP_STATUS" | cut -d ' ' -f 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn-ps-can-scale() {
|
||||||
|
declare APP="$1"
|
||||||
|
local IMAGE_TAG=$(get_running_image_tag "$APP")
|
||||||
|
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
|
local CAN_SCALE=false
|
||||||
|
|
||||||
|
[[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" >/dev/null 2>&1
|
||||||
|
if [[ ! -f "${DOKKU_SCALE_FILE}.extracted" ]]; then
|
||||||
|
CAN_SCALE=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$CAN_SCALE"
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ cmd-ps-report-single() {
|
|||||||
|
|
||||||
if (is_deployed "$APP"); then DEPLOYED="true"; else DEPLOYED="false"; fi
|
if (is_deployed "$APP"); then DEPLOYED="true"; else DEPLOYED="false"; fi
|
||||||
local passed_phases="deploy"
|
local passed_phases="deploy"
|
||||||
RESTARTPOLICY=$(get_restart_policies "$(get_phase_file_path "$passed_phases")" || true)
|
local RESTARTPOLICY=$(get_restart_policies "$(get_phase_file_path "$passed_phases")" || true)
|
||||||
|
local CAN_SCALE="$(fn-ps-can-scale "$APP")"
|
||||||
|
|
||||||
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 2 -n | xargs)"
|
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 2 -n | xargs)"
|
||||||
local CONTAINER_FILE
|
local CONTAINER_FILE
|
||||||
@@ -70,6 +71,7 @@ cmd-ps-report-single() {
|
|||||||
"--running: $RUNNING"
|
"--running: $RUNNING"
|
||||||
"--restore: $RESTORE"
|
"--restore: $RESTORE"
|
||||||
"--restart-policy: $RESTARTPOLICY"
|
"--restart-policy: $RESTARTPOLICY"
|
||||||
|
"--ps-can-scale: $CAN_SCALE"
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ -z "$INFO_FLAG" ]]; then
|
if [[ -z "$INFO_FLAG" ]]; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core ps plugin"
|
description = "dokku core ps plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core repo plugin"
|
description = "dokku core repo plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core resource plugin"
|
description = "dokku core resource plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ func GetResourceValue(appName string, processType string, resourceType string, k
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultValue := ""
|
defaultValue := ""
|
||||||
for key, value := range resources {
|
for k, value := range resources {
|
||||||
if key == propertyKey("_default_", resourceType, key) {
|
if k == propertyKey("_default_", resourceType, key) {
|
||||||
defaultValue = value
|
defaultValue = value
|
||||||
}
|
}
|
||||||
if key == propertyKey(processType, resourceType, key) {
|
if k == propertyKey(processType, resourceType, key) {
|
||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ func main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parts[1] == "cpu" {
|
||||||
|
parts[1] = "cpus"
|
||||||
|
}
|
||||||
|
|
||||||
limits[parts[1]] = value
|
limits[parts[1]] = value
|
||||||
}
|
}
|
||||||
if parts[0] == "reserve" {
|
if parts[0] == "reserve" {
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
processType := flag.Arg(1)
|
processType := flag.Arg(1)
|
||||||
resourceType := flag.Arg(1)
|
resourceType := flag.Arg(2)
|
||||||
key := flag.Arg(1)
|
key := flag.Arg(3)
|
||||||
|
|
||||||
value, err := resource.GetResourceValue(appName, processType, resourceType, key)
|
value, err := resource.GetResourceValue(appName, processType, resourceType, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -121,10 +121,11 @@ func setResourceType(appName string, processType string, r Resource, resourceTyp
|
|||||||
common.LogInfo2Quiet(message)
|
common.LogInfo2Quiet(message)
|
||||||
|
|
||||||
for key, value := range resources {
|
for key, value := range resources {
|
||||||
if value != "" {
|
if value == "" {
|
||||||
common.LogVerbose(fmt.Sprintf("%v: %v", key, value))
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
common.LogVerbose(fmt.Sprintf("%v: %v", key, value))
|
||||||
property := propertyKey(processType, resourceType, key)
|
property := propertyKey(processType, resourceType, key)
|
||||||
err := common.PropertyWrite("resource", appName, property, value)
|
err := common.PropertyWrite("resource", appName, property, value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -142,7 +143,9 @@ func reportResourceType(appName string, processType string, resourceType string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
message := fmt.Sprintf("resource %v %v information", noun, appName)
|
message := fmt.Sprintf("resource %v %v information", noun, appName)
|
||||||
if processType != "_default_" {
|
if processType == "_default_" {
|
||||||
|
message = fmt.Sprintf("%v [defaults]", message)
|
||||||
|
} else {
|
||||||
message = fmt.Sprintf("%v (%v)", message, processType)
|
message = fmt.Sprintf("%v (%v)", message, processType)
|
||||||
}
|
}
|
||||||
common.LogInfo2Quiet(message)
|
common.LogInfo2Quiet(message)
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ scheduler-docker-local-check-deploy() {
|
|||||||
# docker cp exits with status 1 when run as non-root user when it tries to chown the file
|
# docker cp exits with status 1 when run as non-root user when it tries to chown the file
|
||||||
# after successfully copying the file. Thus, we suppress stderr.
|
# after successfully copying the file. Thus, we suppress stderr.
|
||||||
# ref: https://github.com/dotcloud/docker/issues/3986
|
# ref: https://github.com/dotcloud/docker/issues/3986
|
||||||
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_CHECKS.XXXXX)
|
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
docker cp "$DOKKU_APP_CONTAINER_ID:/app/CHECKS" "$CHECK_DEPLOY_TMP_WORK_DIR" 2>/dev/null || true
|
docker cp "$DOKKU_APP_CONTAINER_ID:/app/CHECKS" "$CHECK_DEPLOY_TMP_WORK_DIR" 2>/dev/null || true
|
||||||
|
|
||||||
local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS
|
local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS
|
||||||
@@ -99,7 +99,7 @@ scheduler-docker-local-check-deploy() {
|
|||||||
dokku_log_info2_quiet "end $APP $DOKKU_APP_CONTAINER_TYPE container output"
|
dokku_log_info2_quiet "end $APP $DOKKU_APP_CONTAINER_TYPE container output"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
trap 'checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID' RETURN INT TERM EXIT
|
trap "checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID" RETURN INT TERM EXIT
|
||||||
|
|
||||||
if [[ ! -s "${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]]; then
|
if [[ ! -s "${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]]; then
|
||||||
# We allow custom check for web instances only
|
# We allow custom check for web instances only
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core scheduler-docker-local plugin"
|
description = "dokku core scheduler-docker-local plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ scheduler-docker-local-scheduler-inspect() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local TMP_INSPECT_CMD=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
|
local TMP_INSPECT_CMD=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
trap 'rm -rf "$TMP_INSPECT_CMD" >/dev/null' RETURN INT TERM EXIT
|
trap "rm -rf '$TMP_INSPECT_CMD' >/dev/null" RETURN INT TERM EXIT
|
||||||
cat >"$TMP_INSPECT_CMD" <<EOF
|
cat >"$TMP_INSPECT_CMD" <<EOF
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
@@ -34,7 +34,7 @@ for container in data:
|
|||||||
env.append(e)
|
env.append(e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
k, v = e.split('=', 2)
|
k, v = e.split('=', 1)
|
||||||
env.append('{0}=XXXXXX'.format(k))
|
env.append('{0}=XXXXXX'.format(k))
|
||||||
|
|
||||||
container['Config']['Env'] = env
|
container['Config']['Env'] = env
|
||||||
|
|||||||
23
plugins/scheduler-docker-local/scheduler-is-deployed
Executable file
23
plugins/scheduler-docker-local/scheduler-is-deployed
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
scheduler-docker-local-scheduler-is-deployed() {
|
||||||
|
declare desc="checks if an app is deployed"
|
||||||
|
declare DOKKU_SCHEDULER="$1" APP="$2"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(
|
||||||
|
ls "$DOKKU_ROOT/$APP"/CONTAINER.* &>/dev/null
|
||||||
|
echo $?
|
||||||
|
) -eq 0 ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
scheduler-docker-local-scheduler-is-deployed "$@"
|
||||||
@@ -8,8 +8,11 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
|||||||
scheduler-docker-local-scheduler-run() {
|
scheduler-docker-local-scheduler-run() {
|
||||||
declare desc="runs command in container based on app image"
|
declare desc="runs command in container based on app image"
|
||||||
declare trigger="scheduler-docker-local scheduler-run"
|
declare trigger="scheduler-docker-local scheduler-run"
|
||||||
declare DOKKU_SCHEDULER="$1" APP="$2"
|
declare DOKKU_SCHEDULER="$1" APP="$2" ENV_COUNT="$3"
|
||||||
shift 2
|
shift 3
|
||||||
|
|
||||||
|
declare RUN_ENV=("${@:1:ENV_COUNT}")
|
||||||
|
shift "$ENV_COUNT"
|
||||||
|
|
||||||
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
|
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
|
||||||
return
|
return
|
||||||
@@ -25,38 +28,45 @@ scheduler-docker-local-scheduler-run() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-run "$APP" "$IMAGE_TAG")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-run "$APP" "$IMAGE_TAG")
|
||||||
[[ "$DOKKU_TRACE" ]] && local DOCKER_ARGS+=" -e TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||||
|
|
||||||
local IMAGE_SOURCE_TYPE="dockerfile"
|
local IMAGE_SOURCE_TYPE="dockerfile"
|
||||||
is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish"
|
is_image_herokuish_based "$IMAGE" && IMAGE_SOURCE_TYPE="herokuish"
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE" "$PHASE_SCRIPT_KEY")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-run "$APP" "$IMAGE_TAG" "$IMAGE_SOURCE_TYPE")
|
||||||
|
DOCKER_ARGS+=" -e DYNO=run.$RANDOM"
|
||||||
|
|
||||||
declare -a ARG_ARRAY
|
declare -a ARG_ARRAY
|
||||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||||
|
|
||||||
local DOKKU_RUN_OPTS=" -e DYNO=run.$RANDOM"
|
local DOKKU_RUN_OPTS=" -e DYNO=run.$RANDOM"
|
||||||
if [[ "$DOKKU_RM_CONTAINER" ]]; then
|
if [[ "$DOKKU_RM_CONTAINER" ]]; then
|
||||||
DOKKU_RUN_OPTS+=" --rm"
|
DOCKER_ARGS+=" --rm"
|
||||||
elif [[ "$DOKKU_DETACH_CONTAINER" ]]; then
|
elif [[ "$DOKKU_DETACH_CONTAINER" ]]; then
|
||||||
DOKKU_RUN_OPTS+=" --detach"
|
DOCKER_ARGS+=" --detach"
|
||||||
fi
|
fi
|
||||||
|
has_tty && DOCKER_ARGS+=" -i -t"
|
||||||
|
# the output of docker-args-run is possibly quoted/escaped so eval to normalize
|
||||||
|
declare -a DOCKER_ARGS_ARRAY
|
||||||
|
eval "DOCKER_ARGS_ARRAY=($DOCKER_ARGS)"
|
||||||
|
for env_pair in "${RUN_ENV[@]}"; do
|
||||||
|
DOCKER_ARGS_ARRAY+=("--env=$env_pair")
|
||||||
|
done
|
||||||
|
|
||||||
has_tty && DOKKU_RUN_OPTS+=" -i -t"
|
|
||||||
[[ "$IMAGE_SOURCE_TYPE" == "herokuish" ]] && local EXEC_CMD="/exec"
|
[[ "$IMAGE_SOURCE_TYPE" == "herokuish" ]] && local EXEC_CMD="/exec"
|
||||||
|
|
||||||
DOKKU_QUIET_OUTPUT=1 extract_procfile "$APP"
|
DOKKU_QUIET_OUTPUT=1 extract_procfile "$APP"
|
||||||
|
|
||||||
POTENTIAL_PROCFILE_KEY="$1"
|
POTENTIAL_PROCFILE_KEY="$1"
|
||||||
PROC_CMD=$(get_cmd_from_procfile "$APP" "$POTENTIAL_PROCFILE_KEY" || echo '')
|
PROC_CMD=$(get_cmd_from_procfile "$APP" "$POTENTIAL_PROCFILE_KEY" 2>/dev/null || echo '')
|
||||||
remove_procfile "$APP"
|
remove_procfile "$APP"
|
||||||
|
|
||||||
if [[ -n "$PROC_CMD" ]]; then
|
if [[ -n "$PROC_CMD" ]]; then
|
||||||
dokku_log_info1 "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
|
dokku_log_info1_quiet "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
|
||||||
set -- "$PROC_CMD" "${@:2}"
|
set -- "$PROC_CMD" "${@:2}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
docker run $DOKKU_GLOBAL_RUN_ARGS $DOKKU_RUN_OPTS "${ARG_ARRAY[@]}" $IMAGE $EXEC_CMD "$@"
|
docker run $DOKKU_GLOBAL_RUN_ARGS "${DOCKER_ARGS_ARRAY[@]}" $IMAGE $EXEC_CMD "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduler-docker-local-scheduler-run "$@"
|
scheduler-docker-local-scheduler-run "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core shell plugin"
|
description = "dokku core shell plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -14,9 +14,14 @@ verify_ssh_key_file() {
|
|||||||
declare desc="Test that public key is valid"
|
declare desc="Test that public key is valid"
|
||||||
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
||||||
local key line=0
|
local key line=0
|
||||||
|
local TMP_KEY_FILE
|
||||||
|
TMP_KEY_FILE=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
|
trap "rm -rf '$TMP_KEY_FILE' >/dev/null" RETURN INT TERM EXIT
|
||||||
|
|
||||||
while read -r key; do
|
while read -r key; do
|
||||||
line=$((line + 1))
|
line=$((line + 1))
|
||||||
ssh-keygen -l -f /dev/stdin <<<"$key" &>/dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys line $line failed ssh-keygen check."
|
echo "$key" >"$TMP_KEY_FILE"
|
||||||
|
ssh-keygen -lf "$TMP_KEY_FILE" &>/dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys line $line failed ssh-keygen check."
|
||||||
done <"${DOKKU_ROOT}/.ssh/authorized_keys"
|
done <"${DOKKU_ROOT}/.ssh/authorized_keys"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core ssh-keys plugin"
|
description = "dokku core ssh-keys plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -7,22 +7,33 @@ source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
|||||||
add_keys() {
|
add_keys() {
|
||||||
declare desc="add a new key via sshcommand"
|
declare desc="add a new key via sshcommand"
|
||||||
local cmd="ssh-keys:add"
|
local cmd="ssh-keys:add"
|
||||||
shift
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
local name="$1" key_file="$2" key_contents key_from_pipe
|
declare NAME="$1" KEY_FILE="$2"
|
||||||
[[ -p /dev/stdin ]] && read -r key_from_pipe
|
local TMP_KEY_FILE
|
||||||
if [[ -n "$key_from_pipe" ]]; then
|
TMP_KEY_FILE=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
|
||||||
ssh-keygen -lf /dev/stdin <<<"$key_from_pipe" &>/dev/null || dokku_log_fail "Key piped in is not a valid ssh public key"
|
trap "rm -rf '$TMP_KEY_FILE' >/dev/null" RETURN INT TERM EXIT
|
||||||
key_contents="$key_from_pipe"
|
|
||||||
elif [[ -n "$key_file" ]]; then
|
if [[ -n "$KEY_FILE" ]]; then
|
||||||
key_contents="$(cat "$key_file")"
|
true
|
||||||
ssh-keygen -lf /dev/stdin <<<"$key_contents" &>/dev/null || dokku_log_fail "Key from file is not a valid ssh public key"
|
elif [[ -p /dev/stdin ]]; then
|
||||||
|
local key_contents
|
||||||
|
read -r key_contents
|
||||||
|
echo "$key_contents" >"$TMP_KEY_FILE"
|
||||||
|
KEY_FILE="$TMP_KEY_FILE"
|
||||||
|
else
|
||||||
|
dokku_log_fail "No key specified via file or pipe"
|
||||||
fi
|
fi
|
||||||
[[ -n "$name" && -n "$key_contents" ]] || dokku_log_fail "Two arguments are required if not piping, ie: dokku ssh-keys:add <NAME> <KEY_FILE>"
|
|
||||||
local count="$(wc -l <<<"$key_contents")"
|
if [[ ! -s "$KEY_FILE" ]]; then
|
||||||
[ "$count" -eq 1 ] || dokku_log_fail 'Too many keys provided, set one per invocation of dokku ssh-keys:add <NAME> <KEY_FILE>'
|
dokku_log_fail "Empty key was specified"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local count="$(wc -l "$KEY_FILE" | awk '{ print $1; }')"
|
||||||
|
[[ "$count" -eq 1 ]] || dokku_log_fail "Too many keys provided, set one per invocation of dokku ssh-keys:add <NAME> <KEY_FILE>"
|
||||||
|
ssh-keygen -lf "$KEY_FILE" &>/dev/null || dokku_log_fail "Key specified in is not a valid ssh public key"
|
||||||
create_ssh_key_file
|
create_ssh_key_file
|
||||||
verify_ssh_key_exists
|
verify_ssh_key_exists
|
||||||
echo "$key_contents" | sshcommand acl-add dokku "$name" || dokku_log_fail "sshcommand returned an error: $?"
|
sshcommand acl-add dokku "$NAME" "$KEY_FILE" || dokku_log_fail "sshcommand returned an error: $?"
|
||||||
verify_ssh_key_file
|
verify_ssh_key_file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core storage plugin"
|
description = "dokku core storage plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core tags plugin"
|
description = "dokku core tags plugin"
|
||||||
version = "0.15.4"
|
version = "0.17.2"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user