File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 99 "math/big"
1010 "net/url"
1111 "os"
12+ "strconv"
1213 "time"
1314
1415 "github.com/BurntSushi/toml"
@@ -210,6 +211,17 @@ func (cc ChainConfig) FullNodeURL() (*url.URL, error) {
210211}
211212
212213var envOverrides = map [string ]func (* Config , string ){
214+ "DB_HOST" : func (c * Config , v string ) { c .DB .Host = v },
215+ "DB_PORT" : func (c * Config , v string ) {
216+ port , err := strconv .Atoi (v )
217+ if err == nil {
218+ c .DB .Port = port
219+ } else {
220+ // The logger is not yet initialized here, so we use fmt.Printf
221+ fmt .Printf ("ERROR: Invalid DB_PORT value: %s\n " , v )
222+ }
223+ },
224+ "DB_DATABASE" : func (c * Config , v string ) { c .DB .Database = v },
213225 "DB_USERNAME" : func (c * Config , v string ) { c .DB .Username = v },
214226 "DB_PASSWORD" : func (c * Config , v string ) { c .DB .Password = v },
215227 "NODE_URL" : func (c * Config , v string ) { c .Chain .NodeURL = v },
You can’t perform that action at this time.
0 commit comments