Disable database SSL/TLS encryption
Removed DATABASE_SSL and DATABASE_SSL_VERIFY environment variable handling and SSL configuration from database connection settings.
This commit is contained in:
parent
4d79bcb9ba
commit
df6431c899
1 changed files with 30 additions and 51 deletions
|
|
@ -49,21 +49,6 @@ if config_env() == :prod do
|
||||||
# Configure clustering based on environment
|
# Configure clustering based on environment
|
||||||
cluster_enabled = System.get_env("CLUSTER_ENABLED", "false") == "true"
|
cluster_enabled = System.get_env("CLUSTER_ENABLED", "false") == "true"
|
||||||
|
|
||||||
# Parse SSL configuration from environment
|
|
||||||
ssl_enabled = System.get_env("DATABASE_SSL", "false") == "true"
|
|
||||||
ssl_verify = System.get_env("DATABASE_SSL_VERIFY", "true") == "true"
|
|
||||||
|
|
||||||
ssl_opts =
|
|
||||||
if ssl_enabled do
|
|
||||||
if ssl_verify do
|
|
||||||
[ssl: true]
|
|
||||||
else
|
|
||||||
[ssl: true, ssl_opts: [verify: :verify_none]]
|
|
||||||
end
|
|
||||||
else
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
|
|
||||||
# ## Configuring the mailer
|
# ## Configuring the mailer
|
||||||
#
|
#
|
||||||
# Configure Resend for email delivery
|
# Configure Resend for email delivery
|
||||||
|
|
@ -71,42 +56,36 @@ if config_env() == :prod do
|
||||||
adapter: Resend.Swoosh.Adapter,
|
adapter: Resend.Swoosh.Adapter,
|
||||||
api_key: System.get_env("RESEND_API_KEY")
|
api_key: System.get_env("RESEND_API_KEY")
|
||||||
|
|
||||||
config :aprsme,
|
config :aprsme, Aprsme.Repo,
|
||||||
Aprsme.Repo,
|
url: database_url,
|
||||||
Keyword.merge(
|
# Increased pool size for better concurrency (was 25)
|
||||||
[
|
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "45"),
|
||||||
url: database_url,
|
# Increased timeout for ARM system under load
|
||||||
# Increased pool size for better concurrency (was 25)
|
pool_timeout: String.to_integer(System.get_env("POOL_TIMEOUT") || "10000"),
|
||||||
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "45"),
|
# Match PostgreSQL statement timeout capabilities
|
||||||
# Increased timeout for ARM system under load
|
timeout: String.to_integer(System.get_env("DB_TIMEOUT") || "30000"),
|
||||||
pool_timeout: String.to_integer(System.get_env("POOL_TIMEOUT") || "10000"),
|
socket_options:
|
||||||
# Match PostgreSQL statement timeout capabilities
|
maybe_ipv6 ++
|
||||||
timeout: String.to_integer(System.get_env("DB_TIMEOUT") || "30000"),
|
[
|
||||||
socket_options:
|
# TCP optimizations for better connection handling
|
||||||
maybe_ipv6 ++
|
keepalive: true,
|
||||||
[
|
nodelay: true,
|
||||||
# TCP optimizations for better connection handling
|
recbuf: 8192,
|
||||||
keepalive: true,
|
sndbuf: 8192
|
||||||
nodelay: true,
|
],
|
||||||
recbuf: 8192,
|
types: Aprsme.PostgresTypes,
|
||||||
sndbuf: 8192
|
# Reduced queue target for faster response
|
||||||
],
|
queue_target: 100,
|
||||||
types: Aprsme.PostgresTypes,
|
# Check queue more frequently
|
||||||
# Reduced queue target for faster response
|
queue_interval: 1_000,
|
||||||
queue_target: 100,
|
# Optimize for unnamed prepared statements (better for dynamic queries)
|
||||||
# Check queue more frequently
|
prepare: :unnamed,
|
||||||
queue_interval: 1_000,
|
# Connection parameters to leverage PostgreSQL settings
|
||||||
# Optimize for unnamed prepared statements (better for dynamic queries)
|
# Note: When using PgBouncer, only certain parameters are supported
|
||||||
prepare: :unnamed,
|
parameters: [
|
||||||
# Connection parameters to leverage PostgreSQL settings
|
# Application name for monitoring
|
||||||
# Note: When using PgBouncer, only certain parameters are supported
|
application_name: "aprsme"
|
||||||
parameters: [
|
]
|
||||||
# Application name for monitoring
|
|
||||||
application_name: "aprsme"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
ssl_opts
|
|
||||||
)
|
|
||||||
|
|
||||||
config :aprsme, AprsmeWeb.Endpoint,
|
config :aprsme, AprsmeWeb.Endpoint,
|
||||||
url: [host: host, port: 443, scheme: "https"],
|
url: [host: host, port: 443, scheme: "https"],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue