The plug was incorrectly placed in the endpoint, causing it to run on all requests including APIs. Moved to :browser pipeline where it belongs, and removed redundant fetch_session call since the pipeline handles it.
32 lines
1.1 KiB
Elixir
32 lines
1.1 KiB
Elixir
import Config
|
|
|
|
# Filter out harmless Oban shutdown messages during deployments
|
|
config :logger, :default_handler,
|
|
filters: [
|
|
drop_oban_shutdown: {
|
|
&Towerops.LoggerFilters.drop_oban_shutdown/2,
|
|
[]
|
|
}
|
|
]
|
|
|
|
# Do not print debug messages in production
|
|
config :logger,
|
|
level: :info,
|
|
metadata_filter: [oban_shutdown_filter: true]
|
|
|
|
# Configure Swoosh API Client
|
|
config :swoosh, api_client: Swoosh.ApiClient.Req
|
|
|
|
# Disable Swoosh Local Memory Storage
|
|
config :swoosh, local: false
|
|
|
|
# Note we also include the path to a cache manifest
|
|
# containing the digested version of static files. This
|
|
# manifest is generated by the `mix assets.deploy` task,
|
|
# which you should run after static files are built and
|
|
# before starting your production server.
|
|
config :towerops, ToweropsWeb.Endpoint,
|
|
cache_static_manifest: "priv/static/cache_manifest.json",
|
|
# Force SSL redirects and enable HSTS (HTTP Strict Transport Security)
|
|
# HSTS tells browsers to only use HTTPS for this domain for the next year
|
|
force_ssl: [hsts: true, rewrite_on: [:x_forwarded_host, :x_forwarded_port, :x_forwarded_proto]]
|