diff --git a/.env.example b/.env.example index db9d3f7e..af282507 100644 --- a/.env.example +++ b/.env.example @@ -3,3 +3,8 @@ export DISABLE_MAINNET_SYNC=true # Set to true if you want to disable mainnet sy export DISABLE_TESTNET_SYNC=true # Set to true if you want to disable testnet sync export RPC_API_HOST= # Set to your mainnet rpc api host, is will be used in the explorer as "Mainnet" export TESTNET_RPC_API_HOST= # Set to your testnet rpc api host, is will be used in the explorer as "Testnet" +export DB_NAME= # set DB creds +export DB_USER= +export DB_PASS= +export DB_HOST= + diff --git a/config/dev.exs b/config/dev.exs index 9d0113d3..e40d6e2d 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -3,10 +3,10 @@ import Config # Configure your database if System.get_env("DB_TYPE") == "postgresql" do config :starknet_explorer, StarknetExplorer.Repo, - database: "madaraexplorer_dev", - username: "madaraexplorer_user", - password: "madaraexplorerlambda", - hostname: "localhost", + database: System.get_env("DB_NAME", "madaraexplorer_dev"), + username: System.get_env("DB_USER", "madaraexplorer_user"), + password: System.get_env("DB_PASS", "madaraexplorerlambda"), + hostname: System.get_env("DB_HOST", "localhost"), port: 5432 else config :starknet_explorer, StarknetExplorer.Repo,