diff --git a/docker/backend-nextcloud-apache/Dockerfile b/docker/backend-nextcloud-apache/Dockerfile index 9b8b50a..820e643 100644 --- a/docker/backend-nextcloud-apache/Dockerfile +++ b/docker/backend-nextcloud-apache/Dockerfile @@ -53,6 +53,11 @@ RUN /setup_newrelic.sh && rm /setup_newrelic.sh COPY nextcloud-common/entrypoint.sh / COPY nextcloud-common/config/* /usr/src/nextcloud/config/ +# Create combined CA file, per: +# https://learn.microsoft.com/en-us/azure/mariadb/concepts-certificate-rotation +COPY nextcloud-common/ssl/azure_ca/ /tmp/azure_ca +RUN cat /tmp/azure_ca/*.pem >/usr/src/nextcloud/config/azure_ca.pem + # We supply all custom apps via Docker image; app store is disabled COPY nextcloud-common/custom_apps/. /usr/src/nextcloud/custom_apps/ diff --git a/docker/backend-nextcloud-fpm/Dockerfile b/docker/backend-nextcloud-fpm/Dockerfile index 65663d4..9e19403 100644 --- a/docker/backend-nextcloud-fpm/Dockerfile +++ b/docker/backend-nextcloud-fpm/Dockerfile @@ -100,6 +100,11 @@ RUN /setup_newrelic.sh && rm /setup_newrelic.sh COPY nextcloud-common/entrypoint.sh / COPY nextcloud-common/config/* /usr/src/nextcloud/config/ +# Create combined CA file, per: +# https://learn.microsoft.com/en-us/azure/mariadb/concepts-certificate-rotation +COPY nextcloud-common/ssl/azure_ca/ /tmp/azure_ca +RUN cat /tmp/azure_ca/*.pem >/usr/src/nextcloud/config/azure_ca.pem + # We supply all custom apps via Docker image; app store is disabled COPY nextcloud-common/custom_apps/. /usr/src/nextcloud/custom_apps/ diff --git a/docker/nextcloud-common/config/mysql-ssl.config.php b/docker/nextcloud-common/config/mysql-ssl.config.php index 3da8eec..5eba0ca 100644 --- a/docker/nextcloud-common/config/mysql-ssl.config.php +++ b/docker/nextcloud-common/config/mysql-ssl.config.php @@ -1,24 +1,18 @@ array( - PDO::MYSQL_ATTR_SSL_CA => $ssl_ca_location, - ), - ); - } +# Support connecting to Azure MySQL over SSL +$CONFIG = array( + 'dbdriveroptions' => array( + PDO::MYSQL_ATTR_SSL_CA => sprintf('%s/%s', $config_folder, AZURE_CA_PEM_FILE), + ), +); diff --git a/docker/nextcloud-common/entrypoint.sh b/docker/nextcloud-common/entrypoint.sh index 58569f6..5fd1701 100755 --- a/docker/nextcloud-common/entrypoint.sh +++ b/docker/nextcloud-common/entrypoint.sh @@ -192,6 +192,7 @@ deploy_nextcloud_release() { echo "'config' directory is writable." echo "Sync-ing configuration snippets:" cp -v /usr/src/nextcloud/config/*.config.php /var/www/html/config/ + cp -v /usr/src/nextcloud/config/*.pem /var/www/html/config/ echo "" else echo "'config' directory is not writable." diff --git a/docker/nextcloud-common/ssl/azure_ca/BaltimoreCyberTrustRoot.crt.pem b/docker/nextcloud-common/ssl/azure_ca/BaltimoreCyberTrustRoot.crt.pem new file mode 100644 index 0000000..2bd16eb --- /dev/null +++ b/docker/nextcloud-common/ssl/azure_ca/BaltimoreCyberTrustRoot.crt.pem @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + diff --git a/docker/nextcloud-common/ssl/azure_ca/DigiCertGlobalRootG2.crt.pem b/docker/nextcloud-common/ssl/azure_ca/DigiCertGlobalRootG2.crt.pem new file mode 100644 index 0000000..798e002 --- /dev/null +++ b/docker/nextcloud-common/ssl/azure_ca/DigiCertGlobalRootG2.crt.pem @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYW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CERTIFICATE----- diff --git a/docker/nextcloud-cron/Dockerfile b/docker/nextcloud-cron/Dockerfile index 71ccd1b..9be328d 100644 --- a/docker/nextcloud-cron/Dockerfile +++ b/docker/nextcloud-cron/Dockerfile @@ -19,6 +19,11 @@ RUN rm -f /usr/src/nextcloud/config/redis.config.php COPY nextcloud-cron/entrypoint.sh / COPY nextcloud-common/config/* /usr/src/nextcloud/config/ +# Create combined CA file, per: +# https://learn.microsoft.com/en-us/azure/mariadb/concepts-certificate-rotation +COPY nextcloud-common/ssl/azure_ca/ /tmp/azure_ca +RUN cat /tmp/azure_ca/*.pem >/usr/src/nextcloud/config/azure_ca.pem + COPY nextcloud-cron/cleanup_uploads.sh / # Ensure custom apps are available during cron runs.