Skip to content

Commit

Permalink
parametrize homer config and data database names (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-alen authored Nov 2, 2023
1 parent 9794301 commit 8abc1e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/docker-entrypoint.d/1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
DB_HOST=${DB_HOST:-localhost}
DB_KEEPALIVE=${DB_KEEPALIVE:-false} #default to false
DB_KEEPALIVE=${DB_KEEPALIVE,,} #set to lower-case
DB_HOMER_CONFIG=${DB_HOMER_CONFIG:-homer_config}
DB_HOMER_DATA=${DB_HOMER_DATA:-homer_data}
INFLUX_DB=${INFLUX_DB:-localhost}
PROM_HOST=${PROM_HOST:-localhost}
LOKI_HOST=${LOKI_HOST:-localhost}
Expand All @@ -14,6 +16,8 @@ if [ -f /usr/local/homer/etc/webapp_config.json ]; then
if [ -n "$DB_USER" ]; then sed -i "s/homer_user/${DB_USER}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$DB_PASS" ]; then sed -i "s/homer_password/${DB_PASS}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$DB_KEEPALIVE" ]; then sed -i "s/homer_db_keepalive/${DB_KEEPALIVE}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$DB_HOMER_CONFIG" ]; then sed -i "s/homer_config/${DB_HOMER_CONFIG}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$DB_HOMER_DATA" ]; then sed -i "s/homer_data/${DB_HOMER_DATA}/g" /usr/local/homer/etc/webapp_config.json; fi

if [ -n "$HOMER_LOGLEVEL" ]; then sed -i "s/homer_loglevel/${HOMER_LOGLEVEL}/g" /usr/local/homer/etc/webapp_config.json;
else sed -i "s/homer_loglevel/error/g" /usr/local/homer/etc/webapp_config.json; fi
Expand Down

0 comments on commit 8abc1e7

Please sign in to comment.