Skip to content

Commit

Permalink
Merge pull request #4 from lildude/silence
Browse files Browse the repository at this point in the history
Add silent mode option
  • Loading branch information
lildude authored Apr 7, 2024
2 parents b0083b7 + 74a64fa commit f86b423
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

- Added option to silence the logging. Disabled by default.

## 1.0.0

- Initial release
Expand Down
1 change: 1 addition & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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": "[email protected]",
"image": "ghcr.io/lildude/ha-addon-ghostfolio-{arch}"
Expand Down
19 changes: 16 additions & 3 deletions rootfs/etc/services.d/ghostfolio/run
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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
if bashio::config.true 'silent'; then
yarn start:production >/dev/null
else
yarn start:production
fi
3 changes: 3 additions & 0 deletions translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit f86b423

Please sign in to comment.