diff --git a/Containers/talk/Dockerfile b/Containers/talk/Dockerfile index 6a3b227e..404326dc 100644 --- a/Containers/talk/Dockerfile +++ b/Containers/talk/Dockerfile @@ -70,7 +70,8 @@ RUN set -ex; \ libwebsockets \ \ shadow \ - grep; \ + grep \ + util-linux-misc; \ useradd --system -u 1000 eturnal; \ apk del --no-cache \ shadow; \ diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index f89949f3..57344ee0 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -18,6 +18,22 @@ elif [ -z "$INTERNAL_SECRET" ]; then exit 1 fi +# Trust additional CA certificates, if the user provided NEXTCLOUD_TRUSTED_CACERTS_DIR +# The container is read-only, so we build a custom bundle in /tmp (tmpfs) and +# point Go's TLS stack to it via SSL_CERT_FILE. +if mountpoint -q /usr/local/share/ca-certificates; then + echo "Trusting additional CA certificates..." + set -x + cp /etc/ssl/certs/ca-certificates.crt /tmp/ca-certificates.crt + for cert in /usr/local/share/ca-certificates/*; do + if [ -f "$cert" ]; then + cat "$cert" >> /tmp/ca-certificates.crt + fi + done + export SSL_CERT_FILE=/tmp/ca-certificates.crt + set +x +fi + set -x IPv4_ADDRESS_TALK_RELAY="$(hostname -i | grep -oP '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)" # shellcheck disable=SC2153 diff --git a/php/containers.json b/php/containers.json index a72d19a2..2e1923c0 100644 --- a/php/containers.json +++ b/php/containers.json @@ -437,6 +437,13 @@ "8081" ], "internal_port": "%TALK_PORT%", + "volumes": [ + { + "source": "%NEXTCLOUD_TRUSTED_CACERTS_DIR%", + "destination": "/usr/local/share/ca-certificates", + "writeable": false + } + ], "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "TALK_HOST=nextcloud-aio-talk",