Compare commits

...

56 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
e435d01258 Release 0.22.7
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.22.7

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
```

### Bug Fixes

- #4301: @josegonzalez Ensure vector container starts correctly
2021-01-07 03:07:57 -05:00
Jose Diaz-Gonzalez
793e9d377e Merge pull request #4301 from dokku/4299-vector-fixes
Ensure vector container starts correctly
2021-01-07 03:07:40 -05:00
Jose Diaz-Gonzalez
a57680fbbf feat: test vector commands 2021-01-07 01:54:04 -05:00
Jose Diaz-Gonzalez
eda71e3ffe feat: mirror log tailing support for logs:vector-logs command 2021-01-07 01:43:55 -05:00
Jose Diaz-Gonzalez
b186d9d66c docs: fix help output 2021-01-07 01:42:51 -05:00
Jose Diaz-Gonzalez
f16a211b48 feat: add more tests for the logs plugin 2021-01-07 01:34:19 -05:00
Jose Diaz-Gonzalez
d70a9be97e fix: correct issue where all flags were not shown if an invalid flag was specified 2021-01-07 01:34:05 -05:00
Jose Diaz-Gonzalez
666bb9dfee fix: unscope err for report subcommands 2021-01-07 01:12:50 -05:00
Jose Diaz-Gonzalez
081a44755e docs: fix examples to use correct property key 2021-01-07 01:07:20 -05:00
Jose Diaz-Gonzalez
2eae6c25af tests: add test for logs:help 2021-01-07 00:14:43 -05:00
Jose Diaz-Gonzalez
4bbee232d8 fix: handle error cases in starting a new vector container 2021-01-07 00:12:44 -05:00
Jose Diaz-Gonzalez
441f7ab22a fix: pass 1 to --watch-config flag
Apparently this needs a value...
2021-01-07 00:12:23 -05:00
Jose Diaz-Gonzalez
714b27f8a4 chore: quiet output of starting container
We check if the container is running later, so there isn't a need for us to see the containerID here
2021-01-07 00:08:05 -05:00
Jose Diaz-Gonzalez
2d841f47eb fix: handle case where there are no apps 2021-01-06 22:45:47 -05:00
Jose Diaz-Gonzalez
4c98cd922f Release 0.22.6
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# History

## 0.22.6

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.6/bootstrap.sh
sudo DOKKU_TAG=v0.22.6 bash bootstrap.sh
```

### Bug Fixes

- #4295: @josegonzalez Update ps subcommands and triggers

### New Features

- #4286: @josegonzalez Add support for templated CHECKS files
- #4294: @josegonzalez Enhance ssh client logging output
- #4291: @josegonzalez Add log aggregation support via Vector
- #4288: @josegonzalez Add the pid of the dokku process to event logs
- #4289: @josegonzalez Clean precheck tmp file on exit

### Refactors

- #4287: @josegonzalez Refactor parallelized goroutines to use error groups

### Documentation

- #4292: @thomasfedb Update docs to note support for Ubuntu 20.04
- #4293: @ltalirz Fix path in persistent storage docs

### Other

- #4290: @josegonzalez Add support for debug logging plugin trigger stderr and stdout
2021-01-05 09:50:19 -05:00
Jose Diaz-Gonzalez
1c3c712629 Merge pull request #4295 from dokku/fix-triggers
Update ps subcommands and triggers
2021-01-05 09:45:59 -05:00
Jose Diaz-Gonzalez
84ec74e97f fix: update ps subcommands and triggers
- There were missing trigger symlinks due to the the rewrite omitting them
- There was an extra symlink for a subcommand that was removed
2021-01-05 03:50:52 -05:00
Jose Diaz-Gonzalez
57cc1c7f8e Merge pull request #4286 from dokku/3974-templated-checks
Add support for templated CHECKS files
2021-01-05 03:15:36 -05:00
Jose Diaz-Gonzalez
0e67ffc41e Merge pull request #4294 from dokku/4278-better-client-logging
Enhance ssh client logging output
2021-01-05 02:21:34 -05:00
Jose Diaz-Gonzalez
f4e0d19d43 fix: correct path for templated checks file 2021-01-05 01:02:39 -05:00
Jose Diaz-Gonzalez
07e7988cdf feat: add sigil templating to CHECKS files
This enables general templating capabilities, in addition to environment variable access.

Closes #3974.
2021-01-05 00:16:55 -05:00
Jose Diaz-Gonzalez
d21aca2c59 chore: remove unnecessary extra logic
This is now performed in copy_from_image for all files.
2021-01-05 00:16:55 -05:00
Jose Diaz-Gonzalez
540e066acf fix: return the failed exit code 2021-01-05 00:10:54 -05:00
Jose Diaz-Gonzalez
a49de4e473 docs: make the header more clear
[ci skip]
2021-01-04 23:00:58 -05:00
Jose Diaz-Gonzalez
4c28ae2630 Merge pull request #4291 from dokku/2268-vector-logging
Add log aggregation support via Vector
2021-01-04 22:56:25 -05:00
Jose Diaz-Gonzalez
2d07d89d60 docs: add new as of banner
[ci skip]
2021-01-04 22:56:03 -05:00
Jose Diaz-Gonzalez
83d8c8448b feat: remind users to check their ssh config in cases of ssh error
Closes #4278
2021-01-04 22:41:04 -05:00
Jose Diaz-Gonzalez
8eccd50ecb chore: standardize logging output
- send errors to stderr
- use proper prefixes on errors
- use correct prefixes on stdout
2021-01-04 22:38:28 -05:00
Jose Diaz-Gonzalez
09ed45534d refactor: always write out the vector configuration 2021-01-04 21:48:38 -05:00
Jose Diaz-Gonzalez
711945147b refactor: use --watch-config instead of signaling the container to reload config 2021-01-04 21:48:28 -05:00
Jose Diaz-Gonzalez
0b3a6687f6 feat: actually mount the apps log dir
Also fix it so that the log directory is mountable from a custom path on the host if running dokku within a container.
2021-01-04 21:45:26 -05:00
Jose Diaz-Gonzalez
1aec869f9e fix: do not delete apps log subdir
This is a new directory introduced for vector logging should not be deleted so vector logging still works.
2021-01-04 21:40:51 -05:00
Jose Diaz-Gonzalez
6f9a6eb294 fix: only check for global properties when appName is --global 2021-01-04 12:43:15 -05:00
Jose Diaz-Gonzalez
96ed840d17 Merge pull request #4292 from thomasfedb/patch-1
Update docs to note support for Ubuntu 20.04
2021-01-04 12:19:39 -05:00
Jose Diaz-Gonzalez
5acdf4a43c Merge pull request #4293 from ltalirz/patch-2
Update persistent-storage.md
2021-01-04 12:19:05 -05:00
Leopold Talirz
6b4c545592 Update persistent-storage.md
add directory to complete path
2021-01-04 16:17:54 +01:00
Thomas Drake-Brockman
dd6cbcf242 Update docs to note support for Ubuntu 20.04 2021-01-04 21:50:02 +08:00
Jose Diaz-Gonzalez
d6acf5530e fix: add some comments 2021-01-04 01:14:40 -05:00
Jose Diaz-Gonzalez
94696e81fa fix: ensure the vector container does not exit when no configured sinks are in place 2021-01-04 01:12:25 -05:00
Jose Diaz-Gonzalez
43d6a2ad94 feat: add ability to set a global vector sink 2021-01-04 01:11:49 -05:00
Jose Diaz-Gonzalez
e1425a85e4 feat: add ability to set global properties
Not all properties can be set globally, and the "appName" in the global case is currently defaulted to `--global`. This is okay because domain label names cannot start with hyphens, and all app names must be valid domain label names.
2021-01-04 00:50:14 -05:00
Jose Diaz-Gonzalez
f5fa94cc9c chore: remove dburl usage
dburl adds aliases for everything, which breaks if two schemes are similar enough (anything with `aws_` as a prefix broke scheme registration). It does not appear to add anything, so we'll drop that dependency.

