mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
feat: tunnel TS exports, port forward labels, and db migrations
- Add TS derive and type annotations to all tunnel API param structs - Export tunnel bindings to a tunnel/ subdirectory with index generation - Change port forward label from String to Option<String> - Add TunnelDatabase::init() with default subnet creation - Add tunnel migration framework with m_00_port_forward_entry migration to convert legacy string-only port forwards to the new entry format
This commit is contained in:
@@ -6,5 +6,5 @@ export type AddPackageSignerParams = {
|
||||
id: PackageId
|
||||
signer: Guid
|
||||
versions: string | null
|
||||
merge?: boolean
|
||||
merge: boolean
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export type ServerInfo = {
|
||||
zram: boolean
|
||||
governor: Governor | null
|
||||
smtp: SmtpValue | null
|
||||
ifconfigUrl: string
|
||||
echoipUrls: string[]
|
||||
ram: number
|
||||
devices: Array<LshwDevice>
|
||||
kiosk: boolean | null
|
||||
|
||||
@@ -306,3 +306,4 @@ export { WifiInfo } from './WifiInfo'
|
||||
export { WifiListInfo } from './WifiListInfo'
|
||||
export { WifiListOut } from './WifiListOut'
|
||||
export { WifiSsidParams } from './WifiSsidParams'
|
||||
export * as Tunnel from './tunnel'
|
||||
|
||||
7
sdk/base/lib/osBindings/tunnel/AddDeviceParams.ts
Normal file
7
sdk/base/lib/osBindings/tunnel/AddDeviceParams.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AddDeviceParams = {
|
||||
subnet: string
|
||||
name: string
|
||||
ip: string | null
|
||||
}
|
||||
4
sdk/base/lib/osBindings/tunnel/AddKeyParams.ts
Normal file
4
sdk/base/lib/osBindings/tunnel/AddKeyParams.ts
Normal 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 { AnyVerifyingKey } from './AnyVerifyingKey'
|
||||
|
||||
export type AddKeyParams = { name: string; key: AnyVerifyingKey }
|
||||
7
sdk/base/lib/osBindings/tunnel/AddPortForwardParams.ts
Normal file
7
sdk/base/lib/osBindings/tunnel/AddPortForwardParams.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AddPortForwardParams = {
|
||||
source: string
|
||||
target: string
|
||||
label: string | null
|
||||
}
|
||||
3
sdk/base/lib/osBindings/tunnel/AddSubnetParams.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/AddSubnetParams.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AddSubnetParams = { name: string }
|
||||
3
sdk/base/lib/osBindings/tunnel/GatewayId.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/GatewayId.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type GatewayId = string
|
||||
3
sdk/base/lib/osBindings/tunnel/GatewayType.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/GatewayType.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type GatewayType = 'inbound-outbound' | 'outbound-only'
|
||||
13
sdk/base/lib/osBindings/tunnel/IpInfo.ts
Normal file
13
sdk/base/lib/osBindings/tunnel/IpInfo.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { NetworkInterfaceType } from './NetworkInterfaceType'
|
||||
|
||||
export type IpInfo = {
|
||||
name: string
|
||||
scopeId: number
|
||||
deviceType: NetworkInterfaceType | null
|
||||
subnets: string[]
|
||||
lanIp: string[]
|
||||
wanIp: string | null
|
||||
ntpServers: string[]
|
||||
dnsServers: string[]
|
||||
}
|
||||
3
sdk/base/lib/osBindings/tunnel/ListDevicesParams.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/ListDevicesParams.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ListDevicesParams = { subnet: string }
|
||||
10
sdk/base/lib/osBindings/tunnel/NetworkInterfaceInfo.ts
Normal file
10
sdk/base/lib/osBindings/tunnel/NetworkInterfaceInfo.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { GatewayType } from './GatewayType'
|
||||
import type { IpInfo } from './IpInfo'
|
||||
|
||||
export type NetworkInterfaceInfo = {
|
||||
name: string | null
|
||||
secure: boolean | null
|
||||
ipInfo: IpInfo | null
|
||||
type: GatewayType | null
|
||||
}
|
||||
8
sdk/base/lib/osBindings/tunnel/NetworkInterfaceType.ts
Normal file
8
sdk/base/lib/osBindings/tunnel/NetworkInterfaceType.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type NetworkInterfaceType =
|
||||
| 'ethernet'
|
||||
| 'wireless'
|
||||
| 'bridge'
|
||||
| 'wireguard'
|
||||
| 'loopback'
|
||||
7
sdk/base/lib/osBindings/tunnel/PortForwardEntry.ts
Normal file
7
sdk/base/lib/osBindings/tunnel/PortForwardEntry.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type PortForwardEntry = {
|
||||
target: string
|
||||
label: string | null
|
||||
enabled: boolean
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PortForwardEntry } from './PortForwardEntry'
|
||||
|
||||
export type PortForwards = { [key: string]: string }
|
||||
export type PortForwards = { [key: string]: PortForwardEntry }
|
||||
|
||||
3
sdk/base/lib/osBindings/tunnel/RemoveDeviceParams.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/RemoveDeviceParams.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type RemoveDeviceParams = { subnet: string; ip: string }
|
||||
4
sdk/base/lib/osBindings/tunnel/RemoveKeyParams.ts
Normal file
4
sdk/base/lib/osBindings/tunnel/RemoveKeyParams.ts
Normal 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 { AnyVerifyingKey } from './AnyVerifyingKey'
|
||||
|
||||
export type RemoveKeyParams = { key: AnyVerifyingKey }
|
||||
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type RemovePortForwardParams = { source: string }
|
||||
3
sdk/base/lib/osBindings/tunnel/SetPasswordParams.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/SetPasswordParams.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type SetPasswordParams = { password: string }
|
||||
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type SetPortForwardEnabledParams = { source: string; enabled: boolean }
|
||||
7
sdk/base/lib/osBindings/tunnel/ShowConfigParams.ts
Normal file
7
sdk/base/lib/osBindings/tunnel/ShowConfigParams.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ShowConfigParams = {
|
||||
subnet: string
|
||||
ip: string
|
||||
wanAddr: string | null
|
||||
}
|
||||
3
sdk/base/lib/osBindings/tunnel/SubnetParams.ts
Normal file
3
sdk/base/lib/osBindings/tunnel/SubnetParams.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type SubnetParams = { subnet: string }
|
||||
@@ -1,5 +1,7 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AnyVerifyingKey } from './AnyVerifyingKey'
|
||||
import type { GatewayId } from './GatewayId'
|
||||
import type { NetworkInterfaceInfo } from './NetworkInterfaceInfo'
|
||||
import type { PortForwards } from './PortForwards'
|
||||
import type { Sessions } from './Sessions'
|
||||
import type { SignerInfo } from './SignerInfo'
|
||||
@@ -11,7 +13,7 @@ export type TunnelDatabase = {
|
||||
sessions: Sessions
|
||||
password: string | null
|
||||
authPubkeys: { [key: AnyVerifyingKey]: SignerInfo }
|
||||
gateways: { [key: AnyVerifyingKey]: SignerInfo }
|
||||
gateways: { [key: GatewayId]: NetworkInterfaceInfo }
|
||||
wg: WgServer
|
||||
portForwards: PortForwards
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type UpdatePortForwardLabelParams = {
|
||||
source: string
|
||||
label: string | null
|
||||
}
|
||||
35
sdk/base/lib/osBindings/tunnel/index.ts
Normal file
35
sdk/base/lib/osBindings/tunnel/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export { AddDeviceParams } from './AddDeviceParams'
|
||||
export { AddKeyParams } from './AddKeyParams'
|
||||
export { AddPortForwardParams } from './AddPortForwardParams'
|
||||
export { AddSubnetParams } from './AddSubnetParams'
|
||||
export { AnyVerifyingKey } from './AnyVerifyingKey'
|
||||
export { Base64 } from './Base64'
|
||||
export { GatewayId } from './GatewayId'
|
||||
export { GatewayType } from './GatewayType'
|
||||
export { IpInfo } from './IpInfo'
|
||||
export { ListDevicesParams } from './ListDevicesParams'
|
||||
export { NetworkInterfaceInfo } from './NetworkInterfaceInfo'
|
||||
export { NetworkInterfaceType } from './NetworkInterfaceType'
|
||||
export { Pem } from './Pem'
|
||||
export { PortForwardEntry } from './PortForwardEntry'
|
||||
export { PortForwards } from './PortForwards'
|
||||
export { RemoveDeviceParams } from './RemoveDeviceParams'
|
||||
export { RemoveKeyParams } from './RemoveKeyParams'
|
||||
export { RemovePortForwardParams } from './RemovePortForwardParams'
|
||||
export { Sessions } from './Sessions'
|
||||
export { Session } from './Session'
|
||||
export { SetPasswordParams } from './SetPasswordParams'
|
||||
export { SetPortForwardEnabledParams } from './SetPortForwardEnabledParams'
|
||||
export { ShowConfigParams } from './ShowConfigParams'
|
||||
export { SignerInfo } from './SignerInfo'
|
||||
export { SubnetParams } from './SubnetParams'
|
||||
export { TunnelCertData } from './TunnelCertData'
|
||||
export { TunnelDatabase } from './TunnelDatabase'
|
||||
export { TunnelUpdateResult } from './TunnelUpdateResult'
|
||||
export { UpdatePortForwardLabelParams } from './UpdatePortForwardLabelParams'
|
||||
export { WebserverInfo } from './WebserverInfo'
|
||||
export { WgConfig } from './WgConfig'
|
||||
export { WgServer } from './WgServer'
|
||||
export { WgSubnetClients } from './WgSubnetClients'
|
||||
export { WgSubnetConfig } from './WgSubnetConfig'
|
||||
export { WgSubnetMap } from './WgSubnetMap'
|
||||
Reference in New Issue
Block a user