domains api + migration

This commit is contained in:
Aiden McClelland
2025-08-06 14:29:35 -06:00
parent ea12251a7e
commit d6dfaf8feb
39 changed files with 496 additions and 87 deletions

View File

@@ -1,4 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AcmeProvider } from "./AcmeProvider"
export type DomainConfig = { public: boolean; acme: AcmeProvider | null }
export type DomainConfig = {
root: string
public: boolean
acme: AcmeProvider | null
}

View File

@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { GatewayId } from "./GatewayId"
export type DomainSettings = { gateway: GatewayId }

View File

@@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AcmeProvider } from "./AcmeProvider"
import type { AcmeSettings } from "./AcmeSettings"
import type { DomainSettings } from "./DomainSettings"
import type { GatewayId } from "./GatewayId"
import type { Host } from "./Host"
import type { NetworkInterfaceInfo } from "./NetworkInterfaceInfo"
@@ -9,6 +10,7 @@ import type { WifiInfo } from "./WifiInfo"
export type NetworkInfo = {
wifi: WifiInfo
host: Host
networkInterfaces: { [key: GatewayId]: NetworkInterfaceInfo }
gateways: { [key: GatewayId]: NetworkInterfaceInfo }
acme: { [key: AcmeProvider]: AcmeSettings }
domains: { [key: string]: DomainSettings }
}

View File

@@ -67,6 +67,7 @@ export { Description } from "./Description"
export { DestroySubcontainerFsParams } from "./DestroySubcontainerFsParams"
export { DeviceFilter } from "./DeviceFilter"
export { DomainConfig } from "./DomainConfig"
export { DomainSettings } from "./DomainSettings"
export { Duration } from "./Duration"
export { EchoParams } from "./EchoParams"
export { EditSignerParams } from "./EditSignerParams"

View File

@@ -12,8 +12,9 @@ export class IpAddress {
this.octets[octIdx++] = num & 255
idx += 1
}
if (idx < 7) {
idx = segs.length - 1
const lastSegIdx = segs.length - 1
if (idx < lastSegIdx) {
idx = lastSegIdx
octIdx = 15
while (segs[idx]) {
const num = parseInt(segs[idx], 16)