这是indexloc提供的服务,不要输入任何密码
Skip to content
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
4 changes: 2 additions & 2 deletions plugins/certs/commands
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ certs_set() {
cd $TEMP_DIR
tar xvf - <&0

CRT_FILE_SEARCH=$(find . -type f -name "*.crt")
CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.crt")
CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^')
if [[ $CRT_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .crt file"
Expand All @@ -49,7 +49,7 @@ certs_set() {
CRT_FILE=$CRT_FILE_SEARCH
fi

KEY_FILE_SEARCH=$(find . -type f -name "*.key")
KEY_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.key")
KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^')
if [[ $KEY_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .key file"
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/10_certs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ teardown() {
assert_success
}

@test "(certs) certs:add < tar should ignore OSX hidden files" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/osx_ssl_tarred.tar"
echo "output: "$output
echo "status: "$status
assert_success
}

@test "(certs) certs:info" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP"
echo "output: "$output
Expand Down
Binary file added tests/unit/osx_ssl_tarred.tar
Binary file not shown.