Skip to content

Commit

Permalink
Revert Postgres socket options (#416)
Browse files Browse the repository at this point in the history
* Revert "fix(release): postgres socket options"

This reverts commit a2007b8.

* Revert "fix(releases): more postgres SSL options (#408)"

This reverts commit e4122c4.

* Revert "fix(release): add ssl_opts server_name_indication (#405)"

This reverts commit 346665e.

* Revert "feat(postgres): add release setting for ssl (#404)"

This reverts commit c8a039b.
  • Loading branch information
Betree authored Aug 30, 2023
1 parent a2007b8 commit c7685ce
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,11 @@ end

# ---- [APP CONFIG] :db ----

# Location of root certificates to verify database SSL connection.
# For example: /opt/homebrew/etc/openssl@3/cert.pem
database_ca_cert_filepath =
load_secret.({"DATABASE_CA_CERT_FILEPATH", "/etc/ssl/certs/ca-certificates.crt"})

postgres_enable_ssl? = load_bool.({"db_ssl", "false"})
postgres_socket_options = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
postgres_ssl_options = []

if postgres_enable_ssl? do
postgres_ssl_options = [
server_name_indication: to_charlist(load_secret.("db_hostname")),
verify: :verify_peer,
cacertfile: database_ca_cert_filepath,
customize_hostname_check: [match_fun: :public_key.pkix_verify_hostname_match_fun(:https)]
]
end

config :db, DB.Repo,
hostname: load_secret.("db_hostname"),
username: load_secret.("db_username"),
password: load_secret.("db_password"),
database: load_secret.("db_name"),
pool_size: load_int.({"db_pool_size", 10}),
socket_options: postgres_socket_options,
ssl: postgres_enable_ssl?,
ssl_opts: postgres_ssl_options
database: load_secret.("db_name")

config :ex_aws,
access_key_id: [load_secret.("s3_access_key_id"), :instance_role],
Expand Down

0 comments on commit c7685ce

Please sign in to comment.