Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cff817044 | ||
|
|
407bbc1556 | ||
|
|
f2ace6f571 | ||
|
|
3034e66126 | ||
|
|
701ffff27e | ||
|
|
ec9cca59da | ||
|
|
90d1d6b429 | ||
|
|
3d8f903d30 | ||
|
|
eedca27a11 | ||
|
|
69a22fb3eb | ||
|
|
d3270d3117 | ||
|
|
f02203c14c | ||
|
|
7ad691c439 | ||
|
|
4eaaf0f244 | ||
|
|
a160992c08 | ||
|
|
1a361a9524 | ||
|
|
be07cdb13e |
@@ -16,12 +16,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FuzzySharp" Version="2.0.2" />
|
||||
<PackageReference Include="MessagePack" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePack.Annotations" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePackAnalyzer" Version="3.0.238-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NetMQ" Version="4.0.1.13" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
DROP TABLE Unfiltered;
|
||||
DROP TABLE Runtimes;
|
||||
|
||||
CREATE TABLE "Unfiltered" (
|
||||
"Id" INTEGER NOT NULL,
|
||||
"Ip" TEXT NOT NULL,
|
||||
"ResponseCode" INTEGER NOT NULL,
|
||||
"Port1" INTEGER NOT NULL,
|
||||
"Port2" INTEGER NOT NULL,
|
||||
"Filtered" INTEGER NOT NULL,
|
||||
CONSTRAINT "PK_Unfiltered" PRIMARY KEY("Id" AUTOINCREMENT)
|
||||
);
|
||||
|
||||
CREATE TABLE "Runtimes" (
|
||||
"Id" INTEGER NOT NULL CONSTRAINT "PK_Runtimes" PRIMARY KEY AUTOINCREMENT,
|
||||
"StartTime" TEXT NOT NULL,
|
||||
"EndTime" TEXT NOT NULL,
|
||||
"ThreadNumber" INTEGER NOT NULL
|
||||
);
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using Backend.Helper;
|
||||
using MessagePack;
|
||||
using Models.Handler;
|
||||
using Models.Model.Backend;
|
||||
using Models.Model.External;
|
||||
@@ -14,12 +13,18 @@ public class Communication
|
||||
{
|
||||
private readonly DbHandler _dbHandler;
|
||||
private readonly ThreadHandler _threadHandler;
|
||||
private readonly IpScanner _ipScanner;
|
||||
private readonly ContentFilter _contentFilter;
|
||||
private bool _isRunning = true;
|
||||
private string _basePath;
|
||||
|
||||
public Communication(DbHandler dbHandler, ThreadHandler threadHandler)
|
||||
public Communication(DbHandler dbHandler, ThreadHandler threadHandler, IpScanner ipScanner, ContentFilter contentFilter, string basePath)
|
||||
{
|
||||
_dbHandler = dbHandler;
|
||||
_threadHandler = threadHandler;
|
||||
_ipScanner = ipScanner;
|
||||
_contentFilter = contentFilter;
|
||||
_basePath = basePath;
|
||||
}
|
||||
|
||||
public WaitHandle[] Start()
|
||||
@@ -38,20 +43,29 @@ public class Communication
|
||||
{
|
||||
using ResponseSocket rep = new();
|
||||
|
||||
//rep.Options.IPv4Only = true;
|
||||
|
||||
rep.Bind("tcp://127.0.0.1:5556");
|
||||
|
||||
while (_isRunning)
|
||||
{
|
||||
byte[] message = rep.ReceiveFrameBytes();
|
||||
|
||||
CommunicationObject? communicationObject = JsonSerializer.Deserialize<CommunicationObject>(message);
|
||||
|
||||
CommunicationObject communicationObject = MessagePackSerializer.Deserialize<CommunicationObject>(message);
|
||||
|
||||
//rep.SendFrame(JsonSerializer.SerializeToUtf8Bytes("Success"));
|
||||
|
||||
if (communicationObject is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
OnServerOnReceiveReady(communicationObject, rep);
|
||||
}
|
||||
|
||||
((EventWaitHandle) obj).Set();
|
||||
}
|
||||
|
||||
|
||||
[RequiresDynamicCode("Calls System.Text.Json.JsonSerializer.Serialize<TValue>(TValue, JsonSerializerOptions)")]
|
||||
[RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.Serialize<TValue>(TValue, JsonSerializerOptions)")]
|
||||
private void OnServerOnReceiveReady(CommunicationObject communicationObject, ResponseSocket rep)
|
||||
@@ -60,8 +74,8 @@ public class Communication
|
||||
{
|
||||
case CommunicationCommand.GetScanningProgress:
|
||||
{
|
||||
DatabaseSizes databaseSizes = FilesystemHelper.GetDatabaseSizes();
|
||||
|
||||
DatabaseSizes databaseSizes = FilesystemHelper.GetDatabaseSizes(_basePath);
|
||||
|
||||
long discardedIndexes = _dbHandler.GetDiscardedIndexes();
|
||||
|
||||
ScanningStatus status = new();
|
||||
@@ -77,13 +91,13 @@ public class Communication
|
||||
}
|
||||
|
||||
status.AmountOfIpv4Left = 4294967296 - discardedIndexes;
|
||||
status.TotalFiltered = DbHandler.GetFilteredIndexes();
|
||||
status.TotalFiltered = _dbHandler.GetFilteredIndexes();
|
||||
status.TotalDiscarded = discardedIndexes;
|
||||
status.MyDbSize = databaseSizes.MyDbSize;
|
||||
status.FilteredDbSize = databaseSizes.FilteredDbSize;
|
||||
status.DiscardedDbSize = databaseSizes.DiscardedDbSize;
|
||||
|
||||
byte[] serializedResult = MessagePackSerializer.Serialize(status, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray));
|
||||
|
||||
byte[] serializedResult = JsonSerializer.SerializeToUtf8Bytes(status);
|
||||
|
||||
rep.SendFrame(serializedResult);
|
||||
|
||||
@@ -93,7 +107,7 @@ public class Communication
|
||||
case CommunicationCommand.DbReindex:
|
||||
{
|
||||
_dbHandler.ReIndex();
|
||||
|
||||
|
||||
SendStringResponse(rep, "All Dbs have been reindexed.");
|
||||
break;
|
||||
}
|
||||
@@ -101,7 +115,7 @@ public class Communication
|
||||
case CommunicationCommand.DbVacuum:
|
||||
{
|
||||
_dbHandler.Vacuum();
|
||||
|
||||
|
||||
SendStringResponse(rep, "All Dbs have been vacuumed.");
|
||||
break;
|
||||
}
|
||||
@@ -121,13 +135,45 @@ public class Communication
|
||||
_isRunning = false;
|
||||
break;
|
||||
}
|
||||
|
||||
case CommunicationCommand.ChangeRuntimeVariable:
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(communicationObject.VariableValue)) break;
|
||||
|
||||
if (communicationObject.Variable == RuntimeVariable.DbContent.ToString())
|
||||
{
|
||||
int value = int.Parse(communicationObject.VariableValue);
|
||||
_dbHandler.SetContentWaitTime(value);
|
||||
}
|
||||
|
||||
if (communicationObject.Variable == RuntimeVariable.DbDiscarded.ToString())
|
||||
{
|
||||
int value = int.Parse(communicationObject.VariableValue);
|
||||
_dbHandler.SetDiscardedWaitTime(value);
|
||||
}
|
||||
|
||||
if (communicationObject.Variable == RuntimeVariable.ScannerTimeout.ToString())
|
||||
{
|
||||
int value = int.Parse(communicationObject.VariableValue);
|
||||
_ipScanner.SetTimeout(value);
|
||||
}
|
||||
|
||||
if (communicationObject.Variable == RuntimeVariable.ContentFilter.ToString())
|
||||
{
|
||||
int value = int.Parse(communicationObject.VariableValue);
|
||||
_contentFilter.SetTimeout(value);
|
||||
}
|
||||
|
||||
rep.SendFrame(JsonSerializer.SerializeToUtf8Bytes("Success"));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void SendStringResponse(ResponseSocket rep, string response)
|
||||
{
|
||||
MessagePackSerializerOptions withCompression = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray);
|
||||
byte[] serializedResult = MessagePackSerializer.Serialize(response, withCompression);
|
||||
byte[] serializedResult = JsonSerializer.SerializeToUtf8Bytes(response);
|
||||
|
||||
rep.SendFrame(serializedResult);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using Backend.Helper;
|
||||
using Models.Handler;
|
||||
using Models.Model.Backend;
|
||||
@@ -9,16 +8,31 @@ namespace Backend.Handler;
|
||||
|
||||
public class ContentFilter
|
||||
{
|
||||
private readonly ConcurrentQueue<QueueItem> _queue;
|
||||
private readonly ConcurrentQueue<Filtered> _queue;
|
||||
private readonly ConcurrentQueue<UnfilteredQueueItem> _unfilteredQueue;
|
||||
private readonly DbHandler _dbHandler;
|
||||
private const string GetDomainPort80 = "/home/skingging/Documents/Projects/CSharp/RSE/Backend/Scripts/GetDomainNamePort80.sh";
|
||||
private const string GetDomainPort443 = "/home/skingging/Documents/Projects/CSharp/RSE/Backend/Scripts/GetDomainNamePort443.sh";
|
||||
private readonly string _getDomainPort80;
|
||||
private readonly string _getDomainPort443;
|
||||
private bool _stop;
|
||||
private int _timeOut;
|
||||
private readonly string _basePath;
|
||||
|
||||
public ContentFilter(ConcurrentQueue<QueueItem> queue, DbHandler dbHandler)
|
||||
public ContentFilter(ConcurrentQueue<Filtered> queue, ConcurrentQueue<UnfilteredQueueItem> unfilteredQueue, DbHandler dbHandler, string basePath)
|
||||
{
|
||||
_queue = queue;
|
||||
_dbHandler = dbHandler;
|
||||
_basePath = basePath;
|
||||
_unfilteredQueue = unfilteredQueue;
|
||||
|
||||
_getDomainPort80 = $"{basePath}/Backend/Scripts/GetDomainNamePort80.sh";
|
||||
_getDomainPort443 = $"{basePath}/Backend/Scripts/GetDomainNamePort443.sh";
|
||||
|
||||
SetTimeout(3000);
|
||||
}
|
||||
|
||||
public void SetTimeout(int timeOut)
|
||||
{
|
||||
_timeOut = timeOut;
|
||||
}
|
||||
|
||||
public WaitHandle[] Start()
|
||||
@@ -26,6 +40,7 @@ public class ContentFilter
|
||||
WaitHandle[] waitHandles = new WaitHandle[1];
|
||||
EventWaitHandle handle = new(false, EventResetMode.ManualReset);
|
||||
waitHandles[0] = handle;
|
||||
|
||||
Thread f = new (Filter!);
|
||||
f.Start(handle);
|
||||
|
||||
@@ -34,49 +49,50 @@ public class ContentFilter
|
||||
|
||||
private void Filter(object obj)
|
||||
{
|
||||
long indexes = DbHandler.GetUnfilteredIndexes();
|
||||
|
||||
for (long i = 0; i < indexes; i++)
|
||||
while (!_stop)
|
||||
{
|
||||
if (_stop) break;
|
||||
List<long> indexes = _dbHandler.GetUnfilteredIndexes();
|
||||
|
||||
Unfiltered? unfiltered = DbHandler.ReadUnfilteredWithId(i);
|
||||
|
||||
if (unfiltered is null || unfiltered.Filtered == 1) continue;
|
||||
|
||||
unfiltered.Filtered = 1;
|
||||
|
||||
QueueItem superUnfilteredObject = new()
|
||||
for (int i = 0; i < indexes.Count; i++)
|
||||
{
|
||||
Unfiltered = unfiltered,
|
||||
Operations = Operations.Update
|
||||
};
|
||||
|
||||
_queue.Enqueue(superUnfilteredObject);
|
||||
|
||||
if (_dbHandler.GetFilteredIp(unfiltered.Ip))
|
||||
{
|
||||
continue;
|
||||
if (_stop) break;
|
||||
|
||||
Unfiltered unfiltered = _dbHandler.ReadUnfilteredWithId(indexes[i]);
|
||||
|
||||
if (unfiltered.Filtered) continue;
|
||||
|
||||
Ip ip = unfiltered.Ip;
|
||||
|
||||
unfiltered.Filtered = true;
|
||||
|
||||
UnfilteredQueueItem superUnfilteredObject = new()
|
||||
{
|
||||
Unfiltered = unfiltered,
|
||||
Operations = Operations.Update
|
||||
};
|
||||
|
||||
_unfilteredQueue.Enqueue(superUnfilteredObject);
|
||||
|
||||
if (_dbHandler.FilteredIpExists(unfiltered.Ip))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Filtered filtered = GetSiteData(ip);
|
||||
|
||||
filtered.Port1 = unfiltered.Port1;
|
||||
filtered.Port2 = unfiltered.Port2;
|
||||
|
||||
_queue.Enqueue(filtered);
|
||||
}
|
||||
|
||||
Filtered filtered = GetSiteData(unfiltered.Ip);
|
||||
|
||||
filtered.Port1 = unfiltered.Port1;
|
||||
filtered.Port2 = unfiltered.Port2;
|
||||
|
||||
QueueItem superFilteredObject = new()
|
||||
{
|
||||
Filtered = filtered,
|
||||
Operations = Operations.Insert
|
||||
};
|
||||
|
||||
_queue.Enqueue(superFilteredObject);
|
||||
Thread.Sleep(_timeOut);
|
||||
}
|
||||
|
||||
((EventWaitHandle) obj).Set();
|
||||
}
|
||||
|
||||
private static Filtered GetSiteData(string ip)
|
||||
private Filtered GetSiteData(Ip ip)
|
||||
{
|
||||
StartProcess(ip, 80);
|
||||
StartProcess(ip, 443);
|
||||
@@ -112,7 +128,7 @@ public class ContentFilter
|
||||
|
||||
for (int i = 0; i < ports.Length; i++)
|
||||
{
|
||||
using StreamReader streamReader = new($"{ports[i]}Header.txt");
|
||||
using StreamReader streamReader = new($"{_basePath}/Backend/Scripts/{ports[i]}Header.txt");
|
||||
|
||||
while (streamReader.Peek() != -1)
|
||||
{
|
||||
@@ -204,19 +220,18 @@ public class ContentFilter
|
||||
return siteData;
|
||||
}
|
||||
|
||||
private static void StartProcess(string ip, int port)
|
||||
private void StartProcess(Ip ip, int port)
|
||||
{
|
||||
string fileName = port == 80 ? GetDomainPort80 : GetDomainPort443;
|
||||
string fileName = port == 80 ? _getDomainPort80 : _getDomainPort443;
|
||||
|
||||
Process proc = new();
|
||||
proc.StartInfo = new()
|
||||
{
|
||||
FileName = fileName,
|
||||
Arguments = $"{ip}",
|
||||
FileName = "/bin/bash",
|
||||
Arguments = $"{fileName} {ip.Ip1}.{ip.Ip2}.{ip.Ip3}.{ip.Ip4} {_basePath}/Backend/Scripts/{port}Header.txt",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = false,
|
||||
RedirectStandardError = false,
|
||||
RedirectStandardInput = false,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using Backend.Helper;
|
||||
@@ -18,16 +17,28 @@ public class ScanSettings
|
||||
|
||||
public class IpScanner
|
||||
{
|
||||
private readonly ConcurrentQueue<QueueItem> _queue;
|
||||
private readonly ConcurrentQueue<Discarded> _discardedQueue;
|
||||
private readonly ConcurrentQueue<UnfilteredQueueItem> _unfilteredQueue;
|
||||
private readonly ConcurrentQueue<ScannerResumeObject> _resumeQueue;
|
||||
private readonly DbHandler _dbHandler;
|
||||
private bool _stop;
|
||||
private int _timeout;
|
||||
|
||||
public IpScanner(ConcurrentQueue<QueueItem> queue, DbHandler dbHandler, ConcurrentQueue<Discarded> discardedQueue)
|
||||
public IpScanner(ConcurrentQueue<UnfilteredQueueItem> unfilteredQueue, ConcurrentQueue<Discarded> discardedQueue,
|
||||
ConcurrentQueue<ScannerResumeObject> resumeQueue, DbHandler dbHandler
|
||||
)
|
||||
{
|
||||
_queue = queue;
|
||||
_dbHandler = dbHandler;
|
||||
_discardedQueue = discardedQueue;
|
||||
_unfilteredQueue = unfilteredQueue;
|
||||
_resumeQueue = resumeQueue;
|
||||
|
||||
SetTimeout(64);
|
||||
}
|
||||
|
||||
public void SetTimeout(int milliseconds)
|
||||
{
|
||||
_timeout = milliseconds;
|
||||
}
|
||||
|
||||
public WaitHandle[] Start(int threads)
|
||||
@@ -110,7 +121,6 @@ public class IpScanner
|
||||
|
||||
if (_discardedQueue.Count >= 2000)
|
||||
{
|
||||
Console.WriteLine("loooooooooooooooooooooooooooool");
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
@@ -121,24 +131,30 @@ public class IpScanner
|
||||
resumeObject.FourthByte = l;
|
||||
break;
|
||||
}
|
||||
|
||||
string ip = $"{i}.{j}.{k}.{l}";
|
||||
|
||||
|
||||
Ip ip = new()
|
||||
{
|
||||
Ip1 = i,
|
||||
Ip2 = j,
|
||||
Ip3 = k,
|
||||
Ip4 = l
|
||||
};
|
||||
|
||||
IPStatus responseCode = IPStatus.Unknown;
|
||||
|
||||
try
|
||||
{
|
||||
// Sometimes, if the pinger gets a Destination Unreachable Communication administratively prohibited response, the pinger will throw an exception.
|
||||
// https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol?useskin=vector#Control_messages
|
||||
_ = IPAddress.TryParse(ip, out IPAddress? address);
|
||||
_ = IPAddress.TryParse(ip.ToString(), out IPAddress? address);
|
||||
if (address is not null)
|
||||
{
|
||||
responseCode = ping.Send(address, 512, buf, null).Status;
|
||||
responseCode = ping.Send(address, _timeout, buf, null).Status;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
//
|
||||
}
|
||||
|
||||
if (responseCode != IPStatus.Success)
|
||||
@@ -147,7 +163,7 @@ public class IpScanner
|
||||
continue;
|
||||
}
|
||||
|
||||
(int, int) ports = TcpClientHelper.CheckPort(ip, 80, 443);
|
||||
(int, int) ports = TcpClientHelper.CheckPort(ip.ToString(), 80, 443);
|
||||
|
||||
if (ports is { Item1: 0, Item2: 0 })
|
||||
{
|
||||
@@ -155,7 +171,7 @@ public class IpScanner
|
||||
continue;
|
||||
}
|
||||
|
||||
_queue.Enqueue(CreateUnfilteredQueueItem(ip, (int)responseCode, ports));
|
||||
_unfilteredQueue.Enqueue(CreateUnfilteredQueueItem(ip, ports));
|
||||
}
|
||||
|
||||
if (_stop)
|
||||
@@ -180,46 +196,35 @@ public class IpScanner
|
||||
//Console.WriteLine($"Thread ({scanSettings.ThreadNumber}) is at index ({i}) out of ({scanSettings.End}). Remaining ({scanSettings.End - i})");
|
||||
}
|
||||
|
||||
QueueItem resume = new()
|
||||
{
|
||||
ResumeObject = resumeObject,
|
||||
Operations = Operations.Insert
|
||||
};
|
||||
|
||||
_queue.Enqueue(resume);
|
||||
_resumeQueue.Enqueue(resumeObject);
|
||||
|
||||
scanSettings.Handle!.Set();
|
||||
}
|
||||
|
||||
private static Discarded CreateDiscardedQueueItem(string ip, int responseCode)
|
||||
private static Discarded CreateDiscardedQueueItem(Ip ip, int responseCode)
|
||||
{
|
||||
Discarded discarded = new()
|
||||
return new()
|
||||
{
|
||||
Ip = ip,
|
||||
ResponseCode = responseCode
|
||||
};
|
||||
|
||||
return discarded;
|
||||
}
|
||||
|
||||
private static QueueItem CreateUnfilteredQueueItem(string ip, int responseCode, (int, int) ports)
|
||||
private static UnfilteredQueueItem CreateUnfilteredQueueItem(Ip ip, (int, int) ports)
|
||||
{
|
||||
Unfiltered unfiltered = new()
|
||||
{
|
||||
Ip = ip,
|
||||
ResponseCode = responseCode,
|
||||
Port1 = ports.Item1,
|
||||
Port2 = ports.Item2,
|
||||
Filtered = 0
|
||||
Filtered = false
|
||||
};
|
||||
|
||||
QueueItem superUnfilteredObject = new()
|
||||
return new()
|
||||
{
|
||||
Unfiltered = unfiltered,
|
||||
Operations = Operations.Insert
|
||||
};
|
||||
|
||||
return superUnfilteredObject;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
||||
@@ -14,52 +14,52 @@ public class ThreadHandler
|
||||
private bool _communicationStopped;
|
||||
private bool _ipScannerStopped;
|
||||
private bool _contentFilterStopped;
|
||||
private bool _stopSignal;
|
||||
|
||||
public ThreadHandler()
|
||||
public ThreadHandler(string path)
|
||||
{
|
||||
ConcurrentQueue<QueueItem> contentQueue = new();
|
||||
ConcurrentQueue<Filtered> filteredQueue = new();
|
||||
ConcurrentQueue<Discarded> discardedQueue = new();
|
||||
ConcurrentQueue<UnfilteredQueueItem> unfilteredQueue = new();
|
||||
ConcurrentQueue<ScannerResumeObject> scannerResumeQueue = new();
|
||||
|
||||
_dbHandler = new(contentQueue, discardedQueue);
|
||||
_communication = new(_dbHandler, this);
|
||||
_ipScanner = new(contentQueue, _dbHandler, discardedQueue);
|
||||
_contentFilter = new(contentQueue, _dbHandler);
|
||||
_dbHandler = new(filteredQueue, discardedQueue, unfilteredQueue, scannerResumeQueue, path);
|
||||
_ipScanner = new(unfilteredQueue, discardedQueue, scannerResumeQueue, _dbHandler);
|
||||
_contentFilter = new(filteredQueue, unfilteredQueue, _dbHandler, path);
|
||||
_communication = new(_dbHandler, this, _ipScanner, _contentFilter, path);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Thread scanner = new(StartScanner);
|
||||
Thread indexer = new(StartIndexer);
|
||||
Thread indexer = new(StartContentFilter);
|
||||
Thread database = new(StartDbHandler);
|
||||
Thread discarded = new(StartDiscardedDbHandler);
|
||||
Thread filtered = new(StartFilteredDbHandler);
|
||||
Thread resume = new(StartResumeDbHandler);
|
||||
Thread communication = new(StartCommunicationHandler);
|
||||
|
||||
scanner.Start();
|
||||
indexer.Start();
|
||||
database.Start();
|
||||
discarded.Start();
|
||||
filtered.Start();
|
||||
resume.Start();
|
||||
communication.Start();
|
||||
|
||||
scanner.Join();
|
||||
indexer.Join();
|
||||
database.Join();
|
||||
discarded.Join();
|
||||
filtered.Join();
|
||||
resume.Join();
|
||||
communication.Join();
|
||||
}
|
||||
|
||||
public static void ManualGc()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
private void StartScanner()
|
||||
{
|
||||
Thread.Sleep(10000); // Let the database handler instantiate and warm up first.
|
||||
Thread.Sleep(5000); // Let the database handler instantiate and warm up first.
|
||||
|
||||
WaitHandle[] wait = _ipScanner.Start(4);
|
||||
WaitHandle[] wait = _ipScanner.Start(64);
|
||||
|
||||
WaitHandle.WaitAll(wait);
|
||||
|
||||
@@ -68,25 +68,30 @@ public class ThreadHandler
|
||||
_ipScannerStopped = true;
|
||||
}
|
||||
|
||||
private void StartIndexer()
|
||||
private void StartContentFilter()
|
||||
{
|
||||
while (!_stopSignal)
|
||||
{
|
||||
WaitHandle[] wait = _contentFilter.Start();
|
||||
|
||||
WaitHandle.WaitAll(wait);
|
||||
|
||||
Thread.Sleep(300000); // 5 minutes
|
||||
}
|
||||
WaitHandle[] wait = _contentFilter.Start();
|
||||
|
||||
Console.WriteLine("Indexer finished");
|
||||
WaitHandle.WaitAll(wait);
|
||||
|
||||
Console.WriteLine("Content filter finished");
|
||||
|
||||
_contentFilterStopped = true;
|
||||
}
|
||||
|
||||
private void StartDbHandler()
|
||||
{
|
||||
_dbHandler.StartContent();
|
||||
_dbHandler.UnfilteredDbHandler();
|
||||
}
|
||||
|
||||
private void StartFilteredDbHandler()
|
||||
{
|
||||
_dbHandler.FilteredDbHandler();
|
||||
}
|
||||
|
||||
private void StartResumeDbHandler()
|
||||
{
|
||||
_dbHandler.ResumeDbHandler();
|
||||
}
|
||||
|
||||
private void StartDiscardedDbHandler()
|
||||
@@ -110,10 +115,9 @@ public class ThreadHandler
|
||||
|
||||
Stop();
|
||||
}
|
||||
|
||||
|
||||
private void Stop()
|
||||
{
|
||||
_stopSignal = true;
|
||||
_ipScanner.Stop();
|
||||
_contentFilter.Stop();
|
||||
|
||||
|
||||
@@ -4,24 +4,24 @@ namespace Backend.Helper;
|
||||
|
||||
public static class FilesystemHelper
|
||||
{
|
||||
public static DatabaseSizes GetDatabaseSizes()
|
||||
public static DatabaseSizes GetDatabaseSizes(string basePath)
|
||||
{
|
||||
DatabaseSizes databaseSizes = new();
|
||||
|
||||
FileInfo fileInfo = new("../../../../Models/mydb.db");
|
||||
FileInfo fileInfo = new($"{basePath}/Models/mydb.db");
|
||||
databaseSizes.MyDbSize = fileInfo.Length.ToSize(SizeUnits.KB);
|
||||
|
||||
databaseSizes.DiscardedDbSize = GetDiscardedDbSizes().ToSize(SizeUnits.KB);
|
||||
databaseSizes.DiscardedDbSize = GetDiscardedDbSizes(basePath).ToSize(SizeUnits.KB);
|
||||
|
||||
fileInfo = new("../../../../Models/Filtered.db");
|
||||
fileInfo = new($"{basePath}/Models/Filtered.db");
|
||||
databaseSizes.FilteredDbSize = fileInfo.Length.ToSize(SizeUnits.KB);
|
||||
|
||||
return databaseSizes;
|
||||
}
|
||||
|
||||
private static long GetDiscardedDbSizes()
|
||||
private static long GetDiscardedDbSizes(string basePath)
|
||||
{
|
||||
const string folder = "../../../../Models";
|
||||
string folder = $"{basePath}/Models";
|
||||
string[] files = Directory.GetFiles(folder, "*.db");
|
||||
|
||||
long size = 0;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Backend.Helper;
|
||||
|
||||
public static class HttpClientHelper
|
||||
@@ -16,16 +18,17 @@ public static class HttpClientHelper
|
||||
}
|
||||
|
||||
client.DefaultRequestHeaders.Accept.Clear();
|
||||
client.Timeout = TimeSpan.FromSeconds(30);
|
||||
|
||||
HttpResponseMessage? response = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
response = await client.GetAsync("/");
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
//
|
||||
}
|
||||
|
||||
if (response is null || !response.IsSuccessStatusCode)
|
||||
@@ -35,7 +38,7 @@ public static class HttpClientHelper
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
|
||||
public static async Task<bool> HasRobotsTxt(string url, int port)
|
||||
{
|
||||
using HttpClient client = new();
|
||||
@@ -54,12 +57,12 @@ public static class HttpClientHelper
|
||||
HttpResponseMessage? response = null;
|
||||
|
||||
try
|
||||
{
|
||||
response = await client.GetAsync("/robots.txt");
|
||||
{//
|
||||
response = await client.SendAsync(new(HttpMethod.Head, "/robots.txt"));
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
//
|
||||
}
|
||||
|
||||
return response is not null && response.IsSuccessStatusCode;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Backend.Helper;
|
||||
|
||||
public static class ProjectPathHelper
|
||||
{
|
||||
public static string GetProjectPath()
|
||||
{
|
||||
return new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent!.Parent!.Parent!.Parent!.FullName;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
using Backend.Handler;
|
||||
using Backend.Helper;
|
||||
|
||||
Console.WriteLine("Program started");
|
||||
|
||||
ThreadHandler threadHandler = new();
|
||||
ThreadHandler threadHandler = new(ProjectPathHelper.GetProjectPath());
|
||||
threadHandler.Start();
|
||||
|
||||
Console.WriteLine("Done");
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -k -vvI -m 10 https://"$1" &> 443Header.txt
|
||||
curl -k -vvI -m 10 https://"$1" &> "$2"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -k -vvI -m 10 http://"$1" &> 80Header.txt
|
||||
curl -k -vvI -m 10 http://"$1" &> "$2"
|
||||
#80Header.txt
|
||||
|
||||
+47
-15
@@ -1,4 +1,6 @@
|
||||
using MessagePack;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using Models.Model.Backend;
|
||||
using Models.Model.External;
|
||||
using NetMQ;
|
||||
using NetMQ.Sockets;
|
||||
@@ -32,7 +34,7 @@ public static class Commands
|
||||
|
||||
Console.WriteLine(SendAndRecieveStringMessage(communicationObject));
|
||||
}
|
||||
|
||||
|
||||
public static void Vacuum()
|
||||
{
|
||||
CommunicationObject communicationObject = new();
|
||||
@@ -48,6 +50,18 @@ public static class Commands
|
||||
|
||||
Console.WriteLine(SendAndRecieveStringMessage(communicationObject));
|
||||
}
|
||||
|
||||
public static void SetRuntimeVariable(RuntimeVariable runtimeVariable, string value)
|
||||
{
|
||||
CommunicationObject communicationObject = new()
|
||||
{
|
||||
Command = CommunicationCommand.ChangeRuntimeVariable,
|
||||
Variable = runtimeVariable.ToString(),
|
||||
VariableValue = value
|
||||
};
|
||||
|
||||
Console.WriteLine(SendAndRecieveStringMessage(communicationObject));
|
||||
}
|
||||
|
||||
public static void GetHelp()
|
||||
{
|
||||
@@ -59,32 +73,50 @@ public static class Commands
|
||||
Console.WriteLine(" g - manual garbage collect on the server");
|
||||
Console.WriteLine(" r - manual reindex the databases");
|
||||
Console.WriteLine(" v - manual vacuum the databases");
|
||||
Console.WriteLine(" R - change runtime variable");
|
||||
Console.WriteLine(" lR - list runtime variables");
|
||||
Console.WriteLine(" help - shows this help");
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
private static string SendAndRecieveStringMessage(CommunicationObject communicationObject)
|
||||
public static void PrintRuntimeVariables()
|
||||
{
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
client.SendFrame(bytes);
|
||||
byte[] msg = client.ReceiveFrameBytes();
|
||||
client.Close();
|
||||
return MessagePackSerializer.Deserialize<string>(msg, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray));
|
||||
Console.WriteLine("Runtime variables:");
|
||||
Console.WriteLine($"{RuntimeVariable.ScannerTimeout.ToString()} - Sets the timeout in milliseconds for the scanner");
|
||||
Console.WriteLine($"{RuntimeVariable.ContentFilter.ToString()} - Sets the timeout in milliseconds for the content filter");
|
||||
Console.WriteLine($"{RuntimeVariable.DbContent.ToString()} - Sets the wait time in milliseconds for the content database if the queue is empty");
|
||||
Console.WriteLine($"{RuntimeVariable.DbDiscarded.ToString()} - Sets the wait time in milliseconds for the discarded database if the queue is empty");
|
||||
}
|
||||
|
||||
private static ScanningStatus GetProgress(CommunicationObject communicationObject)
|
||||
[RequiresDynamicCode("Calls System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)")]
|
||||
[RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)")]
|
||||
private static string? SendAndRecieveStringMessage(CommunicationObject communicationObject)
|
||||
{
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
//byte[] bytes = MessagePackSerializer.Serialize(communicationObject, ContractlessStandardResolver.Options);
|
||||
|
||||
byte[] lol = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
client.SendFrame(bytes);
|
||||
client.SendFrame(lol);
|
||||
byte[] msg = client.ReceiveFrameBytes();
|
||||
client.Close();
|
||||
|
||||
return MessagePackSerializer.Deserialize<ScanningStatus>(msg, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray));
|
||||
return JsonSerializer.Deserialize<string>(msg);
|
||||
}
|
||||
|
||||
[RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)")]
|
||||
[RequiresDynamicCode("Calls System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)")]
|
||||
private static ScanningStatus GetProgress(CommunicationObject communicationObject)
|
||||
{
|
||||
byte[] lol = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
client.SendFrame(lol);
|
||||
byte[] msg = client.ReceiveFrameBytes();
|
||||
client.Close();
|
||||
|
||||
return JsonSerializer.Deserialize<ScanningStatus>(msg);
|
||||
}
|
||||
}
|
||||
+4
-11
@@ -5,14 +5,13 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<PublishAot>true</PublishAot>
|
||||
<Platform>x64</Platform>
|
||||
|
||||
<!--<Platform>x64</Platform>
|
||||
<Optimize>true</Optimize>
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<PublishAot>true</PublishAot>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<TrimMode>link</TrimMode>
|
||||
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
|
||||
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -20,12 +19,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MessagePack" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePack.Annotations" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePackAnalyzer" Version="3.0.238-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NetMQ" Version="4.0.1.13" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Manager;
|
||||
using Models.Model.Backend;
|
||||
|
||||
bool stop = false;
|
||||
|
||||
@@ -36,6 +37,46 @@ do
|
||||
Commands.ReIndex();
|
||||
}
|
||||
|
||||
else if (string.Equals(input, "R"))
|
||||
{
|
||||
Console.WriteLine("Variable name.");
|
||||
string? variable = Console.ReadLine();
|
||||
|
||||
Console.WriteLine("Variable value.");
|
||||
string? value = Console.ReadLine();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(variable) || string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
Console.WriteLine("Please enter a value.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (variable == RuntimeVariable.ScannerTimeout.ToString())
|
||||
{
|
||||
Commands.SetRuntimeVariable(RuntimeVariable.ScannerTimeout, value);
|
||||
}
|
||||
|
||||
else if (variable == RuntimeVariable.ContentFilter.ToString())
|
||||
{
|
||||
Commands.SetRuntimeVariable(RuntimeVariable.ContentFilter, value);
|
||||
}
|
||||
|
||||
else if (variable == RuntimeVariable.DbDiscarded.ToString())
|
||||
{
|
||||
Commands.SetRuntimeVariable(RuntimeVariable.DbDiscarded, value);
|
||||
}
|
||||
|
||||
else if (variable == RuntimeVariable.DbContent.ToString())
|
||||
{
|
||||
Commands.SetRuntimeVariable(RuntimeVariable.DbContent, value);
|
||||
}
|
||||
}
|
||||
|
||||
else if (string.Equals(input, "lR"))
|
||||
{
|
||||
Commands.PrintRuntimeVariables();
|
||||
}
|
||||
|
||||
else if (string.Equals(input, "help"))
|
||||
{
|
||||
Commands.GetHelp();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+233
-81
@@ -7,24 +7,51 @@ namespace Models.Handler;
|
||||
|
||||
public class DbHandler
|
||||
{
|
||||
private readonly ConcurrentQueue<QueueItem> _contentQueue;
|
||||
private readonly ConcurrentQueue<Filtered> _filteredQueue;
|
||||
private readonly ConcurrentQueue<UnfilteredQueueItem> _unfilteredQueue;
|
||||
private readonly ConcurrentQueue<Discarded> _discardedQueue;
|
||||
|
||||
private const string UnfilteredConnectionString = "Data Source=../../../../Models/mydb.db";
|
||||
private const string DiscardedConnectionString = "Data Source=../../../../Models/Discarded.db";
|
||||
private const string FilteredConnectionString = "Data Source=../../../../Models/Filtered.db";
|
||||
private const string ResumeConnectionString = "Data Source=../../../../Models/ScannerResume.db";
|
||||
private readonly ConcurrentQueue<ScannerResumeObject> _resumeQueue;
|
||||
|
||||
private readonly string _unfilteredConnectionString;
|
||||
private readonly string _discardedConnectionString;
|
||||
private readonly string _filteredConnectionString;
|
||||
private readonly string _resumeConnectionString;
|
||||
private readonly List<string> _discardedConnectionStrings = [];
|
||||
|
||||
private const string InsertStatement = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY; PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off; INSERT INTO Unfiltered (Ip, ResponseCode, Port1, Port2, Filtered) VALUES (@ip, @responseCode, @port1, @port2, @filtered)";
|
||||
private const string InsertIntoFiltered = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY; PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off; INSERT INTO Filtered (Ip, Port1, Port2, Title1, Title2, Description1, Description2, Url1, Url2, ServerType1, ServerType2, RobotsTXT1, RobotsTXT2, HttpVersion1, HttpVersion2, CertificateIssuerCountry, CertificateOrganizationName, IpV6, TlsVersion, CipherSuite, KeyExchangeAlgorithm, PublicKeyType1, PublicKeyType2, PublicKeyType3, AcceptEncoding1, AcceptEncoding2, ALPN, Connection1, Connection2) VALUES (@ip, @port1, @port2, @title1, @title2, @description1, @description2, @url1, @url2, @serverType1, @serverType2, @robotsTXT1, @robotsTXT2, @httpVersion1, @httpVersion2, @certificateIssuerCountry, @certificateOrganizationName, @ipV6, @tlsVersion, @cipherSuite, @keyExchangeAlgorithm, @publicKeyType1, @publicKeyType2, @publicKeyType3, @acceptEncoding1, @acceptEncoding2, @aLPN, @connection1, @connection2)";
|
||||
private const string InsertIntoDiscarded = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY; PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off; INSERT INTO Discarded (Ip, ResponseCode) VALUES (@ip, @responseCode)";
|
||||
private const string InsertIntoResume = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY; PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off; INSERT INTO Resume (ThreadNumber, StartRange, EndRange, FirstByte, SecondByte, ThirdByte, FourthByte) VALUES (@threadNumber, @startRange, @endRange, @firstByte, @secondByte, @thirdByte, @fourthByte);";
|
||||
private const string InsertStatement = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY;" +
|
||||
" PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off;" +
|
||||
" INSERT INTO Unfiltered (Ip1, Ip2, Ip3, Ip4, Port1, Port2, Filtered)" +
|
||||
" VALUES (@ip1, @ip2, @ip3, @ip4, @port1, @port2, @filtered)";
|
||||
|
||||
private const string InsertIntoFiltered = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY;" +
|
||||
" PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off;" +
|
||||
" INSERT INTO Filtered (Ip1, Ip2, Ip3, Ip4, Port1, Port2, Title1, Title2," +
|
||||
" Description1, Description2, Url1, Url2, ServerType1, ServerType2," +
|
||||
" RobotsTXT1, RobotsTXT2, HttpVersion1, HttpVersion2, CertificateIssuerCountry," +
|
||||
" CertificateOrganizationName, IpV6, TlsVersion, CipherSuite, KeyExchangeAlgorithm," +
|
||||
" PublicKeyType1, PublicKeyType2, PublicKeyType3, AcceptEncoding1, AcceptEncoding2," +
|
||||
" ALPN, Connection1, Connection2) VALUES (@ip1, @ip2, @ip3, @ip4, @port1, @port2," +
|
||||
" @title1, @title2, @description1, @description2, @url1, @url2, @serverType1," +
|
||||
" @serverType2, @robotsTXT1, @robotsTXT2, @httpVersion1, @httpVersion2," +
|
||||
" @certificateIssuerCountry, @certificateOrganizationName, @ipV6, @tlsVersion," +
|
||||
" @cipherSuite, @keyExchangeAlgorithm, @publicKeyType1, @publicKeyType2," +
|
||||
" @publicKeyType3, @acceptEncoding1, @acceptEncoding2, @aLPN, @connection1, @connection2)";
|
||||
|
||||
private const string InsertIntoDiscarded = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY;" +
|
||||
" PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off;" +
|
||||
" INSERT INTO Discarded (Ip1, Ip2, Ip3, Ip4, ResponseCode)" +
|
||||
" VALUES (@ip1, @ip2, @ip3, @ip4, @responseCode)";
|
||||
|
||||
private const string InsertIntoResume = "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY;" +
|
||||
" PRAGMA journal_mode = MEMORY; PRAGMA foreign_keys = off;" +
|
||||
" INSERT INTO Resume (ThreadNumber, StartRange, EndRange, FirstByte, SecondByte, ThirdByte, FourthByte)" +
|
||||
" VALUES (@threadNumber, @startRange, @endRange, @firstByte, @secondByte, @thirdByte, @fourthByte);";
|
||||
|
||||
private const string ReadUnfilteredStatement = "SELECT * FROM Unfiltered WHERE Id = @id;";
|
||||
private const string ReadUnfilteredIdsStatement = "SELECT Id FROM Unfiltered WHERE Id != 0 ORDER BY Id DESC LIMIT 1;";
|
||||
private const string ReadUnfilteredIdsStatement = "SELECT Id FROM Unfiltered WHERE Filtered == 0;";
|
||||
private const string ReadFilteredStatement = "SELECT Title2, Url2 FROM Filtered WHERE (Url2 NOT NULL AND Url2 != '') AND (Title2 NOT NULL AND Title2 != '') ORDER BY Url2 DESC;";
|
||||
private const string ReadFilteredIdsStatement = "SELECT Id FROM Filtered WHERE Id != 0 ORDER BY Id DESC LIMIT 1;";
|
||||
private const string ReadFilteredIpStatement = "SELECT Ip1, Ip2, Ip3, Ip4 FROM Filtered WHERE Ip1 == @ip1 AND Ip2 == @ip1 AND Ip3 == @ip1 AND Ip4 == @ip1 ORDER BY Ip1 DESC LIMIT 1;";
|
||||
private const string ReadDiscardedSeqIdsStatement = "SELECT seq FROM sqlite_sequence;";
|
||||
private const string ReadAndDeleteResumeStatement = "SELECT * FROM Resume WHERE ThreadNumber == @threadNumber; DELETE FROM RESUME WHERE ThreadNumber == @threadNumber;";
|
||||
|
||||
@@ -33,55 +60,122 @@ public class DbHandler
|
||||
private const string ReIndexDatabasesStatement = "REINDEX;";
|
||||
|
||||
private const string VacuumDatabasesStatement = "VACUUM;";
|
||||
|
||||
|
||||
private readonly object _readFilteredLock = new();
|
||||
private readonly object _readAndDeleteResumeLock = new();
|
||||
|
||||
private bool _stop;
|
||||
private bool _pause;
|
||||
private bool _paused;
|
||||
|
||||
private int _contentWaitTime;
|
||||
private int _discardedWaitTime;
|
||||
|
||||
private readonly string _basePath;
|
||||
|
||||
public DbHandler(ConcurrentQueue<QueueItem> contentQueue, ConcurrentQueue<Discarded> discardedQueue)
|
||||
public DbHandler(ConcurrentQueue<Filtered> filteredQueue,
|
||||
ConcurrentQueue<Discarded> discardedQueue,
|
||||
ConcurrentQueue<UnfilteredQueueItem> unfilteredQueue,
|
||||
ConcurrentQueue<ScannerResumeObject> resumeQueue, string basePath)
|
||||
{
|
||||
_contentQueue = contentQueue;
|
||||
_filteredQueue = filteredQueue;
|
||||
_discardedQueue = discardedQueue;
|
||||
_unfilteredQueue = unfilteredQueue;
|
||||
_resumeQueue = resumeQueue;
|
||||
|
||||
SetContentWaitTime(100);
|
||||
SetDiscardedWaitTime(10);
|
||||
|
||||
_basePath = basePath;
|
||||
|
||||
_unfilteredConnectionString = $"Data Source={basePath}/Models/mydb.db";
|
||||
_discardedConnectionString = $"Data Source={basePath}/Models/Discarded.db";
|
||||
_filteredConnectionString = $"Data Source={basePath}/Models/Filtered.db";
|
||||
_resumeConnectionString = $"Data Source={basePath}/Models/ScannerResume.db";
|
||||
}
|
||||
|
||||
public void StartContent()
|
||||
public void SetContentWaitTime(int waitTime)
|
||||
{
|
||||
Console.WriteLine("Content DbHandler started");
|
||||
_contentWaitTime = waitTime;
|
||||
}
|
||||
|
||||
public void SetDiscardedWaitTime(int waitTime)
|
||||
{
|
||||
_discardedWaitTime = waitTime;
|
||||
}
|
||||
|
||||
public void UnfilteredDbHandler()
|
||||
{
|
||||
Console.WriteLine("Unfiltered DbHandler started");
|
||||
|
||||
while (!_stop)
|
||||
{
|
||||
if (_contentQueue.IsEmpty || _pause)
|
||||
if (_unfilteredQueue.IsEmpty || _pause)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
Thread.Sleep(_contentWaitTime);
|
||||
_paused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
_contentQueue.TryDequeue(out QueueItem? queueItem);
|
||||
_unfilteredQueue.TryDequeue(out UnfilteredQueueItem queueItem);
|
||||
|
||||
if (queueItem is null) { continue; }
|
||||
|
||||
switch (queueItem.Operations)
|
||||
if (queueItem.Operations == Operations.Insert)
|
||||
{
|
||||
case Operations.Insert when queueItem.Unfiltered is not null:
|
||||
InsertUnfiltered(queueItem.Unfiltered);
|
||||
break;
|
||||
case Operations.Insert when queueItem.Filtered is not null:
|
||||
InsertFiltered(queueItem.Filtered);
|
||||
break;
|
||||
case Operations.Insert when queueItem.ResumeObject is not null:
|
||||
InsertResumeObject(queueItem.ResumeObject);
|
||||
break;
|
||||
case Operations.Update when queueItem.Unfiltered is not null:
|
||||
UpdateUnfiltered(queueItem.Unfiltered);
|
||||
break;
|
||||
InsertUnfiltered(queueItem.Unfiltered);
|
||||
}
|
||||
|
||||
else if (queueItem.Operations == Operations.Update)
|
||||
{
|
||||
UpdateUnfiltered(queueItem.Unfiltered);
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Content DbHandler stopped.");
|
||||
Console.WriteLine("Unfiltered DbHandler stopped.");
|
||||
}
|
||||
|
||||
public void FilteredDbHandler()
|
||||
{
|
||||
Console.WriteLine("Filtered DB handler started");
|
||||
|
||||
while (!_stop)
|
||||
{
|
||||
if (_filteredQueue.IsEmpty || _pause)
|
||||
{
|
||||
Thread.Sleep(_contentWaitTime);
|
||||
_paused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
_filteredQueue.TryDequeue(out Filtered? queueItem);
|
||||
|
||||
InsertFiltered(queueItem!);
|
||||
}
|
||||
|
||||
Console.WriteLine("Filtered DbHandler stopped.");
|
||||
}
|
||||
|
||||
public void ResumeDbHandler()
|
||||
{
|
||||
Console.WriteLine("Resume DB handler started");
|
||||
|
||||
while (!_stop)
|
||||
{
|
||||
if (_resumeQueue.IsEmpty || _pause)
|
||||
{
|
||||
Thread.Sleep(_contentWaitTime);
|
||||
_paused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
_resumeQueue.TryDequeue(out ScannerResumeObject? queueItem);
|
||||
|
||||
if (queueItem is not null)
|
||||
{
|
||||
InsertResumeObject(queueItem);
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Resume DbHandler stopped.");
|
||||
}
|
||||
|
||||
public WaitHandle[] Start(int threads)
|
||||
@@ -100,7 +194,7 @@ public class DbHandler
|
||||
|
||||
waitHandles[i] = handle;
|
||||
|
||||
Thread f = new (RunDiscarded!);
|
||||
Thread f = new (DiscardedDbHandler!);
|
||||
f.Start(discardedDbHandlerSetting);
|
||||
|
||||
Thread.Sleep(1000);
|
||||
@@ -109,7 +203,7 @@ public class DbHandler
|
||||
return waitHandles;
|
||||
}
|
||||
|
||||
private void RunDiscarded(object obj)
|
||||
private void DiscardedDbHandler(object obj)
|
||||
{
|
||||
DiscardedDbHandlerSetting discardedDbHandlerSetting = (DiscardedDbHandlerSetting)obj;
|
||||
Console.WriteLine($"Discarded DbHandler started with thread: ({discardedDbHandlerSetting.ThreadId})");
|
||||
@@ -120,32 +214,32 @@ public class DbHandler
|
||||
{
|
||||
if (_discardedQueue.IsEmpty || _pause)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
Thread.Sleep(_discardedWaitTime);
|
||||
_paused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
_discardedQueue.TryDequeue(out Discarded? queueItem);
|
||||
|
||||
if (queueItem is null) { continue; }
|
||||
_discardedQueue.TryDequeue(out Discarded queueItem);
|
||||
|
||||
InsertDiscarded(queueItem, connectionString);
|
||||
}
|
||||
|
||||
discardedDbHandlerSetting.Handle!.Set();
|
||||
|
||||
Console.WriteLine("Content DbHandler stopped.");
|
||||
Console.WriteLine("Discarded DbHandler stopped.");
|
||||
}
|
||||
|
||||
private static void InsertUnfiltered(Unfiltered unfiltered)
|
||||
private void InsertUnfiltered(Unfiltered unfiltered)
|
||||
{
|
||||
using SqliteConnection connection = new(UnfilteredConnectionString);
|
||||
using SqliteConnection connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(InsertStatement, connection);
|
||||
|
||||
command.Parameters.AddWithValue("@ip", unfiltered.Ip);
|
||||
command.Parameters.AddWithValue("@responseCode", unfiltered.ResponseCode);
|
||||
command.Parameters.AddWithValue("@ip1", unfiltered.Ip.Ip1);
|
||||
command.Parameters.AddWithValue("@ip2", unfiltered.Ip.Ip2);
|
||||
command.Parameters.AddWithValue("@ip3", unfiltered.Ip.Ip3);
|
||||
command.Parameters.AddWithValue("@ip4", unfiltered.Ip.Ip4);
|
||||
command.Parameters.AddWithValue("@port1", unfiltered.Port1);
|
||||
command.Parameters.AddWithValue("@port2", unfiltered.Port2);
|
||||
command.Parameters.AddWithValue("@filtered", unfiltered.Filtered);
|
||||
@@ -161,21 +255,27 @@ public class DbHandler
|
||||
|
||||
using SqliteCommand command = new(InsertIntoDiscarded, connection);
|
||||
|
||||
command.Parameters.AddWithValue("@ip", discarded.Ip);
|
||||
command.Parameters.AddWithValue("@ip1", discarded.Ip.Ip1);
|
||||
command.Parameters.AddWithValue("@ip2", discarded.Ip.Ip2);
|
||||
command.Parameters.AddWithValue("@ip3", discarded.Ip.Ip3);
|
||||
command.Parameters.AddWithValue("@ip4", discarded.Ip.Ip4);
|
||||
command.Parameters.AddWithValue("@responseCode", discarded.ResponseCode);
|
||||
_ = command.ExecuteNonQuery();
|
||||
|
||||
connection.Close();
|
||||
}
|
||||
|
||||
private static void InsertFiltered(Filtered filtered)
|
||||
private void InsertFiltered(Filtered filtered)
|
||||
{
|
||||
using SqliteConnection connection = new(FilteredConnectionString);
|
||||
using SqliteConnection connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(InsertIntoFiltered, connection);
|
||||
|
||||
command.Parameters.AddWithValue("@ip", filtered.Ip);
|
||||
command.Parameters.AddWithValue("@ip1", filtered.Ip.Ip1);
|
||||
command.Parameters.AddWithValue("@ip2", filtered.Ip.Ip2);
|
||||
command.Parameters.AddWithValue("@ip3", filtered.Ip.Ip3);
|
||||
command.Parameters.AddWithValue("@ip4", filtered.Ip.Ip4);
|
||||
command.Parameters.AddWithValue("@port1", filtered.Port1);
|
||||
command.Parameters.AddWithValue("@port2", filtered.Port2);
|
||||
command.Parameters.AddWithValue("@url1", filtered.Url1);
|
||||
@@ -209,9 +309,9 @@ public class DbHandler
|
||||
connection.Close();
|
||||
}
|
||||
|
||||
private static void InsertResumeObject(ScannerResumeObject resumeObject)
|
||||
private void InsertResumeObject(ScannerResumeObject resumeObject)
|
||||
{
|
||||
using SqliteConnection connection = new(ResumeConnectionString);
|
||||
using SqliteConnection connection = new(_resumeConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(InsertIntoResume, connection);
|
||||
@@ -228,9 +328,9 @@ public class DbHandler
|
||||
connection.Close();
|
||||
}
|
||||
|
||||
private static void UpdateUnfiltered(Unfiltered unfiltered)
|
||||
private void UpdateUnfiltered(Unfiltered unfiltered)
|
||||
{
|
||||
using SqliteConnection connection = new(UnfilteredConnectionString);
|
||||
using SqliteConnection connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(UpdateUnfilteredStatement, connection);
|
||||
@@ -241,36 +341,40 @@ public class DbHandler
|
||||
connection.Close();
|
||||
}
|
||||
|
||||
public static Unfiltered? ReadUnfilteredWithId(long id)
|
||||
public Unfiltered ReadUnfilteredWithId(long id)
|
||||
{
|
||||
using SqliteConnection connection = new(UnfilteredConnectionString);
|
||||
using SqliteConnection connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadUnfilteredStatement, connection);
|
||||
command.Parameters.AddWithValue("@id", id);
|
||||
|
||||
using SqliteDataReader reader = command.ExecuteReader();
|
||||
if (!reader.HasRows) return null;
|
||||
if (!reader.HasRows) return new();
|
||||
|
||||
Unfiltered unfiltered = new();
|
||||
Ip ip = new();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
unfiltered.Id = reader.GetInt32(0);
|
||||
unfiltered.Ip = reader.GetString(1);
|
||||
unfiltered.Port1 = reader.GetInt32(3);
|
||||
unfiltered.Port2 = reader.GetInt32(4);
|
||||
unfiltered.Filtered = reader.GetInt32(5);
|
||||
ip.Ip1 = reader.GetInt32(1);
|
||||
ip.Ip2 = reader.GetInt32(2);
|
||||
ip.Ip3 = reader.GetInt32(3);
|
||||
ip.Ip4 = reader.GetInt32(4);
|
||||
unfiltered.Port1 = reader.GetInt32(5);
|
||||
unfiltered.Port2 = reader.GetInt32(6);
|
||||
unfiltered.Filtered = reader.GetBoolean(7);
|
||||
}
|
||||
|
||||
unfiltered.Ip = ip;
|
||||
|
||||
return unfiltered;
|
||||
}
|
||||
|
||||
public static long GetUnfilteredIndexes()
|
||||
public List<long> GetUnfilteredIndexes()
|
||||
{
|
||||
long rowId = 0;
|
||||
|
||||
using SqliteConnection connection = new(UnfilteredConnectionString);
|
||||
using SqliteConnection connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadUnfilteredIdsStatement, connection);
|
||||
@@ -278,22 +382,24 @@ public class DbHandler
|
||||
|
||||
if (!reader.HasRows)
|
||||
{
|
||||
return 0;
|
||||
return [];
|
||||
}
|
||||
|
||||
List<long> ids = [];
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
rowId = reader.GetInt64(0);
|
||||
ids.Add(reader.GetInt64(0));
|
||||
}
|
||||
|
||||
return rowId;
|
||||
return ids;
|
||||
}
|
||||
|
||||
public static long GetFilteredIndexes()
|
||||
public long GetFilteredIndexes()
|
||||
{
|
||||
long rowId = 0;
|
||||
|
||||
using SqliteConnection connection = new(FilteredConnectionString);
|
||||
using SqliteConnection connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadFilteredIdsStatement, connection);
|
||||
@@ -338,8 +444,54 @@ public class DbHandler
|
||||
return rowId;
|
||||
}
|
||||
|
||||
public bool GetFilteredIp(string ip)
|
||||
public bool FilteredIpExists(Ip ip)
|
||||
{
|
||||
using SqliteConnection connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadFilteredIpStatement, connection);
|
||||
command.Parameters.AddWithValue("@ip1", ip.Ip1);
|
||||
command.Parameters.AddWithValue("@ip2", ip.Ip2);
|
||||
command.Parameters.AddWithValue("@ip3", ip.Ip3);
|
||||
command.Parameters.AddWithValue("@ip4", ip.Ip4);
|
||||
|
||||
using SqliteDataReader reader = command.ExecuteReader();
|
||||
|
||||
if (!reader.HasRows)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Ip tempIp = new();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
tempIp.Ip1 = reader.GetInt32(0);
|
||||
tempIp.Ip2 = reader.GetInt32(1);
|
||||
tempIp.Ip3 = reader.GetInt32(2);
|
||||
tempIp.Ip4 = reader.GetInt32(3);
|
||||
}
|
||||
|
||||
if (tempIp.Ip1 != ip.Ip1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tempIp.Ip2 != ip.Ip2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tempIp.Ip3 != ip.Ip3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tempIp.Ip4 != ip.Ip4)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -347,7 +499,7 @@ public class DbHandler
|
||||
{
|
||||
lock (_readFilteredLock)
|
||||
{
|
||||
using SqliteConnection connection = new(FilteredConnectionString);
|
||||
using SqliteConnection connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadFilteredStatement, connection);
|
||||
@@ -377,7 +529,7 @@ public class DbHandler
|
||||
{
|
||||
lock (_readAndDeleteResumeLock)
|
||||
{
|
||||
using SqliteConnection connection = new(ResumeConnectionString);
|
||||
using SqliteConnection connection = new(_resumeConnectionString);
|
||||
connection.Open();
|
||||
|
||||
using SqliteCommand command = new(ReadAndDeleteResumeStatement, connection);
|
||||
@@ -417,21 +569,21 @@ public class DbHandler
|
||||
Thread.Sleep(5000); // Just for safety.
|
||||
}
|
||||
|
||||
SqliteConnection connection = new(DiscardedConnectionString);
|
||||
SqliteConnection connection = new(_discardedConnectionString);
|
||||
connection.Open();
|
||||
|
||||
SqliteCommand command = new(ReIndexDatabasesStatement, connection);
|
||||
_ = command.ExecuteNonQuery();
|
||||
connection.Close();
|
||||
|
||||
connection = new(FilteredConnectionString);
|
||||
connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
command = new(ReIndexDatabasesStatement, connection);
|
||||
_ = command.ExecuteNonQuery();
|
||||
connection.Close();
|
||||
|
||||
connection = new(UnfilteredConnectionString);
|
||||
connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
command = new(ReIndexDatabasesStatement, connection);
|
||||
@@ -456,21 +608,21 @@ public class DbHandler
|
||||
Thread.Sleep(5000); // Just for safety.
|
||||
}
|
||||
|
||||
SqliteConnection connection = new(DiscardedConnectionString);
|
||||
SqliteConnection connection = new(_discardedConnectionString);
|
||||
connection.Open();
|
||||
|
||||
SqliteCommand command = new(VacuumDatabasesStatement, connection);
|
||||
_ = command.ExecuteNonQuery();
|
||||
connection.Close();
|
||||
|
||||
connection = new(FilteredConnectionString);
|
||||
connection = new(_filteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
command = new(VacuumDatabasesStatement, connection);
|
||||
_ = command.ExecuteNonQuery();
|
||||
connection.Close();
|
||||
|
||||
connection = new(UnfilteredConnectionString);
|
||||
connection = new(_unfilteredConnectionString);
|
||||
connection.Open();
|
||||
|
||||
command = new(VacuumDatabasesStatement, connection);
|
||||
@@ -486,9 +638,9 @@ public class DbHandler
|
||||
|
||||
private string CreateDiscardedDb(int threadNumber)
|
||||
{
|
||||
string databaseName = $"Data Source=../../../../Models/Discarded{threadNumber}.db";
|
||||
string databaseName = $"Data Source={_basePath}/Models/Discarded{threadNumber}.db";
|
||||
|
||||
const string createStatement = "CREATE TABLE IF NOT EXISTS Discarded (Id INTEGER NOT NULL, Ip TEXT NOT NULL, ResponseCode INTEGER NOT NULL, PRIMARY KEY(Id AUTOINCREMENT))";
|
||||
const string createStatement = "CREATE TABLE IF NOT EXISTS Discarded (Id INTEGER NOT NULL, Ip1 TEXT NOT NULL, Ip2 TEXT NOT NULL, Ip3 TEXT NOT NULL, Ip4 TEXT NOT NULL, ResponseCode INTEGER NOT NULL, PRIMARY KEY(Id AUTOINCREMENT))";
|
||||
|
||||
_discardedConnectionStrings.Add(databaseName);
|
||||
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
[MessagePackObject]
|
||||
public struct DatabaseSizes
|
||||
{
|
||||
[Key(0)]
|
||||
public double DiscardedDbSize { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
|
||||
public double FilteredDbSize { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
|
||||
public double MyDbSize { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public class Discarded
|
||||
public struct Discarded
|
||||
{
|
||||
public string Ip { get; set; } = "";
|
||||
public Ip Ip { get; set; }
|
||||
|
||||
public int ResponseCode { get; set; }
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Models.Model.Backend;
|
||||
|
||||
public class Filtered
|
||||
{
|
||||
public string Ip { get; set; } = "";
|
||||
public Ip Ip { get; set; }
|
||||
public string Title1 { get; set; } = "";
|
||||
public string Title2 { get; set; } = "";
|
||||
public string Description1 { get; set; } = "";
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public struct Ip
|
||||
{
|
||||
public int Ip1 { get; set; }
|
||||
|
||||
public int Ip2 { get; set; }
|
||||
|
||||
public int Ip3 { get; set; }
|
||||
|
||||
public int Ip4 { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Ip1}.{Ip2}.{Ip3}.{Ip4}";
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public enum Operations
|
||||
{
|
||||
Insert,
|
||||
Update,
|
||||
Optimize,
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public class QueueItem
|
||||
{
|
||||
public Unfiltered? Unfiltered { get; init; }
|
||||
public Filtered? Filtered { get; init; }
|
||||
public ScannerResumeObject? ResumeObject { get; init; }
|
||||
public Operations Operations { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public enum RuntimeVariable
|
||||
{
|
||||
DbContent,
|
||||
DbDiscarded,
|
||||
ContentFilter,
|
||||
ScannerTimeout
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public class Unfiltered
|
||||
public struct Unfiltered
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Ip { get; set; } = "";
|
||||
|
||||
public int ResponseCode { get; init; }
|
||||
|
||||
|
||||
public Ip Ip { get; set; }
|
||||
|
||||
public int Port1 { get; set; }
|
||||
|
||||
|
||||
public int Port2 { get; set; }
|
||||
|
||||
public int Filtered { get; set; }
|
||||
|
||||
public bool Filtered { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Models.Model.Backend;
|
||||
|
||||
public struct UnfilteredQueueItem
|
||||
{
|
||||
public Unfiltered Unfiltered { get; init; }
|
||||
public Operations Operations { get; init; }
|
||||
}
|
||||
@@ -7,4 +7,5 @@ public enum CommunicationCommand
|
||||
StopScanning,
|
||||
DbReindex,
|
||||
DbVacuum,
|
||||
ChangeRuntimeVariable,
|
||||
}
|
||||
+10
-6
@@ -1,13 +1,17 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Models.Model.External;
|
||||
|
||||
[MessagePackObject]
|
||||
//[MessagePackObject]
|
||||
public class CommunicationObject
|
||||
{
|
||||
[Key(0)]
|
||||
//[Key(0)]
|
||||
public CommunicationCommand Command { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public string? SearchTerm { get; set; }
|
||||
//[Key(1)]
|
||||
public string? SearchTerm { get; set; } = "";
|
||||
|
||||
//[Key(2)]
|
||||
public string? Variable { get; set; } = "";
|
||||
|
||||
//[Key(3)]
|
||||
public string? VariableValue { get; set; } = "";
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Models.Model.External;
|
||||
|
||||
[MessagePackObject]
|
||||
public class CommunicationResult
|
||||
{
|
||||
[Key(0)]
|
||||
public List<SearchResult?>? Result { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public ScanningStatus? Status { get; set; }
|
||||
}
|
||||
+2
-13
@@ -1,29 +1,18 @@
|
||||
using MessagePack;
|
||||
using Models.Model.Backend;
|
||||
|
||||
namespace Models.Model.External;
|
||||
|
||||
[MessagePackObject]
|
||||
public struct ScanningStatus
|
||||
{
|
||||
[Key(0)]
|
||||
public float PercentageOfIpv4Scanned { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public long TotalFiltered { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public long AmountOfIpv4Left { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public long TotalDiscarded { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public double DiscardedDbSize { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
|
||||
public double FilteredDbSize { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
|
||||
public double MyDbSize { get; set; }
|
||||
}
|
||||
@@ -7,12 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MessagePack" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePack.Annotations" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePackAnalyzer" Version="3.0.238-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.10" />
|
||||
<PackageReference Include="SQLite" Version="3.13.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cbackend/@EntryIndexedValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cinternal/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
DROP TABLE Unfiltered;
|
||||
|
||||
CREATE TABLE "Unfiltered" (
|
||||
"Id" INTEGER NOT NULL,
|
||||
"Ip1" INTEGER NOT NULL,
|
||||
"Ip2" INTEGER NOT NULL,
|
||||
"Ip3" INTEGER NOT NULL,
|
||||
"Ip4" INTEGER NOT NULL,
|
||||
"Port1" INTEGER NOT NULL,
|
||||
"Port2" INTEGER NOT NULL,
|
||||
"Filtered" INTEGER NOT NULL,
|
||||
CONSTRAINT "PK_Unfiltered" PRIMARY KEY("Id" AUTOINCREMENT)
|
||||
)
|
||||
Binary file not shown.
+4
-3
@@ -32,7 +32,7 @@ progressApi.MapGet("/", () =>
|
||||
Command = CommunicationCommand.GetScanningProgress
|
||||
};
|
||||
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
@@ -40,7 +40,7 @@ progressApi.MapGet("/", () =>
|
||||
byte[] msg = client.ReceiveFrameBytes();
|
||||
client.Close();
|
||||
|
||||
return MessagePackSerializer.Deserialize<ScanningStatus>(msg, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray));
|
||||
return JsonSerializer.Deserialize<ScanningStatus>(msg);
|
||||
});
|
||||
|
||||
RouteGroupBuilder searchApi = app.MapGroup("/search");
|
||||
@@ -51,7 +51,7 @@ searchApi.MapGet("/{term}", (string term) =>
|
||||
communicationObject.Command = CommunicationCommand.GetSearches;
|
||||
communicationObject.SearchTerm = term;
|
||||
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
@@ -66,6 +66,7 @@ app.Run();
|
||||
|
||||
[JsonSerializable(typeof(ScanningStatus))]
|
||||
[JsonSerializable(typeof(SearchResults))]
|
||||
[JsonSerializable(typeof(CommunicationObject))]
|
||||
internal partial class AppJsonSerializerContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
+1
-7
@@ -5,16 +5,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<PublishAot>true</PublishAot>
|
||||
<PublishAot>false</PublishAot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MessagePack" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePack.Annotations" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePackAnalyzer" Version="3.0.238-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NetMQ" Version="4.0.1.13" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000006pdb6Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003Fd17d4b69379a42eb90f15b17ef6c846a5400_003F39_003F1eeed291_003F02000006pdb6Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000007pdb1Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003F096da63313a8436fb75089601a728c765200_003Fbb_003Ff6383783_003F02000007pdb1Low_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000007pdb1Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003F357247e747614c8297021dd08d79da3d5200_003Ff2_003Fc4ae8c87_003F02000007pdb1Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000010pdb3Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003F80cf8253b0c2409096d0c0e368300af28200_003Fdd_003F8098fc19_003F02000010pdb3Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000011pdb4Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003F1f6cfdd1e3a14f6390237f6ab98b06af8000_003F0d_003Febdca535_003F02000011pdb4Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAttributes_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F9a4cb3a98df697f884fa5f45bc79e4291fa3e948c7f42560e14678e12055e_003FAttributes_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAttribute_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fbb9be2cb8efb72a7d2286fbdd10a293b55b3e2a912f49fac6a7719673268e4b_003FAttribute_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConcurrentQueue_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fb049a159646b52d2dd6ced21de315f79dff86421243e94ffd4f29c6f7e4df25_003FConcurrentQueue_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConsole_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F2ccd2056ec55b7b67558d52e32a887ed5ac7e346fc429b218c188d0a99cb5be_003FConsole_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFormatters_002EMessagePack_002EGeneratedMessagePackResolver_002EModels_002EModel_002EExternal_002ESearchResultsFormatter_002Eg_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F99b5d033f8bfb58a6a753ca88a3d956f2228bd48_003FFormatters_002EMessagePack_002EGeneratedMessagePackResolver_002EModels_002EModel_002EExternal_002ESearchResultsFormatter_002Eg_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFuture_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F13cbfe6856867dd1ed4e39575e46d816dae2a146a8ceec8f76b5897f5e0fe_003FFuture_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpContent_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F5a55e5df9328b51021ba85b8f12ff49eca8772dba9772c0d61d5e28edf255c_003FHttpContent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpMethodAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F2e4732e712a98f9ac0d080ac68669b3db6d98781e0d5ad89886cb6bcc890b18_003FHttpMethodAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIFormatterResolver_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fc7d856f45ddf907f9face6c2bdba7836cc70fed4bb2b8ebd83ee6917584af3_003FIFormatterResolver_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIOThread_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F125fae6d49819da7be4fb21fbb4a936a7ec325971cf9264a24af55bf7111ad8_003FIOThread_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIPStatus_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8fe420eaf60c4dfca87ce1d5f1cdfa4816200_003Fbd_003F71bcce16_003FIPStatus_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMessagePackSerializer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fe5f8b0187e62d74a4b9fefd657c192dab367bb342ef5ffbd90a4ed2ea428ec7a_003FMessagePackSerializer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APingOptions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F77bf2fbffc5491eadd62f1dbebc233798cd7fcb9b39ab7ee3bb35519f4d94ecc_003FPingOptions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APing_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F3080b18e3637ea741b5b65abd6aee06e41494a82a58b3e2ed87d4ddb5cc62_003FPing_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APing_002EUnix_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F8d57f5f5fd3290d6a89a5b767ad89988dd893c988eba430cd461b8b88d7ad9d_003FPing_002EUnix_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATask_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F35f3a54f5acb408a3e219b2de039f1a39557b7e4515f11238cba07b60c0ce_003FTask_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATextWriter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fdda89b2ed0975050b6847325357a756a5866a5435e3ddb4feff535ba36facb7_003FTextWriter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A0200000Cpdb6Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003Fb53c196a821648e4ae3b142a6ae58d7b9400_003Fa8_003F21a43479_003F0200000Cpdb6Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A02000011pdb3Low_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003FILViewer_003F7c3ed02c2ce44598b7f304f8ac45e58f8600_003F6d_003F99b875d1_003F02000011pdb3Low_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADirectoryInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fe4ec446cfe0489bc3ef68a45c6766d183e999ebdc657e94fb1ad059de2bb9_003FDirectoryInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThread_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F693e634d7742afaf486acd69d84fe2a9e1ee1b11ba84f29cd1d67668d20dd59_003FThread_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
Reference in New Issue
Block a user