mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
nextcloud: allow to configure mysql root cert
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
6506b5e5cc
commit
6b3af009e2
3 changed files with 17 additions and 2 deletions
|
|
@ -7,3 +7,11 @@ if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES')) {
|
|||
),
|
||||
);
|
||||
}
|
||||
if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL')) {
|
||||
$CONFIG = array(
|
||||
'dbdriveroptions' => array(
|
||||
'PDO::MYSQL_ATTR_SSL_CA' => '/var/www/html/data/certificates/MYSQL',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -283,6 +283,10 @@ EOF
|
|||
if [ -n "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" ]; then
|
||||
mkdir /var/www/html/data/certificates
|
||||
echo "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" > "/var/www/html/data/certificates/POSTGRES"
|
||||
# Write out mysql root cert
|
||||
elif [ -n "$NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL" ]; then
|
||||
mkdir /var/www/html/data/certificates
|
||||
echo "$NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL" > "/var/www/html/data/certificates/MYSQL"
|
||||
fi
|
||||
|
||||
echo "Installing with $DATABASE_TYPE database"
|
||||
|
|
|
|||
|
|
@ -68,11 +68,14 @@ fi
|
|||
|
||||
# Postgres root cert
|
||||
if [ -f "/nextcloud/data/certificates/POSTGRES" ]; then
|
||||
POSTGRES_CERT="?sslmode=verify-ca&sslrootcert=/nextcloud/data/certificates/POSTGRES"
|
||||
CERT_OPTIONS="?sslmode=verify-ca&sslrootcert=/nextcloud/data/certificates/POSTGRES"
|
||||
# Mysql root cert
|
||||
elif [ -f "/nextcloud/data/certificates/MYSQL" ]; then
|
||||
CERT_OPTIONS="?sslmode=verify-ca&ssl-ca=/nextcloud/data/certificates/MYSQL"
|
||||
fi
|
||||
|
||||
# Set sensitive values as env
|
||||
export DATABASE_URL="$DATABASE_TYPE://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB$POSTGRES_CERT"
|
||||
export DATABASE_URL="$DATABASE_TYPE://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB$CERT_OPTIONS"
|
||||
export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"
|
||||
|
||||
# Run it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue