Skip to content

Commit 0a7b38c

Browse files
author
Thomas Preud'homme
committed
Allow setting auth_token at 1st container startup
Removing or renaming machines or runs require to have an auth_token. This commit adds a mechanism to set that token on first startup of the LNT container by setting the LNT_AUTH_TOKEN environment variable. Reviewed By: tnfchris, PrzemekWirkus, cmatthews Differential Revision: https://reviews.llvm.org/D113470
1 parent 5d58367 commit 0a7b38c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- DB_ENGINE=postgres
1111
- DB_HOST=lnt-postgres
1212
- DB_PWD
13+
- LNT_AUTH_TOKEN
1314
depends_on:
1415
- db
1516
deploy:

docker/docker-entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ if [ ! -r /etc/lnt.cfg ]; then
1111
--tmp-dir /tmp/lnt \
1212
--db-dir "${DB_PATH}" \
1313
--default-db "${DB_BASE}"
14+
if [ -n "${LNT_AUTH_TOKEN:-}" ]; then
15+
sed -i "s/# \(api_auth_token =\).*/\1 '${LNT_AUTH_TOKEN}'/" /etc/lnt.cfg
16+
fi
1417
fi
1518

1619
cd /var/lib/lnt

0 commit comments

Comments
 (0)