mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #7216 from nextcloud/enh/noid/allow-configure-mysql-root-cert
nextcloud: allow to configure mysql root cert
This commit is contained in:
commit
2bde893647
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
|
if [ -n "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" ]; then
|
||||||
mkdir /var/www/html/data/certificates
|
mkdir /var/www/html/data/certificates
|
||||||
echo "$NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES" > "/var/www/html/data/certificates/POSTGRES"
|
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
|
fi
|
||||||
|
|
||||||
echo "Installing with $DATABASE_TYPE database"
|
echo "Installing with $DATABASE_TYPE database"
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,14 @@ fi
|
||||||
|
|
||||||
# Postgres root cert
|
# Postgres root cert
|
||||||
if [ -f "/nextcloud/data/certificates/POSTGRES" ]; then
|
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
|
fi
|
||||||
|
|
||||||
# Set sensitive values as env
|
# 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"
|
export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"
|
||||||
|
|
||||||
# Run it
|
# Run it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue