Skip to content

Commit b1a243a

Browse files
authored
Merge pull request #4 from spacetourist/dev
🔧 enable API key auth to be enabled via docker config
2 parents 9794301 + 2340eb4 commit b1a243a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docker/docker-entrypoint.d/1

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ if [ -f /usr/local/homer/etc/webapp_config.json ]; then
1515
if [ -n "$DB_PASS" ]; then sed -i "s/homer_password/${DB_PASS}/g" /usr/local/homer/etc/webapp_config.json; fi
1616
if [ -n "$DB_KEEPALIVE" ]; then sed -i "s/homer_db_keepalive/${DB_KEEPALIVE}/g" /usr/local/homer/etc/webapp_config.json; fi
1717

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

21+
if [ -n "$HOMER_ENABLE_API" ]; then sed -i "s/homer_enable_api/${HOMER_ENABLE_API}/g" /usr/local/homer/etc/webapp_config.json;
22+
else sed -i "s/homer_enable_api/false/g" /usr/local/homer/etc/webapp_config.json; fi
23+
2124
if [ -n "$INFLUX_HOST" ]; then sed -i "s/influx_host/${INFLUX_HOST}/g" /usr/local/homer/etc/webapp_config.json; fi
2225
if [ -n "$INFLUX_USER" ]; then sed -i "s/influx_user/${INFLUX_USER}/g" /usr/local/homer/etc/webapp_config.json; fi
2326
if [ -n "$INFLUX_PASS" ]; then sed -i "s/influx_pass/${INFLUX_PASS}/g" /usr/local/homer/etc/webapp_config.json; fi

docker/webapp_config.json

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"host": "http://loki_host:3100",
4141
"api": "api/prom"
4242
},
43+
"api_settings": {
44+
"enable_token_auth": homer_enable_api
45+
},
4346
"http_settings": {
4447
"host": "0.0.0.0",
4548
"port": homer_web_port,

0 commit comments

Comments
 (0)