Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/apps/block_scout_web/config/config.exs

121 lines
3.8 KiB

# This file is responsible for configuring your application
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
import Config
network_path =
"NETWORK_PATH"
|> System.get_env("/")
|> (&(if String.ends_with?(&1, "/") do
String.trim_trailing(&1, "/")
else
&1
end)).()
api_path =
"API_PATH"
|> System.get_env("/")
|> (&(if String.ends_with?(&1, "/") do
String.trim_trailing(&1, "/")
else
&1
end)).()
# General application configuration
config :block_scout_web,
namespace: BlockScoutWeb,
ecto_repos: [Explorer.Repo, Explorer.Repo.Account],
cookie_domain: System.get_env("SESSION_COOKIE_DOMAIN")
config :block_scout_web,
admin_panel_enabled: System.get_env("ADMIN_PANEL_ENABLED", "") == "true"
config :block_scout_web, BlockScoutWeb.Counters.BlocksIndexedCounter, enabled: true
config :block_scout_web, BlockScoutWeb.Counters.InternalTransactionsIndexedCounter, enabled: true
# Configures the endpoint
config :block_scout_web, BlockScoutWeb.Endpoint,
url: [
path: network_path,
api_path: api_path
],
render_errors: [view: BlockScoutWeb.ErrorView, accepts: ~w(html json)],
pubsub_server: BlockScoutWeb.PubSub
config :block_scout_web, BlockScoutWeb.Tracer,
service: :block_scout_web,
adapter: SpandexDatadog.Adapter,
trace_key: :blockscout
# Configures gettext
config :block_scout_web, BlockScoutWeb.Gettext, locales: ~w(en), default_locale: "en"
config :block_scout_web, BlockScoutWeb.SocialMedia,
twitter: "PoaNetwork",
telegram: "poa_network",
facebook: "PoaNetwork",
instagram: "PoaNetwork"
config :block_scout_web, BlockScoutWeb.Chain.TransactionHistoryChartController,
5 years ago
# days
history_size: 30
config :ex_cldr,
default_locale: "en",
default_backend: BlockScoutWeb.Cldr
config :logger, :block_scout_web,
# keep synced with `config/config.exs`
format: "$dateT$time $metadata[$level] $message\n",
metadata:
~w(application fetcher request_id first_block_number last_block_number missing_block_range_count missing_block_count
block_number step count error_count shrunk import_id transaction_id)a,
metadata_filter: [application: :block_scout_web]
config :prometheus, BlockScoutWeb.Prometheus.Instrumenter,
# override default for Phoenix 1.4 compatibility
# * `:transport_name` to `:transport`
# * remove `:vsn`
channel_join_labels: [:channel, :topic, :transport],
# override default for Phoenix 1.4 compatibility
# * `:transport_name` to `:transport`
# * remove `:vsn`
channel_receive_labels: [:channel, :topic, :transport, :event]
config :spandex_phoenix, tracer: BlockScoutWeb.Tracer
config :wobserver,
# return only the local node
discovery: :none,
mode: :plug
config :block_scout_web, BlockScoutWeb.ApiRouter,
writing_enabled: System.get_env("DISABLE_WRITE_API") != "true",
reading_enabled: System.get_env("DISABLE_READ_API") != "true",
wobserver_enabled: System.get_env("WOBSERVER_ENABLED") == "true"
config :block_scout_web, BlockScoutWeb.WebRouter, enabled: System.get_env("DISABLE_WEBAPP") != "true"
config :block_scout_web, BlockScoutWeb.CSPHeader,
mixpanel_url: System.get_env("MIXPANEL_URL", "https://api-js.mixpanel.com"),
amplitude_url: System.get_env("AMPLITUDE_URL", "https://api2.amplitude.com/2/httpapi")
Account/Watchlist/Notifications (#13) * Auth for debug Fix for Auth callback calls endless cycle * Logout from auth0 and add profile picture Fix styles in signin/signout * Add profile * Update dockerfiles * Make auth paths dependent of API_PATH * Change api_path to network_path * Save identity from auth into DB * Hardcode urls to make it work again Style fixes * Change sign_in icon * Create Watchlist together with identity * Add watchlist show * Add watchlist addresses Fix creating account on first login Make address as it should look like * Associate watchlist with addresses * Create watchlist address UI Add balance in coin (need to use right coin) * Add tokens on watchlist Fix warnings Fix topnav styles * Add watch_ and notify_ fields in WatchlistAddress * Notifications draft Style fixes Removed divider Watchlist Address Form: ERC-721 & ERC-1155 -> NFT Form style -> modal Move Auth into Account module Add any valid address to watchlist Fix profile namespace in router Fixes in build Notification Fixed insert notifications * Send Emails via SendGrid * Add AUTH0 & SENDGRID API keys to Makefile * Finish email variables Fix warnings Add links to email * Update & Delete Watchlist Addresses Fix styles Fix warnings * Authorize create/update watchlist_address Fix credo warnings * Refactoring and fix UI * Introduce sender & template ENVs * Fix credo warns * Fix formatter & dialyzer * Make Notifier main entrypoint * Fix tests * Fix comments * Hardcode auth0 callbacks for prod env Export it in dev env and it should work: ``` export AUTH0_CALLBACK_URL='http://localhost:4000/auth/auth0/callback' export AUTH0_LOGOUT_RETURN_URL='http://localhost:4000/auth/logout' ``` * Style fixes * Private tags on address/transaction/token pages * Add account logger * fix email subject * Fix token_transfers notifications * Prepare for release * Fix transaction dropdown * Remoe unwanted changes * Reset CI cache * Fix Dialyzer, gettext * Add logout_return_to_url to :ueberauth config for test env * Invalidate GA cache * Redefine sign_in_link for test env * Fix adding address with disabled checkboxes Remove testnet hardcode from prod config CI fix attempt * Add AUTH0_LOGOUT_URL env * Fix logger warning * current_user/1, check that mapping contains :current_user object before executing get_session function * Fix current_user * Final fix of current_user/1 * Introduce COIN_NAME env * Lowercase hashes in email * Style fix * Add block_url to email * Fix creating notifications for NFT * Add notifier to token_transfers import runner * Add processing transfer into Notifier * Fix token transfer summary * WIP: Account refactoring (#19) * Move Ueberauth settings to config.exs * Make AuthController more clear * Fix error when build_watchlist_notification returns nil * Set WatchlistAddressForm defaults * Style fix * Fix double send email for tokens * Style fix WatchlistController * Style fix AddWatchlistAddress * Style fix UserFromAuth * Use Logger instead AccountLogger * Credo fix * Fix AddWatchlistAddress * Fix Notifier Co-authored-by: Oleg Sovetnik <sovetnik@oblaka.biz> Co-authored-by: nikitosing <nikitosing4@mail.ru>
3 years ago
# Configures Ueberauth local settings
config :ueberauth, Ueberauth,
providers: [
auth0: {
Ueberauth.Strategy.Auth0,
[callback_path: "/auth/auth0/callback", callback_params: ["path"]]
Account/Watchlist/Notifications (#13) * Auth for debug Fix for Auth callback calls endless cycle * Logout from auth0 and add profile picture Fix styles in signin/signout * Add profile * Update dockerfiles * Make auth paths dependent of API_PATH * Change api_path to network_path * Save identity from auth into DB * Hardcode urls to make it work again Style fixes * Change sign_in icon * Create Watchlist together with identity * Add watchlist show * Add watchlist addresses Fix creating account on first login Make address as it should look like * Associate watchlist with addresses * Create watchlist address UI Add balance in coin (need to use right coin) * Add tokens on watchlist Fix warnings Fix topnav styles * Add watch_ and notify_ fields in WatchlistAddress * Notifications draft Style fixes Removed divider Watchlist Address Form: ERC-721 & ERC-1155 -> NFT Form style -> modal Move Auth into Account module Add any valid address to watchlist Fix profile namespace in router Fixes in build Notification Fixed insert notifications * Send Emails via SendGrid * Add AUTH0 & SENDGRID API keys to Makefile * Finish email variables Fix warnings Add links to email * Update & Delete Watchlist Addresses Fix styles Fix warnings * Authorize create/update watchlist_address Fix credo warnings * Refactoring and fix UI * Introduce sender & template ENVs * Fix credo warns * Fix formatter & dialyzer * Make Notifier main entrypoint * Fix tests * Fix comments * Hardcode auth0 callbacks for prod env Export it in dev env and it should work: ``` export AUTH0_CALLBACK_URL='http://localhost:4000/auth/auth0/callback' export AUTH0_LOGOUT_RETURN_URL='http://localhost:4000/auth/logout' ``` * Style fixes * Private tags on address/transaction/token pages * Add account logger * fix email subject * Fix token_transfers notifications * Prepare for release * Fix transaction dropdown * Remoe unwanted changes * Reset CI cache * Fix Dialyzer, gettext * Add logout_return_to_url to :ueberauth config for test env * Invalidate GA cache * Redefine sign_in_link for test env * Fix adding address with disabled checkboxes Remove testnet hardcode from prod config CI fix attempt * Add AUTH0_LOGOUT_URL env * Fix logger warning * current_user/1, check that mapping contains :current_user object before executing get_session function * Fix current_user * Final fix of current_user/1 * Introduce COIN_NAME env * Lowercase hashes in email * Style fix * Add block_url to email * Fix creating notifications for NFT * Add notifier to token_transfers import runner * Add processing transfer into Notifier * Fix token transfer summary * WIP: Account refactoring (#19) * Move Ueberauth settings to config.exs * Make AuthController more clear * Fix error when build_watchlist_notification returns nil * Set WatchlistAddressForm defaults * Style fix * Fix double send email for tokens * Style fix WatchlistController * Style fix AddWatchlistAddress * Style fix UserFromAuth * Use Logger instead AccountLogger * Credo fix * Fix AddWatchlistAddress * Fix Notifier Co-authored-by: Oleg Sovetnik <sovetnik@oblaka.biz> Co-authored-by: nikitosing <nikitosing4@mail.ru>
3 years ago
}
]
Account/Watchlist/Notifications (#13) * Auth for debug Fix for Auth callback calls endless cycle * Logout from auth0 and add profile picture Fix styles in signin/signout * Add profile * Update dockerfiles * Make auth paths dependent of API_PATH * Change api_path to network_path * Save identity from auth into DB * Hardcode urls to make it work again Style fixes * Change sign_in icon * Create Watchlist together with identity * Add watchlist show * Add watchlist addresses Fix creating account on first login Make address as it should look like * Associate watchlist with addresses * Create watchlist address UI Add balance in coin (need to use right coin) * Add tokens on watchlist Fix warnings Fix topnav styles * Add watch_ and notify_ fields in WatchlistAddress * Notifications draft Style fixes Removed divider Watchlist Address Form: ERC-721 & ERC-1155 -> NFT Form style -> modal Move Auth into Account module Add any valid address to watchlist Fix profile namespace in router Fixes in build Notification Fixed insert notifications * Send Emails via SendGrid * Add AUTH0 & SENDGRID API keys to Makefile * Finish email variables Fix warnings Add links to email * Update & Delete Watchlist Addresses Fix styles Fix warnings * Authorize create/update watchlist_address Fix credo warnings * Refactoring and fix UI * Introduce sender & template ENVs * Fix credo warns * Fix formatter & dialyzer * Make Notifier main entrypoint * Fix tests * Fix comments * Hardcode auth0 callbacks for prod env Export it in dev env and it should work: ``` export AUTH0_CALLBACK_URL='http://localhost:4000/auth/auth0/callback' export AUTH0_LOGOUT_RETURN_URL='http://localhost:4000/auth/logout' ``` * Style fixes * Private tags on address/transaction/token pages * Add account logger * fix email subject * Fix token_transfers notifications * Prepare for release * Fix transaction dropdown * Remoe unwanted changes * Reset CI cache * Fix Dialyzer, gettext * Add logout_return_to_url to :ueberauth config for test env * Invalidate GA cache * Redefine sign_in_link for test env * Fix adding address with disabled checkboxes Remove testnet hardcode from prod config CI fix attempt * Add AUTH0_LOGOUT_URL env * Fix logger warning * current_user/1, check that mapping contains :current_user object before executing get_session function * Fix current_user * Final fix of current_user/1 * Introduce COIN_NAME env * Lowercase hashes in email * Style fix * Add block_url to email * Fix creating notifications for NFT * Add notifier to token_transfers import runner * Add processing transfer into Notifier * Fix token transfer summary * WIP: Account refactoring (#19) * Move Ueberauth settings to config.exs * Make AuthController more clear * Fix error when build_watchlist_notification returns nil * Set WatchlistAddressForm defaults * Style fix * Fix double send email for tokens * Style fix WatchlistController * Style fix AddWatchlistAddress * Style fix UserFromAuth * Use Logger instead AccountLogger * Credo fix * Fix AddWatchlistAddress * Fix Notifier Co-authored-by: Oleg Sovetnik <sovetnik@oblaka.biz> Co-authored-by: nikitosing <nikitosing4@mail.ru>
3 years ago
3 years ago
config :hammer,
backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"