Merge pull request #1834 from jvanbaarsen/ignore-osx-hidden-files
Make sure we ignore hidden files in the SSL cert check
This commit is contained in:
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
BIN
tests/unit/osx_ssl_tarred.tar
Normal file
BIN
tests/unit/osx_ssl_tarred.tar
Normal file
Binary file not shown.
Reference in New Issue
Block a user