|
| 1 | +use Mix.Config |
| 2 | + |
| 3 | +# For production, we configure the host to read the PORT |
| 4 | +# from the system environment. Therefore, you will need |
| 5 | +# to set PORT=80 before running your server. |
| 6 | +# |
| 7 | +# You should also configure the url host to something |
| 8 | +# meaningful, we use this information when generating URLs. |
| 9 | +# |
| 10 | +# Finally, we also include the path to a manifest |
| 11 | +# containing the digested version of static files. This |
| 12 | +# manifest is generated by the mix phoenix.digest task |
| 13 | +# which you typically run after static files are built. |
| 14 | +config :code_corps, CodeCorps.Endpoint, |
| 15 | + http: [port: {:system, "PORT"}], |
| 16 | + url: [scheme: "http", host: "api.pbqrpbecf-qri.org", port: 80], |
| 17 | + secret_key_base: System.get_env("SECRET_KEY_BASE") |
| 18 | + |
| 19 | +# Configure your database |
| 20 | +config :code_corps, CodeCorps.Repo, |
| 21 | + adapter: Ecto.Adapters.Postgres, |
| 22 | + url: System.get_env("DATABASE_URL"), |
| 23 | + pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), |
| 24 | + ssl: true |
| 25 | + |
| 26 | +# CORS allowed origins |
| 27 | +config :code_corps, allowed_origins: [ |
| 28 | + "http://pbqrpbecf-qri.org", |
| 29 | + "http://www.pbqrpbecf-qri.org", |
| 30 | + "https://pbqrpbecf-qri.org", |
| 31 | + "https://www.pbqrpbecf-qri.org" |
| 32 | +] |
| 33 | + |
| 34 | +config :guardian, Guardian, |
| 35 | + secret_key: System.get_env("GUARDIAN_SECRET_KEY") |
| 36 | + |
| 37 | +# Do not print debug messages in production |
| 38 | +config :logger, level: :info |
| 39 | + |
| 40 | +# ## SSL Support |
| 41 | +# |
| 42 | +# To get SSL working, you will need to add the `https` key |
| 43 | +# to the previous section and set your `:url` port to 443: |
| 44 | +# |
| 45 | +# config :code_corps, CodeCorps.Endpoint, |
| 46 | +# ... |
| 47 | +# url: [host: "example.com", port: 443], |
| 48 | +# https: [port: 443, |
| 49 | +# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), |
| 50 | +# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")] |
| 51 | +# |
| 52 | +# Where those two env variables return an absolute path to |
| 53 | +# the key and cert in disk or a relative path inside priv, |
| 54 | +# for example "priv/ssl/server.key". |
| 55 | +# |
| 56 | +# We also recommend setting `force_ssl`, ensuring no data is |
| 57 | +# ever sent via http, always redirecting to https: |
| 58 | +# |
| 59 | +# config :code_corps, CodeCorps.Endpoint, |
| 60 | +# force_ssl: [hsts: true] |
| 61 | +# |
| 62 | +# Check `Plug.SSL` for all available options in `force_ssl`. |
| 63 | + |
| 64 | +# ## Using releases |
| 65 | +# |
| 66 | +# If you are doing OTP releases, you need to instruct Phoenix |
| 67 | +# to start the server for all endpoints: |
| 68 | +# |
| 69 | +# config :phoenix, :serve_endpoints, true |
| 70 | +# |
| 71 | +# Alternatively, you can configure exactly which server to |
| 72 | +# start per endpoint: |
| 73 | +# |
| 74 | +# config :code_corps, CodeCorps.Endpoint, server: true |
| 75 | +# |
| 76 | +# You will also need to set the application root to `.` in order |
| 77 | +# for the new static assets to be served after a hot upgrade: |
| 78 | +# |
| 79 | +# config :code_corps, CodeCorps.Endpoint, root: "." |
0 commit comments