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 all 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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=<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>

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", "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,
Expand Down
Loading