Edited/Removed files

This commit is contained in:
rafsanulhasan 2018-09-01 17:53:32 +06:00
parent dda7d5b3e5
commit 206be058e5
15 changed files with 16 additions and 83 deletions

Binary file not shown.

View File

@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk as dotnet-build FROM microsoft/dotnet:2.1-sdk as dotnet-build
WORKDIR /src WORKDIR /src
@ -17,7 +16,6 @@ FROM dotnet-build as build
WORKDIR /src/src/Services/Identity/Identity.API/wwwroot WORKDIR /src/src/Services/Identity/Identity.API/wwwroot
COPY --from=node-build /web/wwwroot . COPY --from=node-build /web/wwwroot .
WORKDIR /src WORKDIR /src
COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/
COPY . . COPY . .
WORKDIR /src/src/Services/Identity/Identity.API WORKDIR /src/src/Services/Identity/Identity.API
RUN dotnet restore -nowarn:msb3202,nu1503 RUN dotnet restore -nowarn:msb3202,nu1503

View File

@ -35,16 +35,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
services.Configure<AppSettings>(Configuration); services.Configure<AppSettings>(Configuration);
services.AddMvc(opts => services.AddMvc();
{
opts.SslPort = 4105;
opts.RequireHttpsPermanent = true;
});
services.AddHttpsRedirection(opts =>
{
opts.HttpsPort = 4105;
});
if (Configuration.GetValue<string>("IsClusterEnv") == bool.TrueString) if (Configuration.GetValue<string>("IsClusterEnv") == bool.TrueString)
{ {
@ -119,11 +110,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
else else
{ {
app.UseExceptionHandler("/Home/Error"); app.UseExceptionHandler("/Home/Error");
app.UseHsts();
} }
app.UseHttpsRedirection();
var pathBase = Configuration["PATH_BASE"]; var pathBase = Configuration["PATH_BASE"];
if (!string.IsNullOrEmpty(pathBase)) if (!string.IsNullOrEmpty(pathBase))
{ {

View File

@ -2,8 +2,8 @@
"ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;", "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;",
"IsClusterEnv": "False", "IsClusterEnv": "False",
"MvcClient": "https://localhost:4100", "MvcClient": "https://localhost:4100",
"SpaClient": "https://localhost:4104", "SpaClient": "http://localhost:5104",
"XamarinCallback": "https://localhost:4105/xamarincallback", "XamarinCallback": "http://localhost:5105/xamarincallback",
"UseCustomizationData": false, "UseCustomizationData": false,
"Logging": { "Logging": {
"IncludeScopes": false, "IncludeScopes": false,

View File

@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk as dotnet-build FROM microsoft/dotnet:2.1-sdk as dotnet-build
WORKDIR /src WORKDIR /src
@ -17,7 +16,6 @@ FROM dotnet-build as build
WORKDIR /src/src/Web/WebMVC/wwwroot WORKDIR /src/src/Web/WebMVC/wwwroot
COPY --from=node-build /web/wwwroot . COPY --from=node-build /web/wwwroot .
WORKDIR /src WORKDIR /src
COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/
COPY . . COPY . .
WORKDIR /src/src/Web/WebMVC WORKDIR /src/src/Web/WebMVC
RUN dotnet restore -nowarn:msb3202,nu1503 RUN dotnet restore -nowarn:msb3202,nu1503

View File

@ -1,23 +1,5 @@
using Microsoft.ApplicationInsights.Extensibility; using Microsoft.eShopOnContainers.WebMVC.Services;
using Microsoft.ApplicationInsights.ServiceFabric;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.eShopOnContainers.WebMVC.Services;
using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.eShopOnContainers.WebMVC.ViewModels;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.HealthChecks;
using Microsoft.Extensions.Logging;
using Polly;
using Polly.Extensions.Http;
using StackExchange.Redis;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using WebMVC.Infrastructure; using WebMVC.Infrastructure;
using WebMVC.Infrastructure.Middlewares; using WebMVC.Infrastructure.Middlewares;
using WebMVC.Services; using WebMVC.Services;
@ -41,10 +23,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
opts.CheckConsentNeeded = context => true; opts.CheckConsentNeeded = context => true;
opts.MinimumSameSitePolicy = SameSiteMode.None; opts.MinimumSameSitePolicy = SameSiteMode.None;
}); });
services.AddHttpsRedirection(opts=>
{
opts.HttpsPort = 4100;
});
services.AddAppInsight(Configuration) services.AddAppInsight(Configuration)
.AddHealthChecks(Configuration) .AddHealthChecks(Configuration)
.AddCustomMvc(Configuration) .AddCustomMvc(Configuration)
@ -68,7 +46,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
else else
{ {
app.UseExceptionHandler("/Error"); app.UseExceptionHandler("/Error");
app.UseHsts();
} }
var pathBase = Configuration["PATH_BASE"]; var pathBase = Configuration["PATH_BASE"];
@ -78,7 +55,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
app.UsePathBase(pathBase); app.UsePathBase(pathBase);
} }
app.UseHttpsRedirection();
app.UseCookiePolicy(); app.UseCookiePolicy();
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
@ -161,11 +137,7 @@ namespace Microsoft.eShopOnContainers.WebMVC
services.AddOptions(); services.AddOptions();
services.Configure<AppSettings>(configuration); services.Configure<AppSettings>(configuration);
services.AddMvc(opts=> services.AddMvc();
{
opts.SslPort = 4100;
opts.RequireHttpsPermanent = true;
});
services.AddSession(); services.AddSession();

