Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file modified .vs/ActivityReceiver/v15/.suo
Binary file not shown.
Binary file modified .vs/ActivityReceiver/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/ActivityReceiver/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
Binary file added .vs/ActivityReceiver/v16/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions ActivityReceiver/ActivityReceiver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" PrivateAssets="All" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ActivityReceiver/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -19,7 +20,6 @@ public static void Main(string[] args)

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseSetting(WebHostDefaults.DetailedErrorsKey,"true")
.UseStartup<Startup>()
.Build();
}
Expand Down
24 changes: 21 additions & 3 deletions ActivityReceiver/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using ActivityReceiver.ViewModels;
using ActivityReceiver.Functions;
using ActivityReceiver.DataBuilders;
using Microsoft.AspNetCore.HttpOverrides;
using Pomelo.EntityFrameworkCore.MySql;

namespace ActivityReceiver
{
Expand All @@ -32,11 +34,19 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("ApplicationDbContextConnection")));
services.AddDbContextPool<ApplicationDbContext>(options =>
options.UseMySql(Configuration.GetConnectionString("ApplicationDbContextConnection"),
mySqlOptions=>
{
mySqlOptions.ServerVersion(new Version(5, 7, 17), Pomelo.EntityFrameworkCore.MySql.Infrastructure.ServerType.MySql);
}));

services.AddDbContext<ActivityReceiverDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("ActivityReceiverDbContextConnection")));
options.UseMySql(Configuration.GetConnectionString("ActivityReceiverDbContextConnection"),
mySqlOptions =>
{
mySqlOptions.ServerVersion(new Version(5, 7, 17), Pomelo.EntityFrameworkCore.MySql.Infrastructure.ServerType.MySql);
}));

// Change the policy of password
services.AddIdentity<ApplicationUser, IdentityRole>(options => {
Expand Down Expand Up @@ -91,8 +101,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, Applicat
app.UseExceptionHandler("/Home/Error");
}

//ProxyPass?
app.UsePathBase("/activityreceiver");

app.UseStaticFiles();

//the Authentication needs ForwardedHeaders middle-ware to run
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseAuthentication();

app.UseMvc(routes =>
Expand Down
6 changes: 4 additions & 2 deletions ActivityReceiver/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"ConnectionStrings": {
"ApplicationDbContextConnection": "Server=(localdb)\\mssqllocaldb;Database=ActivityReceiver_ApplicationDbContext;Trusted_Connection=True;MultipleActiveResultSets=true",
//"ApplicationDbContextConnection": "Server=(localdb)\\mssqllocaldb;Database=ActivityReceiver_ApplicationDbContext;Trusted_Connection=True;MultipleActiveResultSets=true",
//"ApplicationDbContextConnection": "Server=localhost\\SQLExpress;Database=ActivityReceiver_ApplicationDbContext;Trusted_Connection=false;MultipleActiveResultSets=true;User Id=Neko3000;password=ccxxll333123?;",
//"ApplicationDbContextConnection": "Server=118.25.44.137\\172_17_0_14\\SQLEXPRESS,55661;Database=ActivityReceiver_ApplicationDbContext;Trusted_Connection=false;MultipleActiveResultSets=true;User Id=Neko3000;password=ccxxll333123?;",
"ActivityReceiverDbContextConnection": "Server=(localdb)\\mssqllocaldb;Database=AcitvityReceiver_ActivityReceiverDbContext;Trusted_Connection=True;MultipleActiveResultSets=true"
"ApplicationDbContextConnection": "Server=localhost;;Database=ActivityReceiver_ApplicationDbContext;Uid=root;Pwd=root333123;",
//"ActivityReceiverDbContextConnection": "Server=(localdb)\\mssqllocaldb;Database=AcitvityReceiver_ActivityReceiverDbContext;Trusted_Connection=True;MultipleActiveResultSets=true"
//"ActivityReceiverDbContextConnection": "Server=localhost\\SQLExpress;Database=ActivityReceiver_ActivityReceiverDbContext;Trusted_Connection=false;MultipleActiveResultSets=true;User Id=Neko3000;password=ccxxll333123?;"
//"ActivityReceiverDbContextConnection": "Server=118.25.44.137\\172_17_0_14\\SQLEXPRESS,55661;Database=ActivityReceiver_ActivityReceiverDbContext;Trusted_Connection=false;MultipleActiveResultSets=true;User Id=Neko3000;password=ccxxll333123?;"
"ActivityReceiverDbContextConnection": "Server=localhost;;Database=ActivityReceiver_ActivityReceiverDbContext;Uid=root;Pwd=root333123;"
},
"Logging": {
"IncludeScopes": false,
Expand Down
Loading