mirror of
https://github.com/unraid/api.git
synced 2026-01-02 14:40:01 -06:00
Compare commits
9 Commits
feat/flash
...
4.9.5-buil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eecd9b1017 | ||
|
|
441e1805c1 | ||
|
|
29dcb7d0f0 | ||
|
|
1a7d35d3f6 | ||
|
|
af33e999a0 | ||
|
|
85a35804c1 | ||
|
|
a35c8ff2f1 | ||
|
|
153e7a1e3a | ||
|
|
e73fc356cb |
2
.github/workflows/deploy-storybook.yml
vendored
2
.github/workflows/deploy-storybook.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
node-version: '22.17.0'
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
"version": "4.8.0",
|
||||
"version": "4.9.5",
|
||||
"extraOrigins": [
|
||||
"https://google.com",
|
||||
"https://test.com"
|
||||
],
|
||||
"sandbox": true,
|
||||
"ssoSubIds": [],
|
||||
"plugins": ["unraid-api-plugin-connect"]
|
||||
"plugins": [
|
||||
"unraid-api-plugin-connect"
|
||||
]
|
||||
}
|
||||
@@ -247,347 +247,6 @@ A field whose value conforms to the standard URL format as specified in RFC3986:
|
||||
"""
|
||||
scalar URL
|
||||
|
||||
type DiskPartition {
|
||||
"""The name of the partition"""
|
||||
name: String!
|
||||
|
||||
"""The filesystem type of the partition"""
|
||||
fsType: DiskFsType!
|
||||
|
||||
"""The size of the partition in bytes"""
|
||||
size: Float!
|
||||
}
|
||||
|
||||
"""The type of filesystem on the disk partition"""
|
||||
enum DiskFsType {
|
||||
XFS
|
||||
BTRFS
|
||||
VFAT
|
||||
ZFS
|
||||
EXT4
|
||||
NTFS
|
||||
}
|
||||
|
||||
type Disk implements Node {
|
||||
id: PrefixedID!
|
||||
|
||||
"""The device path of the disk (e.g. /dev/sdb)"""
|
||||
device: String!
|
||||
|
||||
"""The type of disk (e.g. SSD, HDD)"""
|
||||
type: String!
|
||||
|
||||
"""The model name of the disk"""
|
||||
name: String!
|
||||
|
||||
"""The manufacturer of the disk"""
|
||||
vendor: String!
|
||||
|
||||
"""The total size of the disk in bytes"""
|
||||
size: Float!
|
||||
|
||||
"""The number of bytes per sector"""
|
||||
bytesPerSector: Float!
|
||||
|
||||
"""The total number of cylinders on the disk"""
|
||||
totalCylinders: Float!
|
||||
|
||||
"""The total number of heads on the disk"""
|
||||
totalHeads: Float!
|
||||
|
||||
"""The total number of sectors on the disk"""
|
||||
totalSectors: Float!
|
||||
|
||||
"""The total number of tracks on the disk"""
|
||||
totalTracks: Float!
|
||||
|
||||
"""The number of tracks per cylinder"""
|
||||
tracksPerCylinder: Float!
|
||||
|
||||
"""The number of sectors per track"""
|
||||
sectorsPerTrack: Float!
|
||||
|
||||
"""The firmware revision of the disk"""
|
||||
firmwareRevision: String!
|
||||
|
||||
"""The serial number of the disk"""
|
||||
serialNum: String!
|
||||
|
||||
"""The interface type of the disk"""
|
||||
interfaceType: DiskInterfaceType!
|
||||
|
||||
"""The SMART status of the disk"""
|
||||
smartStatus: DiskSmartStatus!
|
||||
|
||||
"""The current temperature of the disk in Celsius"""
|
||||
temperature: Float
|
||||
|
||||
"""The partitions on the disk"""
|
||||
partitions: [DiskPartition!]!
|
||||
}
|
||||
|
||||
"""The type of interface the disk uses to connect to the system"""
|
||||
enum DiskInterfaceType {
|
||||
SAS
|
||||
SATA
|
||||
USB
|
||||
PCIE
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
"""
|
||||
The SMART (Self-Monitoring, Analysis and Reporting Technology) status of the disk
|
||||
"""
|
||||
enum DiskSmartStatus {
|
||||
OK
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
type KeyFile {
|
||||
location: String
|
||||
contents: String
|
||||
}
|
||||
|
||||
type Registration implements Node {
|
||||
id: PrefixedID!
|
||||
type: registrationType
|
||||
keyFile: KeyFile
|
||||
state: RegistrationState
|
||||
expiration: String
|
||||
updateExpiration: String
|
||||
}
|
||||
|
||||
enum registrationType {
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
INVALID
|
||||
TRIAL
|
||||
}
|
||||
|
||||
enum RegistrationState {
|
||||
TRIAL
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
EEXPIRED
|
||||
EGUID
|
||||
EGUID1
|
||||
ETRIAL
|
||||
ENOKEYFILE
|
||||
ENOKEYFILE1
|
||||
ENOKEYFILE2
|
||||
ENOFLASH
|
||||
ENOFLASH1
|
||||
ENOFLASH2
|
||||
ENOFLASH3
|
||||
ENOFLASH4
|
||||
ENOFLASH5
|
||||
ENOFLASH6
|
||||
ENOFLASH7
|
||||
EBLACKLISTED
|
||||
EBLACKLISTED1
|
||||
EBLACKLISTED2
|
||||
ENOCONN
|
||||
}
|
||||
|
||||
type Vars implements Node {
|
||||
id: PrefixedID!
|
||||
|
||||
"""Unraid version"""
|
||||
version: String
|
||||
maxArraysz: Int
|
||||
maxCachesz: Int
|
||||
|
||||
"""Machine hostname"""
|
||||
name: String
|
||||
timeZone: String
|
||||
comment: String
|
||||
security: String
|
||||
workgroup: String
|
||||
domain: String
|
||||
domainShort: String
|
||||
hideDotFiles: Boolean
|
||||
localMaster: Boolean
|
||||
enableFruit: String
|
||||
|
||||
"""Should a NTP server be used for time sync?"""
|
||||
useNtp: Boolean
|
||||
|
||||
"""NTP Server 1"""
|
||||
ntpServer1: String
|
||||
|
||||
"""NTP Server 2"""
|
||||
ntpServer2: String
|
||||
|
||||
"""NTP Server 3"""
|
||||
ntpServer3: String
|
||||
|
||||
"""NTP Server 4"""
|
||||
ntpServer4: String
|
||||
domainLogin: String
|
||||
sysModel: String
|
||||
sysArraySlots: Int
|
||||
sysCacheSlots: Int
|
||||
sysFlashSlots: Int
|
||||
useSsl: Boolean
|
||||
|
||||
"""Port for the webui via HTTP"""
|
||||
port: Int
|
||||
|
||||
"""Port for the webui via HTTPS"""
|
||||
portssl: Int
|
||||
localTld: String
|
||||
bindMgt: Boolean
|
||||
|
||||
"""Should telnet be enabled?"""
|
||||
useTelnet: Boolean
|
||||
porttelnet: Int
|
||||
useSsh: Boolean
|
||||
portssh: Int
|
||||
startPage: String
|
||||
startArray: Boolean
|
||||
spindownDelay: String
|
||||
queueDepth: String
|
||||
spinupGroups: Boolean
|
||||
defaultFormat: String
|
||||
defaultFsType: String
|
||||
shutdownTimeout: Int
|
||||
luksKeyfile: String
|
||||
pollAttributes: String
|
||||
pollAttributesDefault: String
|
||||
pollAttributesStatus: String
|
||||
nrRequests: Int
|
||||
nrRequestsDefault: Int
|
||||
nrRequestsStatus: String
|
||||
mdNumStripes: Int
|
||||
mdNumStripesDefault: Int
|
||||
mdNumStripesStatus: String
|
||||
mdSyncWindow: Int
|
||||
mdSyncWindowDefault: Int
|
||||
mdSyncWindowStatus: String
|
||||
mdSyncThresh: Int
|
||||
mdSyncThreshDefault: Int
|
||||
mdSyncThreshStatus: String
|
||||
mdWriteMethod: Int
|
||||
mdWriteMethodDefault: String
|
||||
mdWriteMethodStatus: String
|
||||
shareDisk: String
|
||||
shareUser: String
|
||||
shareUserInclude: String
|
||||
shareUserExclude: String
|
||||
shareSmbEnabled: Boolean
|
||||
shareNfsEnabled: Boolean
|
||||
shareAfpEnabled: Boolean
|
||||
shareInitialOwner: String
|
||||
shareInitialGroup: String
|
||||
shareCacheEnabled: Boolean
|
||||
shareCacheFloor: String
|
||||
shareMoverSchedule: String
|
||||
shareMoverLogging: Boolean
|
||||
fuseRemember: String
|
||||
fuseRememberDefault: String
|
||||
fuseRememberStatus: String
|
||||
fuseDirectio: String
|
||||
fuseDirectioDefault: String
|
||||
fuseDirectioStatus: String
|
||||
shareAvahiEnabled: Boolean
|
||||
shareAvahiSmbName: String
|
||||
shareAvahiSmbModel: String
|
||||
shareAvahiAfpName: String
|
||||
shareAvahiAfpModel: String
|
||||
safeMode: Boolean
|
||||
startMode: String
|
||||
configValid: Boolean
|
||||
configError: ConfigErrorState
|
||||
joinStatus: String
|
||||
deviceCount: Int
|
||||
flashGuid: String
|
||||
flashProduct: String
|
||||
flashVendor: String
|
||||
regCheck: String
|
||||
regFile: String
|
||||
regGuid: String
|
||||
regTy: registrationType
|
||||
regState: RegistrationState
|
||||
|
||||
"""Registration owner"""
|
||||
regTo: String
|
||||
regTm: String
|
||||
regTm2: String
|
||||
regGen: String
|
||||
sbName: String
|
||||
sbVersion: String
|
||||
sbUpdated: String
|
||||
sbEvents: Int
|
||||
sbState: String
|
||||
sbClean: Boolean
|
||||
sbSynced: Int
|
||||
sbSyncErrs: Int
|
||||
sbSynced2: Int
|
||||
sbSyncExit: String
|
||||
sbNumDisks: Int
|
||||
mdColor: String
|
||||
mdNumDisks: Int
|
||||
mdNumDisabled: Int
|
||||
mdNumInvalid: Int
|
||||
mdNumMissing: Int
|
||||
mdNumNew: Int
|
||||
mdNumErased: Int
|
||||
mdResync: Int
|
||||
mdResyncCorr: String
|
||||
mdResyncPos: String
|
||||
mdResyncDb: String
|
||||
mdResyncDt: String
|
||||
mdResyncAction: String
|
||||
mdResyncSize: Int
|
||||
mdState: String
|
||||
mdVersion: String
|
||||
cacheNumDevices: Int
|
||||
cacheSbNumDisks: Int
|
||||
fsState: String
|
||||
|
||||
"""Human friendly string of array events happening"""
|
||||
fsProgress: String
|
||||
|
||||
"""
|
||||
Percentage from 0 - 100 while upgrading a disk or swapping parity drives
|
||||
"""
|
||||
fsCopyPrcnt: Int
|
||||
fsNumMounted: Int
|
||||
fsNumUnmountable: Int
|
||||
fsUnmountableMask: String
|
||||
|
||||
"""Total amount of user shares"""
|
||||
shareCount: Int
|
||||
|
||||
"""Total amount shares with SMB enabled"""
|
||||
shareSmbCount: Int
|
||||
|
||||
"""Total amount shares with NFS enabled"""
|
||||
shareNfsCount: Int
|
||||
|
||||
"""Total amount shares with AFP enabled"""
|
||||
shareAfpCount: Int
|
||||
shareMoverActive: Boolean
|
||||
csrfToken: String
|
||||
}
|
||||
|
||||
"""Possible error states for configuration"""
|
||||
enum ConfigErrorState {
|
||||
UNKNOWN_ERROR
|
||||
INELIGIBLE
|
||||
INVALID
|
||||
NO_KEY_SERVER
|
||||
WITHDRAWN
|
||||
}
|
||||
|
||||
type Permission {
|
||||
resource: Resource!
|
||||
actions: [String!]!
|
||||
@@ -961,6 +620,102 @@ enum ThemeName {
|
||||
white
|
||||
}
|
||||
|
||||
type DiskPartition {
|
||||
"""The name of the partition"""
|
||||
name: String!
|
||||
|
||||
"""The filesystem type of the partition"""
|
||||
fsType: DiskFsType!
|
||||
|
||||
"""The size of the partition in bytes"""
|
||||
size: Float!
|
||||
}
|
||||
|
||||
"""The type of filesystem on the disk partition"""
|
||||
enum DiskFsType {
|
||||
XFS
|
||||
BTRFS
|
||||
VFAT
|
||||
ZFS
|
||||
EXT4
|
||||
NTFS
|
||||
}
|
||||
|
||||
type Disk implements Node {
|
||||
id: PrefixedID!
|
||||
|
||||
"""The device path of the disk (e.g. /dev/sdb)"""
|
||||
device: String!
|
||||
|
||||
"""The type of disk (e.g. SSD, HDD)"""
|
||||
type: String!
|
||||
|
||||
"""The model name of the disk"""
|
||||
name: String!
|
||||
|
||||
"""The manufacturer of the disk"""
|
||||
vendor: String!
|
||||
|
||||
"""The total size of the disk in bytes"""
|
||||
size: Float!
|
||||
|
||||
"""The number of bytes per sector"""
|
||||
bytesPerSector: Float!
|
||||
|
||||
"""The total number of cylinders on the disk"""
|
||||
totalCylinders: Float!
|
||||
|
||||
"""The total number of heads on the disk"""
|
||||
totalHeads: Float!
|
||||
|
||||
"""The total number of sectors on the disk"""
|
||||
totalSectors: Float!
|
||||
|
||||
"""The total number of tracks on the disk"""
|
||||
totalTracks: Float!
|
||||
|
||||
"""The number of tracks per cylinder"""
|
||||
tracksPerCylinder: Float!
|
||||
|
||||
"""The number of sectors per track"""
|
||||
sectorsPerTrack: Float!
|
||||
|
||||
"""The firmware revision of the disk"""
|
||||
firmwareRevision: String!
|
||||
|
||||
"""The serial number of the disk"""
|
||||
serialNum: String!
|
||||
|
||||
"""The interface type of the disk"""
|
||||
interfaceType: DiskInterfaceType!
|
||||
|
||||
"""The SMART status of the disk"""
|
||||
smartStatus: DiskSmartStatus!
|
||||
|
||||
"""The current temperature of the disk in Celsius"""
|
||||
temperature: Float
|
||||
|
||||
"""The partitions on the disk"""
|
||||
partitions: [DiskPartition!]!
|
||||
}
|
||||
|
||||
"""The type of interface the disk uses to connect to the system"""
|
||||
enum DiskInterfaceType {
|
||||
SAS
|
||||
SATA
|
||||
USB
|
||||
PCIE
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
"""
|
||||
The SMART (Self-Monitoring, Analysis and Reporting Technology) status of the disk
|
||||
"""
|
||||
enum DiskSmartStatus {
|
||||
OK
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
type InfoApps implements Node {
|
||||
id: PrefixedID!
|
||||
|
||||
@@ -1351,6 +1106,60 @@ type Owner {
|
||||
avatar: String!
|
||||
}
|
||||
|
||||
type KeyFile {
|
||||
location: String
|
||||
contents: String
|
||||
}
|
||||
|
||||
type Registration implements Node {
|
||||
id: PrefixedID!
|
||||
type: registrationType
|
||||
keyFile: KeyFile
|
||||
state: RegistrationState
|
||||
expiration: String
|
||||
updateExpiration: String
|
||||
}
|
||||
|
||||
enum registrationType {
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
INVALID
|
||||
TRIAL
|
||||
}
|
||||
|
||||
enum RegistrationState {
|
||||
TRIAL
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
EEXPIRED
|
||||
EGUID
|
||||
EGUID1
|
||||
ETRIAL
|
||||
ENOKEYFILE
|
||||
ENOKEYFILE1
|
||||
ENOKEYFILE2
|
||||
ENOFLASH
|
||||
ENOFLASH1
|
||||
ENOFLASH2
|
||||
ENOFLASH3
|
||||
ENOFLASH4
|
||||
ENOFLASH5
|
||||
ENOFLASH6
|
||||
ENOFLASH7
|
||||
EBLACKLISTED
|
||||
EBLACKLISTED1
|
||||
EBLACKLISTED2
|
||||
ENOCONN
|
||||
}
|
||||
|
||||
type ProfileModel implements Node {
|
||||
id: PrefixedID!
|
||||
username: String!
|
||||
@@ -1416,6 +1225,197 @@ type Settings implements Node {
|
||||
api: ApiConfig!
|
||||
}
|
||||
|
||||
type Vars implements Node {
|
||||
id: PrefixedID!
|
||||
|
||||
"""Unraid version"""
|
||||
version: String
|
||||
maxArraysz: Int
|
||||
maxCachesz: Int
|
||||
|
||||
"""Machine hostname"""
|
||||
name: String
|
||||
timeZone: String
|
||||
comment: String
|
||||
security: String
|
||||
workgroup: String
|
||||
domain: String
|
||||
domainShort: String
|
||||
hideDotFiles: Boolean
|
||||
localMaster: Boolean
|
||||
enableFruit: String
|
||||
|
||||
"""Should a NTP server be used for time sync?"""
|
||||
useNtp: Boolean
|
||||
|
||||
"""NTP Server 1"""
|
||||
ntpServer1: String
|
||||
|
||||
"""NTP Server 2"""
|
||||
ntpServer2: String
|
||||
|
||||
"""NTP Server 3"""
|
||||
ntpServer3: String
|
||||
|
||||
"""NTP Server 4"""
|
||||
ntpServer4: String
|
||||
domainLogin: String
|
||||
sysModel: String
|
||||
sysArraySlots: Int
|
||||
sysCacheSlots: Int
|
||||
sysFlashSlots: Int
|
||||
useSsl: Boolean
|
||||
|
||||
"""Port for the webui via HTTP"""
|
||||
port: Int
|
||||
|
||||
"""Port for the webui via HTTPS"""
|
||||
portssl: Int
|
||||
localTld: String
|
||||
bindMgt: Boolean
|
||||
|
||||
"""Should telnet be enabled?"""
|
||||
useTelnet: Boolean
|
||||
porttelnet: Int
|
||||
useSsh: Boolean
|
||||
portssh: Int
|
||||
startPage: String
|
||||
startArray: Boolean
|
||||
spindownDelay: String
|
||||
queueDepth: String
|
||||
spinupGroups: Boolean
|
||||
defaultFormat: String
|
||||
defaultFsType: String
|
||||
shutdownTimeout: Int
|
||||
luksKeyfile: String
|
||||
pollAttributes: String
|
||||
pollAttributesDefault: String
|
||||
pollAttributesStatus: String
|
||||
nrRequests: Int
|
||||
nrRequestsDefault: Int
|
||||
nrRequestsStatus: String
|
||||
mdNumStripes: Int
|
||||
mdNumStripesDefault: Int
|
||||
mdNumStripesStatus: String
|
||||
mdSyncWindow: Int
|
||||
mdSyncWindowDefault: Int
|
||||
mdSyncWindowStatus: String
|
||||
mdSyncThresh: Int
|
||||
mdSyncThreshDefault: Int
|
||||
mdSyncThreshStatus: String
|
||||
mdWriteMethod: Int
|
||||
mdWriteMethodDefault: String
|
||||
mdWriteMethodStatus: String
|
||||
shareDisk: String
|
||||
shareUser: String
|
||||
shareUserInclude: String
|
||||
shareUserExclude: String
|
||||
shareSmbEnabled: Boolean
|
||||
shareNfsEnabled: Boolean
|
||||
shareAfpEnabled: Boolean
|
||||
shareInitialOwner: String
|
||||
shareInitialGroup: String
|
||||
shareCacheEnabled: Boolean
|
||||
shareCacheFloor: String
|
||||
shareMoverSchedule: String
|
||||
shareMoverLogging: Boolean
|
||||
fuseRemember: String
|
||||
fuseRememberDefault: String
|
||||
fuseRememberStatus: String
|
||||
fuseDirectio: String
|
||||
fuseDirectioDefault: String
|
||||
fuseDirectioStatus: String
|
||||
shareAvahiEnabled: Boolean
|
||||
shareAvahiSmbName: String
|
||||
shareAvahiSmbModel: String
|
||||
shareAvahiAfpName: String
|
||||
shareAvahiAfpModel: String
|
||||
safeMode: Boolean
|
||||
startMode: String
|
||||
configValid: Boolean
|
||||
configError: ConfigErrorState
|
||||
joinStatus: String
|
||||
deviceCount: Int
|
||||
flashGuid: String
|
||||
flashProduct: String
|
||||
flashVendor: String
|
||||
regCheck: String
|
||||
regFile: String
|
||||
regGuid: String
|
||||
regTy: registrationType
|
||||
regState: RegistrationState
|
||||
|
||||
"""Registration owner"""
|
||||
regTo: String
|
||||
regTm: String
|
||||
regTm2: String
|
||||
regGen: String
|
||||
sbName: String
|
||||
sbVersion: String
|
||||
sbUpdated: String
|
||||
sbEvents: Int
|
||||
sbState: String
|
||||
sbClean: Boolean
|
||||
sbSynced: Int
|
||||
sbSyncErrs: Int
|
||||
sbSynced2: Int
|
||||
sbSyncExit: String
|
||||
sbNumDisks: Int
|
||||
mdColor: String
|
||||
mdNumDisks: Int
|
||||
mdNumDisabled: Int
|
||||
mdNumInvalid: Int
|
||||
mdNumMissing: Int
|
||||
mdNumNew: Int
|
||||
mdNumErased: Int
|
||||
mdResync: Int
|
||||
mdResyncCorr: String
|
||||
mdResyncPos: String
|
||||
mdResyncDb: String
|
||||
mdResyncDt: String
|
||||
mdResyncAction: String
|
||||
mdResyncSize: Int
|
||||
mdState: String
|
||||
mdVersion: String
|
||||
cacheNumDevices: Int
|
||||
cacheSbNumDisks: Int
|
||||
fsState: String
|
||||
|
||||
"""Human friendly string of array events happening"""
|
||||
fsProgress: String
|
||||
|
||||
"""
|
||||
Percentage from 0 - 100 while upgrading a disk or swapping parity drives
|
||||
"""
|
||||
fsCopyPrcnt: Int
|
||||
fsNumMounted: Int
|
||||
fsNumUnmountable: Int
|
||||
fsUnmountableMask: String
|
||||
|
||||
"""Total amount of user shares"""
|
||||
shareCount: Int
|
||||
|
||||
"""Total amount shares with SMB enabled"""
|
||||
shareSmbCount: Int
|
||||
|
||||
"""Total amount shares with NFS enabled"""
|
||||
shareNfsCount: Int
|
||||
|
||||
"""Total amount shares with AFP enabled"""
|
||||
shareAfpCount: Int
|
||||
shareMoverActive: Boolean
|
||||
csrfToken: String
|
||||
}
|
||||
|
||||
"""Possible error states for configuration"""
|
||||
enum ConfigErrorState {
|
||||
UNKNOWN_ERROR
|
||||
INELIGIBLE
|
||||
INVALID
|
||||
NO_KEY_SERVER
|
||||
WITHDRAWN
|
||||
}
|
||||
|
||||
type VmDomain implements Node {
|
||||
"""The unique identifier for the vm (uuid)"""
|
||||
id: PrefixedID!
|
||||
|
||||
@@ -17,7 +17,6 @@ exports[`Returns paths 1`] = `
|
||||
"myservers-base",
|
||||
"myservers-config",
|
||||
"myservers-config-states",
|
||||
"myservers-env",
|
||||
"myservers-keepalive",
|
||||
"keyfile-base",
|
||||
"machine-id",
|
||||
|
||||
@@ -24,7 +24,6 @@ test('Returns paths', async () => {
|
||||
'myservers-base': '/boot/config/plugins/dynamix.my.servers/',
|
||||
'myservers-config': expect.stringContaining('api/dev/Unraid.net/myservers.cfg'),
|
||||
'myservers-config-states': expect.stringContaining('api/dev/states/myservers.cfg'),
|
||||
'myservers-env': '/boot/config/plugins/dynamix.my.servers/env',
|
||||
'myservers-keepalive': './dev/Unraid.net/fb_keepalive',
|
||||
'keyfile-base': expect.stringContaining('api/dev/Unraid.net'),
|
||||
'machine-id': expect.stringContaining('api/dev/data/machine-id'),
|
||||
|
||||
@@ -67,6 +67,7 @@ export const getPackageJsonDependencies = (): string[] | undefined => {
|
||||
|
||||
export const API_VERSION = process.env.npm_package_version ?? getPackageJson().version;
|
||||
|
||||
/** Controls how the app is built/run (i.e. in terms of optimization) */
|
||||
export const NODE_ENV =
|
||||
(process.env.NODE_ENV as 'development' | 'test' | 'staging' | 'production') ?? 'production';
|
||||
export const environment = {
|
||||
@@ -76,6 +77,7 @@ export const CHOKIDAR_USEPOLLING = process.env.CHOKIDAR_USEPOLLING === 'true';
|
||||
export const IS_DOCKER = process.env.IS_DOCKER === 'true';
|
||||
export const DEBUG = process.env.DEBUG === 'true';
|
||||
export const INTROSPECTION = process.env.INTROSPECTION === 'true';
|
||||
/** Determines the app-level & business logic environment (i.e. what data & infrastructure is used) */
|
||||
export const ENVIRONMENT = process.env.ENVIRONMENT
|
||||
? (process.env.ENVIRONMENT as 'production' | 'staging' | 'development')
|
||||
: 'production';
|
||||
|
||||
@@ -49,7 +49,6 @@ const initialState = {
|
||||
resolvePath(process.env.PATHS_STATES ?? ('/usr/local/emhttp/state/' as const)),
|
||||
'myservers.cfg' as const
|
||||
),
|
||||
'myservers-env': '/boot/config/plugins/dynamix.my.servers/env' as const,
|
||||
'myservers-keepalive':
|
||||
process.env.PATHS_MY_SERVERS_FB ??
|
||||
('/boot/config/plugins/dynamix.my.servers/fb_keepalive' as const),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
import { ensureWriteSync } from '@unraid/shared/util/file.js';
|
||||
import { isEqual } from 'lodash-es';
|
||||
|
||||
import type { RootState } from '@app/store/index.js';
|
||||
@@ -27,8 +27,11 @@ export const startStoreSync = async () => {
|
||||
!isEqual(state, lastState) &&
|
||||
state.paths['myservers-config-states']
|
||||
) {
|
||||
writeFileSync(join(state.paths.states, 'config.log'), JSON.stringify(state.config, null, 2));
|
||||
writeFileSync(
|
||||
ensureWriteSync(
|
||||
join(state.paths.states, 'config.log'),
|
||||
JSON.stringify(state.config, null, 2)
|
||||
);
|
||||
ensureWriteSync(
|
||||
join(state.paths.states, 'graphql.log'),
|
||||
JSON.stringify(state.minigraph, null, 2)
|
||||
);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { copyFile, readFile, writeFile } from 'fs/promises';
|
||||
import { copyFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
|
||||
import { Command, CommandRunner, Option } from 'nest-commander';
|
||||
|
||||
import { cliLogger } from '@app/core/log.js';
|
||||
import { fileExistsSync } from '@app/core/utils/files/file-exists.js';
|
||||
import { ENVIRONMENT } from '@app/environment.js';
|
||||
import { getters } from '@app/store/index.js';
|
||||
import { LogService } from '@app/unraid-api/cli/log.service.js';
|
||||
import { StartCommand } from '@app/unraid-api/cli/start.command.js';
|
||||
import { StopCommand } from '@app/unraid-api/cli/stop.command.js';
|
||||
import { RestartCommand } from '@app/unraid-api/cli/restart.command.js';
|
||||
|
||||
interface SwitchEnvOptions {
|
||||
environment?: 'staging' | 'production';
|
||||
@@ -31,60 +31,43 @@ export class SwitchEnvCommand extends CommandRunner {
|
||||
|
||||
constructor(
|
||||
private readonly logger: LogService,
|
||||
private readonly stopCommand: StopCommand,
|
||||
private readonly startCommand: StartCommand
|
||||
private readonly restartCommand: RestartCommand
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
private async getEnvironmentFromFile(path: string): Promise<'production' | 'staging'> {
|
||||
const envFile = await readFile(path, 'utf-8').catch(() => '');
|
||||
this.logger.debug(`Checking ${path} for current ENV, found ${envFile}`);
|
||||
|
||||
// Match the env file env="production" which would be [0] = env="production", [1] = env and [2] = production
|
||||
const matchArray = /([a-zA-Z]+)=["]*([a-zA-Z]+)["]*/.exec(envFile);
|
||||
// Get item from index 2 of the regex match or return production
|
||||
const [, , currentEnvInFile] = matchArray && matchArray.length === 3 ? matchArray : [];
|
||||
return this.parseStringToEnv(currentEnvInFile);
|
||||
}
|
||||
|
||||
private switchToOtherEnv(environment: 'production' | 'staging'): 'production' | 'staging' {
|
||||
if (environment === 'production') {
|
||||
return 'staging';
|
||||
}
|
||||
return 'production';
|
||||
}
|
||||
|
||||
async run(_, options: SwitchEnvOptions): Promise<void> {
|
||||
const paths = getters.paths();
|
||||
const basePath = paths['unraid-api-base'];
|
||||
const envFlashFilePath = paths['myservers-env'];
|
||||
const currentEnvPath = join(basePath, '.env');
|
||||
|
||||
this.logger.warn('Stopping the Unraid API');
|
||||
try {
|
||||
await this.stopCommand.run([], { delete: false });
|
||||
} catch (err) {
|
||||
this.logger.warn('Failed to stop the Unraid API (maybe already stopped?)');
|
||||
// Determine target environment
|
||||
const currentEnv = ENVIRONMENT;
|
||||
const targetEnv = options.environment ?? 'production';
|
||||
|
||||
this.logger.info(`Switching environment from ${currentEnv} to ${targetEnv}`);
|
||||
|
||||
// Check if target environment file exists
|
||||
const sourceEnvPath = join(basePath, `.env.${targetEnv}`);
|
||||
if (!fileExistsSync(sourceEnvPath)) {
|
||||
this.logger.error(
|
||||
`Environment file ${sourceEnvPath} does not exist. Cannot switch to ${targetEnv} environment.`
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const newEnv =
|
||||
options.environment ??
|
||||
this.switchToOtherEnv(await this.getEnvironmentFromFile(envFlashFilePath));
|
||||
this.logger.info(`Setting environment to ${newEnv}`);
|
||||
// Copy the target environment file to .env
|
||||
this.logger.debug(`Copying ${sourceEnvPath} to ${currentEnvPath}`);
|
||||
try {
|
||||
await copyFile(sourceEnvPath, currentEnvPath);
|
||||
this.logger.info(`Successfully switched to ${targetEnv} environment`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Failed to copy environment file: ${error}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Write new env to flash
|
||||
const newEnvLine = `env="${newEnv}"`;
|
||||
this.logger.debug('Writing %s to %s', newEnvLine, envFlashFilePath);
|
||||
await writeFile(envFlashFilePath, newEnvLine);
|
||||
|
||||
// Copy the new env over to live location before restarting
|
||||
const source = join(basePath, `.env.${newEnv}`);
|
||||
const destination = join(basePath, '.env');
|
||||
|
||||
cliLogger.debug('Copying %s to %s', source, destination);
|
||||
await copyFile(source, destination);
|
||||
|
||||
cliLogger.info('Now using %s', newEnv);
|
||||
await this.startCommand.run([], {});
|
||||
// Restart the API to pick up the new environment
|
||||
this.logger.info('Restarting Unraid API to apply environment changes...');
|
||||
await this.restartCommand.run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ export class NginxService {
|
||||
async reload() {
|
||||
try {
|
||||
await execa('/etc/rc.d/rc.nginx', ['reload']);
|
||||
this.logger.log('Nginx reloaded');
|
||||
return true;
|
||||
} catch (err: unknown) {
|
||||
this.logger.warn('Failed to reload Nginx with error: ', err);
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { ONE_SECOND_MS } from '@app/consts.js';
|
||||
import { NginxService } from '@app/unraid-api/nginx/nginx.service.js';
|
||||
import { ModificationEffect } from '@app/unraid-api/unraid-file-modifier/file-modification.js';
|
||||
|
||||
@Injectable()
|
||||
export class FileModificationEffectService {
|
||||
private readonly logger = new Logger(FileModificationEffectService.name);
|
||||
constructor(private readonly nginxService: NginxService) {}
|
||||
async runEffect(effect: ModificationEffect): Promise<void> {
|
||||
switch (effect) {
|
||||
case 'nginx:reload':
|
||||
this.logger.log('Reloading Nginx in 10 seconds...');
|
||||
await new Promise((resolve) => setTimeout(resolve, 10 * ONE_SECOND_MS));
|
||||
await this.nginxService.reload();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
1751630630443
|
||||
1752524464371
|
||||
@@ -1 +1 @@
|
||||
1751630630198
|
||||
1752524464066
|
||||
@@ -1 +1 @@
|
||||
1751630630343
|
||||
1752524464213
|
||||
@@ -1 +1 @@
|
||||
1751630630571
|
||||
1752524464631
|
||||
@@ -1 +1 @@
|
||||
1751630630810
|
||||
1752524464761
|
||||
@@ -97,7 +97,7 @@
|
||||
"lodash-es": "4.17.21",
|
||||
"nest-authz": "2.17.0",
|
||||
"rxjs": "7.8.2",
|
||||
"ws": "^8.18.0",
|
||||
"ws": "8.18.3",
|
||||
"zen-observable-ts": "1.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,11 +130,19 @@ export class MothershipConnectionService implements OnModuleInit, OnModuleDestro
|
||||
}
|
||||
|
||||
async onModuleInit() {
|
||||
// Crash on startup if these config values are not set initially
|
||||
// Warn on startup if these config values are not set initially
|
||||
const { unraidVersion, flashGuid, apiVersion } = this.configKeys;
|
||||
const warnings: string[] = [];
|
||||
[unraidVersion, flashGuid, apiVersion].forEach((key) => {
|
||||
this.configService.getOrThrow(key);
|
||||
try {
|
||||
this.configService.getOrThrow(key);
|
||||
} catch (error) {
|
||||
warnings.push(`${key} is not set`);
|
||||
}
|
||||
});
|
||||
if (warnings.length > 0) {
|
||||
this.logger.warn('Missing config values: %s', warnings.join(', '));
|
||||
}
|
||||
// Setup IDENTITY_CHANGED & METADATA_CHANGED events
|
||||
this.setupIdentitySubscription();
|
||||
this.setupMetadataChangedEvent();
|
||||
|
||||
9
packages/unraid-shared/justfile
Normal file
9
packages/unraid-shared/justfile
Normal file
@@ -0,0 +1,9 @@
|
||||
# Justfile for unraid-shared
|
||||
|
||||
# Default recipe to run when just is called without arguments
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Watch for changes in src files and run clean + build
|
||||
watch:
|
||||
watchexec -r -e ts,tsx -w src -- pnpm build
|
||||
@@ -1,11 +1,24 @@
|
||||
import { accessSync } from 'fs';
|
||||
import { access } from 'fs/promises';
|
||||
import { access, mkdir, writeFile } from 'fs/promises';
|
||||
import { mkdirSync, writeFileSync } from 'fs';
|
||||
import { F_OK } from 'node:constants';
|
||||
import { dirname } from 'path';
|
||||
|
||||
/**
|
||||
* Checks if a file exists asynchronously.
|
||||
* @param path - The file path to check
|
||||
* @returns Promise that resolves to true if file exists, false otherwise
|
||||
*/
|
||||
export const fileExists = async (path: string) =>
|
||||
access(path, F_OK)
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
|
||||
/**
|
||||
* Checks if a file exists synchronously.
|
||||
* @param path - The file path to check
|
||||
* @returns true if file exists, false otherwise
|
||||
*/
|
||||
export const fileExistsSync = (path: string) => {
|
||||
try {
|
||||
accessSync(path, F_OK);
|
||||
@@ -14,3 +27,44 @@ export const fileExistsSync = (path: string) => {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes data to a file, creating parent directories if they don't exist.
|
||||
*
|
||||
* This function ensures the directory structure exists before writing the file,
|
||||
* equivalent to `mkdir -p` followed by file writing.
|
||||
*
|
||||
* @param path - The file path to write to
|
||||
* @param data - The data to write (string or Buffer)
|
||||
* @throws {Error} If path is invalid (null, empty, or not a string)
|
||||
* @throws {Error} For any file system errors (EACCES, EPERM, ENOSPC, EISDIR, etc.)
|
||||
*/
|
||||
export const ensureWrite = async (path: string, data: string | Buffer) => {
|
||||
if (!path || typeof path !== 'string') {
|
||||
throw new Error(`Invalid path provided: ${path}`);
|
||||
}
|
||||
|
||||
await mkdir(dirname(path), { recursive: true });
|
||||
return await writeFile(path, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes data to a file synchronously, creating parent directories if they don't exist.
|
||||
*
|
||||
* This function ensures the directory structure exists before writing the file,
|
||||
* equivalent to `mkdir -p` followed by file writing.
|
||||
*
|
||||
* @param path - The file path to write to
|
||||
* @param data - The data to write (string or Buffer)
|
||||
* @throws {Error} If path is invalid (null, empty, or not a string)
|
||||
* @throws {Error} For any file system errors (EACCES, EPERM, ENOSPC, EISDIR, etc.)
|
||||
*/
|
||||
export const ensureWriteSync = (path: string, data: string | Buffer) => {
|
||||
if (!path || typeof path !== 'string') {
|
||||
throw new Error(`Invalid path provided: ${path}`);
|
||||
}
|
||||
|
||||
mkdirSync(dirname(path), { recursive: true });
|
||||
return writeFileSync(path, data);
|
||||
};
|
||||
|
||||
|
||||
@@ -331,8 +331,7 @@ exit 0
|
||||
<![CDATA[
|
||||
SCRIPTS_DIR="/usr/local/share/dynamix.unraid.net/install/scripts"
|
||||
# Log file for debugging
|
||||
LOGFILE="/var/log/unraid-api/dynamix-unraid-install.log"
|
||||
mkdir -p "$(dirname "$LOGFILE")"
|
||||
mkdir -p "/var/log/unraid-api"
|
||||
|
||||
echo "Starting Unraid Connect installation..."
|
||||
|
||||
@@ -344,26 +343,26 @@ CFG_NEW=/boot/config/plugins/dynamix.my.servers
|
||||
# Setup the API (but don't start it yet)
|
||||
if [ -x "$SCRIPTS_DIR/setup_api.sh" ]; then
|
||||
echo "Setting up Unraid API..."
|
||||
echo "Running setup_api.sh" >> "$LOGFILE"
|
||||
# Capture output and add to log file
|
||||
setup_output=$("$SCRIPTS_DIR/setup_api.sh")
|
||||
echo "$setup_output" >> "$LOGFILE"
|
||||
echo "Running setup_api.sh"
|
||||
# Run and show output to user
|
||||
"$SCRIPTS_DIR/setup_api.sh"
|
||||
else
|
||||
echo "ERROR: setup_api.sh not found or not executable" >> "$LOGFILE"
|
||||
echo "ERROR: setup_api.sh not found or not executable"
|
||||
echo "ERROR: setup_api.sh not found or not executable"
|
||||
fi
|
||||
|
||||
# Run post-installation verification
|
||||
if [ -x "$SCRIPTS_DIR/verify_install.sh" ]; then
|
||||
echo "Running post-installation verification..."
|
||||
echo "Running verify_install.sh" >> "$LOGFILE"
|
||||
# Capture output and add to log file
|
||||
verify_output=$("$SCRIPTS_DIR/verify_install.sh")
|
||||
echo "$verify_output" >> "$LOGFILE"
|
||||
echo "Running verify_install.sh"
|
||||
# Run and show output to user
|
||||
"$SCRIPTS_DIR/verify_install.sh"
|
||||
else
|
||||
echo "ERROR: verify_install.sh not found or not executable" >> "$LOGFILE"
|
||||
echo "ERROR: verify_install.sh not found or not executable"
|
||||
echo "ERROR: verify_install.sh not found or not executable"
|
||||
fi
|
||||
|
||||
echo "Installation completed at $(date)" >> "$LOGFILE"
|
||||
echo "Installation completed at $(date)"
|
||||
]]>
|
||||
</INLINE>
|
||||
</FILE>
|
||||
@@ -379,6 +378,18 @@ echo "Installation completed at $(date)" >> "$LOGFILE"
|
||||
/etc/rc.d/rc.unraid-api cleanup-dependencies
|
||||
|
||||
echo "Starting Unraid API service"
|
||||
echo "DEBUG: Checking PATH: $PATH"
|
||||
echo "DEBUG: Checking if unraid-api files exist:"
|
||||
ls -la /usr/local/unraid-api/dist/
|
||||
echo "DEBUG: Checking symlink:"
|
||||
ls -la /usr/local/bin/unraid-api
|
||||
echo "DEBUG: Checking Node.js version:"
|
||||
node --version
|
||||
echo "DEBUG: Checking if cli.js is executable:"
|
||||
ls -la /usr/local/unraid-api/dist/cli.js
|
||||
echo "DEBUG: Attempting to run unraid-api directly:"
|
||||
/usr/local/unraid-api/dist/cli.js version || echo "Direct execution failed"
|
||||
|
||||
echo "If no additional messages appear within 30 seconds, it is safe to refresh the page."
|
||||
/etc/rc.d/rc.unraid-api plugins add unraid-api-plugin-connect -b --no-restart
|
||||
/etc/rc.d/rc.unraid-api start
|
||||
|
||||
@@ -166,22 +166,23 @@ _enabled() {
|
||||
return 1
|
||||
}
|
||||
_connected() {
|
||||
CFG=$API_CONFIG_HOME/connect.json
|
||||
[[ ! -f "${CFG}" ]] && return 1
|
||||
local connect_config username status_cfg connection_status
|
||||
connect_config=$API_CONFIG_HOME/connect.json
|
||||
[[ ! -f "${connect_config}" ]] && return 1
|
||||
|
||||
username=$(jq -r '.username // empty' "${CFG}" 2>/dev/null)
|
||||
# is the user signed in?
|
||||
username=$(jq -r '.username // empty' "${connect_config}" 2>/dev/null)
|
||||
if [ -z "${username}" ]; then
|
||||
return 1
|
||||
fi
|
||||
# the minigraph status is no longer synced to the connect config file
|
||||
# to avoid a false negative, we'll omit this check for now.
|
||||
#
|
||||
# shellcheck disable=SC1090
|
||||
# source <(sed -nr '/\[connectionStatus\]/,/\[/{/minigraph/p}' "${CFG}" 2>/dev/null)
|
||||
# # ensure connected
|
||||
# if [[ -z "${minigraph}" || "${minigraph}" != "CONNECTED" ]]; then
|
||||
# return 1
|
||||
# fi
|
||||
# are we connected to mothership?
|
||||
status_cfg="/var/local/emhttp/connectStatus.json"
|
||||
[[ ! -f "${status_cfg}" ]] && return 1
|
||||
connection_status=$(jq -r '.connectionStatus // empty' "${status_cfg}" 2>/dev/null)
|
||||
if [[ "${connection_status}" != "CONNECTED" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
_haserror() {
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
# shellcheck source=/dev/null
|
||||
source /etc/profile
|
||||
|
||||
flash="/boot/config/plugins/dynamix.my.servers"
|
||||
[[ ! -d "${flash}" ]] && echo "Please reinstall the Unraid Connect plugin" && exit 1
|
||||
[[ ! -f "${flash}/env" ]] && echo 'env=production' >"${flash}/env"
|
||||
unraid_binary_path="/usr/local/bin/unraid-api"
|
||||
api_base_dir="/usr/local/unraid-api"
|
||||
scripts_dir="/usr/local/share/dynamix.unraid.net/scripts"
|
||||
|
||||
@@ -18,10 +18,9 @@ $cli = php_sapi_name()=='cli';
|
||||
|
||||
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
require_once "$docroot/plugins/dynamix.my.servers/include/connect-config.php";
|
||||
|
||||
$myservers_flash_cfg_path='/boot/config/plugins/dynamix.my.servers/myservers.cfg';
|
||||
$myservers = file_exists($myservers_flash_cfg_path) ? @parse_ini_file($myservers_flash_cfg_path,true) : [];
|
||||
$isRegistered = !empty($myservers['remote']['username']);
|
||||
$isRegistered = ConnectConfig::isUserSignedIn();
|
||||
|
||||
// Read connection status from the new API status file
|
||||
$statusFilePath = '/var/local/emhttp/connectStatus.json';
|
||||
@@ -595,9 +594,31 @@ set_git_config('user.email', 'gitbot@unraid.net');
|
||||
set_git_config('user.name', 'gitbot');
|
||||
|
||||
// ensure dns can resolve backup.unraid.net
|
||||
if (! checkdnsrr("backup.unraid.net","A") ) {
|
||||
$dnsResolved = false;
|
||||
|
||||
// Try multiple DNS resolution methods
|
||||
if (function_exists('dns_get_record')) {
|
||||
$dnsRecords = dns_get_record("backup.unraid.net", DNS_A);
|
||||
$dnsResolved = !empty($dnsRecords);
|
||||
}
|
||||
|
||||
// Fallback to gethostbyname if dns_get_record fails
|
||||
if (!$dnsResolved) {
|
||||
$ip = gethostbyname("backup.unraid.net");
|
||||
$dnsResolved = ($ip !== "backup.unraid.net");
|
||||
}
|
||||
|
||||
// Final fallback to system nslookup
|
||||
if (!$dnsResolved) {
|
||||
$output = [];
|
||||
$return_var = 0;
|
||||
exec('nslookup backup.unraid.net 2>/dev/null', $output, $return_var);
|
||||
$dnsResolved = ($return_var === 0 && !empty($output));
|
||||
}
|
||||
|
||||
if (!$dnsResolved) {
|
||||
$arrState['loading'] = '';
|
||||
$arrState['error'] = 'DNS is unable to resolve backup.unraid.net';
|
||||
$arrState['error'] = 'DNS resolution failed for backup.unraid.net - PHP DNS functions (checkdnsrr, dns_get_record, gethostbyname) and system nslookup all failed to resolve the hostname. This indicates a DNS configuration issue on your Unraid server. Check your DNS settings in Settings > Network Settings.';
|
||||
response_complete(406, array('error' => $arrState['error']));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/plugins/dynamix.my.servers/include/api-config.php";
|
||||
|
||||
/**
|
||||
* Wrapper around the API's connect.json configuration file.
|
||||
*/
|
||||
class ConnectConfig
|
||||
{
|
||||
public const CONFIG_PATH = ApiConfig::CONFIG_DIR . '/connect.json';
|
||||
|
||||
public static function getConfig()
|
||||
{
|
||||
try {
|
||||
return json_decode(file_get_contents(self::CONFIG_PATH), true) ?? [];
|
||||
} catch (Throwable $e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public static function isUserSignedIn()
|
||||
{
|
||||
$config = self::getConfig();
|
||||
return ApiConfig::isConnectPluginEnabled() && !empty($config['username'] ?? '');
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# Unraid API Installation Verification Script
|
||||
# Checks that critical files are installed correctly
|
||||
|
||||
# Exit on errors
|
||||
set -e
|
||||
|
||||
echo "Performing comprehensive installation verification..."
|
||||
|
||||
# Define critical files to check (POSIX-compliant, no arrays)
|
||||
@@ -171,7 +168,7 @@ if [ $TOTAL_ERRORS -eq 0 ]; then
|
||||
else
|
||||
printf 'Found %d total errors.\n' "$TOTAL_ERRORS"
|
||||
echo "Installation verification completed with issues."
|
||||
echo "See log file for details: /var/log/unraid-api/dynamix-unraid-install.log"
|
||||
echo "Please review the errors above and contact support if needed."
|
||||
# We don't exit with error as this is just a verification script
|
||||
exit 0
|
||||
fi
|
||||
683
pnpm-lock.yaml
generated
683
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,7 @@
|
||||
"@types/testing-library__vue": "5.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.36.0",
|
||||
"@unraid/tailwind-rem-to-rem": "1.1.0",
|
||||
"@vitejs/plugin-vue": "5.2.4",
|
||||
"@vitejs/plugin-vue": "6.0.0",
|
||||
"@vitest/coverage-v8": "3.2.4",
|
||||
"@vitest/ui": "3.2.4",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
@@ -94,7 +94,7 @@
|
||||
"eslint-plugin-storybook": "9.0.16",
|
||||
"eslint-plugin-vue": "10.3.0",
|
||||
"happy-dom": "18.0.1",
|
||||
"jiti": "^2.4.2",
|
||||
"jiti": "2.4.2",
|
||||
"postcss": "8.5.6",
|
||||
"postcss-import": "16.1.1",
|
||||
"prettier": "3.6.2",
|
||||
@@ -112,7 +112,7 @@
|
||||
"vitest": "3.2.4",
|
||||
"vue": "3.5.17",
|
||||
"vue-tsc": "3.0.1",
|
||||
"wrangler": "^3.114.10"
|
||||
"wrangler": "4.24.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "4.44.2"
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
"@types/semver": "7.7.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.36.0",
|
||||
"@unraid/tailwind-rem-to-rem": "1.1.0",
|
||||
"@vitejs/plugin-vue": "5.2.4",
|
||||
"@vitejs/plugin-vue": "6.0.0",
|
||||
"@vitest/coverage-v8": "3.2.4",
|
||||
"@vue/apollo-util": "4.2.2",
|
||||
"@vue/test-utils": "2.4.6",
|
||||
|
||||
Reference in New Issue
Block a user