Skip to content

Commit

Permalink
Merge pull request #4 from spacetourist/dev
Browse files Browse the repository at this point in the history
🔧 enable API key auth to be enabled via docker config
  • Loading branch information
spacetourist authored Jul 24, 2023
2 parents 9794301 + 2340eb4 commit b1a243a
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 @@ -15,9 +15,12 @@ if [ -f /usr/local/homer/etc/webapp_config.json ]; then
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 "$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 b1a243a

Please sign in to comment.