@muhammedaksam/easiarr 1.1.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/package.json +1 -1
- package/src/api/profilarr-api.ts +284 -0
- package/src/apps/registry.ts +92 -0
- package/src/compose/caddy-config.ts +129 -0
- package/src/compose/generator.ts +10 -1
- package/src/config/recyclarr-config.ts +179 -0
- package/src/config/schema.ts +19 -0
- package/src/docker/client.ts +16 -0
- package/src/structure/manager.ts +41 -1
- package/src/ui/screens/FullAutoSetup.ts +123 -1
- package/src/ui/screens/LogsViewer.ts +468 -0
- package/src/ui/screens/MainMenu.ts +14 -0
- package/src/ui/screens/QuickSetup.ts +52 -3
- package/src/ui/screens/RecyclarrSetup.ts +418 -0
- package/src/ui/screens/SettingsScreen.ts +35 -1
- package/src/utils/logs.ts +118 -0
- package/src/utils/migrations.ts +11 -1
- package/src/utils/unraid.ts +101 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unraid Detection and Compatibility Utilities
|
|
3
|
+
* Provides detection of Unraid environment and path adjustments
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { existsSync } from "node:fs"
|
|
7
|
+
import { homedir } from "node:os"
|
|
8
|
+
import { join } from "node:path"
|
|
9
|
+
import { debugLog } from "./debug"
|
|
10
|
+
|
|
11
|
+
// Unraid-specific paths
|
|
12
|
+
const UNRAID_IDENTIFIERS = [
|
|
13
|
+
"/boot/config/plugins", // Unraid plugin directory
|
|
14
|
+
"/etc/unraid-version", // Unraid version file
|
|
15
|
+
"/var/local/emhttp", // Unraid emhttp directory
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const UNRAID_APPDATA_PATH = "/mnt/user/appdata"
|
|
19
|
+
const COMPOSE_MANAGER_PLUGIN_PATH = "/boot/config/plugins/compose.manager"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Detect if running on Unraid OS
|
|
23
|
+
* Checks for Unraid-specific filesystem paths
|
|
24
|
+
*/
|
|
25
|
+
export function isUnraid(): boolean {
|
|
26
|
+
for (const path of UNRAID_IDENTIFIERS) {
|
|
27
|
+
if (existsSync(path)) {
|
|
28
|
+
debugLog("Unraid", `Detected Unraid OS (found ${path})`)
|
|
29
|
+
return true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the default appdata path for Unraid
|
|
37
|
+
* Returns /mnt/user/appdata/easiarr on Unraid, ~/.easiarr otherwise
|
|
38
|
+
*/
|
|
39
|
+
export function getUnraidAppDataPath(): string {
|
|
40
|
+
if (isUnraid()) {
|
|
41
|
+
return join(UNRAID_APPDATA_PATH, "easiarr")
|
|
42
|
+
}
|
|
43
|
+
return join(homedir(), ".easiarr")
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if Docker Compose Manager plugin is installed
|
|
48
|
+
* This plugin allows managing compose stacks via Unraid's web UI
|
|
49
|
+
*/
|
|
50
|
+
export function hasComposeManager(): boolean {
|
|
51
|
+
return existsSync(COMPOSE_MANAGER_PLUGIN_PATH)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get the recommended Compose Manager project directory
|
|
56
|
+
* Compose Manager expects projects in /boot/config/plugins/compose.manager/projects/
|
|
57
|
+
*/
|
|
58
|
+
export function getComposeManagerProjectPath(projectName: string = "easiarr"): string {
|
|
59
|
+
return join(COMPOSE_MANAGER_PLUGIN_PATH, "projects", projectName)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Get platform-appropriate default root directory
|
|
64
|
+
* Adjusts paths for Unraid vs standard Linux/Mac
|
|
65
|
+
*/
|
|
66
|
+
export function getDefaultRootDir(): string {
|
|
67
|
+
if (isUnraid()) {
|
|
68
|
+
// On Unraid, use /mnt/user/data for media and /mnt/user/appdata for configs
|
|
69
|
+
return "/mnt/user/data"
|
|
70
|
+
}
|
|
71
|
+
// Standard path
|
|
72
|
+
return join(homedir(), "easiarr")
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get platform-appropriate config directory
|
|
77
|
+
*/
|
|
78
|
+
export function getConfigDir(): string {
|
|
79
|
+
if (isUnraid()) {
|
|
80
|
+
return UNRAID_APPDATA_PATH
|
|
81
|
+
}
|
|
82
|
+
return join(homedir(), ".easiarr")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get Unraid-specific information for display
|
|
87
|
+
*/
|
|
88
|
+
export function getUnraidInfo(): {
|
|
89
|
+
isUnraid: boolean
|
|
90
|
+
hasComposeManager: boolean
|
|
91
|
+
appDataPath: string
|
|
92
|
+
composeManagerPath: string | null
|
|
93
|
+
} {
|
|
94
|
+
const onUnraid = isUnraid()
|
|
95
|
+
return {
|
|
96
|
+
isUnraid: onUnraid,
|
|
97
|
+
hasComposeManager: onUnraid ? hasComposeManager() : false,
|
|
98
|
+
appDataPath: onUnraid ? UNRAID_APPDATA_PATH : join(homedir(), ".easiarr"),
|
|
99
|
+
composeManagerPath: onUnraid && hasComposeManager() ? getComposeManagerProjectPath() : null,
|
|
100
|
+
}
|
|
101
|
+
}
|