Skip to content

Commit

Permalink
feat: make default credentials for auth customizable
Browse files Browse the repository at this point in the history
The current implementation defaults to username: `admin` and password: `zwave` when enabling auth. However, it can also be beneficial to make this customizable so that it can avoid some additional steps in updating these values.This is completely backwards compatible as well.
  • Loading branch information
karmingc committed Sep 18, 2024
1 parent 2557cbc commit 8894d18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const backupsDir: string =
export const nvmBackupsDir: string = joinPath(backupsDir, 'nvm')
export const storeBackupsDir: string = joinPath(backupsDir, 'store')

export const defaultUser: string = 'admin'
export const defaultPsw: string = 'zwave'
export const defaultUser: string = process.env.DEFAULT_USERNAME || 'admin'
export const defaultPsw: string = process.env.DEFAULT_PASSWORD || 'zwave'
// lgtm [js/hardcoded-credentials]
export const sessionSecret: string =
process.env.SESSION_SECRET || 'DEFAULT_SESSION_SECRET_CHANGE_ME'
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This is the list of the supported environment variables:

- `DEFAULT_USERNAME`: The default username when auth is enabled.
- `DEFAULT_PASSWORD`: The default password when auth is enabled.
- `NETWORK_KEY`: Z-Wave S0 Network key. **Deprecated**
- Network keys:
- `KEY_S0_Legacy`
Expand Down

0 comments on commit 8894d18

Please sign in to comment.