Merge pull request #7684 from michnovka/talk-trust-custom-ca

feat(talk): trust custom CA certificates via NEXTCLOUD_TRUSTED_CACERTS_DIR
This commit is contained in:
Simon L.
2026-03-06 15:10:32 +01:00
committed by GitHub
3 changed files with 25 additions and 1 deletions

View File

@@ -70,7 +70,8 @@ RUN set -ex; \
libwebsockets \
\
shadow \
grep; \
grep \
util-linux-misc; \
useradd --system -u 1000 eturnal; \
apk del --no-cache \
shadow; \

View File

@@ -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

View File

@@ -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",