File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ function copy_certs_to_container() {
4848 ;;
4949 esac
5050
51- # collect .crt files from directory
52- mapfile -t CERT_FILES < <( find " $CERTS_PATH " -maxdepth 1 -type f -name " *.crt" )
51+ # collect .crt files from directory (including symlinks pointing to valid files, e.g. from Let's Encrypt companion)
52+ mapfile -t CERT_FILES < <( find -L " $CERTS_PATH " -maxdepth 1 -type f -name " *.crt" )
5353
5454 if [[ ${# CERT_FILES[@]} -eq 0 ]]; then
55- print_error " Keine .crt-Dateien gefunden in: ${CERT_SOURCE_DIR} " 1
55+ print_error " No .crt files located in: ${CERT_SOURCE_DIR} " 1
5656 return
5757 fi
5858
@@ -61,7 +61,8 @@ function copy_certs_to_container() {
6161
6262 for cert in " ${CERT_FILES[@]} " ; do
6363 filename=" $( basename " ${cert} " ) "
64- docker cp " $cert " " $CONTAINER :$CERT_TARGET_DIR /$filename " > /dev/null
64+ real_cert=" $( readlink -f " ${cert} " ) "
65+ docker cp " $real_cert " " $CONTAINER :$CERT_TARGET_DIR /$filename " > /dev/null
6566 docker exec --user root " $CONTAINER " sh -c " chmod 644 '$CERT_TARGET_DIR /$filename '"
6667 done
6768
You can’t perform that action at this time.
0 commit comments