From 8b773c9639ae423f333a7620afe219080ff6c522 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Tue, 2 Jul 2019 12:55:13 -0500 Subject: [PATCH] add GitHub config env vars --- .env | 4 +++- docker-compose.yml | 2 ++ src/FilterLists.Agent/AppSettings/GitHub.cs | 2 +- .../Extensions/ServiceCollectionExtensions.cs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 41ce7b273..03f118247 100644 --- a/.env +++ b/.env @@ -3,4 +3,6 @@ FILTERLISTS_MYSQL_ROOT_PASSWORD=filterlists FILTERLISTS_MYSQL_DATABASE=filterlists FILTERLISTS_MYSQL_USER=filterlists FILTERLISTS_MYSQL_PASSWORD=filterlists -FILTERLISTS_AGENT_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY= \ No newline at end of file +FILTERLISTS_AGENT_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY= +FILTERLISTS_AGENT_GITHUB_PRODUCT_HEADER_VALUE= +FILTERLISTS_AGENT_GITHUB_PERSONAL_ACCESS_TOKEN= \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8284d3fb4..7f19404dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,6 +66,8 @@ services: - archives:/app/archives environment: ApplicationInsights__InstrumentationKey: ${FILTERLISTS_AGENT_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY} + GitHub__ProductHeaderValue: ${FILTERLISTS_AGENT_GITHUB_PRODUCT_HEADER_VALUE} + GitHub__PersonalAccessToken: ${FILTERLISTS_AGENT_GITHUB_PERSONAL_ACCESS_TOKEN} networks: reverse-proxy: diff --git a/src/FilterLists.Agent/AppSettings/GitHub.cs b/src/FilterLists.Agent/AppSettings/GitHub.cs index 5498a40d1..e88491a2a 100644 --- a/src/FilterLists.Agent/AppSettings/GitHub.cs +++ b/src/FilterLists.Agent/AppSettings/GitHub.cs @@ -3,6 +3,6 @@ public class GitHub { public string ProductHeaderValue { get; set; } - public string OauthToken { get; set; } + public string PersonalAccessToken { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs b/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs index ecc2cca1d..3f3415cf9 100644 --- a/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs +++ b/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs @@ -56,7 +56,7 @@ private static void AddGitHubClient(this IServiceCollection services) var gitHubConfig = s.GetService>(); return new GitHubClient(new ProductHeaderValue(gitHubConfig.Value.ProductHeaderValue)) { - Credentials = new Credentials(gitHubConfig.Value.OauthToken) + Credentials = new Credentials(gitHubConfig.Value.PersonalAccessToken) }; }); }