From b4a47f42e075fee1b088e951a60a66bf0861c45b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:22:22 +0100 Subject: [PATCH 1/4] Task/improve language localization for DE (20261103) (#8394) * Update translations * Update changelog --- CHANGELOG.md | 1 + apps/client/src/locales/messages.de.xlf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acc7d889f7..835a16e8ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the content of the pricing page +- Improved the language localization for German (`de`) ### Fixed diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 7f1d635edb..0d6b6fa537 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -5203,7 +5203,7 @@ For seasoned investors who manage multiple portfolios. - For seasoned investors who manage multiple portfolios. + Für erfahrene Anleger, die mehrere Portfolios verwalten. apps/client/src/app/pages/pricing/pricing-page.html 233 From aacaa3ab880d4eef601f825d4c46ccc74b6b51f1 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 4 Nov 2026 19:23:48 +0100 Subject: [PATCH 2/4] Bugfix/description of root url requirement for MCP server (#8400) * Fix description of ROOT_URL requirement for MCP server * Update changelog --- CHANGELOG.md | 1 + README.md | 6 +++--- apps/api/src/main.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 835a16e8ff..8a615bacbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the flickering of the navigation items in the header for logged-in users +- Fixed the description of the `ROOT_URL` requirement for the server of the Model Context Protocol (MCP) (experimental) ## 3.97.0 - 2026-11-02 diff --git a/README.md b/README.md index 00ae13e290..f8c3c92b89 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Find answers to commonly asked questions about self-hosting Ghostfolio in our [F | `REDIS_PORT` | `number` | | The port where _Redis_ is running | | `REDIS_TLS` | `boolean` (optional) | `false` | Enables TLS/SSL connection to _Redis_ | | `REQUEST_TIMEOUT` | `number` (optional) | `3000` | The timeout of network requests to data providers in milliseconds | -| `ROOT_URL` | `string` (optional) | `http://0.0.0.0:3333` | The root URL of the Ghostfolio application, used for generating callback URLs and external links. | +| `ROOT_URL` | `string` (optional) | `http://0.0.0.0:3333` | The root URL of the Ghostfolio application, used for generating callback URLs and external links. The endpoint of the _Model Context Protocol_ (MCP) accepts only requests to the host name of this URL. | | `TRUST_PROXY` | `string` (optional) | | The [trust proxy](https://expressjs.com/en/guide/behind-proxies.html) setting of _Express.js_ to determine the client IP address for rate limiting, e.g. `1` if the Ghostfolio application runs behind a single reverse proxy | #### OpenID Connect OIDC (experimental) @@ -405,7 +405,7 @@ The _Model Context Protocol_ (MCP) server lets an AI client read your portfolio, ### Prerequisites - Set `ENABLE_FEATURE_MCP` to `true` -- Set `ROOT_URL` to the public URL of your instance if a client calls the endpoint from a browser page. The host name of `ROOT_URL` is the only accepted origin. +- Set `ROOT_URL` to the public URL of your instance. The clients must use the host name of this URL: the endpoint accepts only requests to this host name, and a request from a browser page only with this host name as origin. If a reverse proxy is in front of your instance, it must send the original `Host` header. - Grant an access of the type _MCP_ in _My Ghostfolio_ under _Access_ and copy its token An _MCP_ access with the _Restricted view_ permission reads the portfolio without the monetary values. Grant the _View_ permission to let the client also read the monetary values. Grant the _Restricted view and manage_ or the _View and manage_ permission to let the client also import activities and update the cash balances of your accounts. @@ -415,7 +415,7 @@ An _MCP_ access with the _Restricted view_ permission reads the portfolio withou Point the client to the endpoint below and set the MCP access token as the _Bearer Token_. ``` -POST http://localhost:3333/mcp +POST /mcp "Authorization": "Bearer " ``` diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 8139feea45..6b60d49c05 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -151,7 +151,7 @@ async function bootstrap() { const { hostname } = new URL(configurationService.get('ROOT_URL')); logger.warn( - `The Model Context Protocol (MCP) is enabled, but ROOT_URL is not set. A client which calls the endpoint from a browser page is accepted only with the origin ${hostname}.` + `The Model Context Protocol (MCP) is enabled, but ROOT_URL is not set. The endpoint accepts only requests to the host name ${hostname}. Set ROOT_URL to the public URL of the instance.` ); } From 5a6dbac82c618fbb3827b216b6643ec7997e1539 Mon Sep 17 00:00:00 2001 From: Kenrick Tandrian <60643640+KenTandrian@users.noreply.github.com> Date: Thu, 5 Nov 2026 01:38:57 +0700 Subject: [PATCH 3/4] Task/improve type safety in exchange rate and portfolio table services (#8391) Improve type safety --- .../exchange-rate-data.service.ts | 33 +++++++++++-------- .../portfolio-table.service.spec.ts | 14 +++++++- .../portfolio-table.service.ts | 13 +++++--- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts index f67748c007..d547de0233 100644 --- a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts +++ b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts @@ -88,7 +88,7 @@ export class ExchangeRateDataService { ); const lastDateString = dateStrings.reduce((a, b) => { return a > b ? a : b; - }, undefined); + }, ''); let previousExchangeRate = exchangeRatesByCurrency[`${currency}${targetCurrency}`]?.[ @@ -214,7 +214,7 @@ export class ExchangeRateDataService { const resultExtended = result; for (const symbol of Object.keys(result)) { - const [currency1, currency2] = symbol.match(/.{1,3}/g); + const [currency1, currency2] = symbol.match(/.{1,3}/g) ?? []; const [date] = Object.keys(result[symbol]); // Calculate the opposite direction @@ -226,7 +226,7 @@ export class ExchangeRateDataService { } for (const symbol of Object.keys(resultExtended)) { - const [currency1, currency2] = symbol.match(/.{1,3}/g); + const [currency1, currency2] = symbol.match(/.{1,3}/g) ?? []; this.exchangeRates[symbol] = resultExtended[symbol]?.[dateStringOfYesterday]?.marketPrice; @@ -302,7 +302,7 @@ export class ExchangeRateDataService { const derivedCurrencyFactor = this.derivedCurrencyFactors[`${aFromCurrency}${aToCurrency}`]; - let factor: number; + let factor: number | undefined; if (aFromCurrency === aToCurrency) { factor = 1; @@ -324,8 +324,8 @@ export class ExchangeRateDataService { } else { // Calculate indirectly via base currency - let marketPriceBaseCurrencyFromCurrency: number; - let marketPriceBaseCurrencyToCurrency: number; + let marketPriceBaseCurrencyFromCurrency: number | undefined; + let marketPriceBaseCurrencyToCurrency: number | undefined; try { if (aFromCurrency === DEFAULT_CURRENCY) { @@ -337,7 +337,7 @@ export class ExchangeRateDataService { date: aDate, symbol: `${DEFAULT_CURRENCY}${aFromCurrency}` }) - )?.marketPrice as number; + )?.marketPrice; } } catch {} @@ -351,14 +351,19 @@ export class ExchangeRateDataService { date: aDate, symbol: `${DEFAULT_CURRENCY}${aToCurrency}` }) - )?.marketPrice as number; + )?.marketPrice; } } catch {} - // Calculate the opposite direction - factor = - (1 / marketPriceBaseCurrencyFromCurrency) * - marketPriceBaseCurrencyToCurrency; + if ( + isNumber(marketPriceBaseCurrencyFromCurrency) && + isNumber(marketPriceBaseCurrencyToCurrency) + ) { + // Calculate the opposite direction + factor = + (1 / marketPriceBaseCurrencyFromCurrency) * + marketPriceBaseCurrencyToCurrency; + } } } @@ -530,7 +535,9 @@ export class ExchangeRateDataService { } }) ).forEach(({ currency }) => { - currencies.push(currency); + if (currency) { + currencies.push(currency); + } }); ( diff --git a/apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts b/apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts index 4a213684b8..ecb09b2093 100644 --- a/apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts +++ b/apps/api/src/services/portfolio-table/portfolio-table.service.spec.ts @@ -121,6 +121,7 @@ function createHolding({ assetSubClass = AssetSubClass.STOCK, dataSource = DataSource.YAHOO, isin, + name, symbol = 'AAPL' }: { allocationInPercentage?: number; @@ -128,6 +129,7 @@ function createHolding({ assetSubClass?: AssetSubClass; dataSource?: DataSource; isin?: string | null; + name?: string | null; symbol?: string; } = {}) { return { @@ -140,7 +142,7 @@ function createHolding({ isin, symbol, currency: 'CHF', - name: `Name of ${symbol}` + name: name === undefined ? `Name of ${symbol}` : name }, dateOfFirstActivity: new Date('2024-01-01'), grossPerformance: 100, @@ -631,6 +633,16 @@ describe('PortfolioTableService', () => { expect(row).toContain('| Name of AAPL | | AAPL |'); }); + it('gives an empty name if the asset profile has none', async () => { + const result = await getHoldingsTable([createHolding({ name: null })]); + + const [row] = result.split('\n').filter((line) => { + return line.includes('| AAPL |'); + }); + + expect(row).toContain('| | | AAPL |'); + }); + it('gives the translation of the asset class and of the asset sub class', async () => { const result = await getHoldingsTable([createHolding()]); diff --git a/apps/api/src/services/portfolio-table/portfolio-table.service.ts b/apps/api/src/services/portfolio-table/portfolio-table.service.ts index bcf2839fba..1f51bd5b9b 100644 --- a/apps/api/src/services/portfolio-table/portfolio-table.service.ts +++ b/apps/api/src/services/portfolio-table/portfolio-table.service.ts @@ -52,7 +52,10 @@ function getDataSourceColumnDefinition( const dataSource = getDataSource(row); return dataSource - ? transformDataSourceInResponse({ configurationService, dataSource }) + ? (transformDataSourceInResponse({ + configurationService, + dataSource + }) ?? '') : ''; }, name: DATA_SOURCE_COLUMN_NAME @@ -176,7 +179,7 @@ export class PortfolioTableService { }), { getValue: ({ assetProfile, currency }) => { - return currency ?? assetProfile.currency; + return currency ?? assetProfile.currency ?? ''; }, name: 'Currency' }, @@ -226,7 +229,7 @@ export class PortfolioTableService { [ { getValue: ({ assetProfile }) => { - return assetProfile.name; + return assetProfile.name ?? ''; }, name: 'Name' }, @@ -249,7 +252,7 @@ export class PortfolioTableService { }), { getValue: ({ assetProfile }) => { - return assetProfile.currency; + return assetProfile.currency ?? ''; }, name: 'Currency' }, @@ -696,7 +699,7 @@ export class PortfolioTableService { const performanceSection = ['## Performance', '']; - if (chart?.length > 0) { + if (chart && chart.length > 0) { performanceSection.push( await getMarkdownTable({ columnDefinitions: this.getColumnDefinitions({ From ed11bc64dc59d5cbaafe4f2f507c4f801fd9412e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:14:08 +0100 Subject: [PATCH 4/4] Task/remove auth devices on access token rotation (#8392) * Remove auth devices on access token rotation * Update changelog --- CHANGELOG.md | 1 + apps/api/src/services/user/user.service.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a615bacbf..93b19d8b9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the content of the pricing page +- Disabled the biometric authentication on all devices when generating a new _Security Token_ - Improved the language localization for German (`de`) ### Fixed diff --git a/apps/api/src/services/user/user.service.ts b/apps/api/src/services/user/user.service.ts index b566332f40..b3d7ea89bb 100644 --- a/apps/api/src/services/user/user.service.ts +++ b/apps/api/src/services/user/user.service.ts @@ -708,6 +708,8 @@ export class UserService { userId }); + await this.prismaService.authDevice.deleteMany({ where: { userId } }); + await this.prismaService.user.update({ data: { accessToken: hashedAccessToken }, where: { id: userId }