DebugProxyPass dynamic server_name
This commit is contained in:
parent
cf531cff36
commit
2f65dd3120
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -11,6 +11,14 @@
|
|||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build",
|
||||||
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
||||||
"args": [
|
"args": [
|
||||||
|
"s",
|
||||||
|
"X",
|
||||||
|
"L:/Git/Linux-Ubuntu-Server/etc/nginx/include",
|
||||||
|
"Day-Helper-2024-09-16",
|
||||||
|
"*.conf",
|
||||||
|
"/etc/nginx/include/",
|
||||||
|
"server_name",
|
||||||
|
"proxy_pass~root",
|
||||||
"s",
|
"s",
|
||||||
"X",
|
"X",
|
||||||
"L:/DevOps/Mesa_FI/MesaFabApproval/Fab2ApprovalTests/Programmability/Functions",
|
"L:/DevOps/Mesa_FI/MesaFabApproval/Fab2ApprovalTests/Programmability/Functions",
|
||||||
|
@ -7,34 +7,38 @@ internal static partial class Helper20240916
|
|||||||
internal static void DebugProxyPass(ILogger<Worker> logger, List<string> args)
|
internal static void DebugProxyPass(ILogger<Worker> logger, List<string> args)
|
||||||
{
|
{
|
||||||
string debug;
|
string debug;
|
||||||
|
string domain;
|
||||||
string[] lines;
|
string[] lines;
|
||||||
|
string fileName;
|
||||||
string[] segments;
|
string[] segments;
|
||||||
string domain = args[5];
|
|
||||||
string includePath = args[3];
|
string includePath = args[3];
|
||||||
|
string searchString = args[4];
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
string fileNameWithoutExtension;
|
string[] searchStrings = args[5].Split('~');
|
||||||
string[] searchPatterns = args[4].Split('|');
|
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||||
logger.LogInformation("With search pattern '{SearchPattern}' found {files} file(s)", searchPattern, files.Length);
|
logger.LogInformation("With search pattern '{SearchPattern}' found {files} file(s)", searchPattern, files.Length);
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
{
|
{
|
||||||
debug = string.Empty;
|
debug = string.Empty;
|
||||||
|
domain = string.Empty;
|
||||||
lines = File.ReadAllLines(file);
|
lines = File.ReadAllLines(file);
|
||||||
fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file);
|
fileName = Path.GetFileName(file);
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
{
|
{
|
||||||
segments = line.Split(searchPatterns, StringSplitOptions.None);
|
segments = line.Split(searchString, StringSplitOptions.None);
|
||||||
|
if (segments.Length > 1 && segments[1][0] is ' ' or '\t')
|
||||||
|
domain = segments[1].Trim();
|
||||||
|
segments = line.Split(searchStrings, StringSplitOptions.None);
|
||||||
if (segments.Length < 2)
|
if (segments.Length < 2)
|
||||||
continue;
|
continue;
|
||||||
if (segments[1][0] is not ' ' and not '\t')
|
if (segments[1][0] is not ' ' and not '\t')
|
||||||
continue;
|
continue;
|
||||||
debug = segments[1].Trim();
|
debug = segments[1].Trim();
|
||||||
}
|
}
|
||||||
logger.LogInformation("{includePath}{fileNameWithoutExtension}; # https://{fileNameWithoutExtension}.{domain} # {debug}",
|
logger.LogInformation("include {includePath}{fileName}; # https://{domain} # {debug}",
|
||||||
includePath,
|
includePath,
|
||||||
fileNameWithoutExtension,
|
fileName,
|
||||||
fileNameWithoutExtension,
|
|
||||||
domain,
|
domain,
|
||||||
debug);
|
debug);
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,12 @@ internal static partial class Helper20241108
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
|
[JsonSerializable(typeof(WorkItem[]))]
|
||||||
|
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private record Record(WorkItem WorkItem, WorkItem? Parent, Record[]? Children, Record[]? Related, Record[]? Successors)
|
private record Record(WorkItem WorkItem, WorkItem? Parent, Record[]? Children, Record[]? Related, Record[]? Successors)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -326,7 +332,7 @@ internal static partial class Helper20241108
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(checkFile);
|
string json = File.ReadAllText(checkFile);
|
||||||
results = JsonSerializer.Deserialize<WorkItem[]>(json);
|
results = JsonSerializer.Deserialize(json, WorkItemCollectionSourceGenerationContext.Default.WorkItemArray);
|
||||||
}
|
}
|
||||||
return results is null ? null : new(results);
|
return results is null ? null : new(results);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user