diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ee618..a2c63e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.1 + +- Added option to silence the logging. Disabled by default. + ## 1.0.0 - Initial release diff --git a/DOCS.md b/DOCS.md index 204095e..e4a1fa8 100644 --- a/DOCS.md +++ b/DOCS.md @@ -27,6 +27,7 @@ The configuration is self-explanatory, but essentially we need details about acc - `access_token_salt`: (Optional) A random string used as salt for access tokens. This will be auto-generated on first run if not set. - `jwt_secret_key`: (Optional) A random string used for JSON Web Tokens (JWT). This will be auto-generated on first run if not set. +- `silent`: (Optional) Hide all output except errors in the log file. Default: `false`. Remember to restart the add-on when the configuration is changed. diff --git a/Dockerfile b/Dockerfile index 8554578..9a98d06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM "ghostfolio/ghostfolio:2.65.0" +FROM ghostfolio/ghostfolio:2.65.0 ARG BUILD_ARCH ARG BASHIO_VERSION=0.16.2 diff --git a/config.json b/config.json index 71d3b69..5ac7353 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "name": "Ghostfolio", - "version": "1.0.0", + "version": "1.0.1", "slug": "ghostfolio", "description": "Privacy-first, open source dashboard for your personal finances.", "url": "https://github.com/lildude/ha-addon-ghostfolio", @@ -34,7 +34,8 @@ "api_key_coingecko_demo": "str?", "api_key_coingecko_pro": "str?", "access_token_salt": "str?", - "jwt_secret_key": "str?" + "jwt_secret_key": "str?", + "silent": "bool?" }, "codenotary": "colin@symr.io", "image": "ghcr.io/lildude/ha-addon-ghostfolio-{arch}" diff --git a/rootfs/etc/services.d/ghostfolio/run b/rootfs/etc/services.d/ghostfolio/run index 47d5d66..07827d9 100644 --- a/rootfs/etc/services.d/ghostfolio/run +++ b/rootfs/etc/services.d/ghostfolio/run @@ -2,10 +2,18 @@ # -*- bash -*- # shellcheck shell=bash set -e + +if bashio::config.true 'silent'; then + bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug" +fi + bashio::log.info "Starting redis" -exec redis-server & +if bashio::config.true 'silent'; then + exec redis-server > /dev/null 2>&1 & +else + exec redis-server & +fi -bashio::log.info "Starting Ghostfolio" access_token_salt=$() jwt_secret_key=$(bashio::config 'jwt_secret_key') @@ -48,5 +56,10 @@ if [[ $(grep hassio_ingress /ghostfolio/apps/client/en/main.*.js) -eq 0 ]]; then sed -Ei "s^\(/assets^\(${ingress_entry}/assets^g" /ghostfolio/apps/client/*/*.js fi +bashio::log.info "Starting Ghostfolio" cd /ghostfolio/apps/api -yarn start:production \ No newline at end of file +if bashio::config.true 'silent'; then + yarn start:production >/dev/null +else + yarn start:production +fi \ No newline at end of file diff --git a/translations/en.yaml b/translations/en.yaml index e428ca5..30f0e28 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -26,3 +26,6 @@ configuration: api_key_coingecko_pro: name: CoinGecko Pro API Key description: A CoinGecko Pro API key. + silent: + name: Silent mode + description: Hide all output except errors in the log file.