From be56b33baf5278a7c4c4176d51c2fbff111d547b Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Fri, 25 Jun 2021 15:27:39 -0400 Subject: [PATCH 1/2] Fixing workflow (#337) * Added extra copy for webui when building images --- action-build.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/action-build.sh b/action-build.sh index 14fb8a086..b4c82b6d0 100755 --- a/action-build.sh +++ b/action-build.sh @@ -34,9 +34,6 @@ Package() local runtime="$2" local lOutputFolder=../_output/"$runtime"/Kavita - echo "Integrity check on root folder" - ls -l - ProgressStart "Creating $runtime Package for $framework" # TODO: Use no-restore? Because Build should have already done it for us @@ -45,14 +42,11 @@ Package() echo dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework - echo "Integrity check on API wwwroot folder" - ls -l "$lOutputFolder"/wwwroot - echo "Renaming API -> Kavita" mv "$lOutputFolder"/API "$lOutputFolder"/Kavita - echo "Integrity check on Kavita wwwroot folder" - ls -l "$lOutputFolder"/wwwroot + echo "Copying webui wwwroot to build" + cp -r wwwroot/* "$lOutputFolder"/wwwroot/ echo "Copying Install information" cp ../INSTALL.txt "$lOutputFolder"/README.txt From 6b645737fa086156066a9691a48ee93827aafc9b Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Fri, 25 Jun 2021 15:08:55 -0500 Subject: [PATCH 2/2] Stats API Url Fixed (#338) * Fixed the API call by removing baseAddress and performing concatination in real time --- API/Extensions/ServiceCollectionExtensions.cs | 1 - API/Services/Clients/StatsApiClient.cs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/API/Extensions/ServiceCollectionExtensions.cs b/API/Extensions/ServiceCollectionExtensions.cs index 62a0575ef..3559f3856 100644 --- a/API/Extensions/ServiceCollectionExtensions.cs +++ b/API/Extensions/ServiceCollectionExtensions.cs @@ -16,7 +16,6 @@ namespace API.Extensions { services.AddHttpClient(client => { - client.BaseAddress = new Uri("https://stats.kavitareader.com"); client.DefaultRequestHeaders.Add("api-key", "MsnvA2DfQqxSK5jh"); }); diff --git a/API/Services/Clients/StatsApiClient.cs b/API/Services/Clients/StatsApiClient.cs index 00dddfad3..e07bec222 100644 --- a/API/Services/Clients/StatsApiClient.cs +++ b/API/Services/Clients/StatsApiClient.cs @@ -1,6 +1,7 @@ using System; using System.Net.Http; using System.Net.Http.Json; +using System.Threading; using System.Threading.Tasks; using API.Configurations.CustomOptions; @@ -15,6 +16,7 @@ namespace API.Services.Clients private readonly HttpClient _client; private readonly StatsOptions _options; private readonly ILogger _logger; + private const string ApiUrl = "http://stats.kavitareader.com"; public StatsApiClient(HttpClient client, IOptions options, ILogger logger) { @@ -29,7 +31,7 @@ namespace API.Services.Clients try { - var response = await _client.PostAsJsonAsync("/api/InstallationStats", data); + using var response = await _client.PostAsJsonAsync(ApiUrl + "/api/InstallationStats", data); responseContent = await response.Content.ReadAsStringAsync();