From 59ffcd3032393ffeb6eaaf8c5a718ce6603f62ac Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Sun, 7 Apr 2024 10:52:09 +0000 Subject: [PATCH 1/3] Add silent option --- CHANGELOG.md | 4 ++++ DOCS.md | 1 + config.json | 5 +++-- rootfs/etc/services.d/ghostfolio/run | 19 ++++++++++++++++--- translations/en.yaml | 3 +++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ee618..2d4d821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.1 + +- Added option to silence the logging + ## 1.0.0 - Initial release diff --git a/DOCS.md b/DOCS.md index 204095e..27e6054 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. Remember to restart the add-on when the configuration is changed. 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..cea8260 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. From 8bcb2bbdc4746e2705f6c66a0f83970f6ae75cfd Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Sun, 7 Apr 2024 10:52:25 +0000 Subject: [PATCH 2/3] Unquote Hopefully dependabot will find this now. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 74a64fa525d4e6fe7438c3a88267d446f4fd92f6 Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Sun, 7 Apr 2024 10:57:53 +0000 Subject: [PATCH 3/3] Docs --- CHANGELOG.md | 2 +- DOCS.md | 2 +- translations/en.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d4d821..a2c63e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 1.0.1 -- Added option to silence the logging +- Added option to silence the logging. Disabled by default. ## 1.0.0 diff --git a/DOCS.md b/DOCS.md index 27e6054..e4a1fa8 100644 --- a/DOCS.md +++ b/DOCS.md @@ -27,7 +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. +- `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/translations/en.yaml b/translations/en.yaml index cea8260..30f0e28 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -27,5 +27,5 @@ configuration: name: CoinGecko Pro API Key description: A CoinGecko Pro API key. silent: - name: Silent mode. + name: Silent mode description: Hide all output except errors in the log file.