Commit Graph

242 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
bde77dbf78 feat: cleanup log output for failure case
Also mark DOKKU_DISABLE_ANSI_PREFIX_REMOVAL as deprecated (it will be removed in 0.23.0 and no prefixes will be removed at that time).
2020-11-28 03:32:11 -05:00
Jose Diaz-Gonzalez
ef490f0a05 feat: retire intermediate containers after use
Rather than waiting for the next deploy, take advantage of the retire system to retire these containers immediately.

Note that since the retire process happens out of band, the containers may stick around for up to 5 minutes, after which point they will be removed.

Customization of the wait time to retire - currently 60 seconds - is up for future debate. The containers ultimately haven't been useful for debugging, so keeping them around for longer won't help in most cases, and folks can disable the dokku-retire service (or cron) if that is desired.
2020-11-22 16:57:39 -05:00
Jose Diaz-Gonzalez
696df45306 refactor: extract release_and_deploy calls to a plugin trigger
Better would be to separate the release and deploy aspects into distinct triggers - as well as have it release a specific image - but this is a good first pass.
2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez
ecc6c9e01d Merge pull request #4129 from dokku/4102-prohibit-non-dns-names
Prohibit non-dns names for apps and process types
2020-09-09 23:39:27 -04:00
Jose Diaz-Gonzalez
7e9f98b513 Merge pull request #4080 from hugopeixoto/fix/app-vhost-usage 2020-09-09 21:23:15 -04:00
Jose Diaz-Gonzalez
0f514f300e feat: prohibit non-dns names for apps and process types
This is necessary for ensuring ssl certificates can be auto-retrieved for apps, and also easing integration into schedulers that use names and process types as part of DNS records.

As well, this fixes an issue where we may potentially have invalid DNS entries when adding apps to custom networks.

Closes #4102
Closes #4114
2020-09-09 20:07:50 -04:00
Jose Diaz-Gonzalez
0351bf73b0 fix: update deprecated function name 2020-08-30 13:41:14 -04:00
Hugo Peixoto
d5b2d0d98e Stop using VHOST when listing app domains and urls 2020-07-19 16:29:35 +01:00
Roland van Laar
5f312d7347 Make make test pass on linting 2020-07-04 00:08:44 +02:00
Jose Diaz-Gonzalez
2dfb0ef3e6 fix: correct entering running containers
This functionality was broken due to a refactor of argument handling in a previous release.

In addition to the fix, all the functionality was moved to scheduler-enter, which allows scheduler plugins to implement ways of entering containers in the relevant scheduler.

Closes #3972
2020-05-12 23:06:10 -04:00
Jose Diaz-Gonzalez
46287cac0f feat: allow apps named tls
The `tls` name is no longer a reserved app name, and can be used by applications. This was previously a reserved app name due to it's use as a place for global SSL certificate files; Dokku has not supported global SSL certificates for many releases, and thus there is no need to reserve the name.
2020-05-08 23:58:06 -04:00
Jose Diaz-Gonzalez
92621a3187 Merge pull request #3966 from dokku/domains-triggers
Move domain manipulation into triggers
2020-05-06 14:21:06 -04:00
Jose Diaz-Gonzalez
61a306664f refactor: move domain manipulation into triggers
This allows other plugins to avoid understanding the underlying details of how domains might be integrated with.
2020-05-06 00:16:51 -04:00
Jose Diaz-Gonzalez
d35576302d chore: drop dokku references in logging output
This isn't super useful outside of branding. Users that rely on this information may wish to turn on event logging to trace output that way.
2020-05-05 23:39:38 -04:00
Jose Diaz-Gonzalez
38a13ecd39 feat: expose network listeners to nginx templates for all process types
This change allows users to specify a custom nginx.conf.sigil that can expose non-web process types to the outside world in addition to the web process type.

Closes #3258
2020-03-11 12:34:38 -04:00
Jose Diaz-Gonzalez
054bf26b0e chore: remove unnecessary source/import statements 2020-02-28 06:03:53 -05:00
Jose Diaz-Gonzalez
6fd4b5adb1 refactor: rewrite proxy plugin in golang 2020-02-22 06:40:24 -05:00
Jose Diaz-Gonzalez
e19b52442b fix: remove deprecated egrep calls from codebase 2020-02-17 05:59:52 -05:00
Jose Diaz-Gonzalez
d759c6c12d Merge pull request #3682 from dokku/3588-tty-default-lang
Force tty check to run with the default language
2020-02-10 05:14:24 -05:00
Jose Diaz-Gonzalez
e67b96780d refactor: unify command declaration across codebase 2020-02-10 01:40:30 -05:00
Jose Diaz-Gonzalez
1cb586b2e7 refactor: standardize command naming
This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output.
2020-02-09 22:41:39 -05:00
Jose Diaz-Gonzalez
385aed85b9 chore: fix log_exit call 2020-02-08 19:46:50 -05:00
Jose Diaz-Gonzalez
d39f4ce54d feat: add stderr log functions 2020-02-08 19:46:44 -05:00
Jose Diaz-Gonzalez
ca5946636f chore: move fn-in-array to common-functions
This is used by all generic `set` commands, so we should just make it globally available.
2019-12-19 02:29:22 -05:00
Michael Hobbs
972830a5f3 fix: respect DOKKU_APP_USER in is_image_herokuish_based 2019-11-19 15:07:29 -07:00
Jose Diaz-Gonzalez
35287a2d28 fix: force tty check to run with the default language
This fixes the case where the system language is non-english. See this stackexchange answer for more details: https://unix.stackexchange.com/q/87745

