This commit is contained in:
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
@@ -48,8 +48,7 @@
|
|||||||
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;",
|
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;",
|
||||||
"AYANOVA_USE_URLS": "http://*:7575;",
|
"AYANOVA_USE_URLS": "http://*:7575;",
|
||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_METRICS_USE_INFLUXDB": "false",
|
|
||||||
"AYANOVA_SERVER_TEST_MODE":"false",
|
"AYANOVA_SERVER_TEST_MODE":"false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL":"small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL":"small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET":"-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET":"-7",
|
||||||
@@ -67,14 +66,4 @@
|
|||||||
"processId": "${command:pickProcess}"
|
"processId": "${command:pickProcess}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
// "AYANOVA_DB_CONNECTION":"Server=localhost;Username=postgres;Password=raven;Database=ayanovadev",
|
|
||||||
//"AYANOVA_LOG_LEVEL": "Info"
|
|
||||||
//"AYANOVA_DB_CONNECTION":"Server=localhost;Username=postgres;Password=raven;Database=AyaNova",
|
|
||||||
|
|
||||||
// "AYANOVA_PERMANENTLY_ERASE_DATABASE": "true",
|
|
||||||
|
|
||||||
//Development system folders
|
|
||||||
//"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
|
||||||
//"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,33 +30,20 @@ namespace AyaNova
|
|||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
public Startup(Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnvironment)
|
public Startup(Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnvironment)
|
||||||
{//ILogger<Startup> logger, ILoggerFactory logFactory,
|
{
|
||||||
|
|
||||||
// Get the factory for ILogger instances.
|
|
||||||
var nlogLoggerProvider = new NLogLoggerProvider();
|
var nlogLoggerProvider = new NLogLoggerProvider();
|
||||||
|
|
||||||
// Create an ILogger.
|
|
||||||
_newLog = nlogLoggerProvider.CreateLogger("SERVER");
|
_newLog = nlogLoggerProvider.CreateLogger("SERVER");
|
||||||
|
|
||||||
//x_log = logger;
|
|
||||||
_hostingEnvironment = hostingEnvironment;
|
_hostingEnvironment = hostingEnvironment;
|
||||||
//AyaNova.Util.ApplicationLogging.LoggerFactory = logFactory;
|
|
||||||
//AyaNova.Util.ApplicationLogging.theLogger = _newLog;
|
|
||||||
AyaNova.Util.ApplicationLogging.LoggerProvider = nlogLoggerProvider;
|
AyaNova.Util.ApplicationLogging.LoggerProvider = nlogLoggerProvider;
|
||||||
|
|
||||||
//this must be set here
|
|
||||||
ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH = hostingEnvironment.ContentRootPath;
|
ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH = hostingEnvironment.ContentRootPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly ILogger _newLog;
|
private readonly ILogger _newLog;
|
||||||
|
|
||||||
// private readonly ILogger<Startup>x_log;
|
|
||||||
private string _connectionString = "";
|
private string _connectionString = "";
|
||||||
private readonly Microsoft.AspNetCore.Hosting.IWebHostEnvironment _hostingEnvironment;
|
private readonly Microsoft.AspNetCore.Hosting.IWebHostEnvironment _hostingEnvironment;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
//
|
||||||
//
|
//
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
@@ -68,13 +55,7 @@ namespace AyaNova
|
|||||||
services.AddMiniProfiler(options =>
|
services.AddMiniProfiler(options =>
|
||||||
{
|
{
|
||||||
options.RouteBasePath = "/profiler";
|
options.RouteBasePath = "/profiler";
|
||||||
//options.ShouldProfile = request => MyShouldThisBeProfiledFunction(request);
|
//in testing only ignorepaths was reliable and worked and docs say it prevents any profiling at all
|
||||||
// options.ShouldProfile = request =>
|
|
||||||
// {
|
|
||||||
|
|
||||||
// return true;
|
|
||||||
// };
|
|
||||||
// options.IgnoredPaths.Add("/auth");
|
|
||||||
options.IgnorePath("/auth").IgnorePath("/user").IgnorePath("/docs");
|
options.IgnorePath("/auth").IgnorePath("/user").IgnorePath("/docs");
|
||||||
options.ResultsAuthorize = request =>
|
options.ResultsAuthorize = request =>
|
||||||
{
|
{
|
||||||
@@ -82,11 +63,6 @@ namespace AyaNova
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
// options.ShouldProfile`
|
|
||||||
// options.EnableServerTimingHeader = false;
|
|
||||||
// options.TrackConnectionOpenClose = false;
|
|
||||||
// options.ShouldProfile=false;
|
|
||||||
|
|
||||||
}).AddEntityFramework();
|
}).AddEntityFramework();
|
||||||
|
|
||||||
|
|
||||||
@@ -394,6 +370,7 @@ namespace AyaNova
|
|||||||
{
|
{
|
||||||
if (!context.User.Identity.IsAuthenticated)
|
if (!context.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
|
#region Profiler workaround
|
||||||
//Is this a profiler route? If so we're going to use the dl token to authorize
|
//Is this a profiler route? If so we're going to use the dl token to authorize
|
||||||
if (context.Request.Path.Value.StartsWith("/profiler/results"))
|
if (context.Request.Path.Value.StartsWith("/profiler/results"))
|
||||||
{
|
{
|
||||||
@@ -441,7 +418,7 @@ namespace AyaNova
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion profiler workaround
|
||||||
|
|
||||||
context.Request.HttpContext.Items["AY_ROLES"] = 0;
|
context.Request.HttpContext.Items["AY_ROLES"] = 0;
|
||||||
await next.Invoke();
|
await next.Invoke();
|
||||||
|
|||||||
Reference in New Issue
Block a user