Also remove go-jsonmerge, as this was refactored to use structs instead of byte manipulation...
2021-01-04 00:42:13 -05:00
Jose Diaz-Gonzalez
fd85b1f605 feat: add vector integration
This currently is missing a few features:

- global sinks
- logrotation

But works fairly well otherwise.
2021-01-04 00:30:22 -05:00
Jose Diaz-Gonzalez
b386783ec8 Merge pull request #4287 from dokku/parallelize-refactor
Refactor parallelized goroutines to use error groups
2021-01-02 23:53:11 -05:00
Jose Diaz-Gonzalez
3b76b81edf fix: set correct variable for app image repo 2021-01-02 18:47:48 -05:00
Jose Diaz-Gonzalez
2eb159b0c3 refactor: use error group for fetching the app shell to use for app-json tasks 2021-01-02 18:45:30 -05:00
Jose Diaz-Gonzalez
596e7b6f24 feat: use error group to fetch the deploying app image
This is a fairly slow operation currently done serially, making ps:scale output brutally slow. Using an error group to parallelize the output is also pleasing to the eyes :)
2021-01-02 18:45:30 -05:00
Jose Diaz-Gonzalez
aa0437bb23 refactor: use an error group to simplify parallel retrieval of scheduler
This makes the code a bit simpler to read and more idiomatic
2021-01-02 18:45:30 -05:00
Jose Diaz-Gonzalez
a6c22a292d Merge pull request #4288 from dokku/pid-log
Add the pid of the dokku process to event logs
2021-01-02 18:40:30 -05:00
Jose Diaz-Gonzalez
0635edba17 Merge pull request #4289 from dokku/clean-on-exit
Clean precheck tmp file on exit
2021-01-02 18:40:23 -05:00
Jose Diaz-Gonzalez
a0491a5ef2 Merge pull request #4290 from dokku/debug-output
Add support for debug logging plugin trigger stderr and stdout
2021-01-02 18:40:15 -05:00
Jose Diaz-Gonzalez
38d172c477 refactor: add support for debug logging plugin trigger stderr and stdout
Previously, this could get a bit hazy when running the command within a goroutine. The new method creates pipes for writing stdout/stderr for each call to PluginTriggerOutput, then debug logs if if trace mode is on.

While it is a bit weird to read, it is more correct and should get rid of any parallel processing issues.
2021-01-02 06:13:48 -05:00
Jose Diaz-Gonzalez
5e4c918d40 feat: trim any extra debug log prefixes 2021-01-02 06:11:51 -05:00
Jose Diaz-Gonzalez
e8aaacff5e refactor: simplify code 2021-01-02 06:11:34 -05:00
Jose Diaz-Gonzalez
21d4d640c2 fix: clean precheck tmp file on exit 2021-01-02 05:23:52 -05:00
Jose Diaz-Gonzalez
b927c1b84d feat: add the pid of the dokku process to event logs 2021-01-02 05:23:12 -05:00
106 changed files with 1358 additions and 234 deletions

View File

