This is an archive of the discontinued LLVM Phabricator instance.

Allow setting auth_token at 1st container startup
ClosedPublic

Authored by thopre on Nov 9 2021, 1:59 AM.

Details

Summary

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.

Event Timeline

thopre requested review of this revision.Nov 9 2021, 1:59 AM
thopre created this revision.
PrzemekWirkus accepted this revision.Nov 9 2021, 2:09 AM

LGTM, but Thomas please wait 24h for this patch to cool down. Maybe others have comments.
But change itself is straightforward IMO.

This revision is now accepted and ready to land.Nov 9 2021, 2:09 AM
tnfchris accepted this revision.Nov 9 2021, 2:49 AM

Yes this works fine and doesn't interfere with our approach.

We took a different route here in that we COPY the lnt.cfg from outside the container into it to /etc/lnt-new.cfg and then restore it after the create command
but before the exec.

We do this since there are other settings we want to preserve, such as mail server settings etc.

thopre added a comment.Nov 9 2021, 3:09 AM

Yes this works fine and doesn't interfere with our approach.

We took a different route here in that we COPY the lnt.cfg from outside the container into it to /etc/lnt-new.cfg and then restore it after the create command
but before the exec.

We do this since there are other settings we want to preserve, such as mail server settings etc.

Sounds like create-config should be modified to honor an existing config file so that you could just use a ADD in your Dockerfile

Yes this works fine and doesn't interfere with our approach.

We took a different route here in that we COPY the lnt.cfg from outside the container into it to /etc/lnt-new.cfg and then restore it after the create command
but before the exec.

We do this since there are other settings we want to preserve, such as mail server settings etc.

Sounds like create-config should be modified to honor an existing config file so that you could just use a ADD in your Dockerfile

Yeah, I think that's the best long term approach, but doesn't need to block your change here though.

thopre added a comment.Nov 9 2021, 3:25 AM

Yes this works fine and doesn't interfere with our approach.

We took a different route here in that we COPY the lnt.cfg from outside the container into it to /etc/lnt-new.cfg and then restore it after the create command
but before the exec.

We do this since there are other settings we want to preserve, such as mail server settings etc.

Sounds like create-config should be modified to honor an existing config file so that you could just use a ADD in your Dockerfile

Yeah, I think that's the best long term approach, but doesn't need to block your change here though.

Sure. Thanks. I'll wait 24h as recommended by @PrzemekWirkus and land it if noone objects.

This revision was automatically updated to reflect the committed changes.