feat(api): complete NaxOS management daemon, GitOps engine, ZFS controller, and test suite
CI & Test NaxOS Management API / test (push) Failing after 2m49s
CI & Test NaxOS Management API / test (push) Failing after 2m49s
This commit is contained in:
@@ -0,0 +1,200 @@
|
||||
export type ZfsLayout = 'stripe' | 'mirror' | 'raidz1' | 'raidz2' | 'raidz3';
|
||||
|
||||
export interface ZfsDisk {
|
||||
name: string;
|
||||
path: string;
|
||||
size: string;
|
||||
health: string;
|
||||
readErrors: number;
|
||||
writeErrors: number;
|
||||
checksumErrors: number;
|
||||
}
|
||||
|
||||
export interface ZfsVdev {
|
||||
name: string;
|
||||
type: ZfsLayout | 'disk';
|
||||
health: string;
|
||||
disks: ZfsDisk[];
|
||||
}
|
||||
|
||||
export interface ZfsPool {
|
||||
name: string;
|
||||
size: string;
|
||||
allocated: string;
|
||||
free: string;
|
||||
fragmentation: string;
|
||||
capacityPercent: number;
|
||||
health: 'ONLINE' | 'DEGRADED' | 'FAULTED' | 'OFFLINE' | 'UNAVAIL';
|
||||
altroot: string;
|
||||
vdevs: ZfsVdev[];
|
||||
scanStatus?: string;
|
||||
scrubProgress?: number;
|
||||
}
|
||||
|
||||
export interface ZfsDataset {
|
||||
name: string;
|
||||
pool: string;
|
||||
used: string;
|
||||
available: string;
|
||||
referenced: string;
|
||||
mountpoint: string;
|
||||
compression: string;
|
||||
quota: string;
|
||||
reservation: string;
|
||||
recordsize: string;
|
||||
}
|
||||
|
||||
export interface ZfsSnapshot {
|
||||
name: string;
|
||||
dataset: string;
|
||||
snapshotTag: string;
|
||||
creationTime: string;
|
||||
usedBytes: string;
|
||||
referencedBytes: string;
|
||||
}
|
||||
|
||||
export interface UnimportedPool {
|
||||
name: string;
|
||||
id: string;
|
||||
state: string;
|
||||
status: string;
|
||||
action?: string;
|
||||
disks: string[];
|
||||
}
|
||||
|
||||
export interface SmbShare {
|
||||
name: string;
|
||||
path: string;
|
||||
comment?: string;
|
||||
readOnly: boolean;
|
||||
browseable: boolean;
|
||||
guestOk: boolean;
|
||||
validUsers: string[];
|
||||
forceUser?: string;
|
||||
forceGroup?: string;
|
||||
timeMachine: boolean;
|
||||
timeMachineMaxSize?: string;
|
||||
}
|
||||
|
||||
export interface NfsExportClient {
|
||||
subnet: string;
|
||||
options: string;
|
||||
}
|
||||
|
||||
export interface NfsExport {
|
||||
path: string;
|
||||
clients: NfsExportClient[];
|
||||
}
|
||||
|
||||
export interface SystemUser {
|
||||
username: string;
|
||||
description?: string;
|
||||
isAdmin: boolean;
|
||||
sshKeys: string[];
|
||||
smbAccess: boolean;
|
||||
}
|
||||
|
||||
export type AppRuntime = 'systemd' | 'docker' | 'k3s';
|
||||
|
||||
export interface AppCatalogItem {
|
||||
id: string;
|
||||
name: string;
|
||||
category: 'Media' | 'Storage' | 'Productivity' | 'Security' | 'Automation';
|
||||
description: string;
|
||||
icon: string;
|
||||
defaultPort: number;
|
||||
supportedRuntimes: AppRuntime[];
|
||||
recommendedRuntime: AppRuntime;
|
||||
envVariables?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface InstalledApp {
|
||||
id: string;
|
||||
appId: string;
|
||||
name: string;
|
||||
runtime: AppRuntime;
|
||||
status: 'running' | 'stopped' | 'errored' | 'starting';
|
||||
port: number;
|
||||
version: string;
|
||||
cpuUsagePercent: number;
|
||||
memoryUsageBytes: number;
|
||||
config: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface GitOpsStatus {
|
||||
enabled: boolean;
|
||||
remoteUrl?: string;
|
||||
branch: string;
|
||||
lastCommitSha: string;
|
||||
lastCommitMessage: string;
|
||||
lastSyncTime?: string;
|
||||
pendingChanges: boolean;
|
||||
isClean: boolean;
|
||||
}
|
||||
|
||||
export interface GitCommit {
|
||||
hash: string;
|
||||
author: string;
|
||||
date: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface SystemStatus {
|
||||
hostname: string;
|
||||
uptimeSeconds: number;
|
||||
cpuUsagePercent: number;
|
||||
memoryTotalBytes: number;
|
||||
memoryUsedBytes: number;
|
||||
arcSizeBytes: number;
|
||||
arcHitRatioPercent: number;
|
||||
zfsPoolsCount: number;
|
||||
activeSharesCount: number;
|
||||
runningAppsCount: number;
|
||||
osVersion: string;
|
||||
nixosGeneration: number;
|
||||
}
|
||||
|
||||
export interface NaxosConfig {
|
||||
core: {
|
||||
hostname: string;
|
||||
timezone: string;
|
||||
};
|
||||
storage: {
|
||||
arcMaxBytes: number;
|
||||
autoScrub: boolean;
|
||||
autoTrim: boolean;
|
||||
pools: Record<string, {
|
||||
layout: ZfsLayout;
|
||||
devices: string[];
|
||||
ashift: number;
|
||||
datasets: Record<string, {
|
||||
mountpoint: string;
|
||||
compression: string;
|
||||
recordsize: string;
|
||||
quota?: string;
|
||||
}>;
|
||||
}>;
|
||||
importExistingPools: string[];
|
||||
};
|
||||
shares: {
|
||||
samba: {
|
||||
enable: boolean;
|
||||
workgroup: string;
|
||||
shares: Record<string, SmbShare>;
|
||||
};
|
||||
nfs: {
|
||||
enable: boolean;
|
||||
exports: NfsExport[];
|
||||
};
|
||||
};
|
||||
appEngine: {
|
||||
defaultRuntime: AppRuntime;
|
||||
apps: Record<string, InstalledApp>;
|
||||
};
|
||||
users: Record<string, SystemUser>;
|
||||
gitops: {
|
||||
remoteUrl?: string;
|
||||
branch: string;
|
||||
autoPushOnCommit: boolean;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user