-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathprod.exs
111 lines (97 loc) · 3.51 KB
/
prod.exs
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
103
104
105
106
107
108
109
110
111
use Mix.Config
# For production, we configure the host to read the PORT
# from the system environment. Therefore, you will need
# to set PORT=80 before running your server.
#
# You should also configure the url host to something
# meaningful, we use this information when generating URLs.
#
# Finally, we also include the path to a manifest
# containing the digested version of static files. This
# manifest is generated by the mix phoenix.digest task
# which you typically run after static files are built.
config :code_corps, CodeCorpsWeb.Endpoint,
http: [port: {:system, "PORT"}],
instrumenters: [Timber.PhoenixInstrumenter],
url: [scheme: "https", host: "api.codecorps.org", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
secret_key_base: System.get_env("SECRET_KEY_BASE")
config :code_corps, site_url: "https://www.codecorps.org"
# Configure your database
config :code_corps, CodeCorps.Repo,
adapter: Ecto.Adapters.Postgres,
loggers: [{Timber.Ecto, :log, [:info]}],
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: true
# CORS allowed origins
config :code_corps, allowed_origins: [
"http://codecorps.org",
"http://www.codecorps.org",
"https://codecorps.org",
"https://www.codecorps.org"
]
config :code_corps, CodeCorps.Guardian,
secret_key: System.get_env("GUARDIAN_SECRET_KEY")
# Timber logging
config :logger,
level: :info,
backends: [Timber.Logger]
config :timber, :transport, Timber.Transports.IODevice
# Configures Segment for analytics
config :code_corps, :analytics, CodeCorps.Analytics.SegmentAPI
# Configures stripe for production
config :code_corps, :stripe, Stripe
config :code_corps, :stripe_env, :prod
# Configure elasticsearch
config :code_corps, :elasticsearch_url, "http://0.0.0.0:9200"
config :sentry,
environment_name: Mix.env || :prod
config :code_corps, CodeCorps.Mailer,
adapter: Bamboo.PostmarkAdapter,
api_key: System.get_env("POSTMARK_API_KEY")
config :code_corps,
postmark_forgot_password_template: "1989483",
postmark_organization_invite_email_template: "3441863",
postmark_project_acceptance_template: "1447041",
postmark_project_request_template: "4017262",
postmark_receipt_template: "1255222"
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key
# to the previous section and set your `:url` port to 443:
#
# config :code_corps, CodeCorpsWeb.Endpoint,
# ...
# url: [host: "example.com", port: 443],
# https: [port: 443,
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")]
#
# Where those two env variables return an absolute path to
# the key and cert in disk or a relative path inside priv,
# for example "priv/ssl/server.key".
#
# We also recommend setting `force_ssl`, ensuring no data is
# ever sent via http, always redirecting to https:
#
# config :code_corps, CodeCorpsWeb.Endpoint,
# force_ssl: [hsts: true]
#
# Check `Plug.SSL` for all available options in `force_ssl`.
# ## Using releases
#
# If you are doing OTP releases, you need to instruct Phoenix
# to start the server for all endpoints:
#
# config :phoenix, :serve_endpoints, true
#
# Alternatively, you can configure exactly which server to
# start per endpoint:
#
# config :code_corps, CodeCorpsWeb.Endpoint, server: true
#
# You will also need to set the application root to `.` in order
# for the new static assets to be served after a hot upgrade:
#
# config :code_corps, CodeCorpsWeb.Endpoint, root: "."