Compare commits

...

4 Commits

Author SHA1 Message Date
127abb8f4e Release 1.93.0 (#566) 2021-12-21 20:24:24 +01:00
ed1136999a Feature/extend documentation for self hosting (#565)
* Extend documentation for self-hosting

* Add tag "latest" to docker image

* Update changelog
2021-12-21 20:22:58 +01:00
9f545e3e2b Feature/add cryptocurrency solana (#563)
* Add support for Solana and clean up symbol conversion (SOL1USD)

* Update changelog
2021-12-20 21:24:58 +01:00
1602f976f0 Feature/convert errors to warnings in portfolio calculator (#562)
* Convert errors to warnings

* Update changelog
2021-12-20 21:03:12 +01:00
11 changed files with 81 additions and 43 deletions

View File

@ -5,6 +5,17 @@ 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).
## 1.93.0 - 21.12.2021
### Added
- Added support for cryptocurrency _Solana_ (`SOL-USD`)
- Extended the documentation for self-hosting with the [official Ghostfolio Docker image](https://hub.docker.com/r/ghostfolio/ghostfolio)
### Fixed
- Converted errors to warnings in portfolio calculator
## 1.92.0 - 19.12.2021
### Added

View File

@ -81,19 +81,27 @@ The backend is based on [NestJS](https://nestjs.com) using [PostgreSQL](https://
The frontend is built with [Angular](https://angular.io) and uses [Angular Material](https://material.angular.io) with utility classes from [Bootstrap](https://getbootstrap.com).
## Run with Docker
## Run with Docker (self-hosting)
### Prerequisites
- [Docker](https://www.docker.com/products/docker-desktop)
### Setup Docker Image
### a. Run environment
Run the following commands to build and start the Docker image:
Run the following command to start the Docker images from [Docker Hub](https://hub.docker.com/r/ghostfolio/ghostfolio):
```bash
docker-compose -f docker/docker-compose-build-local.yml build
docker-compose -f docker/docker-compose-build-local.yml up
docker-compose -f docker/docker-compose.yml up
```
### b. Build and run environment
Run the following commands to build and start the Docker images:
```bash
docker-compose -f docker/docker-compose.build.yml build
docker-compose -f docker/docker-compose.build.yml up
```
### Setup Database
@ -112,6 +120,12 @@ Open http://localhost:3333 in your browser and accomplish these steps:
1. Go to the _Admin Control Panel_ and click _Gather All Data_ to fetch historical data
1. Click _Sign out_ and check out the _Live Demo_
### Finalization
1. Create a new user via _Get Started_
1. Assign the role `ADMIN` to this user (directly in the database)
1. Delete the original _Admin_ (directly in the database)
### Migrate Database
With the following command you can keep your database schema in sync after a Ghostfolio version update:

View File

@ -238,9 +238,7 @@ export class PortfolioCalculator {
if (!marketSymbolMap[nextDate]?.[item.symbol]) {
invalidSymbols.push(item.symbol);
hasErrors = true;
Logger.error(
`Missing value for symbol ${item.symbol} at ${nextDate}`
);
Logger.warn(`Missing value for symbol ${item.symbol} at ${nextDate}`);
continue;
}
let lastInvestment: Big = new Big(0);
@ -271,7 +269,7 @@ export class PortfolioCalculator {
if (!initialValue) {
invalidSymbols.push(item.symbol);
hasErrors = true;
Logger.error(
Logger.warn(
`Missing value for symbol ${item.symbol} at ${currentDate}`
);
continue;
@ -515,7 +513,7 @@ export class PortfolioCalculator {
currentPosition.netPerformancePercentage.mul(currentInitialValue)
);
} else if (!currentPosition.quantity.eq(0)) {
Logger.error(
Logger.warn(
`Missing initial value for symbol ${currentPosition.symbol} at ${currentPosition.firstBuyDate}`
);
hasErrors = true;

View File

@ -4,5 +4,6 @@
"AVAX": "Avalanche",
"MATIC": "Polygon",
"SHIB": "Shiba Inu",
"SOL": "Solana",
"UNI3": "Uniswap"
}

View File

@ -14,8 +14,6 @@ jest.mock(
return true;
case 'DOGEUSD':
return true;
case 'SOLUSD':
return true;
default:
return false;
}
@ -55,9 +53,6 @@ describe('YahooFinanceService', () => {
expect(
await yahooFinanceService.convertToYahooFinanceSymbol('DOGEUSD')
).toEqual('DOGE-USD');
expect(
await yahooFinanceService.convertToYahooFinanceSymbol('SOL1USD')
).toEqual('SOL1-USD');
expect(
await yahooFinanceService.convertToYahooFinanceSymbol('USDCHF')
).toEqual('USDCHF=X');

View File

@ -49,7 +49,6 @@ export class YahooFinanceService implements DataProviderInterface {
* Currency: USDCHF -> USDCHF=X
* Cryptocurrency: BTCUSD -> BTC-USD
* DOGEUSD -> DOGE-USD
* SOL1USD -> SOL1-USD
*/
public convertToYahooFinanceSymbol(aSymbol: string) {
if (aSymbol.includes(baseCurrency) && aSymbol.length >= 6) {
@ -57,9 +56,7 @@ export class YahooFinanceService implements DataProviderInterface {
return `${aSymbol}=X`;
} else if (
this.cryptocurrencyService.isCryptocurrency(
aSymbol
.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
.replace('1', '')
aSymbol.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
)
) {
// Add a dash before the last three characters
@ -246,9 +243,7 @@ export class YahooFinanceService implements DataProviderInterface {
return (
(quoteType === 'CRYPTOCURRENCY' &&
this.cryptocurrencyService.isCryptocurrency(
symbol
.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
.replace('1', '')
symbol.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
)) ||
quoteType === 'EQUITY' ||
quoteType === 'ETF'

View File

@ -1,5 +1,15 @@
version: '3.7'
services:
ghostfolio:
build: ../
env_file:
- ../.env
environment:
DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
REDIS_HOST: 'redis'
ports:
- 3333:3333
postgres:
image: postgres:12
env_file:
@ -10,15 +20,5 @@ services:
redis:
image: 'redis:alpine'
ghostfolio:
build: ../
env_file:
- ../.env
environment:
REDIS_HOST: 'redis'
DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
ports:
- 3333:3333
volumes:
postgres:

View File

@ -0,0 +1,22 @@
version: '3.7'
services:
postgres:
image: postgres:12
container_name: postgres
restart: unless-stopped
ports:
- 5432:5432
env_file:
- ../.env
volumes:
- postgres:/var/lib/postgresql/data
redis:
image: 'redis:alpine'
container_name: redis
restart: unless-stopped
ports:
- 6379:6379
volumes:
postgres:

View File

@ -1,11 +1,17 @@
version: '3.7'
services:
ghostfolio:
image: ghostfolio/ghostfolio
env_file:
- ../.env
environment:
DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
REDIS_HOST: 'redis'
ports:
- 3333:3333
postgres:
image: postgres:12
container_name: postgres
restart: unless-stopped
ports:
- 5432:5432
env_file:
- ../.env
volumes:
@ -13,10 +19,6 @@ services:
redis:
image: 'redis:alpine'
container_name: redis
restart: unless-stopped
ports:
- 6379:6379
volumes:
postgres:

View File

@ -1,6 +1,6 @@
{
"name": "ghostfolio",
"version": "1.92.0",
"version": "1.93.0",
"homepage": "https://ghostfol.io",
"license": "AGPL-3.0",
"scripts": {

View File

@ -1,5 +1,5 @@
set -xe
echo "$DOCKER_HUB_ACCESS_TOKEN" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
docker build -t ghostfolio/ghostfolio:$TRAVIS_TAG .
docker push ghostfolio/ghostfolio:$TRAVIS_TAG
docker build -t ghostfolio/ghostfolio:$TRAVIS_TAG -t ghostfolio/ghostfolio:latest .
docker push ghostfolio/ghostfolio --all-tags