Merge branch 'next/minor' of github.com:Start9Labs/start-os into next/major

This commit is contained in:
Matt Hill
2025-02-08 19:19:35 -07:00
parent 95cad7bdd9
commit 95722802dc
206 changed files with 11364 additions and 4104 deletions

View File

@@ -77,19 +77,18 @@ type BindOptionsByKnownProtocol =
preferredExternalPort?: number
addSsl?: AddSslOptions
}
export type BindOptionsByProtocol = BindOptionsByKnownProtocol | BindOptions
export type HostKind = BindParams["kind"]
export type BindOptionsByProtocol =
| BindOptionsByKnownProtocol
| (BindOptions & { protocol: null })
const hasStringProtocol = object({
protocol: string,
}).test
export class Host {
export class MultiHost {
constructor(
readonly options: {
effects: Effects
kind: HostKind
id: string
},
) {}
@@ -113,7 +112,7 @@ export class Host {
async bindPort(
internalPort: number,
options: BindOptionsByProtocol,
): Promise<Origin<this>> {
): Promise<Origin> {
if (hasStringProtocol(options)) {
return await this.bindPortForKnown(options, internalPort)
} else {
@@ -130,7 +129,6 @@ export class Host {
},
) {
const binderOptions = {
kind: this.options.kind,
id: this.options.id,
internalPort,
...options,
@@ -163,7 +161,6 @@ export class Host {
const secure: Security | null = !protoInfo.secure ? null : { ssl: false }
await this.options.effects.bind({
kind: this.options.kind,
id: this.options.id,
internalPort,
preferredExternalPort,
@@ -190,21 +187,3 @@ function inObject<Key extends string>(
): obj is { [K in Key]: unknown } {
return key in obj
}
// export class StaticHost extends Host {
// constructor(options: { effects: Effects; id: string }) {
// super({ ...options, kind: "static" })
// }
// }
// export class SingleHost extends Host {
// constructor(options: { effects: Effects; id: string }) {
// super({ ...options, kind: "single" })
// }
// }
export class MultiHost extends Host {
constructor(options: { effects: Effects; id: string }) {
super({ ...options, kind: "multi" })
}
}

View File

@@ -1,11 +1,11 @@
import { AddressInfo } from "../types"
import { AddressReceipt } from "./AddressReceipt"
import { Host, Scheme } from "./Host"
import { MultiHost, Scheme } from "./Host"
import { ServiceInterfaceBuilder } from "./ServiceInterfaceBuilder"
export class Origin<T extends Host> {
export class Origin {
constructor(
readonly host: T,
readonly host: MultiHost,
readonly internalPort: number,
readonly scheme: string | null,
readonly sslScheme: string | null,
@@ -46,7 +46,6 @@ export class Origin<T extends Host> {
const {
name,
description,
hasPrimary,
id,
type,
username,
@@ -67,7 +66,6 @@ export class Origin<T extends Host> {
id,
name,
description,
hasPrimary,
addressInfo,
type,
masked,

View File

@@ -20,7 +20,6 @@ export class ServiceInterfaceBuilder {
name: string
id: string
description: string
hasPrimary: boolean
type: ServiceInterfaceType
username: string | null
path: string