change default viper config file to ./dev.env, fixes #2, #13

This commit is contained in:
dhax 2024-09-20 02:07:12 +02:00
parent 8c140ba3fa
commit 359d35fdd2
5 changed files with 25 additions and 21 deletions

View file

@ -83,18 +83,14 @@ Package auth/pwdless contains example api tests using a mocked database. Run the
### Environment Variables
By default viper will look at $HOME/.go-base.yaml for a config file. Setting your config as Environment Variables is recommended as by 12-Factor App.
By default viper will look at ./dev.env for a config file. Setting your config as Environment Variables is recommended as by 12-Factor App.
| Name | Type | Default | Description |
| ----------------------- | ------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PORT | string | localhost:3000 | http address (accepts also port number only for heroku compability) |
| LOG_LEVEL | string | debug | log level |
| LOG_TEXTLOGGING | bool | false | defaults to json logging |
| DB_NETWORK | string | tcp | database 'tcp' or 'unix' connection |
| DB_ADDR | string | localhost:5432 | database tcp address or unix socket |
| DB_USER | string | postgres | database user name |
| DB_PASSWORD | string | postgres | database user password |
| DB_DATABASE | string | postgres | database shema name |
| DB_DSN | string | postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable | database dsn connection string |
| AUTH_LOGIN_URL | string | <http://localhost:3000/login> | client login url as sent in login token email |
| AUTH_LOGIN_TOKEN_LENGTH | int | 8 | length of login token |
| AUTH_LOGIN_TOKEN_EXPIRY | time.Duration | 11m | login token expiry |