Extract exthereum configuration to environment variables and config/dev.secret.exs

pull/2/head
Doc Ritezel 7 years ago committed by CJ Bryan and Matt Olenick
parent 46b796bb65
commit 63efe24b36
  1. 1
      README.md
  2. 11
      config/config.exs
  3. 2
      config/dev.exs
  4. 11
      config/dev.secret.exs.example
  5. 5
      config/prod.exs
  6. 8
      config/test.exs
  7. 10
      mix.exs

@ -22,6 +22,7 @@ This is a tool for inspecting and analyzing the POA Network blockchain.
To get POA Explorer up and running locally: To get POA Explorer up and running locally:
* Set up some default configuration with: `$ cp config/dev.secrets.esx.example config/dev.secrets.esx`
* Install dependencies with `$ mix do deps.get, local.rebar, deps.compile, compile` * Install dependencies with `$ mix do deps.get, local.rebar, deps.compile, compile`
* Create and migrate your database with `$ mix ecto.create && mix ecto.migrate` * Create and migrate your database with `$ mix ecto.create && mix ecto.migrate`
* Install Node.js dependencies with `$ cd assets && npm install && cd ..` * Install Node.js dependencies with `$ cd assets && npm install && cd ..`

@ -15,7 +15,6 @@ config :explorer, ExplorerWeb.Gettext, locales: ~w(en), default_locale: "en"
# Configures the endpoint # Configures the endpoint
config :explorer, ExplorerWeb.Endpoint, config :explorer, ExplorerWeb.Endpoint,
url: [host: "localhost"], url: [host: "localhost"],
secret_key_base: "RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5",
render_errors: [view: ExplorerWeb.ErrorView, accepts: ~w(html json)], render_errors: [view: ExplorerWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: Explorer.PubSub, adapter: Phoenix.PubSub.PG2] pubsub: [name: Explorer.PubSub, adapter: Phoenix.PubSub.PG2]
@ -24,11 +23,11 @@ config :logger, :console,
format: "$time $metadata[$level] $message\n", format: "$time $metadata[$level] $message\n",
metadata: [:request_id] metadata: [:request_id]
config :ethereumex,
scheme: "http",
host: "localhost",
port: 8545
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.
import_config "#{Mix.env}.exs" import_config "#{Mix.env}.exs"
config :ethereumex,
scheme: "https",
host: "sokol.poa.network",
port: 443

@ -54,3 +54,5 @@ config :explorer, Explorer.Repo,
database: "explorer_dev", database: "explorer_dev",
hostname: "localhost", hostname: "localhost",
pool_size: 10 pool_size: 10
import_config "dev.secret.exs"

@ -0,0 +1,11 @@
use Mix.Config
# Configure ethereumex
config :ethereumex,
scheme: "http",
host: "localhost",
port: 8545
# Configures the endpoint
config :explorer, ExplorerWeb.Endpoint,
secret_key_base: "RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5"

@ -35,3 +35,8 @@ config :explorer, Explorer.Repo,
config :new_relixir, config :new_relixir,
application_name: System.get_env("NEW_RELIC_APP_NAME"), application_name: System.get_env("NEW_RELIC_APP_NAME"),
license_key: System.get_env("NEW_RELIC_LICENSE_KEY") license_key: System.get_env("NEW_RELIC_LICENSE_KEY")
config :ethereumex,
scheme: System.get_env("ETHEREUM_SCHEME"),
host: System.get_env("ETHEREUM_HOST"),
port: System.get_env("ETHEREUM_PORT")

@ -4,6 +4,7 @@ use Mix.Config
# you can enable the server option below. # you can enable the server option below.
config :explorer, ExplorerWeb.Endpoint, config :explorer, ExplorerWeb.Endpoint,
http: [port: 4001], http: [port: 4001],
secret_key_base: "27Swe6KtEtmN37WyEYRjKWyxYULNtrxlkCEKur4qoV+Lwtk8lafsR16ifz1XBBYj",
server: true server: true
config :explorer, :sql_sandbox, true config :explorer, :sql_sandbox, true
@ -18,6 +19,13 @@ config :explorer, Explorer.Repo,
hostname: "localhost", hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox pool: Ecto.Adapters.SQL.Sandbox
# Configure wallaby
config :wallaby, config :wallaby,
screenshot_on_failure: true, screenshot_on_failure: true,
chrome: [headless: false] chrome: [headless: false]
# Configure ethereumex
config :ethereumex,
scheme: "https",
host: "sokol.poa.network",
port: 443

@ -25,12 +25,14 @@ defmodule Explorer.Mixfile do
end end
# Specifies which paths to compile per environment. # Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(:test), do: ["test/support" | elixirc_paths()]
defp elixirc_paths(_), do: ["lib"] defp elixirc_paths(_), do: elixirc_paths()
defp elixirc_paths, do: ["lib"]
# Specifies extra applications to start per environment # Specifies extra applications to start per environment
defp extra_applications(:prod), do: [:ethereumex, :timex, :timex_ecto, :set_locale, :logger, :runtime_tools, :phoenix_pubsub_redis, :new_relixir] defp extra_applications(:prod), do: [:phoenix_pubsub_redis, :new_relixir | extra_applications()]
defp extra_applications(_), do: [:ethereumex, :timex, :timex_ecto, :set_locale, :logger, :runtime_tools] defp extra_applications(_), do: extra_applications()
defp extra_applications, do: [:ethereumex, :timex, :timex_ecto, :set_locale, :logger, :runtime_tools]
# Specifies your project dependencies. # Specifies your project dependencies.
# #

Loading…
Cancel
Save