Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: use container-local config dir path when reading arguments" #272

Merged
merged 1 commit into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions functions
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ letsencrypt_configure_and_get_dir() {
# store config settings
echo "--http.port :$acme_port $config" >"$config_dir/config"

# send both host and container path
# to respect mapped DOKKU_ROOT when running in a container
echo "$DOKKU_HOST_ROOT/$app/letsencrypt/certs/$config_hash:$config_dir"
# re-implement entire path to respect mapped DOKKU_ROOT when running in a container
echo "$DOKKU_HOST_ROOT/$app/letsencrypt/certs/$config_hash"
}

letsencrypt_get_email() {
Expand Down
8 changes: 3 additions & 5 deletions subcommands/enable
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ letsencrypt_acme() {
dokku_log_info1 "Getting letsencrypt certificate for ${app}..."

# read arguments from appropriate config file into the config array
config_dirs="$(letsencrypt_configure_and_get_dir "$app" "$acme_port")"
host_config_dir="$(echo "$config_dirs" | cut -d: -f1)"
container_config_dir="$(echo "$config_dirs" | cut -d: -f2)"
read -r -a config <"$container_config_dir/config"
config_dir="$(letsencrypt_configure_and_get_dir "$app" "$acme_port")"
read -r -a config <"$config_dir/config"

# run letsencrypt as a docker container using "certonly" mode
# port 80 of the standalone webserver will be forwarded by the proxy
Expand All @@ -97,7 +95,7 @@ letsencrypt_acme() {
docker run --rm \
--user $DOKKU_UID:$DOKKU_GID \
-p "$acme_port:$acme_port" \
-v "$host_config_dir:/certs" \
-v "$config_dir:/certs" \
"${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION}" \
"${config[@]}" run | sed "s/^/ /"

Expand Down
8 changes: 3 additions & 5 deletions subcommands/revoke
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ letsencrypt_acme_revoke() {
local acme_port=$(get_available_port)

# read arguments from appropriate config file into the config array
config_dirs="$(letsencrypt_configure_and_get_dir "$app" "$acme_port")"
host_config_dir="$(echo "$config_dirs" | cut -d: -f1)"
container_config_dir="$(echo "$config_dirs" | cut -d: -f2)"
read -r -a config <"$container_config_dir/config"
local config_dir="$(letsencrypt_configure_and_get_dir "$app" "$acme_port")"
read -r -a config <"$config_dir/config"

# run letsencrypt as a docker container using "certonly" mode
# port 80 of the standalone webserver will be forwarded by the proxy
Expand All @@ -30,7 +28,7 @@ letsencrypt_acme_revoke() {
docker run --rm \
--user $DOKKU_UID:$DOKKU_GID \
-p "$acme_port:$acme_port" \
-v "$host_config_dir:/certs" \
-v "$config_dir:/certs" \
"${PLUGIN_IMAGE}:${PLUGIN_IMAGE_VERSION}" \
"${config[@]}" revoke | sed "s/^/ /"

Expand Down