Début de upgrade version et docker

upgrade-docker
VANNEAU 3 years ago
parent c316fe1b1c
commit c9717c8af8
  1. 4
      Dockerfile
  2. 12
      EPAServeur.Tests/EPAServeur.Tests.csproj
  3. 2
      EPAServeur/ClientCollaborateur/ApiClient.cs
  4. 2
      EPAServeur/Commun/APIAccess.cs
  5. 4
      EPAServeur/Commun/BDaccess.cs
  6. 2
      EPAServeur/Commun/KeycloakAuthentificator.cs
  7. 22
      EPAServeur/EPAServeur.csproj
  8. 1
      EPAServeur/Program.cs
  9. 7
      EPAServeur/Properties/launchSettings.json
  10. 22
      EPAServeur/Startup.cs
  11. 9
      EPAServeur/appsettings.json

@ -0,0 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0
COPY EPAServeur/bin/Release/net6.0/publish/ App/
WORKDIR /App
ENTRYPOINT ["dotnet", "EPAServeur.dll"]

@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
</ItemGroup>
<ItemGroup>

@ -203,7 +203,7 @@ namespace IO.Swagger.ClientCollaborateur
path, method, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, contentType);
InterceptRequest(request);
var response = await RestClient.ExecuteTaskAsync(request);
var response = await RestClient.ExecuteAsync(request);
//var response = await RestClient.ExecuteAsync(request);
InterceptResponse(request, response);
return (Object)response;

@ -12,7 +12,7 @@ namespace EPAServeur.BDAccess
public class APIAccess
{
private static APIAccess instance = null;
private string serveur = "http://localhost:3000";
private string serveur = "http://www.epa.apside.com/api";
private APIAccess()
{

@ -16,9 +16,9 @@ namespace EPAServeur.BDAccess
{
MySqlConnectionStringBuilder infoConnection = new MySqlConnectionStringBuilder()
{
Server = "localhost",
Server = "digitepa_db",
Port = 3306,
Database = "evaluationprofessionelle",
Database = "database_ep",
UserID = "dev",
Password = "dev"
};

@ -10,7 +10,7 @@ namespace EPAServeur.Commun
{
public class KeycloakAuthentificator
{
private static readonly string host = "http://localhost:8080/auth/realms/master/protocol/openid-connect/userinfo";
private static readonly string host = "http://www.epa.apside.com/auth/realms/master/protocol/openid-connect/userinfo";
public static bool IsvalidToken(string token)
{
List<KeyValuePair<string, string>> param = new List<KeyValuePair<string, string>>();

@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release;InitDB</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.7" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.21" />
<PackageReference Include="RestSharp" Version="106.11.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.17" />
<PackageReference Include="MySql.EntityFrameworkCore" Version="3.1.17" />
<PackageReference Include="RestSharp" Version="106.13.0" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.5.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.5.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.5.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.3" />
</ItemGroup>

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;

@ -1,4 +1,4 @@
{
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
@ -11,11 +11,14 @@
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": false,
"launchUrl": "api/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
}
}
}

@ -38,7 +38,8 @@ namespace EPAServeur
options.AddPolicy(name: AllowCrossClientEPA,
builder =>
{
builder.WithOrigins("http://localhost:4200").AllowAnyHeader().AllowAnyMethod();
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();//WithOrigins("http://digitepa_proxy/").AllowAnyHeader().AllowAnyMethod();
});
});
@ -53,6 +54,8 @@ namespace EPAServeur
{
o.Authority = Configuration["Jwt:Authority"];
o.Audience = Configuration["Jwt:Audience"];
o.TokenValidationParameters.ValidateIssuer = false;
//o.TokenValidationParameters.ValidIssuers = Configuration.GetSection("Jwt:ValidIssuers").Get<string[]>();
if (Environment.IsDevelopment())
{
@ -95,15 +98,16 @@ namespace EPAServeur
services.AddDbContext<EpContext>(b => b.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"]));
var optionBuider = new DbContextOptionsBuilder<EpContext>()
.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"])
/*var optionBuider = new DbContextOptionsBuilder<EpContext>()
//.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"])
.UseMySQL("server=localhost;database=server_ep;user=root;password=root")
.Options;
using (var context = new EpContext(optionBuider))
{
context.Database.EnsureDeleted(); //PENSEZ A ENLEVER CETTE LIGNE ET A NE JAMAIS LA REMETTRE QUAND LE SERVEUR SERA MIS EN PRODUCTION ^^
context.Database.EnsureCreated();
context.SaveChanges();
using (var context = new EpContext(optionBuider)) { };*/
/*{
//context.Database.EnsureDeleted(); //PENSEZ A ENLEVER CETTE LIGNE ET A NE JAMAIS LA REMETTRE QUAND LE SERVEUR SERA MIS EN PRODUCTION ^^
//context.Database.EnsureCreated();
//context.SaveChanges();
DataSeeder.AddInformationsDeBase(context);
DataSeeder.AddChamps(context);
@ -112,7 +116,7 @@ namespace EPAServeur
DataSeeder.AddEngagements(context);
DataSeeder.AddEp(context);
DataSeeder.AddRereferentEP(context);
}
}*/
//faire using, check si kekchoz exkist puis appeler les m<EFBFBD>thodes de cr<EFBFBD>ation si il n'y a rien
//API Collaborateurs

@ -1,11 +1,14 @@
{
"Jwt": {
"Authority": "http://localhost:8080/auth/realms/Apside",
"Audience": "account"
"Authority": "https://digitepa_proxy/auth/realms/Apside",
"Audience": "account",
"ValidIssuers": [
"https://digitepa_proxy/auth/realms/Apside"
]
},
"Data": {
"DefaultConnection": {
"ConnectionString": "server=localhost;database=server_ep;user=root;password=root"
"ConnectionString": "server=digitepa_db;database=database_ep;user=dev;password=dev"
}
},
"Logging": {

Loading…
Cancel
Save