Skip to content

Commit

Permalink
Merge pull request #535 from spacetourist/master
Browse files Browse the repository at this point in the history
🔧 enable API key auth to be enabled via docker config
  • Loading branch information
adubovikov authored Feb 16, 2024
2 parents 8361b3b + b1a243a commit 96cdc1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker/docker-entrypoint.d/1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ if [ -f /usr/local/homer/etc/webapp_config.json ]; then
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;
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

if [ -n "$HOMER_ENABLE_API" ]; then sed -i "s/homer_enable_api/${HOMER_ENABLE_API}/g" /usr/local/homer/etc/webapp_config.json;
else sed -i "s/homer_enable_api/false/g" /usr/local/homer/etc/webapp_config.json; fi

if [ -n "$INFLUX_HOST" ]; then sed -i "s/influx_host/${INFLUX_HOST}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$INFLUX_USER" ]; then sed -i "s/influx_user/${INFLUX_USER}/g" /usr/local/homer/etc/webapp_config.json; fi
if [ -n "$INFLUX_PASS" ]; then sed -i "s/influx_pass/${INFLUX_PASS}/g" /usr/local/homer/etc/webapp_config.json; fi
Expand Down
3 changes: 3 additions & 0 deletions docker/webapp_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"host": "http://loki_host:3100",
"api": "api/prom"
},
"api_settings": {
"enable_token_auth": homer_enable_api
},
"http_settings": {
"host": "0.0.0.0",
"port": homer_web_port,
Expand Down

0 comments on commit 96cdc1d

Please sign in to comment.