forked from code-corps/code-corps-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.exs
More file actions
102 lines (78 loc) · 3.2 KB
/
config.exs
File metadata and controls
102 lines (78 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
# General application configuration
config :code_corps,
ecto_repos: [CodeCorps.Repo]
# Configures the endpoint
config :code_corps, CodeCorpsWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "eMl0+Byu0Zv7q48thBu23ChBVFO1+sdLqoMI8yZoxEviF1K3C5uIohbDfvM9felL",
render_errors: [view: CodeCorpsWeb.ErrorView, accepts: ~w(html json json-api)],
pubsub: [name: CodeCorps.PubSub,
adapter: Phoenix.PubSub.PG2]
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Configures JSON API encoding
config :phoenix, :format_encoders,
"json-api": Poison
# Configures JSON API mime type
config :mime, :types, %{
"application/vnd.api+json" => ["json-api"]
}
config :guardian, Guardian,
issuer: "CodeCorps",
ttl: { 30, :days },
verify_issuer: true, # optional
secret_key: System.get_env("GUARDIAN_SECRET_KEY"),
serializer: CodeCorpsWeb.GuardianSerializer
# Configures ex_aws with credentials
config :ex_aws, :code_corps,
access_key_id: [System.get_env("AWS_ACCESS_KEY_ID"), :instance_role],
secret_access_key: [System.get_env("AWS_SECRET_ACCESS_KEY"), :instance_role]
config :code_corps,
asset_host: System.get_env("CLOUDFRONT_DOMAIN")
config :code_corps,
intercom_identity_secret_key: System.get_env("INTERCOM_IDENTITY_SECRET_KEY")
config :segment,
write_key: System.get_env("SEGMENT_WRITE_KEY")
config :code_corps, :cloudex, Cloudex
config :cloudex,
api_key: System.get_env("CLOUDEX_API_KEY"),
secret: System.get_env("CLOUDEX_SECRET"),
cloud_name: System.get_env("CLOUDEX_CLOUD_NAME")
# Configures random icon color generator
config :code_corps, :icon_color_generator, CodeCorps.RandomIconColor.Generator
# Set Corsica logging to output a console warning when rejecting a request
config :code_corps, :corsica_log_level, [rejected: :warn]
{:ok, pem} = (System.get_env("GITHUB_APP_PEM") || "") |> Base.decode64()
config :code_corps,
github: CodeCorps.GitHub.API.Gateway,
github_app_id: System.get_env("GITHUB_APP_ID"),
github_app_client_id: System.get_env("GITHUB_APP_CLIENT_ID"),
github_app_client_secret: System.get_env("GITHUB_APP_CLIENT_SECRET"),
github_app_pem: pem
config :stripity_stripe,
api_key: System.get_env("STRIPE_SECRET_KEY"),
connect_client_id: System.get_env("STRIPE_PLATFORM_CLIENT_ID")
config :sentry,
dsn: System.get_env("SENTRY_DSN"),
enable_source_code_context: true,
included_environments: ~w(prod staging)a
config :code_corps, :sentry, CodeCorps.Sentry.Async
config :code_corps, :processor, CodeCorps.Processor.Async
config :code_corps, password_reset_timeout: 3600
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env}.exs"
# Import Timber, structured logging
import_config "timber.exs"
import_config "scout_apm.exs"
config :code_corps, CodeCorps.Repo,
loggers: [{Ecto.LogEntry, :log, []},
{ScoutApm.Instruments.EctoLogger, :log, []}]