Skip to content
Snippets Groups Projects
Commit 78907c3c authored by Sandra Westerhoff's avatar Sandra Westerhoff
Browse files

Merge branch 'dev' into 'master'

merge dev into master

See merge request !24
parents aa37e0c2 7cbf50d0
No related branches found
No related tags found
1 merge request!24merge dev into master
...@@ -3,3 +3,6 @@ ...@@ -3,3 +3,6 @@
FROM mcr.microsoft.com/devcontainers/dotnet:8.0 as develop FROM mcr.microsoft.com/devcontainers/dotnet:8.0 as develop
USER vscode 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 @@ ...@@ -10,13 +10,20 @@
"containerUser": "vscode", "containerUser": "vscode",
"customizations": { "customizations": {
"vscode": { "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": [ "extensions": [
"ms-dotnettools.csdevkit", "ms-dotnettools.csdevkit",
"ms-azuretools.vscode-docker", "ms-azuretools.vscode-docker",
"ms-dotnettools.csharp", "ms-dotnettools.csharp",
"mhutchie.git-graph", "mhutchie.git-graph",
"mutantdino.resourcemonitor" "mutantdino.resourcemonitor",
"patcx.vscode-nuget-gallery"
] ]
} }
}, },
......
...@@ -23,13 +23,23 @@ public class Deployer ...@@ -23,13 +23,23 @@ public class Deployer
{ {
_logger = logger; _logger = logger;
_graphDeployerConfiguration = graphDeployerConfiguration.CurrentValue; _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", BasePath = $"{_graphDeployerConfiguration.Endpoint.TrimEnd('/')}/coscine",
ApiKeyPrefix = { { "Authorization", "Bearer" } }, ApiKeyPrefix = { { "Authorization", "Bearer" } },
ApiKey = { { "Authorization", _graphDeployerConfiguration.ApiKey } }, ApiKey = { { "Authorization", _graphDeployerConfiguration.ApiKey } },
Timeout = 300000 // 5 minutes 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/"; public static string WorkingFolder { get; set; } = "./output/";
...@@ -151,7 +161,7 @@ public class Deployer ...@@ -151,7 +161,7 @@ public class Deployer
} }
else else
{ {
_logger.LogInformation("Skipped {graphName} as it has not changed.", graphId); _logger.LogDebug("Skipped {graphName} as it has not changed.", graphId);
SkippedGraphs.Add(graphId); SkippedGraphs.Add(graphId);
continue; continue;
} }
......
...@@ -4,6 +4,9 @@ WORKDIR /App ...@@ -4,6 +4,9 @@ WORKDIR /App
# Copy everything # Copy everything
COPY . ./ 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 # Restore as distinct layers
RUN dotnet restore RUN dotnet restore
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" /> <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="dotNetRdf" Version="3.1.1" />
<PackageReference Include="GitLabApiClient" Version="1.8.1-beta.5" /> <PackageReference Include="GitLabApiClient" Version="1.8.1-beta.5" />
<PackageReference Include="LibGit2Sharp" Version="0.30.0" /> <PackageReference Include="LibGit2Sharp" Version="0.30.0" />
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<None Update="appsettings.json"> <None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="appsettings.development.json"> <None Update="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="nlog.config"> <None Update="nlog.config">
......
...@@ -12,6 +12,11 @@ public class GraphDeployerConfiguration ...@@ -12,6 +12,11 @@ public class GraphDeployerConfiguration
/// </summary> /// </summary>
public bool IsEnabled { get; init; } public bool IsEnabled { get; init; }
/// <summary>
/// Value indicating whether the graph deployer should skip SSL certificate checks.
/// </symmary>
public bool SkipSslCheck { get; set; }
/// <summary> /// <summary>
/// The working folder where the graph deployer will store the cloned repositories. /// The working folder where the graph deployer will store the cloned repositories.
/// </summary> /// </summary>
......
...@@ -135,9 +135,6 @@ public class Program ...@@ -135,9 +135,6 @@ public class Program
// Set the log location // Set the log location
LogManager.Configuration.Variables["logHome"] = graphDeployerConfiguration.Logger?.LogHome ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs"); LogManager.Configuration.Variables["logHome"] = graphDeployerConfiguration.Logger?.LogHome ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
// Register the HTTP client
services.AddHttpClient();
// Add services for reporting // Add services for reporting
services.AddTransient<Deployer>(); services.AddTransient<Deployer>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment