mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
Feature/backup+restore (#2613)
* feat: Implementation on the backup for the service. * wip: Getting the flow of backup/restore * feat: Recover * Feature: Commit the full pass on the backup restore. * use special type for backup instead of special id (#2614) * fix: Allow compat docker style to run again * fix: Backup for the js side * chore: Update some of the callbacks --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AddressInfo } from "./AddressInfo"
|
||||
import type { ExportedHostnameInfo } from "./ExportedHostnameInfo"
|
||||
import type { HostKind } from "./HostKind"
|
||||
import type { ServiceInterfaceId } from "./ServiceInterfaceId"
|
||||
import type { ServiceInterfaceType } from "./ServiceInterfaceType"
|
||||
|
||||
export type ExportServiceInterfaceParams = {
|
||||
id: string
|
||||
id: ServiceInterfaceId
|
||||
name: string
|
||||
description: string
|
||||
hasPrimary: boolean
|
||||
@@ -11,4 +14,6 @@ export type ExportServiceInterfaceParams = {
|
||||
masked: boolean
|
||||
addressInfo: AddressInfo
|
||||
type: ServiceInterfaceType
|
||||
hostKind: HostKind
|
||||
hostnames: Array<ExportedHostnameInfo>
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { HealthCheckResult } from "./HealthCheckResult"
|
||||
export type MainStatus =
|
||||
| { status: "stopped" }
|
||||
| { status: "restarting" }
|
||||
| { status: "restoring" }
|
||||
| { status: "stopping"; timeout: Duration }
|
||||
| { status: "starting" }
|
||||
| {
|
||||
|
||||
@@ -55,6 +55,17 @@ export class Overlay {
|
||||
])
|
||||
} else if (options.type === "pointer") {
|
||||
await this.effects.mount({ location: path, target: options })
|
||||
} else if (options.type === "backup") {
|
||||
const subpath = options.subpath
|
||||
? options.subpath.startsWith("/")
|
||||
? options.subpath
|
||||
: `/${options.subpath}`
|
||||
: "/"
|
||||
await execFile("mount", [
|
||||
"--bind",
|
||||
`/media/startos/backup${subpath}`,
|
||||
path,
|
||||
])
|
||||
} else {
|
||||
throw new Error(`unknown type ${(options as any).type}`)
|
||||
}
|
||||
@@ -188,6 +199,7 @@ export type MountOptions =
|
||||
| MountOptionsVolume
|
||||
| MountOptionsAssets
|
||||
| MountOptionsPointer
|
||||
| MountOptionsBackup
|
||||
|
||||
export type MountOptionsVolume = {
|
||||
type: "volume"
|
||||
@@ -209,3 +221,8 @@ export type MountOptionsPointer = {
|
||||
subpath: string | null
|
||||
readonly: boolean
|
||||
}
|
||||
|
||||
export type MountOptionsBackup = {
|
||||
type: "backup"
|
||||
subpath: string | null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user