Closes #3588
2019-10-14 05:03:18 -04:00
Jose Diaz-Gonzalez
498bdd0491 chore: cleanup build and destroy logging output 2019-09-20 12:31:19 -04:00
Jose Diaz-Gonzalez
b4e95fe0d5 feat: add support for python3
- Use jq where possible
- Drop unused function (no usage across entire codebase nor in any github repository

Closes #3689
2019-09-19 23:33:43 -04:00
Jose Diaz-Gonzalez
798725bb54 feat: allow passing labels to one-off dokku containers
This feature is allows users to add extra label metadata to one-off containers. As this can interfere with Dokku internals if they shadow labels used by plugins, care should be taken to avoid the `com.dokku` or `org.label-schema` namespace.

Also proper name run containers so they don't get random names from docker...
2019-09-16 23:10:14 -04:00
Jose Diaz-Gonzalez
44fcea0ffa refactor: use new-style docker management commands
This PR uses the new syntax for commands introduced in Docker 1.13, making it a bit easier to understand just what a particular command is trying to do.

This also pushes the long-form syntax for docker command flags, which are also easier to understand at a glance.
2019-09-15 18:55:53 -04:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
9a2c8e04a5 feat: quiet down deploys 2019-08-12 17:39:01 -04:00
Jose Diaz-Gonzalez
6fcb53113a fix: return true when removing temporary files extracted from docker
If you are running docker in docker, the permissions on the generated file are such that they may not be accessible by the normal dokku user. For dokku, it is good enough to ignore the failed removal.
2019-08-05 15:57:54 -04:00
Jose Diaz-Gonzalez
5affe42699 fix: remove unnecessary cat 2019-08-05 15:24:15 -04:00
Jose Diaz-Gonzalez
86febeb7ca fix: do not try to remove the container twice 2019-08-05 13:35:03 -04:00
Jose Diaz-Gonzalez
8dbf855d56 feat: handle case where docker cp is run as non root and tries to chown the file
This _may_ be cargo-cult, but its an easy way to handle any potential issues, so we'll include it regardless.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
dc9d597cd8 feat: handle case where file may not have trailing newline and parsing depends on it 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
f771b272e3 fix: handle case where file may have windows newlines
Closes #3611
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
6c8f716c11 refactor: handle case copied file is not directly readable
If "docker cp" is run within docker, it seems the owner is root, resulting in other processes not being able to directly read the file without resorting to `cat` trickery. Doing this in a single place avoids the problem completely.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
008fafbed8 fix: force image pruning 2019-08-03 14:21:34 -04:00
Jose Diaz-Gonzalez
c959b236ea fix: do not prune all unused images
This would impact base images related to image building, as well as other images not managed by Dokku directly.
2019-08-02 11:38:08 -04:00
Jose Diaz-Gonzalez
85b41121de fix: make image removal synchronous
Asynchronous image removal would remove intermediate build images during the build process, causing intermittent build failures for users of multi-stage dockerfiles. While we still remove intermediate docker images that may be used in the current build, we now do so during the deploy, ensuring that there are no intermediate build failures in the future.

Closes #3474
2019-08-02 11:21:51 -04:00
Jose Diaz-Gonzalez
5b53994447 feat: avoid calling the user-auth trigger where possible
As this trigger is always in the execution path, `plugn` starts and expensively checks to see if it can execute the trigger. Rather than call this on every invocation, skip the trigger if no non-core implementation exists.
2019-08-01 20:18:14 -04:00
Jose Diaz-Gonzalez
0a8d5eb744 refactor: add initial support for builder plugins
A builder plugin implements some method for 'building' artifacts from a given source code archive. This refactor moves the majority of the image building code into separate plugins, allowing us to implement other builders, but also simplifying the common pugin codebase.

Also move the pre-build-buildpack hook from the build-env plugin to builder-herokuish.
2019-07-30 14:42:30 -04:00
Jose Diaz-Gonzalez
6836e56b24 refactor: add global docker build and run args
This reduces duplication and allows users to rely on global arguments to generate most labels needed.

The 'commit' command cannot have global arguments because the whitespace within the label change breaks string-based interpolation, and shell arrays cannot be exported.
2019-07-20 05:52:20 -04:00
Jose Diaz-Gonzalez
193e40b4c3 feat: scope cleanup to app when specified
This will require changes in community plugins to properly add the specified labels to intermediate containers.

Closes #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
d1af10fc51 feat: add labels to all build, commit, create, and run docker calls
This will allow us to further filter containers and images by application when cleaning up containers.

Refs #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
402c6db826 chore: move the event logging to it's own tag
Without this, rsyslog will shunt any logging output from the dokku user to the event log, garbling output for future investigation.
2019-07-17 20:48:57 -04:00
Jose Diaz-Gonzalez
785d9b4937 feat: allow setting DOCKER_BIN path for docker execution
This change allows operators to specify a DOCKER_BIN environment variable. This will specify a binary to run when executing docker, which is useful in cases where the 'docker' command being run must be modified in a way that would otherwise be invasive to Dokku, but minimalistic if done within a wrapper.
2019-05-29 00:46:19 -04:00