forked from 0x101-Cyber-Security/NetLock-RMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication_Paths.cs
More file actions
61 lines (50 loc) · 2.84 KB
/
Application_Paths.cs
File metadata and controls
61 lines (50 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Primitives;
using System.Runtime.InteropServices;
namespace NetLock_RMM_Server
{
public class Application_Paths
{
public static string logs_dir = Path.Combine(GetBasePath(), "0x101 Cyber Security", "NetLock RMM", "Server", "Logs");
public static string log_debug_path = Path.Combine(logs_dir, "debug.log");
public static string log_info_path = Path.Combine(logs_dir, "info.log");
public static string log_warning_path = Path.Combine(logs_dir, "warning.log");
public static string log_error_path = Path.Combine(logs_dir, "error.log");
public static string _public_uploads_user = Path.Combine(GetCurrentDirectory(), "www", "public", "uploads", "user");
public static string _public_downloads_user = Path.Combine(GetCurrentDirectory(), "www", "public", "downloads", "user");
public static string _private_files = Path.Combine(GetCurrentDirectory(), "www", "private", "files");
public static string _private_files_admin_db_friendly = Path.Combine(GetCurrentDirectory(), "www", "private", "files");
public static string _private_files_netlock = Path.Combine(GetCurrentDirectory(), "www", "private", "files", "netlock");
public static string _private_files_netlock_temp = Path.Combine(GetCurrentDirectory(), "www", "private", "files", "netlock", "temp");
public static string internal_dir = Path.Combine(GetCurrentDirectory(), "internal");
public static string internal_temp_dir = Path.Combine(GetCurrentDirectory(), "internal", "temp");
//OSSCH_START 5dc91fee-4c1b-45c3-8f0e-792ea705f36e //OSSCH_END
// Lets Encrypt path
public static string certificates_path = Path.Combine(GetCurrentDirectory(), "certificates");
// LLM
public static string llm_model_path = Path.Combine(GetCurrentDirectory(), "llm", "model.gguf");
private static string GetBasePath()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Application_Settings.IsLiveEnvironment)
{
return "/var";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !Application_Settings.IsLiveEnvironment)
{
return "/home/nico-mak/.local/share";
}
else
{
throw new NotSupportedException("Unsupported OS");
}
}
private static string GetCurrentDirectory()
{
return AppContext.BaseDirectory;
}
}
}