diff --git a/ProjectLighthouse/Helpers/FileHelper.cs b/ProjectLighthouse/Helpers/FileHelper.cs index f85b3113..ce33cff1 100644 --- a/ProjectLighthouse/Helpers/FileHelper.cs +++ b/ProjectLighthouse/Helpers/FileHelper.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Text; using LBPUnion.ProjectLighthouse.Types.Files; +using LBPUnion.ProjectLighthouse.Types.Settings; namespace LBPUnion.ProjectLighthouse.Helpers { @@ -14,6 +15,8 @@ namespace LBPUnion.ProjectLighthouse.Helpers public static bool IsFileSafe(LbpFile file) { + if (!ServerSettings.Instance.CheckForUnsafeFiles) return true; + if (file.FileType == LbpFileType.Unknown) file.FileType = DetermineFileType(file.Data); return file.FileType switch diff --git a/ProjectLighthouse/Types/Settings/ServerSettings.cs b/ProjectLighthouse/Types/Settings/ServerSettings.cs index b23a61dc..2826fc78 100644 --- a/ProjectLighthouse/Types/Settings/ServerSettings.cs +++ b/ProjectLighthouse/Types/Settings/ServerSettings.cs @@ -63,13 +63,13 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings } } + public const int CurrentConfigVersion = 8; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! + #region Meta [NotNull] public static ServerSettings Instance; - public const int CurrentConfigVersion = 7; - [JsonPropertyName("ConfigVersionDoNotModifyOrYouWillBeSlapped")] 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 ServerDigestKey { get; set; } public bool UseExternalAuth { get; set; } + + public bool CheckForUnsafeFiles { get; set; } = true; } } \ No newline at end of file