View File

@ -3,8 +3,8 @@
"OrderingUrl": "http://localhost:5102", "OrderingUrl": "http://localhost:5102",
"BasketUrl": "http://localhost:5103", "BasketUrl": "http://localhost:5103",
"MarketingUrl": "http://localhost:5110", "MarketingUrl": "http://localhost:5110",
"IdentityUrl": "https://localhost:4105", "IdentityUrl": "http://localhost:5105",
"CallBackUrl": "https://localhost:4100/", "CallBackUrl": "http://localhost:5100/",
"LocationsUrl": "http://localhost:5109/", "LocationsUrl": "http://localhost:5109/",
"IsClusterEnv": "False", "IsClusterEnv": "False",
"UseResilientHttp": "True", "UseResilientHttp": "True",
@ -23,14 +23,6 @@
"InstrumentationKey": "" "InstrumentationKey": ""
}, },
"HttpClientRetryCount": 8, "HttpClientRetryCount": 8,
"HttpClientExceptionsAllowedBeforeBreaking": 7, "HttpClientExceptionsAllowedBeforeBreaking": 7
"Kestrel": {
"Certificates": {
"Default": {
"Path": "./Certificates/eShopOnContainers.pfx",
"Password": "D0tNet@"
}
}
}
} }

View File

@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk as dotnet-build FROM microsoft/dotnet:2.1-sdk as dotnet-build
WORKDIR /src WORKDIR /src
@ -17,7 +16,6 @@ FROM dotnet-build as publish
WORKDIR /src/src/Web/WebSPA/wwwroot WORKDIR /src/src/Web/WebSPA/wwwroot
COPY --from=node-build /web/wwwroot . COPY --from=node-build /web/wwwroot .
WORKDIR /src WORKDIR /src
COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/
COPY . . COPY . .
WORKDIR /src/src/Web/WebSPA WORKDIR /src/src/Web/WebSPA
RUN dotnet publish -c Release -o /app RUN dotnet publish -c Release -o /app

View File

@ -57,20 +57,11 @@ namespace eShopConContainers.WebSPA
services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN"); services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN");
services services
.AddMvc(opts => .AddMvc()
{
opts.SslPort = 4104;
opts.RequireHttpsPermanent = true;
})
.AddJsonOptions(options => .AddJsonOptions(options =>
{ {
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}); });
services.AddHttpsRedirection(opts =>
{
opts.HttpsPort = 4104;
});
} }
@ -85,12 +76,8 @@ namespace eShopConContainers.WebSPA
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
else
{
app.UseHsts();
}
app.UseHttpsRedirection(); app.UseCookiePolicy();
// Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page // Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page
// load and passed back token on every subsequent async request // load and passed back token on every subsequent async request

View File

@ -1,7 +1,7 @@
{ {
"IdentityUrl": "https://localhost:4105", "IdentityUrl": "http://localhost:5105",
"MarketingUrl": "http://localhost:5110", "MarketingUrl": "http://localhost:5110",
"CallBackUrl": "https://localhost:4104/", "CallBackUrl": "http://localhost:4104/",
"PurchaseUrl": "http://localhost:5200", "PurchaseUrl": "http://localhost:5200",
"UseCustomizationData": true, "UseCustomizationData": true,
"IsClusterEnv": "False", "IsClusterEnv": "False",