-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathprod.exs
More file actions
84 lines (71 loc) · 2.79 KB
/
Copy pathprod.exs
File metadata and controls
84 lines (71 loc) · 2.79 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
import Config
# For production, we often load configuration from external
# sources, such as your system environment. For this reason,
# you won't find the :http configuration below, but set inside
# OrcasiteWeb.Endpoint.init/2 when load_from_system_env is
# true. Any dynamic configuration should be done there.
#
# Don't forget to configure the url host to something meaningful,
# Phoenix uses this information when generating URLs.
#
# Finally, we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the mix phx.digest task
# which you typically run after static files are built.
config :orcasite, OrcasiteWeb.Endpoint,
force_ssl: [rewrite_on: [:x_forwarded_proto]],
watchers: [npm: ["run", "start", cd: Path.expand("../ui", __DIR__)]],
check_origin: (System.get_env("URLS") || "") |> String.split(" ")
# Configure your database
config :orcasite, Orcasite.Repo,
adapter: Ecto.Adapters.Postgres,
ssl: true,
types: Orcasite.PostgresTypes,
ssl_opts: [
verify: :verify_none
]
# Do not print debug messages in production
config :logger, level: :info, format: {Orcasite.Logger, :format}
config :orcasite, :orcasite_s3_url, System.get_env("ORCASITE_S3_URL")
config :orcasite, Orcasite.Mailer,
adapter: Swoosh.Adapters.AmazonSES,
region: "us-west-2",
access_key: System.get_env("AWS_ACCESS_KEY_ID"),
secret: System.get_env("AWS_SECRET_ACCESS_KEY")
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Orcasite.Finch
config :orcasite, OrcasiteWeb.Guardian,
issuer: "orcasite",
secret_key: System.get_env("GUARDIAN_SECRET_KEY")
config :orcasite, OrcasiteWeb.BasicAuth,
username: System.get_env("ADMIN_USER"),
password: System.get_env("ADMIN_PASSWORD")
if System.get_env("REDIS_URL", "") != "" do
redis_ssl = String.starts_with?(System.get_env("REDIS_URL"), "rediss://")
config :orcasite, :cache_adapter, NebulexRedisAdapter
config :orcasite, Orcasite.Cache,
conn_opts:
[
url: System.get_env("REDIS_URL"),
ssl: redis_ssl
]
|> Keyword.merge(if redis_ssl, do: [socket_opts: [verify: :verify_none]], else: []),
pool_size: System.get_env("REDIS_CACHE_POOL_SIZE", "5") |> String.to_integer()
config :hammer,
backend:
{Hammer.Backend.Redis,
[
delete_buckets_timeout: 10_000,
expiry_ms: 60_000 * 60 * 2,
redis_url: System.get_env("REDIS_URL"),
redix_config:
[
ssl: redis_ssl
]
|> Keyword.merge(if redis_ssl, do: [socket_opts: [verify: :verify_none]], else: [])
]}
else
config :orcasite, :cache_adapter, Nebulex.Adapters.Local
config :hammer,
backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}
end
config :orcasite, :env, :prod