diff --git a/Azaion.Common/Constants.cs b/Azaion.Common/Constants.cs deleted file mode 100644 index 8acb0ee..0000000 --- a/Azaion.Common/Constants.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Windows; -using Azaion.Common.DTO; -using Azaion.Common.DTO.Config; -using Azaion.Common.Extensions; - -namespace Azaion.Common; - -public class Constants -{ - public const string JPG_EXT = ".jpg"; - public const string TXT_EXT = ".txt"; - #region DirectoriesConfig - - public const string DEFAULT_VIDEO_DIR = "video"; - public const string DEFAULT_LABELS_DIR = "labels"; - public const string DEFAULT_IMAGES_DIR = "images"; - public const string DEFAULT_RESULTS_DIR = "results"; - public const string DEFAULT_THUMBNAILS_DIR = "thumbnails"; - public const string DEFAULT_GPS_SAT_DIRECTORY = "satellitesDir"; - public const string DEFAULT_GPS_ROUTE_DIRECTORY = "routeDir"; - - #endregion - - #region AnnotatorConfig - - public static readonly AnnotationConfig DefaultAnnotationConfig = new() - { - DetectionClasses = DefaultAnnotationClasses!, - VideoFormats = DefaultVideoFormats!, - ImageFormats = DefaultImageFormats!, - AnnotationsDbFile = DEFAULT_ANNOTATIONS_DB_FILE - }; - - private static readonly List DefaultAnnotationClasses = - [ - new() { Id = 0, Name = "ArmorVehicle", ShortName = "Броня", Color = "#FF0000".ToColor() }, - new() { Id = 1, Name = "Truck", ShortName = "Вантаж.", Color = "#00FF00".ToColor() }, - new() { Id = 2, Name = "Vehicle", ShortName = "Машина", Color = "#0000FF".ToColor() }, - new() { Id = 3, Name = "Atillery", ShortName = "Арта", Color = "#FFFF00".ToColor() }, - new() { Id = 4, Name = "Shadow", ShortName = "Тінь", Color = "#FF00FF".ToColor() }, - new() { Id = 5, Name = "Trenches", ShortName = "Окопи", Color = "#00FFFF".ToColor() }, - new() { Id = 6, Name = "MilitaryMan", ShortName = "Військов", Color = "#188021".ToColor() }, - new() { Id = 7, Name = "TyreTracks", ShortName = "Накати", Color = "#800000".ToColor() }, - new() { Id = 8, Name = "AdditArmoredTank", ShortName = "Танк.захист", Color = "#008000".ToColor() }, - new() { Id = 9, Name = "Smoke", ShortName = "Дим", Color = "#000080".ToColor() }, - new() { Id = 10, Name = "Plane", ShortName = "Літак", Color = "#000080".ToColor() }, - new() { Id = 11, Name = "Moto", ShortName = "Мото", Color = "#808000".ToColor() }, - new() { Id = 12, Name = "CamouflageNet", ShortName = "Сітка", Color = "#800080".ToColor() }, - new() { Id = 13, Name = "CamouflageBranches", ShortName = "Гілки", Color = "#2f4f4f".ToColor() }, - new() { Id = 14, Name = "Roof", ShortName = "Дах", Color = "#1e90ff".ToColor() }, - new() { Id = 15, Name = "Building", ShortName = "Будівля", Color = "#ffb6c1".ToColor() }, - new() { Id = 16, Name = "Caponier", ShortName = "Капонір", Color = "#ffb6c1".ToColor() }, - ]; - - public static readonly List DefaultVideoFormats = ["mp4", "mov", "avi"]; - public static readonly List DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"]; - - public static int DEFAULT_LEFT_PANEL_WIDTH = 250; - public static int DEFAULT_RIGHT_PANEL_WIDTH = 250; - - public const string DEFAULT_ANNOTATIONS_DB_FILE = "annotations.db"; - - # endregion AnnotatorConfig - - # region AIRecognitionConfig - - public static readonly AIRecognitionConfig DefaultAIRecognitionConfig = new() - { - FrameRecognitionSeconds = DEFAULT_FRAME_RECOGNITION_SECONDS, - TrackingDistanceConfidence = TRACKING_DISTANCE_CONFIDENCE, - TrackingProbabilityIncrease = TRACKING_PROBABILITY_INCREASE, - TrackingIntersectionThreshold = TRACKING_INTERSECTION_THRESHOLD, - FramePeriodRecognition = DEFAULT_FRAME_PERIOD_RECOGNITION - }; - - public const double DEFAULT_FRAME_RECOGNITION_SECONDS = 2; - public const double TRACKING_DISTANCE_CONFIDENCE = 0.15; - public const double TRACKING_PROBABILITY_INCREASE = 15; - public const double TRACKING_INTERSECTION_THRESHOLD = 0.8; - public const int DEFAULT_FRAME_PERIOD_RECOGNITION = 4; - - # endregion AIRecognitionConfig - - # region GpsDeniedConfig - - public static readonly GpsDeniedConfig DefaultGpsDeniedConfig = new() - { - MinKeyPoints = 15 - }; - - # endregion - - #region Thumbnails - - public static readonly ThumbnailConfig DefaultThumbnailConfig = new() - { - Size = DefaultThumbnailSize, - Border = DEFAULT_THUMBNAIL_BORDER - }; - - public static readonly Size DefaultThumbnailSize = new(240, 135); - - public const int DEFAULT_THUMBNAIL_BORDER = 10; - - public const string THUMBNAIL_PREFIX = "_thumb"; - public const string RESULT_PREFIX = "_result"; - - #endregion - - public const string MQ_ANNOTATIONS_QUEUE = "azaion-annotations"; - - #region Database - - public const string ANNOTATIONS_TABLENAME = "annotations"; - public const string ANNOTATIONS_QUEUE_TABLENAME = "annotations_queue"; - public const string ADMIN_EMAIL = "admin@azaion.com"; - public const string DETECTIONS_TABLENAME = "detections"; - - #endregion - - #region Mode Captions - - public const string REGULAR_MODE_CAPTION = "Норма"; - public const string WINTER_MODE_CAPTION = "Зима"; - public const string NIGHT_MODE_CAPTION = "Ніч"; - - #endregion - - public const string CSV_PATH = "matches.csv"; -} \ No newline at end of file diff --git a/Azaion.Common/DTO/Config/AppConfig.cs b/Azaion.Common/DTO/Config/AppConfig.cs index cd1d43d..e2acca0 100644 --- a/Azaion.Common/DTO/Config/AppConfig.cs +++ b/Azaion.Common/DTO/Config/AppConfig.cs @@ -1,7 +1,6 @@ using System.IO; using System.Text; using Azaion.Common.Extensions; -using Azaion.CommonSecurity; using Newtonsoft.Json; namespace Azaion.Common.DTO.Config; @@ -44,38 +43,12 @@ public class ConfigUpdater : IConfigUpdater public void CheckConfig() { var exePath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)!; - var configFilePath = Path.Combine(exePath, SecurityConstants.CONFIG_PATH); + var configFilePath = Path.Combine(exePath, Constants.CONFIG_PATH); if (File.Exists(configFilePath)) return; - - var appConfig = new AppConfig - { - AnnotationConfig = Constants.DefaultAnnotationConfig, - - UIConfig = new UIConfig - { - LeftPanelWidth = Constants.DEFAULT_LEFT_PANEL_WIDTH, - RightPanelWidth = Constants.DEFAULT_RIGHT_PANEL_WIDTH, - GenerateAnnotatedImage = false - }, - - DirectoriesConfig = new DirectoriesConfig - { - VideosDirectory = Constants.DEFAULT_VIDEO_DIR, - ImagesDirectory = Constants.DEFAULT_IMAGES_DIR, - LabelsDirectory = Constants.DEFAULT_LABELS_DIR, - ResultsDirectory = Constants.DEFAULT_RESULTS_DIR, - ThumbnailsDirectory = Constants.DEFAULT_THUMBNAILS_DIR, - GpsSatDirectory = Constants.DEFAULT_GPS_SAT_DIRECTORY, - GpsRouteDirectory = Constants.DEFAULT_GPS_ROUTE_DIRECTORY - }, - - ThumbnailConfig = Constants.DefaultThumbnailConfig, - AIRecognitionConfig = Constants.DefaultAIRecognitionConfig, - GpsDeniedConfig = Constants.DefaultGpsDeniedConfig, - }; - Save(appConfig); + + Save(Constants.FailsafeAppConfig); } public void Save(AppConfig config) @@ -91,7 +64,7 @@ public class ConfigUpdater : IConfigUpdater config.UIConfig }; - await File.WriteAllTextAsync(SecurityConstants.CONFIG_PATH, JsonConvert.SerializeObject(publicConfig, Formatting.Indented), Encoding.UTF8); + await File.WriteAllTextAsync(Constants.CONFIG_PATH, JsonConvert.SerializeObject(publicConfig, Formatting.Indented), Encoding.UTF8); }, SaveConfigTaskId, TimeSpan.FromSeconds(5)); } diff --git a/Azaion.Common/SecurityConstants.cs b/Azaion.Common/SecurityConstants.cs index a28097e..03153f8 100644 --- a/Azaion.Common/SecurityConstants.cs +++ b/Azaion.Common/SecurityConstants.cs @@ -1,11 +1,14 @@ using System.IO; using Azaion.Common.DTO; +using Azaion.Common.DTO.Config; +using Azaion.Common.Extensions; using Newtonsoft.Json; using Serilog; +using System.Windows; namespace Azaion.Common; -public class SecurityConstants +public class Constants { public const string CONFIG_PATH = "config.json"; @@ -25,8 +28,11 @@ public class SecurityConstants public const int DEFAULT_ZMQ_INFERENCE_PORT = 5227; public const string DEFAULT_ZMQ_GPS_DENIED_HOST = "127.0.0.1"; - public const int DEFAULT_ZMQ_GPS_DENIED_PORT = 5227; + public const int DEFAULT_ZMQ_GPS_DENIED_PORT = 5255; + public const int DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT = 5256; + #endregion ExternalClientsConfig + # region Cache keys public const string CURRENT_USER_CACHE_KEY = "CurrentUser"; @@ -34,6 +40,128 @@ public class SecurityConstants # endregion + public const string JPG_EXT = ".jpg"; + public const string TXT_EXT = ".txt"; + #region DirectoriesConfig + + public const string DEFAULT_VIDEO_DIR = "video"; + public const string DEFAULT_LABELS_DIR = "labels"; + public const string DEFAULT_IMAGES_DIR = "images"; + public const string DEFAULT_RESULTS_DIR = "results"; + public const string DEFAULT_THUMBNAILS_DIR = "thumbnails"; + public const string DEFAULT_GPS_SAT_DIRECTORY = "satellitesDir"; + public const string DEFAULT_GPS_ROUTE_DIRECTORY = "routeDir"; + + #endregion + + #region AnnotatorConfig + + public static readonly AnnotationConfig DefaultAnnotationConfig = new() + { + DetectionClasses = DefaultAnnotationClasses!, + VideoFormats = DefaultVideoFormats!, + ImageFormats = DefaultImageFormats!, + AnnotationsDbFile = DEFAULT_ANNOTATIONS_DB_FILE + }; + + private static readonly List DefaultAnnotationClasses = + [ + new() { Id = 0, Name = "ArmorVehicle", ShortName = "Броня", Color = "#FF0000".ToColor() }, + new() { Id = 1, Name = "Truck", ShortName = "Вантаж.", Color = "#00FF00".ToColor() }, + new() { Id = 2, Name = "Vehicle", ShortName = "Машина", Color = "#0000FF".ToColor() }, + new() { Id = 3, Name = "Atillery", ShortName = "Арта", Color = "#FFFF00".ToColor() }, + new() { Id = 4, Name = "Shadow", ShortName = "Тінь", Color = "#FF00FF".ToColor() }, + new() { Id = 5, Name = "Trenches", ShortName = "Окопи", Color = "#00FFFF".ToColor() }, + new() { Id = 6, Name = "MilitaryMan", ShortName = "Військов", Color = "#188021".ToColor() }, + new() { Id = 7, Name = "TyreTracks", ShortName = "Накати", Color = "#800000".ToColor() }, + new() { Id = 8, Name = "AdditArmoredTank", ShortName = "Танк.захист", Color = "#008000".ToColor() }, + new() { Id = 9, Name = "Smoke", ShortName = "Дим", Color = "#000080".ToColor() }, + new() { Id = 10, Name = "Plane", ShortName = "Літак", Color = "#000080".ToColor() }, + new() { Id = 11, Name = "Moto", ShortName = "Мото", Color = "#808000".ToColor() }, + new() { Id = 12, Name = "CamouflageNet", ShortName = "Сітка", Color = "#800080".ToColor() }, + new() { Id = 13, Name = "CamouflageBranches", ShortName = "Гілки", Color = "#2f4f4f".ToColor() }, + new() { Id = 14, Name = "Roof", ShortName = "Дах", Color = "#1e90ff".ToColor() }, + new() { Id = 15, Name = "Building", ShortName = "Будівля", Color = "#ffb6c1".ToColor() }, + new() { Id = 16, Name = "Caponier", ShortName = "Капонір", Color = "#ffb6c1".ToColor() }, + ]; + + public static readonly List DefaultVideoFormats = ["mp4", "mov", "avi"]; + public static readonly List DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"]; + + public static int DEFAULT_LEFT_PANEL_WIDTH = 250; + public static int DEFAULT_RIGHT_PANEL_WIDTH = 250; + + public const string DEFAULT_ANNOTATIONS_DB_FILE = "annotations.db"; + + # endregion AnnotatorConfig + + # region AIRecognitionConfig + + public static readonly AIRecognitionConfig DefaultAIRecognitionConfig = new() + { + FrameRecognitionSeconds = DEFAULT_FRAME_RECOGNITION_SECONDS, + TrackingDistanceConfidence = TRACKING_DISTANCE_CONFIDENCE, + TrackingProbabilityIncrease = TRACKING_PROBABILITY_INCREASE, + TrackingIntersectionThreshold = TRACKING_INTERSECTION_THRESHOLD, + FramePeriodRecognition = DEFAULT_FRAME_PERIOD_RECOGNITION + }; + + public const double DEFAULT_FRAME_RECOGNITION_SECONDS = 2; + public const double TRACKING_DISTANCE_CONFIDENCE = 0.15; + public const double TRACKING_PROBABILITY_INCREASE = 15; + public const double TRACKING_INTERSECTION_THRESHOLD = 0.8; + public const int DEFAULT_FRAME_PERIOD_RECOGNITION = 4; + + # endregion AIRecognitionConfig + + # region GpsDeniedConfig + + public static readonly GpsDeniedConfig DefaultGpsDeniedConfig = new() + { + MinKeyPoints = 15 + }; + + # endregion + + #region Thumbnails + + public static readonly ThumbnailConfig DefaultThumbnailConfig = new() + { + Size = DefaultThumbnailSize, + Border = DEFAULT_THUMBNAIL_BORDER + }; + + public static readonly Size DefaultThumbnailSize = new(240, 135); + + public const int DEFAULT_THUMBNAIL_BORDER = 10; + + public const string THUMBNAIL_PREFIX = "_thumb"; + public const string RESULT_PREFIX = "_result"; + + #endregion + + public const string MQ_ANNOTATIONS_QUEUE = "azaion-annotations"; + + #region Database + + public const string ANNOTATIONS_TABLENAME = "annotations"; + public const string ANNOTATIONS_QUEUE_TABLENAME = "annotations_queue"; + public const string ADMIN_EMAIL = "admin@azaion.com"; + public const string DETECTIONS_TABLENAME = "detections"; + + #endregion + + #region Mode Captions + + public const string REGULAR_MODE_CAPTION = "Норма"; + public const string WINTER_MODE_CAPTION = "Зима"; + public const string NIGHT_MODE_CAPTION = "Ніч"; + + #endregion + + public const string CSV_PATH = "matches.csv"; + + public static readonly InitConfig DefaultInitConfig = new() { LoaderClientConfig = new LoaderClientConfig @@ -51,15 +179,61 @@ public class SecurityConstants GpsDeniedClientConfig = new GpsDeniedClientConfig { ZeroMqHost = DEFAULT_ZMQ_GPS_DENIED_HOST, - ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT + ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT, + ZeroMqReceiverPort = DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT }, DirectoriesConfig = new DirectoriesConfig { ApiResourcesDirectory = "" } }; - #endregion ExternalClientsConfig + public static readonly AppConfig FailsafeAppConfig = new() + { + AnnotationConfig = DefaultAnnotationConfig, + + UIConfig = new UIConfig + { + LeftPanelWidth = DEFAULT_LEFT_PANEL_WIDTH, + RightPanelWidth = DEFAULT_RIGHT_PANEL_WIDTH, + GenerateAnnotatedImage = false + }, + + DirectoriesConfig = new DirectoriesConfig + { + VideosDirectory = DEFAULT_VIDEO_DIR, + ImagesDirectory = DEFAULT_IMAGES_DIR, + LabelsDirectory = DEFAULT_LABELS_DIR, + ResultsDirectory = DEFAULT_RESULTS_DIR, + ThumbnailsDirectory = DEFAULT_THUMBNAILS_DIR, + GpsSatDirectory = DEFAULT_GPS_SAT_DIRECTORY, + GpsRouteDirectory = DEFAULT_GPS_ROUTE_DIRECTORY + }, + + ThumbnailConfig = DefaultThumbnailConfig, + AIRecognitionConfig = DefaultAIRecognitionConfig, + GpsDeniedConfig = DefaultGpsDeniedConfig, + + LoaderClientConfig = new LoaderClientConfig + { + ZeroMqHost = DEFAULT_ZMQ_LOADER_HOST, + ZeroMqPort = DEFAULT_ZMQ_LOADER_PORT, + ApiUrl = DEFAULT_API_URL + }, + InferenceClientConfig = new InferenceClientConfig + { + ZeroMqHost = DEFAULT_ZMQ_INFERENCE_HOST, + ZeroMqPort = DEFAULT_ZMQ_INFERENCE_PORT, + ApiUrl = DEFAULT_API_URL + }, + GpsDeniedClientConfig = new GpsDeniedClientConfig + { + ZeroMqHost = DEFAULT_ZMQ_GPS_DENIED_HOST, + ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT, + ZeroMqReceiverPort = DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT + } + }; + public static InitConfig ReadInitConfig(ILogger logger) { try diff --git a/Azaion.Common/Services/AuthProvider.cs b/Azaion.Common/Services/AuthProvider.cs index 00376b3..d3aa34d 100644 --- a/Azaion.Common/Services/AuthProvider.cs +++ b/Azaion.Common/Services/AuthProvider.cs @@ -28,7 +28,7 @@ public class AzaionApi(ILogger logger, HttpClient client, ICache cache, ApiCrede { get { - var user = cache.GetFromCache(SecurityConstants.CURRENT_USER_CACHE_KEY, + var user = cache.GetFromCache(Constants.CURRENT_USER_CACHE_KEY, () => Get("currentUser")); if (user == null) throw new Exception("Can't get current user"); diff --git a/Azaion.Common/Services/GPSMatcherService.cs b/Azaion.Common/Services/GPSMatcherService.cs index bc442ad..478a414 100644 --- a/Azaion.Common/Services/GPSMatcherService.cs +++ b/Azaion.Common/Services/GPSMatcherService.cs @@ -40,7 +40,7 @@ public class GpsMatcherService(IGpsMatcherClient gpsMatcherClient, public async Task RunGpsMatching(string userRouteDir, GeoPoint initGeoPoint, CancellationToken detectToken = default) { - _routeDir = Path.Combine(SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER, _dirConfig.GpsRouteDirectory); + _routeDir = Path.Combine(Constants.EXTERNAL_GPS_DENIED_FOLDER, _dirConfig.GpsRouteDirectory); _userRouteDir = userRouteDir; _allRouteImages = Directory.GetFiles(userRouteDir) diff --git a/Azaion.Common/Services/GpsMatcherClient.cs b/Azaion.Common/Services/GpsMatcherClient.cs index 05ca065..25100c4 100644 --- a/Azaion.Common/Services/GpsMatcherClient.cs +++ b/Azaion.Common/Services/GpsMatcherClient.cs @@ -49,9 +49,9 @@ public class GpsMatcherClient : IGpsMatcherClient using var process = new Process(); process.StartInfo = new ProcessStartInfo { - FileName = SecurityConstants.ExternalGpsDeniedPath, + FileName = Constants.ExternalGpsDeniedPath, Arguments = $"zeromq --rep {gpsConfig.Value.ZeroMqPort} --pub {gpsConfig.Value.ZeroMqReceiverPort}", - WorkingDirectory = SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER, + WorkingDirectory = Constants.EXTERNAL_GPS_DENIED_FOLDER, CreateNoWindow = true }; process.Start(); diff --git a/Azaion.Common/Services/InferenceClient.cs b/Azaion.Common/Services/InferenceClient.cs index 63483ed..7e59620 100644 --- a/Azaion.Common/Services/InferenceClient.cs +++ b/Azaion.Common/Services/InferenceClient.cs @@ -45,7 +45,7 @@ public class InferenceClient : IInferenceClient using var process = new Process(); process.StartInfo = new ProcessStartInfo { - FileName = SecurityConstants.EXTERNAL_INFERENCE_PATH, + FileName = Constants.EXTERNAL_INFERENCE_PATH, Arguments = $"-p {_inferenceClientConfig.ZeroMqPort} -lp {_loaderClientConfig.ZeroMqPort} -a {_inferenceClientConfig.ApiUrl}", CreateNoWindow = true }; diff --git a/Azaion.Common/Services/LoaderClient.cs b/Azaion.Common/Services/LoaderClient.cs index dee71cb..f6c2ac4 100644 --- a/Azaion.Common/Services/LoaderClient.cs +++ b/Azaion.Common/Services/LoaderClient.cs @@ -22,7 +22,7 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio using var process = new Process(); process.StartInfo = new ProcessStartInfo { - FileName = SecurityConstants.EXTERNAL_LOADER_PATH, + FileName = Constants.EXTERNAL_LOADER_PATH, Arguments = $"--port {config.ZeroMqPort} --api {config.ApiUrl}", CreateNoWindow = true }; diff --git a/Azaion.Common/Services/SatelliteDownloader.cs b/Azaion.Common/Services/SatelliteDownloader.cs index 7012ff0..686d785 100644 --- a/Azaion.Common/Services/SatelliteDownloader.cs +++ b/Azaion.Common/Services/SatelliteDownloader.cs @@ -43,7 +43,7 @@ public class SatelliteDownloader( private const int OUTPUT_TILE_SIZE = 512; private readonly string _apiKey = mapConfig.Value.ApiKey; - private readonly string _satDirectory = Path.Combine(SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER, directoriesConfig.Value.GpsSatDirectory); + private readonly string _satDirectory = Path.Combine(Constants.EXTERNAL_GPS_DENIED_FOLDER, directoriesConfig.Value.GpsSatDirectory); public async Task GetTiles(GeoPoint centerGeoPoint, double radiusM, int zoomLevel, CancellationToken token = default) { diff --git a/Azaion.Suite/App.xaml.cs b/Azaion.Suite/App.xaml.cs index 1ca0e1e..d392ea8 100644 --- a/Azaion.Suite/App.xaml.cs +++ b/Azaion.Suite/App.xaml.cs @@ -107,7 +107,7 @@ public partial class App try { new ConfigUpdater().CheckConfig(); - var initConfig = SecurityConstants.ReadInitConfig(Log.Logger); + var initConfig = Constants.ReadInitConfig(Log.Logger); var apiDir = initConfig.DirectoriesConfig.ApiResourcesDirectory; _loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _mainCTokenSource.Token); @@ -120,7 +120,7 @@ public partial class App _host = Host.CreateDefaultBuilder() .ConfigureAppConfiguration((_, config) => config .AddCommandLine(Environment.GetCommandLineArgs()) - .AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true) + .AddJsonFile(Constants.CONFIG_PATH, optional: true, reloadOnChange: true) .AddJsonStream(GetSystemConfig(_loaderClient, apiDir)) .AddJsonStream(GetSecuredConfig(_loaderClient, apiDir))) .UseSerilog()