-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from opencrvs/ocrvs-5932-country-config
refactor(env-vars): validate country-config environment variables
- Loading branch information
Showing
5 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* OpenCRVS is also distributed under the terms of the Civil Registration | ||
* & Healthcare Disclaimer located at http://opencrvs.org/license. | ||
* | ||
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. | ||
*/ | ||
import { bool, cleanEnv, port, str, url } from 'envalid' | ||
|
||
export const env = cleanEnv(process.env, { | ||
DOMAIN: str({ devDefault: '*' }), | ||
GATEWAY_URL: url({ devDefault: 'http://localhost:7070' }), | ||
LOGIN_URL: url({ devDefault: 'http://localhost:3020/' }), | ||
CLIENT_APP_URL: url({ devDefault: 'http://localhost:3000/' }), | ||
FHIR_URL: url({ devDefault: 'http://localhost:3447/fhir' }), | ||
COUNTRY_CONFIG_HOST: str({ devDefault: '0.0.0.0' }), | ||
COUNTRY_CONFIG_PORT: port({ default: 3040 }), | ||
AUTH_URL: url({ devDefault: 'http://localhost:4040' }), | ||
COUNTRY_CONFIG_URL: url({ devDefault: 'http://localhost:3040' }), | ||
APPLICATION_CONFIG_URL: url({ devDefault: 'http://localhost:2021/' }), | ||
SENTRY_DSN: str({ default: undefined }), | ||
CHECK_INVALID_TOKEN: bool({ | ||
devDefault: false, | ||
desc: 'Check if the token has been invalidated in the auth service before it has expired' | ||
}), | ||
CONFIRM_REGISTRATION_URL: url({ | ||
devDefault: 'http://localhost:5050/confirm/registration' | ||
}), | ||
QA_ENV: bool({ default: false }) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3777,6 +3777,13 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: | |
dependencies: | ||
once "^1.4.0" | ||
|
||
envalid@^8.0.0: | ||
version "8.0.0" | ||
resolved "https://registry.yarnpkg.com/envalid/-/envalid-8.0.0.tgz#2314451e18e88051c98540ab60640e330279e486" | ||
integrity sha512-PGeYJnJB5naN0ME6SH8nFcDj9HVbLpYIfg1p5lAyM9T4cH2lwtu2fLbozC/bq+HUUOIFxhX/LP0/GmlqPHT4tQ== | ||
dependencies: | ||
tslib "2.6.2" | ||
|
||
error-ex@^1.3.1: | ||
version "1.3.2" | ||
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" | ||
|
@@ -7322,6 +7329,11 @@ tslib@2: | |
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" | ||
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== | ||
|
||
[email protected]: | ||
version "2.6.2" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" | ||
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== | ||
|
||
tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: | ||
version "1.14.1" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" | ||
|