mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
move mounts to daemons constructor
This commit is contained in:
@@ -32,15 +32,25 @@ export class Overlay {
|
||||
? `${this.rootfs}${path}`
|
||||
: `${this.rootfs}/${path}`
|
||||
if (options.type === "volume") {
|
||||
const subpath = options.subpath
|
||||
? options.subpath.startsWith("/")
|
||||
? options.subpath
|
||||
: `/${options.subpath}`
|
||||
: "/"
|
||||
await execFile("mount", [
|
||||
"--bind",
|
||||
`/media/startos/volumes/${options.id}`,
|
||||
`/media/startos/volumes/${options.id}${subpath}`,
|
||||
path,
|
||||
])
|
||||
} else if (options.type === "assets") {
|
||||
const subpath = options.subpath
|
||||
? options.subpath.startsWith("/")
|
||||
? options.subpath
|
||||
: `/${options.subpath}`
|
||||
: "/"
|
||||
await execFile("mount", [
|
||||
"--bind",
|
||||
`/media/startos/assets/${options.id}`,
|
||||
`/media/startos/assets/${options.id}${subpath}`,
|
||||
path,
|
||||
])
|
||||
} else if (options.type === "pointer") {
|
||||
@@ -140,17 +150,20 @@ export type MountOptions =
|
||||
export type MountOptionsVolume = {
|
||||
type: "volume"
|
||||
id: string
|
||||
subpath: string | null
|
||||
readonly: boolean
|
||||
}
|
||||
|
||||
export type MountOptionsAssets = {
|
||||
type: "assets"
|
||||
id: string
|
||||
subpath: string | null
|
||||
}
|
||||
|
||||
export type MountOptionsPointer = {
|
||||
type: "pointer"
|
||||
packageId: string
|
||||
volumeId: string
|
||||
path: string
|
||||
subpath: string | null
|
||||
readonly: boolean
|
||||
}
|
||||
|
||||
@@ -15,16 +15,6 @@ import {
|
||||
} from "../types"
|
||||
import { GetSystemSmtp } from "./GetSystemSmtp"
|
||||
import { GetStore, getStore } from "../store/getStore"
|
||||
import {
|
||||
MountDependenciesOut,
|
||||
mountDependencies,
|
||||
} from "../dependency/mountDependencies"
|
||||
import {
|
||||
ManifestId,
|
||||
VolumeName,
|
||||
NamedPath,
|
||||
Path,
|
||||
} from "../dependency/setupDependencyMounts"
|
||||
import { MultiHost, Scheme, SingleHost, StaticHost } from "../interfaces/Host"
|
||||
import { ServiceInterfaceBuilder } from "../interfaces/ServiceInterfaceBuilder"
|
||||
import { GetServiceInterface, getServiceInterface } from "./getServiceInterface"
|
||||
@@ -93,15 +83,6 @@ export type Utils<
|
||||
single: (id: string) => SingleHost
|
||||
multi: (id: string) => MultiHost
|
||||
}
|
||||
mountDependencies: <
|
||||
In extends
|
||||
| Record<ManifestId, Record<VolumeName, Record<NamedPath, Path>>>
|
||||
| Record<VolumeName, Record<NamedPath, Path>>
|
||||
| Record<NamedPath, Path>
|
||||
| Path,
|
||||
>(
|
||||
value: In,
|
||||
) => Promise<MountDependenciesOut<In>>
|
||||
serviceInterface: {
|
||||
getOwn: (id: ServiceInterfaceId) => GetServiceInterface & WrapperOverWrite
|
||||
get: (opts: {
|
||||
@@ -306,16 +287,6 @@ export const createUtils = <
|
||||
},
|
||||
checkPortListening: checkPortListening.bind(null, effects),
|
||||
checkWebUrl: checkWebUrl.bind(null, effects),
|
||||
|
||||
mountDependencies: <
|
||||
In extends
|
||||
| Record<ManifestId, Record<VolumeName, Record<NamedPath, Path>>>
|
||||
| Record<VolumeName, Record<NamedPath, Path>>
|
||||
| Record<NamedPath, Path>
|
||||
| Path,
|
||||
>(
|
||||
value: In,
|
||||
) => mountDependencies(effects, value),
|
||||
}
|
||||
}
|
||||
function noop(): void {}
|
||||
|
||||
Reference in New Issue
Block a user