this repo has no description
at main 2.3 kB view raw
1import Config 2 3alias EslHn.ConfigReader, as: CR 4 5# ## Using releases 6# 7# If you use `mix release`, you need to explicitly enable the server 8# by passing the PHX_SERVER=true when you start it: 9# 10# PHX_SERVER=true bin/esl_hn start 11# 12# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server` 13# script that automatically sets the env var above. 14if System.get_env("PHX_SERVER") do 15 config :esl_hn, EslHnWeb.Endpoint, server: true 16end 17 18if config_env() == :prod do 19 config :esl_hn, 20 refresh: CR.duration("ESL_HN_REFRESH", {:minutes, 5}) 21 22 secret_key_base = 23 System.get_env("SECRET_KEY_BASE") || 24 raise """ 25 environment variable SECRET_KEY_BASE is missing. 26 You can generate one by calling: mix phx.gen.secret 27 """ 28 29 host = System.get_env("PHX_HOST") || "example.com" 30 port = String.to_integer(System.get_env("PORT") || "4000") 31 32 config :esl_hn, EslHnWeb.Endpoint, 33 url: [host: host, port: 443, scheme: "https"], 34 http: [ 35 ip: {0, 0, 0, 0, 0, 0, 0, 0}, 36 port: port 37 ], 38 secret_key_base: secret_key_base 39 40 # ## SSL Support 41 # 42 # To get SSL working, you will need to add the `https` key 43 # to your endpoint configuration: 44 # 45 # config :esl_hn, EslHnWeb.Endpoint, 46 # https: [ 47 # ..., 48 # port: 443, 49 # cipher_suite: :strong, 50 # keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), 51 # certfile: System.get_env("SOME_APP_SSL_CERT_PATH") 52 # ] 53 # 54 # The `cipher_suite` is set to `:strong` to support only the 55 # latest and more secure SSL ciphers. This means old browsers 56 # and clients may not be supported. You can set it to 57 # `:compatible` for wider support. 58 # 59 # `:keyfile` and `:certfile` expect an absolute path to the key 60 # and cert in disk or a relative path inside priv, for example 61 # "priv/ssl/server.key". For all supported SSL configuration 62 # options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1 63 # 64 # We also recommend setting `force_ssl` in your config/prod.exs, 65 # ensuring no data is ever sent via http, always redirecting to https: 66 # 67 # config :esl_hn, EslHnWeb.Endpoint, 68 # force_ssl: [hsts: true] 69 # 70 # Check `Plug.SSL` for all available options in `force_ssl`. 71end