Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Feature/tighten validation rule of base currency (#1428)
Thomas Kaul3b4da72ea307
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cf67a1c5a8..5fe8f9e28c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).+## Unreleased++### Changed++- Tightened the validation rule of the base currency environment variable (`BASE_CURRENCY`)+## 1.209.0 - 05.11.2022### Addeddiff --git a/README.md b/README.mdindex a96db529a0..9d038aa41a 100644--- a/README.md+++ b/README.md@@ -83,20 +83,20 @@ We provide official container images hosted on [Docker Hub](https://hub.docker.c### Supported Environment Variables-| Name | Default Value | Description |-| ------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |-| `ACCESS_TOKEN_SALT` | | A random string used as salt for access tokens |-| `BASE_CURRENCY` | `USD` | The base currency of the Ghostfolio application. Caution: This cannot be changed later! |-| `DATABASE_URL` | | The database connection URL, e.g. `postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?sslmode=prefer` |-| `HOST` | `0.0.0.0` | The host where the Ghostfolio application will run on |-| `JWT_SECRET_KEY` | | A random string used for _JSON Web Tokens_ (JWT) |-| `PORT` | `3333` | The port where the Ghostfolio application will run on |-| `POSTGRES_DB` | | The name of the _PostgreSQL_ database |-| `POSTGRES_PASSWORD` | | The password of the _PostgreSQL_ database |-| `POSTGRES_USER` | | The user of the _PostgreSQL_ database |-| `REDIS_HOST` | | The host where _Redis_ is running |-| `REDIS_PASSWORD` | | The password of _Redis_ |-| `REDIS_PORT` | | The port where _Redis_ is running |+| Name | Default Value | Description |+| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |+| `ACCESS_TOKEN_SALT` | | A random string used as salt for access tokens |+| `BASE_CURRENCY` | `USD` | The base currency of the Ghostfolio application.<br />`AUD` \| `CAD` \| `CNY` \| `EUR` \| `GBP` \| `JPY` \| `RUB` \| `USD`<br />Caution: Only set if you intend to track cryptocurrencies in a non-`USD` currency. This cannot be changed later! |+| `DATABASE_URL` | | The database connection URL, e.g. `postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?sslmode=prefer` |+| `HOST` | `0.0.0.0` | The host where the Ghostfolio application will run on |+| `JWT_SECRET_KEY` | | A random string used for _JSON Web Tokens_ (JWT) |+| `PORT` | `3333` | The port where the Ghostfolio application will run on |+| `POSTGRES_DB` | | The name of the _PostgreSQL_ database |+| `POSTGRES_PASSWORD` | | The password of the _PostgreSQL_ database |+| `POSTGRES_USER` | | The user of the _PostgreSQL_ database |+| `REDIS_HOST` | | The host where _Redis_ is running |+| `REDIS_PASSWORD` | | The password of _Redis_ |+| `REDIS_PORT` | | The port where _Redis_ is running |### Run with Docker Composediff --git a/apps/api/src/services/configuration.service.ts b/apps/api/src/services/configuration.service.tsindex 9cddec1f0c..30e9d7c6f0 100644--- a/apps/api/src/services/configuration.service.ts+++ b/apps/api/src/services/configuration.service.ts@@ -12,7 +12,10 @@ export class ConfigurationService {this.environmentConfiguration = cleanEnv(process.env, {ACCESS_TOKEN_SALT: str(),ALPHA_VANTAGE_API_KEY: str({ default: '' }),- BASE_CURRENCY: str({ default: 'USD' }),+ BASE_CURRENCY: str({+ choices: ['AUD', 'CAD', 'CNY', 'EUR', 'GBP', 'JPY', 'RUB', 'USD'],+ default: 'USD'+ }),CACHE_TTL: num({ default: 1 }),DATA_SOURCE_PRIMARY: str({ default: DataSource.YAHOO }),DATA_SOURCES: json({