Skip to content

Commit 56bbceb

Browse files
Hub: Add env to enable auto join with clientid/secret
1 parent 9f94ab3 commit 56bbceb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,18 @@ private void SetupJobs()
292292
_initTimer.Elapsed += async (s, e) =>
293293
{
294294
_initTimer.Stop();
295+
296+
if (string.IsNullOrWhiteSpace(_serverConfig.HubAssignedInstanceId) && Environment.GetEnvironmentVariable("CERTIFY_MANAGEMENT_HUB_AUTOJOIN") == "true")
297+
{
298+
await JoinManagementHub(
299+
Environment.GetEnvironmentVariable("CERTIFY_MANAGEMENT_HUB"),
300+
new Models.Hub.ClientSecret
301+
{
302+
ClientId = Environment.GetEnvironmentVariable("CERTIFY_MANAGEMENT_HUB_CLIENT_ID"),
303+
Secret = Environment.GetEnvironmentVariable("CERTIFY_MANAGEMENT_HUB_CLIENT_SECRET")
304+
});
305+
}
306+
295307
await EnsureMgmtHubConnection();
296308
};
297309
_initTimer.Start();

0 commit comments

Comments
 (0)