mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-31 04:33:40 +00:00
wip"
This commit is contained in:
@@ -25,9 +25,7 @@ export async function mountDependencies<
|
|||||||
const mountPath = `${value.manifestId}/${value.volume}/${value.name}`
|
const mountPath = `${value.manifestId}/${value.volume}/${value.name}`
|
||||||
|
|
||||||
return (await effects.mount({
|
return (await effects.mount({
|
||||||
location: {
|
location: mountPath,
|
||||||
path: mountPath,
|
|
||||||
},
|
|
||||||
target: {
|
target: {
|
||||||
packageId: value.manifestId,
|
packageId: value.manifestId,
|
||||||
path: value.path,
|
path: value.path,
|
||||||
|
|||||||
@@ -3,12 +3,7 @@ import { CheckResult } from "../health/checkFns"
|
|||||||
import { Trigger } from "../trigger"
|
import { Trigger } from "../trigger"
|
||||||
import { TriggerInput } from "../trigger/TriggerInput"
|
import { TriggerInput } from "../trigger/TriggerInput"
|
||||||
import { defaultTrigger } from "../trigger/defaultTrigger"
|
import { defaultTrigger } from "../trigger/defaultTrigger"
|
||||||
import {
|
import { DaemonReturned, Effects, ValidIfNoStupidEscape } from "../types"
|
||||||
DaemonReturned,
|
|
||||||
Effects,
|
|
||||||
Signals,
|
|
||||||
ValidIfNoStupidEscape,
|
|
||||||
} from "../types"
|
|
||||||
import { createUtils } from "../util"
|
import { createUtils } from "../util"
|
||||||
type Daemon<Ids extends string, Command extends string, Id extends string> = {
|
type Daemon<Ids extends string, Command extends string, Id extends string> = {
|
||||||
id: "" extends Id ? never : Id
|
id: "" extends Id ? never : Id
|
||||||
@@ -133,7 +128,7 @@ export class Daemons<Ids extends string> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
async term(options?: { signal?: Signals; timeout?: number }) {
|
async term(options?: { signal?: string; timeout?: number }) {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
Object.values<Promise<DaemonReturned>>(daemonsStarted).map((x) =>
|
Object.values<Promise<DaemonReturned>>(daemonsStarted).map((x) =>
|
||||||
x.then((x) => x.term(options)),
|
x.then((x) => x.term(options)),
|
||||||
|
|||||||
10
lib/types.ts
10
lib/types.ts
@@ -380,14 +380,14 @@ export type Effects = {
|
|||||||
* @returns PEM encoded fullchain (ecdsa)
|
* @returns PEM encoded fullchain (ecdsa)
|
||||||
*/
|
*/
|
||||||
getSslCertificate: (
|
getSslCertificate: (
|
||||||
packageId: string,
|
packageId?: string,
|
||||||
algorithm?: "ecdsa" | "ed25519",
|
algorithm?: "ecdsa" | "ed25519",
|
||||||
) => Promise<[string, string, string]>
|
) => Promise<[string, string, string]>
|
||||||
/**
|
/**
|
||||||
* @returns PEM encoded ssl key (ecdsa)
|
* @returns PEM encoded ssl key (ecdsa)
|
||||||
*/
|
*/
|
||||||
getSslKey: (
|
getSslKey: (
|
||||||
packageId: string,
|
packageId?: string,
|
||||||
algorithm?: "ecdsa" | "ed25519",
|
algorithm?: "ecdsa" | "ed25519",
|
||||||
) => Promise<string>
|
) => Promise<string>
|
||||||
|
|
||||||
@@ -427,11 +427,7 @@ export type Effects = {
|
|||||||
shutdown(): void
|
shutdown(): void
|
||||||
|
|
||||||
mount(options: {
|
mount(options: {
|
||||||
location: {
|
location: string
|
||||||
/** If there is no volumeId then we mount to runMedia a special mounting location */
|
|
||||||
volumeId?: string
|
|
||||||
path: string
|
|
||||||
}
|
|
||||||
target: {
|
target: {
|
||||||
packageId: string
|
packageId: string
|
||||||
volumeId: string
|
volumeId: string
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
ExtractStore,
|
ExtractStore,
|
||||||
InterfaceId,
|
InterfaceId,
|
||||||
PackageId,
|
PackageId,
|
||||||
Signals,
|
|
||||||
ValidIfNoStupidEscape,
|
ValidIfNoStupidEscape,
|
||||||
} from "../types"
|
} from "../types"
|
||||||
import { GetSystemSmtp } from "./GetSystemSmtp"
|
import { GetSystemSmtp } from "./GetSystemSmtp"
|
||||||
@@ -38,7 +37,7 @@ import {
|
|||||||
import * as CP from "node:child_process"
|
import * as CP from "node:child_process"
|
||||||
import { promisify } from "node:util"
|
import { promisify } from "node:util"
|
||||||
import { splitCommand } from "./splitCommand"
|
import { splitCommand } from "./splitCommand"
|
||||||
|
export type Signals = "SIGTERM" | "SIGKILL"
|
||||||
export const SIGTERM: Signals = "SIGTERM"
|
export const SIGTERM: Signals = "SIGTERM"
|
||||||
export const SIGKILL: Signals = "SIGTERM"
|
export const SIGKILL: Signals = "SIGTERM"
|
||||||
export const NO_TIMEOUT = -1
|
export const NO_TIMEOUT = -1
|
||||||
|
|||||||
Reference in New Issue
Block a user