Explicitly set File/Directory permissions for jobs

This commit is contained in:
Glax 2024-10-30 22:27:50 +01:00
parent 067497ddd0
commit 02cf8578c9

View File

@ -1,6 +1,8 @@
using System.Text.RegularExpressions; using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Tranga.MangaConnectors; using Tranga.MangaConnectors;
using static System.IO.UnixFileMode;
namespace Tranga.Jobs; namespace Tranga.Jobs;
@ -146,6 +148,8 @@ public class JobBoss : GlobalBase
if (!Directory.Exists(TrangaSettings.jobsFolderPath)) //No jobs to load if (!Directory.Exists(TrangaSettings.jobsFolderPath)) //No jobs to load
{ {
Directory.CreateDirectory(TrangaSettings.jobsFolderPath); Directory.CreateDirectory(TrangaSettings.jobsFolderPath);
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(TrangaSettings.jobsFolderPath, UserRead | UserWrite | UserExecute | GroupRead | OtherRead);
return; return;
} }
Regex idRex = new (@"(.*)\.json"); Regex idRex = new (@"(.*)\.json");