mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-15 18:20:20 +00:00
nextcloud: fix configuration of default_certificates_bundle_path and allow to use bundle for mailer
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
427f7ec858
commit
17bf4f91d7
3 changed files with 16 additions and 13 deletions
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
// Check if NEXTCLOUD_TRUSTED_CERTIFICATES_ are configured
|
||||||
|
if (str_contains(implode(' ', array_keys(getenv())), 'NEXTCLOUD_TRUSTED_CERTIFICATES_')) {
|
||||||
|
$CONFIG['default_certificates_bundle_path'] = '/var/www/html/data/certificates/ca-bundle.crt';
|
||||||
|
}
|
||||||
|
|
@ -18,3 +18,14 @@ if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN'))
|
||||||
$CONFIG['mail_smtppassword'] = '';
|
$CONFIG['mail_smtppassword'] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MAILER')) {
|
||||||
|
$CONFIG = array(
|
||||||
|
'mail_smtpstreamoptions' => array(
|
||||||
|
'ssl' => array(
|
||||||
|
'verify_peer_name' => false,
|
||||||
|
'cafile' => '/var/www/html/data/certificates/ca-bundle.crt',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,6 @@ run_upgrade_if_needed_due_to_app_update() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_global_ca_bundle_path() {
|
|
||||||
# Only run if env is set
|
|
||||||
if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then
|
|
||||||
php /var/www/html/occ config:system:set default_certificates_bundle_path --value="$CERTIFICATE_BUNDLE"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create cert bundle
|
# Create cert bundle
|
||||||
if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then
|
if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then
|
||||||
|
|
||||||
|
|
@ -246,8 +239,6 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||||
|
|
||||||
run_upgrade_if_needed_due_to_app_update
|
run_upgrade_if_needed_due_to_app_update
|
||||||
|
|
||||||
set_global_ca_bundle_path
|
|
||||||
|
|
||||||
php /var/www/html/occ maintenance:mode --off
|
php /var/www/html/occ maintenance:mode --off
|
||||||
|
|
||||||
echo "Getting and backing up the status of apps for later; this might take a while..."
|
echo "Getting and backing up the status of apps for later; this might take a while..."
|
||||||
|
|
@ -381,8 +372,6 @@ EOF
|
||||||
# Try to force generation of appdata dir:
|
# Try to force generation of appdata dir:
|
||||||
php /var/www/html/occ maintenance:repair
|
php /var/www/html/occ maintenance:repair
|
||||||
|
|
||||||
set_global_ca_bundle_path
|
|
||||||
|
|
||||||
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
|
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
|
@ -599,8 +588,6 @@ fi
|
||||||
|
|
||||||
run_upgrade_if_needed_due_to_app_update
|
run_upgrade_if_needed_due_to_app_update
|
||||||
|
|
||||||
set_global_ca_bundle_path
|
|
||||||
|
|
||||||
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
|
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
|
||||||
# Check if appdata is present
|
# Check if appdata is present
|
||||||
# If not, something broke (e.g. changing ncdatadir after aio was first started)
|
# If not, something broke (e.g. changing ncdatadir after aio was first started)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue