Properly remap http port 80 mappings to https 443 when adding an ssl certificate

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
This commit is contained in:
Jose Diaz-Gonzalez
2016-07-15 02:51:31 -04:00
parent c93396aff9
commit 0d4560177a
9 changed files with 77 additions and 39 deletions

View File

@@ -38,7 +38,6 @@ certs_set() {
if is_file_import "$CRT_FILE" "$KEY_FILE"; then
# importing from file
true
elif is_tar_import; then
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs_set.XXXX")
pushd "$CERTS_SET_TMP_WORK_DIR" &> /dev/null
@@ -64,10 +63,8 @@ certs_set() {
else
local KEY_FILE=$KEY_FILE_SEARCH
fi
else
dokku_log_fail "Tar archive containing server.crt and server.key expected on stdin"
fi
mkdir -p "$APP_SSL_PATH"