This commit is contained in:
50
config/config.exs
Normal file
50
config/config.exs
Normal file
@@ -0,0 +1,50 @@
|
||||
import Config
|
||||
|
||||
# This file is responsible for configuring your application
|
||||
# and its dependencies with the aid of the Config module.
|
||||
#
|
||||
# This configuration file is loaded before any dependency and
|
||||
# is restricted to this project.
|
||||
|
||||
# General application configuration
|
||||
config :provider_service,
|
||||
ecto_repos: [ProviderService.Repo],
|
||||
event_stores: [ProviderService.EventStore]
|
||||
|
||||
config :provider_service, ProviderServiceWeb.Endpoint,
|
||||
url: [host: "localhost"],
|
||||
adapter: Bandit.PhoenixAdapter,
|
||||
render_errors: [
|
||||
formats: [json: ProviderServiceWeb.ErrorJSON],
|
||||
layout: false
|
||||
],
|
||||
pubsub_server: ProviderService.PubSub,
|
||||
live_view: [signing_salt: "zPStCmh9"]
|
||||
|
||||
# Configure Elixir's Logger
|
||||
config :logger, :default_formatter,
|
||||
format: "$time $metadata[$level] $message\n",
|
||||
metadata: [:request_id]
|
||||
|
||||
# Use Jason for JSON parsing in Phoenix
|
||||
config :phoenix, :json_library, Jason
|
||||
|
||||
config :provider_service, ProviderService.CommandedApp,
|
||||
event_store: [
|
||||
adapter: Commanded.EventStore.Adapters.EventStore,
|
||||
event_store: ProviderService.EventStore
|
||||
],
|
||||
pub_sub: :local,
|
||||
registry: :local
|
||||
|
||||
config :commanded,
|
||||
event_store_adapter: Commanded.EventStore.Adapters.EventStore
|
||||
|
||||
config :commanded_ecto_projections,
|
||||
repo: ProviderService.Repo
|
||||
|
||||
config :flop, repo: ProviderService.Repo
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{config_env()}.exs"
|
||||
41
config/dev.exs
Normal file
41
config/dev.exs
Normal file
@@ -0,0 +1,41 @@
|
||||
import Config
|
||||
|
||||
config :provider_service, ProviderService.Repo,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "localhost",
|
||||
database: "provider_service_dev",
|
||||
stacktrace: true,
|
||||
show_sensitive_data_on_connection_error: true,
|
||||
pool_size: 10
|
||||
|
||||
config :provider_service, ProviderServiceWeb.Endpoint,
|
||||
http: [ip: {127, 0, 0, 1}, port: 4002],
|
||||
adapter: Bandit.PhoenixAdapter,
|
||||
check_origin: false,
|
||||
code_reloader: true,
|
||||
debug_errors: true,
|
||||
secret_key_base: "localdevsecretkeybase1234567890localdevsecretkeybase1234567890xx"
|
||||
|
||||
config :ex_aws,
|
||||
access_key_id: "minioadmin",
|
||||
secret_access_key: "minioadmin",
|
||||
region: "us-east-1"
|
||||
|
||||
config :ex_aws, :s3,
|
||||
scheme: "http://",
|
||||
host: "localhost",
|
||||
port: 9000
|
||||
|
||||
config :provider_service, ProviderService.EventStore,
|
||||
serializer: Commanded.Serialization.JsonSerializer,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
database: "provider_service_eventstore_dev",
|
||||
hostname: "localhost",
|
||||
pool_size: 10
|
||||
|
||||
config :provider_service, :s3_bucket, "policy-bucket"
|
||||
|
||||
config :provider_service,
|
||||
solicitation_service_url: "http://localhost:8081"
|
||||
3
config/prod.exs
Normal file
3
config/prod.exs
Normal file
@@ -0,0 +1,3 @@
|
||||
import Config
|
||||
|
||||
config :logger, level: :debug
|
||||
80
config/runtime.exs
Normal file
80
config/runtime.exs
Normal file
@@ -0,0 +1,80 @@
|
||||
import Config
|
||||
|
||||
logger_level =
|
||||
case System.get_env("LOG_LEVEL", "info") do
|
||||
"debug" -> :debug
|
||||
"info" -> :info
|
||||
"warn" -> :warning
|
||||
"error" -> :error
|
||||
val when val in ["warning", "error"] -> :error
|
||||
_ -> :info
|
||||
end
|
||||
|
||||
config :logger, level: logger_level
|
||||
|
||||
config :logger, :console, format: {Logger.Formatter, :format}
|
||||
|
||||
s3_host = System.get_env("S3_HOST", "dev.s3.corredorconect.com")
|
||||
s3_port = System.get_env("S3_PORT", "443")
|
||||
|
||||
config :ex_aws,
|
||||
access_key_id: System.get_env("AWS_ACCESS_KEY_ID"),
|
||||
secret_access_key: System.get_env("AWS_SECRET_ACCESS_KEY"),
|
||||
region: System.get_env("AWS_REGION", "us-east-1")
|
||||
|
||||
config :ex_aws, :s3,
|
||||
scheme: "https://",
|
||||
host: s3_host,
|
||||
port: s3_port
|
||||
|
||||
config :provider_service, :s3_bucket, System.get_env("S3_BUCKET")
|
||||
|
||||
if System.get_env("PHX_SERVER") do
|
||||
config :provider_service, ProviderServiceWeb.Endpoint, server: true
|
||||
end
|
||||
|
||||
if cookie = System.get_env("RELEASE_COOKIE") do
|
||||
config :elixir, :cookie, cookie
|
||||
end
|
||||
|
||||
config :provider_service, ProviderServiceWeb.Endpoint,
|
||||
http: [port: String.to_integer(System.get_env("PORT", "8080"))]
|
||||
|
||||
if config_env() == :prod do
|
||||
database_url =
|
||||
System.get_env("DATABASE_URL") ||
|
||||
raise """
|
||||
environment variable DATABASE_URL is missing.
|
||||
For example: ecto://USER:PASS@HOST/DATABASE
|
||||
"""
|
||||
|
||||
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
|
||||
|
||||
config :provider_service, ProviderService.Repo,
|
||||
url: database_url,
|
||||
pool_size: 1,
|
||||
socket_options: maybe_ipv6
|
||||
|
||||
config :provider_service, ProviderService.EventStore,
|
||||
serializer: Commanded.Serialization.JsonSerializer,
|
||||
url: database_url,
|
||||
pool_size: 1
|
||||
|
||||
secret_key_base =
|
||||
System.get_env("SECRET_KEY_BASE") ||
|
||||
raise """
|
||||
environment variable SECRET_KEY_BASE is missing.
|
||||
You can generate one by calling: mix phx.gen.secret
|
||||
"""
|
||||
|
||||
host = System.get_env("PHX_HOST") || "example.com"
|
||||
|
||||
config :provider_service, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
||||
|
||||
config :provider_service, ProviderServiceWeb.Endpoint,
|
||||
url: [host: host, port: 80, scheme: "http"],
|
||||
http: [
|
||||
ip: {0, 0, 0, 0, 0, 0, 0, 0}
|
||||
],
|
||||
secret_key_base: secret_key_base
|
||||
end
|
||||
27
config/test.exs
Normal file
27
config/test.exs
Normal file
@@ -0,0 +1,27 @@
|
||||
import Config
|
||||
|
||||
config :provider_service, ProviderService.Repo,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "localhost",
|
||||
database: "provider_service_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
pool_size: System.schedulers_online() * 2
|
||||
|
||||
config :provider_service, ProviderServiceWeb.Endpoint,
|
||||
http: [ip: {127, 0, 0, 1}, port: 4002],
|
||||
secret_key_base: "mf3rysPsftCpSAdQfBIFEKFpjA1e9tGi9+jbxhNTs5qC3pC9LSn6P/kWlZatl9a0",
|
||||
server: false
|
||||
|
||||
config :logger, level: :warning
|
||||
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
config :phoenix,
|
||||
sort_verified_routes_query_params: true
|
||||
|
||||
config :provider_service, ProviderService.Application,
|
||||
event_store: [
|
||||
adapter: Commanded.EventStore.Adapters.InMemory,
|
||||
serializer: Commanded.Serialization.JsonSerializer
|
||||
]
|
||||
Reference in New Issue
Block a user