diff --git a/.vscode/launch.json b/.vscode/launch.json index 95c9b301..379d2046 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -48,8 +48,7 @@ "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;", "AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", - "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", - "AYANOVA_METRICS_USE_INFLUXDB": "false", + "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_SERVER_TEST_MODE":"false", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL":"small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET":"-7", @@ -67,14 +66,4 @@ "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", } diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 7672c7cf..63c80126 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -30,33 +30,20 @@ namespace AyaNova ///////////////////////////////////////////////////////////// // public Startup(Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnvironment) - {//ILogger logger, ILoggerFactory logFactory, - - // Get the factory for ILogger instances. + { var nlogLoggerProvider = new NLogLoggerProvider(); - - // Create an ILogger. _newLog = nlogLoggerProvider.CreateLogger("SERVER"); - - //x_log = logger; _hostingEnvironment = hostingEnvironment; - //AyaNova.Util.ApplicationLogging.LoggerFactory = logFactory; - //AyaNova.Util.ApplicationLogging.theLogger = _newLog; AyaNova.Util.ApplicationLogging.LoggerProvider = nlogLoggerProvider; - - //this must be set here ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH = hostingEnvironment.ContentRootPath; - } private readonly ILogger _newLog; - - // private readonly ILoggerx_log; private string _connectionString = ""; 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) { @@ -68,13 +55,7 @@ namespace AyaNova services.AddMiniProfiler(options => { options.RouteBasePath = "/profiler"; - //options.ShouldProfile = request => MyShouldThisBeProfiledFunction(request); - // options.ShouldProfile = request => - // { - - // return true; - // }; - // options.IgnoredPaths.Add("/auth"); + //in testing only ignorepaths was reliable and worked and docs say it prevents any profiling at all options.IgnorePath("/auth").IgnorePath("/user").IgnorePath("/docs"); options.ResultsAuthorize = request => { @@ -82,11 +63,6 @@ namespace AyaNova return true; return false; }; - // options.ShouldProfile` - // options.EnableServerTimingHeader = false; - // options.TrackConnectionOpenClose = false; - // options.ShouldProfile=false; - }).AddEntityFramework(); @@ -394,6 +370,7 @@ namespace AyaNova { 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 if (context.Request.Path.Value.StartsWith("/profiler/results")) { @@ -441,7 +418,7 @@ namespace AyaNova } } } - + #endregion profiler workaround context.Request.HttpContext.Items["AY_ROLES"] = 0; await next.Invoke();