@@ -53,4 +53,4 @@ RUN \
&& rm -f /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
&& rm -f /usr/local/openresty/nginx/conf/sites-enabled/default /usr/share/openresty/html/index.html \
&& sed -i '/imklog/d' /etc/rsyslog.conf \
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/* /var/log/nginx/* /var/log/openresty/*
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/*.log /var/log/nginx/* /var/log/openresty/*

View File

@@ -1,5 +1,52 @@
# History
## 0.22.7
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
```
### Bug Fixes
- #4301: @josegonzalez Ensure vector container starts correctly
## 0.22.6
Install/update via the bootstrap script:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.6/bootstrap.sh
sudo DOKKU_TAG=v0.22.6 bash bootstrap.sh
```
### Bug Fixes
- #4295: @josegonzalez Update ps subcommands and triggers
### New Features
- #4286: @josegonzalez Add support for templated CHECKS files
- #4294: @josegonzalez Enhance ssh client logging output
- #4291: @josegonzalez Add log aggregation support via Vector
- #4288: @josegonzalez Add the pid of the dokku process to event logs
- #4289: @josegonzalez Clean precheck tmp file on exit
### Refactors
- #4287: @josegonzalez Refactor parallelized goroutines to use error groups
### Documentation
- #4292: @thomasfedb Update docs to note support for Ubuntu 20.04
- #4293: @ltalirz Fix path in persistent storage docs
### Other
- #4290: @josegonzalez Add support for debug logging plugin trigger stderr and stdout
## 0.22.5
Install/update via the bootstrap script:

View File

@@ -99,8 +99,8 @@ Otherwise, you will need to import the keypair manually after installation using
To install the latest stable release, run the following commands as a user who has access to `sudo`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.5/bootstrap.sh
sudo DOKKU_TAG=v0.22.5 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
```
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.

View File

@@ -15,7 +15,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.22.5'
VERSION = 'v0.22.7'
def bytes_to_string(b):
if type(b) == bytes:

View File

@@ -32,8 +32,8 @@ fn-random-name() {
}
fn-client-help-msg() {
echo "==> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku" 1>&2
echo "--> i.e. git remote add dokku dokku@<dokku-host>:<app-name>" 1>&2
echo "=====> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku"
echo " i.e. git remote add dokku dokku@<dokku-host>:<app-name>"
exit 20 # exit with specific status. only used in units tests for now
}
@@ -107,7 +107,7 @@ main() {
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
else
echo "This is not a git repository"
echo " ! This is not a git repository" 1>&2
fi
fi
@@ -118,7 +118,7 @@ main() {
counter=0
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null | grep -q "$APP"; do
if [[ $counter -ge 100 ]]; then
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
echo " ! Could not reasonably generate a new app name. Try cleaning up some apps..." 1>&2
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps
exit 1
else
@@ -133,7 +133,7 @@ main() {
echo "-----> Dokku remote added at ${DOKKU_REMOTE_HOST} called ${DOKKU_GIT_REMOTE}"
echo "-----> Application name is ${APP}"
else
echo "! Dokku remote not added! Do you already have a dokku remote?"
echo " ! Dokku remote not added! Do you already have a dokku remote?" 1>&2
return
fi
;;
@@ -149,7 +149,12 @@ main() {
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@"
# shellcheck disable=SC2068,SC2086
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@ || {
ssh_exit_code="$?"
echo " ! Failed to execute dokku command over ssh: exit code $?" 1>&2
echo " ! If there was no output from Dokku, ensure your configured SSH Key can connect to the remote server" 1>&2
return $ssh_exit_code
}
}
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]] || [[ "$0" == $(which dokku) ]]; then

2
debian/control vendored
View File

@@ -1,5 +1,5 @@
Package: dokku
Version: 0.22.5
Version: 0.22.7
Section: web
Priority: optional
Architecture: amd64

View File

@@ -37,7 +37,7 @@ This example demonstrates how to mount the recommended directory to `/storage` i
dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/storage
```
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage` to `/storage` inside the container.
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage/node-js-app` to `/storage` inside the container.
Once you have mounted persistent storage, you will also need to restart the application. See the
[process scaling documentation](/docs/deployment/process-management.md) for more information.

View File

@@ -35,35 +35,35 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.22.5 enabled dokku core standard plugin
20_events 0.22.5 enabled dokku core events logging plugin
app-json 0.22.5 enabled dokku core app-json plugin
apps 0.22.5 enabled dokku core apps plugin
build-env 0.22.5 enabled dokku core build-env plugin
buildpacks 0.22.5 enabled dokku core buildpacks plugin
certs 0.22.5 enabled dokku core certificate management plugin
checks 0.22.5 enabled dokku core checks plugin
common 0.22.5 enabled dokku core common plugin
config 0.22.5 enabled dokku core config plugin
docker-options 0.22.5 enabled dokku core docker-options plugin
domains 0.22.5 enabled dokku core domains plugin
enter 0.22.5 enabled dokku core enter plugin
git 0.22.5 enabled dokku core git plugin
logs 0.22.5 enabled dokku core logs plugin
network 0.22.5 enabled dokku core network plugin
nginx-vhosts 0.22.5 enabled dokku core nginx-vhosts plugin
plugin 0.22.5 enabled dokku core plugin plugin
proxy 0.22.5 enabled dokku core proxy plugin
ps 0.22.5 enabled dokku core ps plugin
repo 0.22.5 enabled dokku core repo plugin
resource 0.22.5 enabled dokku core resource plugin
scheduler-docker-local 0.22.5 enabled dokku core scheduler-docker-local plugin
shell 0.22.5 enabled dokku core shell plugin
ssh-keys 0.22.5 enabled dokku core ssh-keys plugin
storage 0.22.5 enabled dokku core storage plugin
tags 0.22.5 enabled dokku core tags plugin
tar 0.22.5 enabled dokku core tar plugin
trace 0.22.5 enabled dokku core trace plugin
00_dokku-standard 0.22.7 enabled dokku core standard plugin
20_events 0.22.7 enabled dokku core events logging plugin
app-json 0.22.7 enabled dokku core app-json plugin
apps 0.22.7 enabled dokku core apps plugin
build-env 0.22.7 enabled dokku core build-env plugin
buildpacks 0.22.7 enabled dokku core buildpacks plugin
certs 0.22.7 enabled dokku core certificate management plugin
checks 0.22.7 enabled dokku core checks plugin
common 0.22.7 enabled dokku core common plugin
config 0.22.7 enabled dokku core config plugin
docker-options 0.22.7 enabled dokku core docker-options plugin
domains 0.22.7 enabled dokku core domains plugin
enter 0.22.7 enabled dokku core enter plugin
git 0.22.7 enabled dokku core git plugin
logs 0.22.7 enabled dokku core logs plugin
network 0.22.7 enabled dokku core network plugin
nginx-vhosts 0.22.7 enabled dokku core nginx-vhosts plugin
plugin 0.22.7 enabled dokku core plugin plugin
proxy 0.22.7 enabled dokku core proxy plugin
ps 0.22.7 enabled dokku core ps plugin
repo 0.22.7 enabled dokku core repo plugin
resource 0.22.7 enabled dokku core resource plugin
scheduler-docker-local 0.22.7 enabled dokku core scheduler-docker-local plugin
shell 0.22.7 enabled dokku core shell plugin
ssh-keys 0.22.7 enabled dokku core ssh-keys plugin
storage 0.22.7 enabled dokku core storage plugin
tags 0.22.7 enabled dokku core tags plugin
tar 0.22.7 enabled dokku core tar plugin
trace 0.22.7 enabled dokku core trace plugin
```
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.

View File

@@ -2,10 +2,10 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-310x150.png"/>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

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

View File

@@ -39,13 +39,13 @@ h1 {
font-size: 1.6em;
}
.header .navbar-brand a {
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/dokku.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/dokku.png);
text-indent: 40px;
}
.blurb {
color: #424242;
background-color: #ededed;
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/gplaypattern.png);
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}

View File

@@ -19,6 +19,6 @@
"0.19.13",
"0.20.4",
"0.21.4",
"0.22.5"
"0.22.7"
]
}

View File

@@ -87,6 +87,7 @@ The following config variables have special meanings and can be set in a variety
| `PLUGIN_CORE_AVAILABLE_PATH` | `$PLUGIN_CORE_PATH/available"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that stores all available core plugins. |
| `PLUGIN_CORE_ENABLED_PATH` | `$PLUGIN_CORE_PATH/enabled"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that stores all enabled core plugins. |
| `DOKKU_LOGS_DIR` | `/var/log/dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where dokku logs should be written to. |
| `DOKKU_LOGS_HOST_DIR` | `$DOKKU_LOGS_DIR` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | A path on the host that will be mounted into the vector logging container. |
| `DOKKU_EVENTS_LOGFILE` | `$DOKKU_LOGS_DIR/events.log` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where the events log file is written to. |
| `DOKKU_APP_NAME` | none | `--app APP` flag | Name of application to work on. Respected by core plugins. |
| `DOKKU_APPS_FORCE_DELETE` | none | `--force` flag | Whether to force delete an application. Also used by other plugins for destructive actions. |

View File

@@ -2,7 +2,12 @@
```
logs <app> [-h] [-t] [-n num] [-q] [-p process] # Display recent log output
logs:failed [--parallel count] [--all|<app>] # Shows the last failed deploy logs
logs:failed [--all|<app>] # Shows the last failed deploy logs
logs:report [<app>] [<flag>] # Displays a logs report for one or more apps
logs:set [--global|<app>] <key> <value> # Set or clear a logs property for an app
logs:vector-logs [--num num] [--tail] # Display vector log output
logs:vector-start # Start the vector logging container
logs:vector-stop # Stop the vector logging container
```
## Usage
@@ -40,7 +45,7 @@ will show logs continually from the web process.
In some cases, it may be useful to retrieve the logs from a previously failed deploy.
You can retrieve these logs by using the `logs:failed` command
You can retrieve these logs by using the `logs:failed` command.
```shell
dokku logs:failed node-js-app
@@ -51,3 +56,94 @@ You may also fetch all failed app logs by using the `--all` flag.
```shell
dokku logs:failed --all
```
### Vector Logging Shipping
> New as of 0.22.6
Vector is an open-source, lightweight and ultra-fast tool for building observability pipelines. Dokku integrates with it for shipping container logs for the `docker-local` scheduler. Users may configure log-shipping on a per-app or global basis, neither of which interfere with the `dokku logs` commands.
#### Starting the Vector container
> Warning: While the default vector image may be updated over time, this will not impact running vector containers. Users are encouraged to view any Dokku and Vector changelogs to ensure their system will continue running as expected.
Vector may be started via the `logs:vector-start` command.
```shell
dokku logs:vector-start
```
This will start a new container named `vector` with Dokku's vector config mounted and ready for use. If a running container already exists, this command will do nothing. Additionally, if a container exists but is not running, this command will attempt to start the container.
While the default vector image is hardcoded, users may specify an alternative via the `--vector-image` flag:
```shell
dokku logs:vector-start --vector-image timberio/vector:latest-debian
```
The `vector` container will be started with the following volume mounts:
- `/var/lib/dokku/data/logs/vector.json:/etc/vector/vector.json`
- `/var/run/docker.sock:/var/run/docker.sock`
- `/var/log/dokku/apps:/var/log/dokku/apps`
The final volume mount - `/var/log/dokku/apps` - may be used for users that wish to ship logs to a file on disk that may be later logrotated. This directory is owned by the `dokku` user and group, with permissions set to `0755`. At this time, log-rotation is not configured for this directory.
#### Stopping the Vector container
Vector may be stopped via the `logs:vector-stop` command.
```shell
dokku logs:vector-stop
```
The `vector` container will be stopped and removed from the system. If the container is not running, this command will do nothing.
#### Configuring a log sink
Vector uses the concept of log "sinks" to send logs to a given endpoint. Log sinks may be configured globally or on a per-app basis by specifying a `vector-sink` in DSN form with the `logs:set` command. Specifying a sink value will reload any running vector container.
```shell
# setting the sink value in quotes is encouraged to avoid
# issues with ampersand encoding in shell commands
dokku logs:set node-js-app sink "console://?encoding[codec]=json"
```
A sink may be removed by setting an empty value, which will also reload the running vector container.
```shell
dokku logs:set node-js-app vector-sink
```
Only one sink may be specified on a per-app basis at a given time.
Log sinks can also be specified globally by specifying the `--global` flag to `logs:set` with no app name specified:
```shell
dokku logs:set --global vector-sink "console://?encoding[codec]=json"
```
As with app-specific sink settings, the global value may also be cleared by setting no value.
```shell
dokku logs:set --global vector-sink
```
##### Log Sink DSN Format
The DSN form of a sink is as follows:
```
SINK_TYPE://?SINK_OPTIONS
```
Valid values for `SINK_TYPE` include all log vector log sinks, while `SINK_OPTIONS` is a query-string form for the sink's options. The following is a short description on how to set various values:
- `bool`: form: `key=bool`
- `string`: form: `key=string`
- `int`: form: `key=int`
- `[string]`: form: `key[]=string`
- `[int]`: form: `key[]=int`
- `table`: form: `option[key]=value
Please read the [sink documentation](https://vector.dev/docs/reference/sinks/) for your sink of choice to configure the sink as desired.

View File

@@ -157,6 +157,38 @@ https://static.dokku.me/logo.png
While a full URL may be used in order to invoke checks, if you are using relative URLs, the port *must* be omitted.
> Changed as of 0.22.5
Please note that dollar sign bracket characters (`{` and `}`) must be escaped when used within a `CHECKS` file. Escaping follows golang template rules. The proper way to do this is via one of the following methods:
```
# escaping the `{` character
# using double-quotes
{{"{"}}
# using raw string constants
{{`{`}}
# escaping the `}` character
# using double-quotes
{{"}"}}
# using raw string constants
{{`}`}}
```
### Templating Checks Files
> New as of 0.22.5
An app's `CHECKS` file is sent through a single pass of the [`sigil`](https://github.com/gliderlabs/sigil/) templating tool. This enables usage of Golang templating within application `CHECKS` files. In addition to general templating access, access to app environment variables is also allowed via the `var` function:
```
{{ var "SOME_ENV_VAR" }}
```
This may be useful if certain zero-downtime checks require access to an app-specific value, such as a domain name.
### Check settings
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.

View File

@@ -29,7 +29,7 @@ The workflow looks like this:
```shell
# having dokku-arch in ../dokku-arch
vagrant up build-arch
# wait for "==> build-arch: ==> Finished making: dokku 0.22.5-2 (Mon Feb 22 23:20:37 CET 2016)"
# wait for "==> build-arch: ==> Finished making: dokku 0.22.7-2 (Mon Feb 22 23:20:37 CET 2016)"
cd ../dokku-arch
git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9'

View File

@@ -3,7 +3,7 @@
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.22.5
docker pull dokku/dokku:0.22.7
```
Next, run the image.
@@ -17,7 +17,7 @@ docker run \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.22.5
dokku/dokku:0.22.7
```
Dokku is run in the following configuration:

View File

@@ -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:
- A fresh installation of [Ubuntu 16.04/18.04 x64](https://www.ubuntu.com/download), [Debian 9+ 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 16.04/18.04/20.04 x64](https://www.ubuntu.com/download), [Debian 9+ 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>
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
# for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.5/bootstrap.sh;
sudo DOKKU_TAG=v0.22.5 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh;
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -10,30 +10,30 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style>
.sponsors {
@@ -130,12 +130,12 @@
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.5/bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.22.5 bash bootstrap.sh</span>
<span class="command">sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>

View File

@@ -9,26 +9,26 @@
<meta name="author" content="">
<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.22.5/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script>
@@ -42,7 +42,7 @@
</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://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.5/docs/assets/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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">
<style>

1
dokku
View File

@@ -59,6 +59,7 @@ export DOKKU_VALID_EXIT=0
export DOKKU_PID="$BASHPID"
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_LOGS_HOST_DIR=${DOKKU_LOGS_HOST_DIR:=$DOKKU_LOGS_DIR}
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"}
export DOKKU_CONTAINER_LABEL=dokku

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -2,6 +2,7 @@ package appjson
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
@@ -11,6 +12,7 @@ import (
"github.com/dokku/dokku/plugins/common"
shellquote "github.com/kballard/go-shellquote"
"golang.org/x/sync/errgroup"
)
// AppJSON is a struct that represents an app.json file as understood by Dokku
@@ -130,16 +132,31 @@ func getReleaseCommand(appName string, image string) string {
}
func getDokkuAppShell(appName string) string {
dokkuAppShell := "/bin/bash"
if b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...); strings.TrimSpace(string(b[:])) != "" {
dokkuAppShell = strings.TrimSpace(string(b[:]))
shell := "/bin/bash"
globalShell := ""
appShell := ""
ctx := context.Background()
errs, ctx := errgroup.WithContext(ctx)
errs.Go(func() error {
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...)
globalShell = strings.TrimSpace(string(b[:]))
return nil
})
errs.Go(func() error {
b, _ := common.PlugnTriggerOutput("config-global", []string{"DOKKU_APP_SHELL"}...)
appShell = strings.TrimSpace(string(b[:]))
return nil
})
errs.Wait()
if appShell != "" {
shell = appShell
} else if globalShell != "" {
shell = globalShell
}
if b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...); strings.TrimSpace(string(b[:])) != "" {
dokkuAppShell = strings.TrimSpace(string(b[:]))
}
return dokkuAppShell
return shell
}
func executeScript(appName string, imageTag string, phase string) error {

View File

@@ -7,6 +7,7 @@ require (
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
)
replace github.com/dokku/dokku/plugins/common => ../common

View File

@@ -6,3 +6,5 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core app-json plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -6,3 +6,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -18,10 +18,15 @@ func ReportSingleApp(appName, infoFlag string) error {
"--app-locked": reportLocked,
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func reportDir(appName string) string {

View File

@@ -65,8 +65,8 @@ func main() {
err = apps.CommandRename(oldAppName, newAppName, *skipDeploy)
case "report":
args := flag.NewFlagSet("apps:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("apps", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("apps", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = apps.CommandReport(appName, infoFlag)

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-cnb plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-dockerfile plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-herokuish plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -6,3 +6,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core buildpacks plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -16,10 +16,15 @@ func ReportSingleApp(appName, infoFlag string) error {
"--buildpacks-list": reportList,
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func reportList(appName string) string {

View File

@@ -44,8 +44,8 @@ func main() {
err = buildpacks.CommandRemove(appName, buildpack, *index)
case "report":
args := flag.NewFlagSet("buildpacks:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("buildpacks", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("buildpacks", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = buildpacks.CommandReport(appName, infoFlag)

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,20 +1,20 @@
package common
import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"regexp"
"sort"
"strconv"
"strings"
"sync"
"unicode"
"github.com/ryanuber/columnize"
"golang.org/x/sync/errgroup"
)
type errfunc func() error
@@ -68,26 +68,20 @@ func GetAppScheduler(appName string) string {
appScheduler := ""
globalScheduler := ""
var wg sync.WaitGroup
ctx := context.Background()
errs, ctx := errgroup.WithContext(ctx)
if appName != "--global" {
wg.Add(1)
go func() {
defer wg.Done()
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...)
value := strings.TrimSpace(string(b[:]))
if value != "" {
appScheduler = value
}
}()
errs.Go(func() error {
appScheduler = getAppScheduler(appName)
return nil
})
}
wg.Add(1)
go func() {
defer wg.Done()
errs.Go(func() error {
globalScheduler = GetGlobalScheduler()
}()
wg.Wait()
return nil
})
errs.Wait()
if appScheduler == "" {
appScheduler = globalScheduler
@@ -95,6 +89,15 @@ func GetAppScheduler(appName string) string {
return appScheduler
}
func getAppScheduler(appName string) string {
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...)
value := strings.TrimSpace(string(b[:]))
if value != "" {
return value
}
return ""
}
// GetGlobalScheduler fetchs the global scheduler
func GetGlobalScheduler() string {
b, _ := PlugnTriggerOutput("config-get-global", []string{"DOKKU_SCHEDULER"}...)
@@ -108,23 +111,38 @@ func GetGlobalScheduler() string {
// GetDeployingAppImageName returns deploying image identifier for a given app, tag tuple. validate if tag is presented
func GetDeployingAppImageName(appName, imageTag, imageRepo string) (string, error) {
b, err := PlugnTriggerOutput("deployed-app-repository", []string{appName}...)
if err != nil {
return "", err
}
imageRemoteRepository := strings.TrimSpace(string(b[:]))
imageRemoteRepository := ""
newImageTag := ""
newImageRepo := ""
b, err = PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
if err != nil {
return "", err
}
newImageTag := strings.TrimSpace(string(b[:]))
ctx := context.Background()
errs, ctx := errgroup.WithContext(ctx)
errs.Go(func() error {
b, err := PlugnTriggerOutput("deployed-app-repository", []string{appName}...)
if err == nil {
imageRemoteRepository = strings.TrimSpace(string(b[:]))
}
return err
})
errs.Go(func() error {
b, err := PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
if err == nil {
newImageTag = strings.TrimSpace(string(b[:]))
}
return err
})
b, err = PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
if err != nil {
errs.Go(func() error {
b, err := PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
if err == nil {
newImageRepo = strings.TrimSpace(string(b[:]))
}
return err
})
if err := errs.Wait(); err != nil {
return "", err
}
newImageRepo := strings.TrimSpace(string(b[:]))
if newImageRepo != "" {
imageRepo = newImageRepo
@@ -305,7 +323,7 @@ func ParseReportArgs(pluginName string, arguments []string) ([]string, string, e
}
// ReportSingleApp is an internal function that displays a report for an app
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, trimPrefix bool, uppercaseFirstCharacter bool) error {
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, infoFlagKeys []string, trimPrefix bool, uppercaseFirstCharacter bool) error {
flags := []string{}
for key := range infoFlags {
flags = append(flags, key)
@@ -315,7 +333,11 @@ func ReportSingleApp(reportType string, appName string, infoFlag string, infoFla
if len(infoFlag) == 0 {
LogInfo2Quiet(fmt.Sprintf("%s %v information", appName, reportType))
for _, k := range flags {
v := infoFlags[k]
v, ok := infoFlags[k]
if !ok {
continue
}
prefix := "--"
if trimPrefix {
prefix = fmt.Sprintf("--%v-", reportType)
@@ -334,19 +356,17 @@ func ReportSingleApp(reportType string, appName string, infoFlag string, infoFla
for _, k := range flags {
if infoFlag == k {
v := infoFlags[k]
v, ok := infoFlags[k]
if !ok {
continue
}
fmt.Println(v)
return nil
}
}
keys := reflect.ValueOf(infoFlags).MapKeys()
strkeys := make([]string, len(keys))
for i := 0; i < len(keys); i++ {
strkeys[i] = keys[i].String()
}
return fmt.Errorf("Invalid flag passed, valid flags: %s", strings.Join(strkeys, ", "))
sort.Strings(infoFlagKeys)
return fmt.Errorf("Invalid flag passed, valid flags: %s", strings.Join(infoFlagKeys, ", "))
}
// RightPad right-pads the string with pad up to len runes

View File

@@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"strings"
"time"
"github.com/codeskyblue/go-sh"
)
@@ -20,6 +21,43 @@ func ContainerIsRunning(containerID string) bool {
return strings.TrimSpace(string(b[:])) == "true"
}
// ContainerStart runs 'docker container start' against an existing container
// whether that container is running or not
func ContainerStart(containerID string) bool {
cmd := sh.Command(DockerBin(), "container", "start", containerID)
cmd.Stdout = nil
cmd.Stderr = nil
if err := cmd.Run(); err != nil {
return false
}
return true
}
// ContainerExists checks to see if a container exists
func ContainerExists(containerID string) bool {
cmd := sh.Command(DockerBin(), "container", "inspect", containerID)
cmd.Stdout = nil
cmd.Stderr = nil
if err := cmd.Run(); err != nil {
return false
}
return true
}
// ContainerWaitTilReady will wait timeout seconds and then check if a container is running
// returning an error if it is not running at the end of the timeout
func ContainerWaitTilReady(containerID string, timeout time.Duration) error {
time.Sleep(timeout)
if !ContainerIsRunning(containerID) {
return fmt.Errorf("Container %s is not running", containerID)
}
return nil
}
// CopyFromImage copies a file from named image to destination
func CopyFromImage(appName string, image string, source string, destination string) error {
if !VerifyImage(image) {

View File

@@ -163,7 +163,7 @@ dokku_log_plugn_trigger_call() {
local l_hook="$1"
shift
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT DOKKU_PID=$DOKKU_PID"
}
dokku_container_log_verbose_quiet() {

View File

@@ -6,4 +6,5 @@ require (
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
)

View File

@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,8 +1,10 @@
package common
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@@ -93,6 +95,28 @@ func LogVerboseQuietContainerLogs(containerID string) {
}
}
// LogVerboseQuietContainerLogsTail is the verbose log formatter for container logs with tail mode enabled
func LogVerboseQuietContainerLogsTail(containerID string, lines int, tail bool) {
args := []string{"container", "logs", containerID}
if lines > 0 {
args = append(args, "--tail", strconv.Itoa(lines))
}
if tail {
args = append(args, "--follow")
}
sc := NewShellCmdWithArgs(DockerBin(), args...)
stdout, _ := sc.Command.StdoutPipe()
sc.Command.Start()
scanner := bufio.NewScanner(stdout)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
m := scanner.Text()
LogVerboseQuiet(m)
}
sc.Command.Wait()
}
// LogWarn is the warning log formatter
func LogWarn(text string) {
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ! %s", text))
@@ -110,7 +134,7 @@ func LogStderr(text string) {
// LogDebug is the debug log formatter
func LogDebug(text string) {
if os.Getenv("DOKKU_TRACE") == "" {
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ? %s", text))
if os.Getenv("DOKKU_TRACE") == "1" {
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ? %s", strings.TrimPrefix(text, " ? ")))
}
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -12,9 +12,14 @@ import (
)
// CommandPropertySet is a generic function that will set a property for a given plugin/app combination
func CommandPropertySet(pluginName, appName, property, value string, properties map[string]string) {
if err := VerifyAppName(appName); err != nil {
LogFail(err.Error())
func CommandPropertySet(pluginName, appName, property, value string, properties map[string]string, globalProperties map[string]bool) {
if appName != "--global" {
if err := VerifyAppName(appName); err != nil {
LogFail(err.Error())
}
}
if appName == "--global" && !globalProperties[property] {
LogFail("Property cannot be specified globally")
}
if property == "" {
LogFail("No property specified")

View File

@@ -80,21 +80,34 @@ func PlugnTrigger(triggerName string, args ...string) error {
// PlugnTriggerOutput fire the given plugn trigger with the given args
func PlugnTriggerOutput(triggerName string, args ...string) ([]byte, error) {
rescueStderr := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
out, err := PlugnTriggerSetup(triggerName, args...).Output()
w.Close()
LogDebug(fmt.Sprintf("plugn trigger %s %v", triggerName, args))
rE, wE, _ := os.Pipe()
rO, wO, _ := os.Pipe()
session := PlugnTriggerSetup(triggerName, args...)
session.Stderr = wE
session.Stdout = wO
err := session.Run()
wE.Close()
wO.Close()
readStderr, _ := ioutil.ReadAll(r)
os.Stderr = rescueStderr
readStderr, _ := ioutil.ReadAll(rE)
readStdout, _ := ioutil.ReadAll(rO)
var stderr error
stderr := string(readStderr[:])
if err != nil {
stderr = fmt.Errorf(string(readStderr[:]))
err = fmt.Errorf(stderr)
}
return out, stderr
if os.Getenv("DOKKU_TRACE") == "1" {
for _, line := range strings.Split(stderr, "\n") {
LogDebug(fmt.Sprintf("plugn trigger %s stderr: %s", triggerName, line))
}
for _, line := range strings.Split(string(readStdout[:]), "\n") {
LogDebug(fmt.Sprintf("plugn trigger %s stdout: %s", triggerName, line))
}
}
return readStdout, err
}
// PlugnTriggerSetup sets up a plugn trigger call

View File

@@ -8,3 +8,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,2 +1,7 @@
/commands
/subcommands/*
/triggers/*
/triggers
/install
/post-*
/report

View File

@@ -1,5 +1,6 @@
SUBCOMMANDS = subcommands/failed
BUILD = commands subcommands
SUBCOMMANDS = subcommands/failed subcommands/report subcommands/set subcommands/vector-logs subcommands/vector-start subcommands/vector-stop
TRIGGERS = triggers/install triggers/post-delete triggers/report
BUILD = commands subcommands triggers
PLUGIN_NAME = logs
include ../../common.mk

223
plugins/logs/functions.go Normal file
View File

@@ -0,0 +1,223 @@
package logs
import (
"encoding/json"
"errors"
"fmt"
"net/url"
"path/filepath"
"strings"
"time"
"github.com/dokku/dokku/plugins/common"
"github.com/joncalhoun/qson"
)
type vectorConfig struct {
Sources map[string]vectorSource `json:"sources"`
Sinks map[string]vectorSink `json:"sinks"`
}
type vectorSource struct {
Type string `json:"type"`
IncludeLabels []string `json:"include_labels,omitempty"`
}
type vectorSink map[string]interface{}
const vectorContainerName = "vector"
func killVectorContainer() error {
if !common.ContainerExists(vectorContainerName) {
return nil
}
if err := stopVectorContainer(); err != nil {
return err
}
time.Sleep(10 * time.Second)
if err := removeVectorContainer(); err != nil {
return err
}
return nil
}
func removeVectorContainer() error {
if !common.ContainerExists(vectorContainerName) {
return nil
}
cmd := common.NewShellCmd(strings.Join([]string{
common.DockerBin(), "container", "rm", "-f", vectorContainerName}, " "))
return common.SuppressOutput(func() error {
if cmd.Execute() {
return nil
}
if common.ContainerExists(vectorContainerName) {
return errors.New("Unable to remove vector container")
}
return nil
})
}
func startVectorContainer(vectorImage string) error {
cmd := common.NewShellCmd(strings.Join([]string{
common.DockerBin(),
"container",
"run", "--detach", "--name", vectorContainerName, common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"),
"--volume", "/var/lib/dokku/data/logs/vector.json:/etc/vector/vector.json",
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
"--volume", common.MustGetEnv("DOKKU_LOGS_HOST_DIR") + ":/var/logs/dokku/apps",
vectorImage,
"--config", "/etc/vector/vector.json", "--watch-config", "1"}, " "))
cmd.ShowOutput = false
if !cmd.Execute() {
return errors.New("Unable to start vector container")
}
return nil
}
func stopVectorContainer() error {
if !common.ContainerExists(vectorContainerName) {
return nil
}
if !common.ContainerIsRunning(vectorContainerName) {
return nil
}
cmd := common.NewShellCmd(strings.Join([]string{
common.DockerBin(), "container", "stop", vectorContainerName}, " "))
return common.SuppressOutput(func() error {
if cmd.Execute() {
return nil
}
if common.ContainerIsRunning(vectorContainerName) {
return errors.New("Unable to stop vector container")
}
return nil
})
}
func valueToConfig(appName string, value string) (vectorSink, error) {
var data vectorSink
u, err := url.Parse(value)
if err != nil {
return data, err
}
if u.Query().Get("sinks") != "" {
return data, errors.New("Invalid option sinks")
}
t := fmt.Sprintf("type=%s", u.Scheme)
i := fmt.Sprintf("inputs[]=docker-source:%s", appName)
if appName == "--global" {
i = "inputs[]=docker-global-source"
}
if appName == "--null" {
i = "inputs[]=docker-null-source"
}
initialQuery := fmt.Sprintf("%s&%s", t, i)
query := u.RawQuery
if query == "" {
query = initialQuery
} else if strings.HasPrefix(query, "&") {
query = fmt.Sprintf("%s%s", initialQuery, query)
} else {
query = fmt.Sprintf("%s&%s", initialQuery, query)
}
b, err := qson.ToJSON(query)
if err != nil {
return data, err
}
if err := json.Unmarshal(b, &data); err != nil {
return data, err
}
return data, nil
}
func writeVectorConfig() error {
apps, _ := common.DokkuApps()
data := vectorConfig{
Sources: map[string]vectorSource{},
Sinks: map[string]vectorSink{},
}
for _, appName := range apps {
value := common.PropertyGet("logs", appName, "vector-sink")
if value == "" {
continue
}
sink, err := valueToConfig(appName, value)
if err != nil {
return err
}
data.Sources[fmt.Sprintf("docker-source:%s", appName)] = vectorSource{
Type: "docker_logs",
IncludeLabels: []string{fmt.Sprintf("com.dokku.app-name=%s", appName)},
}
data.Sinks[fmt.Sprintf("docker-sink:%s", appName)] = sink
}
value := common.PropertyGet("logs", "--global", "vector-sink")
if value != "" {
sink, err := valueToConfig("--global", value)
if err != nil {
return err
}
data.Sources["docker-global-source"] = vectorSource{
Type: "docker_logs",
IncludeLabels: []string{"com.dokku.app-name"},
}
data.Sinks["docker-global-sink"] = sink
}
if len(data.Sources) == 0 {
// pull from no containers
data.Sources["docker-null-source"] = vectorSource{
Type: "docker_logs",
IncludeLabels: []string{"com.dokku.vector-null"},
}
}
if len(data.Sinks) == 0 {
// write logs to a blackhole
sink, err := valueToConfig("--null", "blackhole://?print_amount=1")
if err != nil {
return err
}
data.Sinks["docker-null-sink"] = sink
}
b, err := json.MarshalIndent(data, "", " ")
if err != nil {
return err
}
vectorConfig := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")
if err := common.WriteSliceToFile(vectorConfig, []string{string(b)}); err != nil {
return err
}
return nil
}

View File

@@ -5,6 +5,7 @@ go 1.15
require (
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)

View File

@@ -2,7 +2,11 @@ github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+Bu
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4quafGxDT9LDasjGdlGkzLbfmmrlng3kA=
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0 h1:ct2XA1aDw8A07Dr8gtrrZgIgLKcZNAl2o9nn0WRMK4Y=
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -6,6 +6,21 @@ import (
"github.com/dokku/dokku/plugins/common"
)
var (
// DefaultProperties is a map of all valid ps properties with corresponding default property values
DefaultProperties = map[string]string{
"vector-sink": "",
}
// GlobalProperties is a map of all valid global logs properties
GlobalProperties = map[string]bool{
"vector-sink": true,
}
)
// VectorImage contains the default vector image to run
const VectorImage = "timberio/vector:0.11.X-debian"
// GetFailedLogs outputs failed deploy logs for a given app
func GetFailedLogs(appName string) error {
common.LogInfo2Quiet(fmt.Sprintf("%s failed deploy logs", appName))

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core logs plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

35
plugins/logs/report.go Normal file
View File

@@ -0,0 +1,35 @@
package logs
import (
"github.com/dokku/dokku/plugins/common"
)
// ReportSingleApp is an internal function that displays the logs report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
flags := map[string]common.ReportFunc{
"--logs-vector-sink": reportVectorSink,
"--logs-global-vector-sink": reportGlobalVectorSink,
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("logs", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func reportVectorSink(appName string) string {
return common.PropertyGet("logs", appName, "vector-sink")
}
func reportGlobalVectorSink(appName string) string {
return common.PropertyGet("logs", "--global", "vector-sink")
}

View File

@@ -23,7 +23,12 @@ Additional commands:`
helpContent = `
logs [-h] [-t|--tail] [-n|--num num] [-q|--quiet] [-p|--ps process] <app>, Display recent log output
logs:failed [<app>], Shows the last failed deploy logs
logs:failed [--all|<app>], Shows the last failed deploy logs
logs:report [<app>] [<flag>], Displays a logs report for one or more apps
logs:set [--global|<app>] <key> <value>, Set or clear a logs property for an app
logs:vector-logs [--num num] [--tail], Display vector log output
logs:vector-start, Start the vector logging container
logs:vector-stop, Stop the vector logging container
`
)

View File

@@ -24,6 +24,42 @@ func main() {
args.Parse(os.Args[2:])
appName := args.Arg(0)
err = logs.CommandFailed(appName, *allApps)
case "report":
args := flag.NewFlagSet("logs:report", flag.ExitOnError)
osArgs, infoFlag, flagErr := common.ParseReportArgs("logs", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = logs.CommandReport(appName, infoFlag)
}
case "set":
args := flag.NewFlagSet("logs:set", flag.ExitOnError)
global := args.Bool("global", false, "--global: set a global property")
args.Parse(os.Args[2:])
appName := args.Arg(0)
property := args.Arg(1)
value := args.Arg(2)
if *global {
appName = "--global"
property = args.Arg(0)
value = args.Arg(1)
}
err = logs.CommandSet(appName, property, value)
case "vector-logs":
args := flag.NewFlagSet("logs:vector-logs", flag.ExitOnError)
num := args.Int("num", 100, "the number of lines to display")
tail := args.Bool("tail", false, "continually stream logs")
args.Parse(os.Args[2:])
err = logs.CommandVectorLogs(*num, *tail)
case "vector-start":
args := flag.NewFlagSet("logs:vector-start", flag.ExitOnError)
vectorImage := args.String("vector-image", logs.VectorImage, "--vector-image: the name of the docker image to run for vector")
args.Parse(os.Args[2:])
err = logs.CommandVectorStart(*vectorImage)
case "vector-stop":
args := flag.NewFlagSet("logs:vector-stop", flag.ExitOnError)
args.Parse(os.Args[2:])
err = logs.CommandVectorStop()
default:
common.LogFail(fmt.Sprintf("Invalid plugin subcommand call: %s", subcommand))
}

View File

@@ -0,0 +1,36 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/logs"
)
// main entrypoint to all triggers
func main() {
parts := strings.Split(os.Args[0], "/")
trigger := parts[len(parts)-1]
flag.Parse()
var err error
switch trigger {
case "install":
err = logs.TriggerInstall()
case "post-delete":
appName := flag.Arg(0)
err = logs.TriggerPostDelete(appName)
case "report":
appName := flag.Arg(0)
err = logs.ReportSingleApp(appName, "")
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
}
if err != nil {
common.LogFail(err.Error())
}
}

View File

@@ -1,8 +1,11 @@
package logs
import (
"errors"
"fmt"
"path/filepath"
"strconv"
"time"
"github.com/dokku/dokku/plugins/common"
)
@@ -45,3 +48,94 @@ func CommandFailed(appName string, allApps bool) error {
return GetFailedLogs(appName)
}
// CommandReport displays a logs report for one or more apps
func CommandReport(appName string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
}
// CommandSet sets or clears a logs property for an app
func CommandSet(appName string, property string, value string) error {
if property == "vector-sink" && value != "" {
_, err := valueToConfig(appName, value)
if err != nil {
return err
}
}
common.CommandPropertySet("logs", appName, property, value, DefaultProperties, GlobalProperties)
if property == "vector-sink" {
common.LogVerboseQuiet(fmt.Sprintf("Writing updated vector config to %s", filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")))
return writeVectorConfig()
}
return nil
}
// CommandVectorLogs tails the log output for the vector container
func CommandVectorLogs(lines int, tail bool) error {
if !common.ContainerExists(vectorContainerName) {
return errors.New("Vector container does not exist")
}
if !common.ContainerIsRunning(vectorContainerName) {
return errors.New("Vector container is not running")
}
common.LogInfo1Quiet("Vector container logs")
common.LogVerboseQuietContainerLogsTail(vectorContainerName, lines, tail)
return nil
}
// CommandVectorStart starts a new vector container
// or starts an existing one if it already exists
func CommandVectorStart(vectorImage string) error {
common.LogInfo2("Starting vector container")
common.LogVerbose("Ensuring vector configuration exists")
if err := writeVectorConfig(); err != nil {
return err
}
if common.ContainerExists(vectorContainerName) {
if common.ContainerIsRunning(vectorContainerName) {
common.LogVerbose("Vector container is running")
return nil
}
common.LogVerbose("Starting vector container")
if !common.ContainerStart(vectorContainerName) {
return errors.New("Unable to start vector container")
}
} else {
if err := startVectorContainer(vectorImage); err != nil {
return err
}
}
common.LogVerbose("Waiting for 10 seconds")
if err := common.ContainerWaitTilReady(vectorContainerName, 10*time.Second); err != nil {
return errors.New("Vector container did not start properly, run logs:vector-logs for more details")
}
common.LogVerbose("Vector container is running")
return nil
}
// CommandVectorStop stops and removes an existing vector container
func CommandVectorStop() error {
common.LogInfo2Quiet("Stopping and removing vector container")
return killVectorContainer()
}

41
plugins/logs/triggers.go Normal file
View File

@@ -0,0 +1,41 @@
package logs
import (
"fmt"
"os"
"path/filepath"
"github.com/dokku/dokku/plugins/common"
)
// TriggerInstall initializes app restart policies
func TriggerInstall() error {
if err := common.PropertySetup("logs"); err != nil {
return fmt.Errorf("Unable to install the logs plugin: %s", err.Error())
}
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs")
if err := os.MkdirAll(directory, 0755); err != nil {
return err
}
if err := common.SetPermissions(directory, 0755); err != nil {
return err
}
logDirectory := filepath.Join(common.MustGetEnv("DOKKU_LOGS_DIR"), "apps")
if err := os.MkdirAll(logDirectory, 0755); err != nil {
return err
}
if err := common.SetPermissions(logDirectory, 0755); err != nil {
return err
}
return nil
}
// TriggerPostDelete destroys the network property for a given app container
func TriggerPostDelete(appName string) error {
return common.PropertyDestroy("logs", appName)
}

View File

@@ -8,3 +8,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -22,6 +22,9 @@ var (
"attach-post-deploy": "",
"tld": "",
}
// GlobalProperties is a map of all valid global network properties
GlobalProperties = map[string]bool{}
)
// BuildConfig builds network config files

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core network plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -19,10 +19,15 @@ func ReportSingleApp(appName, infoFlag string) error {
"--network-web-listeners": reportWebListeners,
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("network", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("network", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func reportBindAllInterfaces(appName string) string {

View File

@@ -53,8 +53,8 @@ func main() {
err = network.CommandRebuildall()
case "report":
args := flag.NewFlagSet("network:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("network", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("network", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = network.CommandReport(appName, infoFlag)

View File

@@ -169,6 +169,6 @@ func CommandSet(appName string, property string, value string) error {
}
}
common.CommandPropertySet("network", appName, property, value, DefaultProperties)
common.CommandPropertySet("network", appName, property, value, DefaultProperties, GlobalProperties)
return nil
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core nginx-vhosts plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core plugin plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -8,3 +8,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core proxy plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -18,10 +18,15 @@ func ReportSingleApp(appName string, infoFlag string) error {
"--proxy-port-map": reportPortMap,
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("proxy", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("proxy", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func reportEnabled(appName string) string {

View File

@@ -64,8 +64,8 @@ func main() {
err = proxy.CommandPortsSet(appName, portMaps)
case "report":
args := flag.NewFlagSet("proxy:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("proxy", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("proxy", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = proxy.CommandReport(appName, infoFlag)

View File

@@ -1,5 +1,5 @@
SUBCOMMANDS = subcommands/inspect subcommands/rebuild subcommands/report subcommands/restart subcommands/restart-policy subcommands/restore subcommands/retire subcommands/scale subcommands/set subcommands/start subcommands/stop
TRIGGERS = triggers/app-restart triggers/install triggers/post-app-clone triggers/post-app-rename triggers/post-create triggers/post-delete triggers/post-stop triggers/pre-deploy triggers/procfile-extract triggers/procfile-get-command triggers/procfile-remove triggers/report
SUBCOMMANDS = subcommands/inspect subcommands/rebuild subcommands/report subcommands/restart subcommands/restore subcommands/retire subcommands/scale subcommands/set subcommands/start subcommands/stop
TRIGGERS = triggers/app-restart triggers/core-post-deploy triggers/install triggers/post-app-clone triggers/post-app-clone-setup triggers/post-app-rename triggers/post-app-rename-setup triggers/post-create triggers/post-delete triggers/post-extract triggers/post-stop triggers/pre-deploy triggers/procfile-extract triggers/procfile-get-command triggers/procfile-remove triggers/report
BUILD = commands subcommands triggers
PLUGIN_NAME = ps

View File

@@ -12,3 +12,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ps plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -16,6 +16,9 @@ var (
DefaultProperties = map[string]string{
"restart-policy": "on-failure:10",
}
// GlobalProperties is a map of all valid global ps properties
GlobalProperties = map[string]bool{}
)
// Rebuild rebuilds app from base image

View File

@@ -28,10 +28,15 @@ func ReportSingleApp(appName, infoFlag string) error {
flags[flag] = fn
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("ps", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("ps", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
func addStatusFlags(appName string, infoFlag string) map[string]common.ReportFunc {

View File

@@ -32,8 +32,8 @@ func main() {
err = ps.CommandRebuild(appName, *allApps, *parallelCount)
case "report":
args := flag.NewFlagSet("ps:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("ps", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("ps", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = ps.CommandReport(appName, infoFlag)

View File

@@ -163,7 +163,7 @@ func CommandSet(appName string, property string, value string) error {
return dockeroptions.SetDockerOptionForPhases(appName, []string{"deploy"}, "restart", value)
}
common.CommandPropertySet("ps", appName, property, value, DefaultProperties)
common.CommandPropertySet("ps", appName, property, value, DefaultProperties, GlobalProperties)
return nil
}

View File

@@ -8,3 +8,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core repo plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -6,3 +6,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core resource plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -28,15 +28,20 @@ func ReportSingleApp(appName, infoFlag string) error {
return nil
}
infoFlags := map[string]string{}
flags := map[string]string{}
for key, value := range resources {
flag := fmt.Sprintf("--resource-%v", key)
infoFlags[flag] = value
flags[flag] = value
}
flagKeys := []string{}
for flagKey := range flags {
flagKeys = append(flagKeys, flagKey)
}
trimPrefix := true
uppercaseFirstCharacter := false
return common.ReportSingleApp("resource", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
return common.ReportSingleApp("resource", appName, infoFlag, flags, flagKeys, trimPrefix, uppercaseFirstCharacter)
}
// GetResourceValue fetches a single value for a given app/process/request/key combination

View File

@@ -50,8 +50,8 @@ func main() {
err = resource.CommandLimitClear(appName, *processType)
case "report":
args := flag.NewFlagSet("resource:report", flag.ExitOnError)
osArgs, infoFlag, err := common.ParseReportArgs("resource", os.Args[2:])
if err == nil {
osArgs, infoFlag, flagErr := common.ParseReportArgs("resource", os.Args[2:])
if flagErr == nil {
args.Parse(osArgs)
appName := args.Arg(0)
err = resource.CommandReport(appName, infoFlag)

View File

@@ -115,16 +115,14 @@ trigger-scheduler-docker-local-check-deploy() {
dokku_log_verbose "Default container check successful!" && exit 0
fi
# ensure CHECKS file has trailing newline
if [[ "$(tail -c1 "$CHECKS_FILENAME")" != "" ]]; then
# workaround for CHECKS file when owner is root. seems to only happen when running inside docker
if [[ "$(stat -c %u "$CHECKS_FILENAME")" == "0" ]]; then
local NEW_CHECKS_FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/$(mktemp dokku-${FUNCNAME[0]}-CHECKS.XXXX)
cat ${CHECKS_FILENAME} >${NEW_CHECKS_FILENAME}
CHECKS_FILENAME=$NEW_CHECKS_FILENAME
fi
echo "" >>"$CHECKS_FILENAME"
fi
local NEW_CHECKS_FILENAME="${CHECK_DEPLOY_TMP_WORK_DIR}/NEW_CHECKS"
template_checks() {
eval "$(config_export app "$APP" --merged)"
sigil -f "$CHECKS_FILENAME" | cat -s >"$NEW_CHECKS_FILENAME"
}
template_checks
CHECKS_FILENAME="$NEW_CHECKS_FILENAME"
# Reads name/value pairs, sets the WAIT and TIMEOUT variables
exec <"$CHECKS_FILENAME"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core scheduler-docker-local plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -59,7 +59,7 @@ scheduler-docker-local-pre-deploy-precheck() {
declare APP="$1" IMAGE_TAG="$2"
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
local CHECKS_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$CHECKS_FILE' >/dev/null" RETURN INT TERM
trap "rm -rf '$CHECKS_FILE' >/dev/null" RETURN INT TERM EXIT
copy_from_image "$IMAGE" "CHECKS" "$CHECKS_FILE" 2>/dev/null || true
dokku_log_info2 "Processing deployment checks"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core shell plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ssh-keys plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core storage plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core tags plugin"
version = "0.22.5"
version = "0.22.7"
[plugin.config]

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