Skip to content

Commit

Permalink
Add environment variables to the config files
Browse files Browse the repository at this point in the history
  • Loading branch information
acravenho authored and feliperenan committed Oct 2, 2018
1 parent bad0a5e commit 3e58963
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 19 deletions.
41 changes: 30 additions & 11 deletions apps/block_scout_web/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions apps/block_scout_web/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ config :block_scout_web,
namespace: BlockScoutWeb,
ecto_repos: [Explorer.Repo]

config :block_scout_web, BlockScoutWeb.Chain, logo: "/images/poa_logo.svg"
config :block_scout_web, BlockScoutWeb.Chain,
network: System.get_env("NETWORK"),
subnetwork: System.get_env("SUBNETWORK"),
network_icon: System.get_env("NETWORK_ICON"),
logo: System.get_env("LOGO")

# Configures the endpoint
config :block_scout_web, BlockScoutWeb.Endpoint,
instrumenters: [BlockScoutWeb.Prometheus.Instrumenter],
url: [host: "localhost"],
url: [
host: "localhost",
path: System.get_env("NETWORK_PATH") || "/"
],
render_errors: [view: BlockScoutWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: BlockScoutWeb.PubSub, adapter: Phoenix.PubSub.PG2]

Expand Down
2 changes: 1 addition & 1 deletion apps/block_scout_web/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json",
force_ssl: false,
secret_key_base: System.get_env("SECRET_KEY_BASE"),
check_origin: ["//*.blockscout.com", "//*.elb.amazonaws.com"],
check_origin: System.get_env("CHECK_ORIGIN") || false,
http: [port: System.get_env("PORT")],
url: [
scheme: "http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<!-- ICON FOR MAINNET -->
<span class="nav-link-icon">
<%= render BlockScoutWeb.IconsView, "_network_icon.html" %>
<%= render BlockScoutWeb.IconsView, Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:network_icon] %>
</span>
<!-- ICON FOR TESTNET -->
<!-- <span class="nav-link-icon">
<%= render BlockScoutWeb.IconsView, "_test_network_icon.html" %>
</span> -->
<%= gettext("POA Core") %>
<%= Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:subnetwork] %>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="https://sokol.blockscout.com/"><%= gettext("POA Sokol") %></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= gettext "BlockScout" %></title>
<title><%= Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:subnetwork] <> " Explorer - " <> Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:network] <> " by BlockScout" %></title>
<link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

<link rel="apple-touch-icon" sizes="180x180" href="<%= static_path(@conn, "/apple-touch-icon.png") %>">
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config :ecto, json_library: Jason
# General application configuration
config :explorer,
ecto_repos: [Explorer.Repo],
coin: "POA"
coin: System.get_env("COIN") || "POA"

config :explorer, Explorer.Integrations.EctoLogger, query_time_ms_threshold: 2_000

Expand Down
1 change: 0 additions & 1 deletion bin/deployment/health_check
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

set -e

# Timeout after 2 min if we still haven't gotten a response
timeout 120s bash <<EOT
# Wait until an HTTP request succeeds against localhost:PORT
Expand Down

0 comments on commit 3e58963

Please sign in to comment.