feat: Public IPFS gateway URL (#10511)

production-fuse
Victor Baranov 4 months ago committed by GitHub
parent a8c0c1ba92
commit 208b0a20b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      apps/block_scout_web/lib/block_scout_web/views/nft_helper.ex
  2. 3
      config/runtime.exs
  3. 4
      docker-compose/envs/common-blockscout.env

@ -84,6 +84,12 @@ defmodule BlockScoutWeb.NFTHelper do
defp ipfs_link(image_url, prefix) do defp ipfs_link(image_url, prefix) do
ipfs_uid = String.slice(image_url, String.length(prefix)..-1//1) ipfs_uid = String.slice(image_url, String.length(prefix)..-1//1)
"https://ipfs.io/ipfs/" <> ipfs_uid public_ipfs_gateway_url =
:indexer
|> Application.get_env(:ipfs)
|> Keyword.get(:public_gateway_url)
|> String.trim_trailing("/")
public_ipfs_gateway_url <> "/" <> ipfs_uid
end end
end end

@ -646,7 +646,8 @@ config :indexer, :ipfs,
gateway_url_param_key: System.get_env("IPFS_GATEWAY_URL_PARAM_KEY"), gateway_url_param_key: System.get_env("IPFS_GATEWAY_URL_PARAM_KEY"),
gateway_url_param_value: System.get_env("IPFS_GATEWAY_URL_PARAM_VALUE"), gateway_url_param_value: System.get_env("IPFS_GATEWAY_URL_PARAM_VALUE"),
gateway_url_param_location: gateway_url_param_location:
ConfigHelper.parse_catalog_value("IPFS_GATEWAY_URL_PARAM_LOCATION", ["query", "header"], true) ConfigHelper.parse_catalog_value("IPFS_GATEWAY_URL_PARAM_LOCATION", ["query", "header"], true),
public_gateway_url: System.get_env("IPFS_PUBLIC_GATEWAY_URL", "https://ipfs.io/ipfs")
config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER") config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER")

@ -367,6 +367,10 @@ EIP_1559_ELASTICITY_MULTIPLIER=2
# AMPLITUDE_API_KEY= # AMPLITUDE_API_KEY=
# AMPLITUDE_URL= # AMPLITUDE_URL=
# IPFS_GATEWAY_URL= # IPFS_GATEWAY_URL=
# IPFS_GATEWAY_URL_PARAM_KEY=
# IPFS_GATEWAY_URL_PARAM_VALUE=
# IPFS_GATEWAY_URL_PARAM_LOCATION=
# IPFS_PUBLIC_GATEWAY_URL=
# ADDRESSES_TABS_COUNTERS_TTL=10m # ADDRESSES_TABS_COUNTERS_TTL=10m
# DENORMALIZATION_MIGRATION_BATCH_SIZE= # DENORMALIZATION_MIGRATION_BATCH_SIZE=
# DENORMALIZATION_MIGRATION_CONCURRENCY= # DENORMALIZATION_MIGRATION_CONCURRENCY=

Loading…
Cancel
Save