Skip to content

Commit

Permalink
Add env variables for SSL mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Murazaki committed Jan 26, 2025
1 parent 8497c0a commit 842e982
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY="false"
#DB_ATTR_SSL_CERT=""

# @see https://pixelfed-glitch.github.io/docs/technical-documentation/config/#db_database
# @dottie/validate one-of=disable allow prefer require verify-ca verify-full
# @dottie/validate one-of=disable allow prefer require trust verify-ca verify-full DISABLED PREFERRED REQUIRED VERIFY_IDENTITY
#DB_SSL_MODE="prefer"

################################################################################
Expand Down
4 changes: 4 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
'prefix' => '',
'strict' => false,
'engine' => null,
'sslMode' => env('DB_SSL_MODE', 'PREFERRED'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => env('MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'),
PDO::MYSQL_ATTR_SSL_CA => env('DB_ATTR_SSL_CA'),
]) : [],
'dump' => [
Expand All @@ -78,7 +80,9 @@
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'sslmode' => env('DB_SSL_MODE', 'trust'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => env('MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'),
PDO::MYSQL_ATTR_SSL_CA => env('DB_ATTR_SSL_CA'),
]) : [],
],
Expand Down

0 comments on commit 842e982

Please sign in to comment.