Skip to content

Commit

Permalink
Clean config
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Apr 20, 2024
1 parent c0257e1 commit e669c06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
16 changes: 9 additions & 7 deletions Protest/Http/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ public Cache(string path) {
if (_deflate > 0) { Console.WriteLine($" Deflate : {100 * _deflate / (_raw + 1),5}% {_raw,10} -> {_deflate,8}"); }
if (_brotli > 0) { Console.WriteLine($" Brotli : {100 * _brotli / (_raw + 1),5}% {_raw,10} -> {_brotli,8}"); }
Console.WriteLine();

FileSystemWatcher watcher = new FileSystemWatcher(path);
watcher.EnableRaisingEvents = true;
watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite;
watcher.Filter = "*";
watcher.IncludeSubdirectories = true;
watcher.Changed += OnFileChanged;

if (Directory.Exists(path)) {
FileSystemWatcher watcher = new FileSystemWatcher(path);
watcher.EnableRaisingEvents = true;
watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite;
watcher.Filter = "*";
watcher.IncludeSubdirectories = true;
watcher.Changed += OnFileChanged;
}
#endif

GC.Collect();
Expand Down
13 changes: 9 additions & 4 deletions Protest/Misc/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ internal static void CreateDefault() {
builder.AppendLine($"db_key = {DB_KEY_STRING}");
builder.AppendLine();

#if DEBUG
builder.AppendLine($"front_path = {front_path}");
builder.AppendLine();
#else
builder.AppendLine($"#front_path = {front_path}");
builder.AppendLine();
#endif

builder.AppendLine($"force_registry_keys = {force_registry_keys.ToString().ToLower()}");
builder.AppendLine("accept_xff_header = false");
Expand All @@ -146,10 +151,10 @@ internal static void CreateDefault() {
builder.AppendLine();

builder.AppendLine();
builder.AppendLine("###");
builder.AppendLine("### Use NETSH to bind an SSL certificate with your https endpoint:");
builder.AppendLine($"### netsh http add sslcert ipport=0.0.0.0:443 certhash=[thumbprint] appid={{{Data.GUID}}}");
builder.AppendLine("###");
builder.AppendLine("##");
builder.AppendLine("## Use NETSH to bind an SSL certificate with your https endpoint:");
builder.AppendLine($"## netsh http add sslcert ipport=0.0.0.0:443 certhash=[thumbprint] appid={{{Data.GUID}}}");
builder.AppendLine("##");

File.WriteAllText(Data.FILE_CONFIG, builder.ToString());
}
Expand Down

0 comments on commit e669c06

Please sign in to comment.