Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Move Database Connection Credentials to Environment Variables #391

Merged
merged 6 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ 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=<YOUR_RPC_API_HOST> # Set to your mainnet rpc api host, is will be used in the explorer as "Mainnet"
export TESTNET_RPC_API_HOST=<YOUR_TESTNET_RPC_API_HOST> # Set to your testnet rpc api host, is will be used in the explorer as "Testnet"
export DB_NAME=<DB_NAME> # set DB creds
export DB_USER=<DB_USER>
export DB_PASS=<DB_PASS>
export DB_HOST=<DB_HOST>
anukkrit149 marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
username: System.get.env("DB_USER"),
password: System.get.env("DB_PASS"),
hostname: System.get.env("DB_HOST"),
anukkrit149 marked this conversation as resolved.
Show resolved Hide resolved
port: 5432
else
config :starknet_explorer, StarknetExplorer.Repo,
Expand Down