Skip to content
Snippets Groups Projects
Commit bd39eef8 authored by Petar Hristov's avatar Petar Hristov :speech_balloon: Committed by L. Ellenbeck
Browse files

Fix: Reduced log verbosity

parent aa37e0c2
Branches
Tags
2 merge requests!24merge dev into master,!23Fix: Reduced log verbosity
......@@ -3,3 +3,6 @@
FROM mcr.microsoft.com/devcontainers/dotnet:8.0 as develop
USER vscode
# Add nuget sources for private packages (here: api-client)
RUN dotnet nuget add source "https://git.rwth-aachen.de/api/v4/projects/88930/packages/nuget/index.json" -n "api-client"
\ No newline at end of file
......@@ -10,13 +10,20 @@
"containerUser": "vscode",
"customizations": {
"vscode": {
"settings": {},
"settings": {
"NugetGallery.sources": [
"{\"name\":\"nuget.org\",\"url\":\"https://api.nuget.org/v3/index.json\"}",
"{\"name\":\"api-client\",\"url\":\"https://git.rwth-aachen.de/api/v4/projects/88930/packages/nuget/index.json\"}"
],
"nuget.includePrereleasePackageVersions": true
},
"extensions": [
"ms-dotnettools.csdevkit",
"ms-azuretools.vscode-docker",
"ms-dotnettools.csharp",
"mhutchie.git-graph",
"mutantdino.resourcemonitor"
"mutantdino.resourcemonitor",
"patcx.vscode-nuget-gallery"
]
}
},
......
......@@ -23,13 +23,23 @@ public class Deployer
{
_logger = logger;
_graphDeployerConfiguration = graphDeployerConfiguration.CurrentValue;
_adminApi = new(new Configuration
// Build the configuration for the API client based on the configuration settings
var apiClientConfig = new Configuration
{
BasePath = $"{_graphDeployerConfiguration.Endpoint.TrimEnd('/')}/coscine",
ApiKeyPrefix = { { "Authorization", "Bearer" } },
ApiKey = { { "Authorization", _graphDeployerConfiguration.ApiKey } },
Timeout = 300000 // 5 minutes
});
};
// Check if the graph deployer has to skip SSL checks when connecting to the API
if (_graphDeployerConfiguration.SkipSslCheck)
{
_logger.LogInformation("Skipping SSL certificate validation...");
// Skip SSL certificate validation
apiClientConfig.RemoteCertificateValidationCallback = (_, _, _, _) => true;
}
_adminApi = new(apiClientConfig);
}
public static string WorkingFolder { get; set; } = "./output/";
......@@ -151,7 +161,7 @@ public class Deployer
}
else
{
_logger.LogInformation("Skipped {graphName} as it has not changed.", graphId);
_logger.LogDebug("Skipped {graphName} as it has not changed.", graphId);
SkippedGraphs.Add(graphId);
continue;
}
......
......@@ -4,6 +4,9 @@ WORKDIR /App
# Copy everything
COPY . ./
# Add nuget sources for private packages (here: api-client)
RUN dotnet nuget add source "https://git.rwth-aachen.de/api/v4/projects/88930/packages/nuget/index.json" -n "api-client"
# Restore as distinct layers
RUN dotnet restore
......
......@@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Coscine.ApiClient" Version="1.8.0" />
<PackageReference Include="Coscine.ApiClient" Version="1.10.0-issue-2944-gdshe0005" />
<PackageReference Include="dotNetRdf" Version="3.1.1" />
<PackageReference Include="GitLabApiClient" Version="1.8.1-beta.5" />
<PackageReference Include="LibGit2Sharp" Version="0.30.0" />
......@@ -40,7 +40,7 @@
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings.development.json">
<None Update="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="nlog.config">
......
......@@ -12,6 +12,11 @@ public class GraphDeployerConfiguration
/// </summary>
public bool IsEnabled { get; init; }
/// <summary>
/// Value indicating whether the graph deployer should skip SSL certificate checks.
/// </symmary>
public bool SkipSslCheck { get; set; }
/// <summary>
/// The working folder where the graph deployer will store the cloned repositories.
/// </summary>
......
......@@ -135,9 +135,6 @@ public class Program
// Set the log location
LogManager.Configuration.Variables["logHome"] = graphDeployerConfiguration.Logger?.LogHome ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
// Register the HTTP client
services.AddHttpClient();
// Add services for reporting
services.AddTransient<Deployer>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment