- Add Repository model to Prisma schema with migration - Create repositoryService for managing repositories - Add repositories API router with CRUD operations - Update GitHubJsonService to support multiple repositories - Update ScriptDownloaderService to use repository URL from scripts - Add repository_url field to Script and ScriptCard types - Add repository management UI tab to GeneralSettingsModal - Display repository source on script cards and detail modal - Implement repository deletion with JSON file cleanup - Initialize default repositories (main and dev) on server startup
111 lines
3.3 KiB
Plaintext
111 lines
3.3 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model InstalledScript {
|
|
id Int @id @default(autoincrement())
|
|
script_name String
|
|
script_path String
|
|
container_id String?
|
|
server_id Int?
|
|
execution_mode String
|
|
installation_date DateTime? @default(now())
|
|
status String
|
|
output_log String?
|
|
web_ui_ip String?
|
|
web_ui_port Int?
|
|
server Server? @relation(fields: [server_id], references: [id], onDelete: SetNull)
|
|
lxc_config LXCConfig?
|
|
|
|
@@map("installed_scripts")
|
|
}
|
|
|
|
model Server {
|
|
id Int @id @default(autoincrement())
|
|
name String @unique
|
|
ip String
|
|
user String
|
|
password String?
|
|
auth_type String? @default("password")
|
|
ssh_key String?
|
|
ssh_key_passphrase String?
|
|
ssh_port Int? @default(22)
|
|
color String?
|
|
created_at DateTime? @default(now())
|
|
updated_at DateTime? @updatedAt
|
|
ssh_key_path String?
|
|
key_generated Boolean? @default(false)
|
|
installed_scripts InstalledScript[]
|
|
|
|
@@map("servers")
|
|
}
|
|
|
|
model LXCConfig {
|
|
id Int @id @default(autoincrement())
|
|
installed_script_id Int @unique
|
|
installed_script InstalledScript @relation(fields: [installed_script_id], references: [id], onDelete: Cascade)
|
|
|
|
// Basic settings
|
|
arch String?
|
|
cores Int?
|
|
memory Int?
|
|
hostname String?
|
|
swap Int?
|
|
onboot Int? // 0 or 1
|
|
ostype String?
|
|
unprivileged Int? // 0 or 1
|
|
|
|
// Network settings (net0)
|
|
net_name String?
|
|
net_bridge String?
|
|
net_hwaddr String?
|
|
net_ip_type String? // 'dhcp' or 'static'
|
|
net_ip String? // IP with CIDR for static
|
|
net_gateway String?
|
|
net_type String? // usually 'veth'
|
|
net_vlan Int?
|
|
|
|
// Storage
|
|
rootfs_storage String?
|
|
rootfs_size String?
|
|
|
|
// Features
|
|
feature_keyctl Int? // 0 or 1
|
|
feature_nesting Int? // 0 or 1
|
|
feature_fuse Int? // 0 or 1
|
|
feature_mount String? // other mount features
|
|
|
|
// Tags
|
|
tags String?
|
|
|
|
// Advanced/raw settings (lxc.* entries and other uncommon settings)
|
|
advanced_config String? // Text blob for advanced settings
|
|
|
|
// Metadata
|
|
synced_at DateTime?
|
|
config_hash String? // Hash of server config for diff detection
|
|
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
|
|
@@map("lxc_configs")
|
|
}
|
|
|
|
model Repository {
|
|
id Int @id @default(autoincrement())
|
|
url String @unique
|
|
enabled Boolean @default(true)
|
|
is_default Boolean @default(false)
|
|
is_removable Boolean @default(true)
|
|
priority Int @default(0)
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
|
|
@@map("repositories")
|
|
}
|