mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-23 17:59:06 +00:00
parent
8edc276767
commit
d8bb77e80b
2 changed files with 7 additions and 2 deletions
|
@ -3,6 +3,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Files;
|
using LBPUnion.ProjectLighthouse.Types.Files;
|
||||||
|
using LBPUnion.ProjectLighthouse.Types.Settings;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Helpers
|
namespace LBPUnion.ProjectLighthouse.Helpers
|
||||||
{
|
{
|
||||||
|
@ -14,6 +15,8 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
||||||
|
|
||||||
public static bool IsFileSafe(LbpFile file)
|
public static bool IsFileSafe(LbpFile file)
|
||||||
{
|
{
|
||||||
|
if (!ServerSettings.Instance.CheckForUnsafeFiles) return true;
|
||||||
|
|
||||||
if (file.FileType == LbpFileType.Unknown) file.FileType = DetermineFileType(file.Data);
|
if (file.FileType == LbpFileType.Unknown) file.FileType = DetermineFileType(file.Data);
|
||||||
|
|
||||||
return file.FileType switch
|
return file.FileType switch
|
||||||
|
|
|
@ -63,13 +63,13 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public const int CurrentConfigVersion = 8; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
|
||||||
|
|
||||||
#region Meta
|
#region Meta
|
||||||
|
|
||||||
[NotNull]
|
[NotNull]
|
||||||
public static ServerSettings Instance;
|
public static ServerSettings Instance;
|
||||||
|
|
||||||
public const int CurrentConfigVersion = 7;
|
|
||||||
|
|
||||||
[JsonPropertyName("ConfigVersionDoNotModifyOrYouWillBeSlapped")]
|
[JsonPropertyName("ConfigVersionDoNotModifyOrYouWillBeSlapped")]
|
||||||
public int ConfigVersion { get; set; } = CurrentConfigVersion;
|
public int ConfigVersion { get; set; } = CurrentConfigVersion;
|
||||||
|
|
||||||
|
@ -91,5 +91,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
||||||
public string ExternalUrl { get; set; } = "http://localhost:10060";
|
public string ExternalUrl { get; set; } = "http://localhost:10060";
|
||||||
public string ServerDigestKey { get; set; }
|
public string ServerDigestKey { get; set; }
|
||||||
public bool UseExternalAuth { get; set; }
|
public bool UseExternalAuth { get; set; }
|
||||||
|
|
||||||
|
public bool CheckForUnsafeFiles { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue