An application which has not been deployed will not have an image
available, and therefore attempting to remove an (empty) cache directory
will fail. Rather than checking for the image - which we should
still do, as not having an image for a deployed app is an error state -
we should instead only attempt the docker cache removal if the directory
cannot be removed via rmdir.
Closes#2294
Rather than removing all port mappings, we simply remap port 80 mappings to 443. The previous behavior would remove custom port mappings for all applications and reset them on any certificate change, preventing automation from plugins such as letsencrypt. While this behavior doesn't matter for buildpack deploys - which only expose a single port on container port 5000 - Dockerfile deploys would frequently be affected by such a change, requiring a remapping of all custom ports.
This commit also standardizes on the method used to source the proxy functions
Checks can be run in several ways:
- checks:run APP
- checks:run APP PROCESS_TYPE
- checks:run APP PROCESS_TYPE.CONTAINER_INDEX
This will reuse the existing checks infrastructure as defined by the checks plugin, and therefore if no checks file is defined, it will default to the normal Dokku container check.
Closes#2218
This hook will allow users to modify the repo in use for deployed applications. An example use case would be one where the image being deployed is from a remote docker registry where the `dokku` username is taken and the app will be deployed from a separate username.
Applications without a restart-policy will have their policies set to `on-failure:10`. Users can completely unset the restart-policy using the `docker-options` plugin, though this will be equivalent to setting it explicitly to `no`.
Restart policies must be explicitly set, and the following are all valid:
- no
- unless-stopped
- always
- on-failure
- on-failure:NUMBER
Fixesdokku/dokku-letsencrypt#67
Change the certs:add command to use a file import without trying to
detect a piped-in tarball if server.crt and server.key files were passed
in as arguments and those files exist.
Fixes hangs on certificate imports by filename when the check for a
STDIN pipe fails e.g. when running dokku remotely using a SSH command.
This allows users to specify port 80 after an application has had domain added. Normally, when we first add an extra domain, the following tuple is added:
http:80:5000
A user might then want to remap port 80 to another port, such as port 8080:
dokku proxy:ports-add APP http:80:8080
The application would then have the following proxy map:
http:80:5000 http:80:8080
As nginx vhosts are resolved in FIFO order, the "correct" upstream of 8080 would basically be ignored. The workaround would be to remove the original port mapping, but the following:
dokku proxy:ports-remove APP 80
Would remove *both* entries and then re-add the default of `http:80:5000`. Thus it was not possible to use the porcelain to correct the port mapping and a user would have to fall back to using the following hack to fix their mapping:
dokku config:set APP DOKKU_PROXY_PORT_MAP='http:80:8080'
You can now use the previous syntax *as well as* the following to remove a port mapping:
dokku proxy:ports-remove APP http:80:5000