Merge branch 'integration/new-container-runtime' of github.com:Start9Labs/start-os into rebase/feat/domains

This commit is contained in:
Matt Hill
2024-03-27 10:35:42 -06:00
77 changed files with 297 additions and 856 deletions

View File

@@ -179,13 +179,13 @@ export class ServiceRoute {
depErrors,
)
const depInfo = pkg.dependencyInfo[depId]
const { title, icon, versionSpec } = pkg.currentDependencies[depId]
return {
id: depId,
version: pkg.currentDependencies[depId].versionRange,
title: depInfo?.title || depId,
icon: depInfo?.icon || '',
version: versionSpec,
title,
icon,
errorText: errorText
? `${errorText}. ${pkgManifest.title} will not work as expected.`
: '',
@@ -252,7 +252,7 @@ export class ServiceRoute {
return this.installDep(pkg, pkgManifest, depId)
case 'configure':
return this.formDialog.open<PackageConfigData>(ServiceConfigModal, {
label: `${pkg.dependencyInfo[depId].title} config`,
label: `${pkg.currentDependencies[depId].title} config`,
data: {
pkgId: depId,
dependentInfo: pkgManifest,
@@ -269,7 +269,7 @@ export class ServiceRoute {
const dependentInfo: DependentInfo = {
id: manifest.id,
title: manifest.title,
version: pkg.currentDependencies[depId].versionRange,
version: pkg.currentDependencies[depId].versionSpec,
}
const navigationExtras: NavigationExtras = {
state: { dependentInfo },

View File

@@ -1493,7 +1493,6 @@ export module Mock {
},
},
currentDependencies: {},
dependencyInfo: {},
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
@@ -1624,15 +1623,13 @@ export module Mock {
},
},
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
healthChecks: [],
},
},
dependencyInfo: {
bitcoind: {
title: Mock.MockManifestBitcoind.title,
icon: 'assets/img/service-icons/bitcoind.svg',
kind: 'running',
registryUrl: '',
versionSpec: '>=26.0.0',
healthChecks: [],
},
},
marketplaceUrl: 'https://registry.start9.com/',
@@ -1871,23 +1868,21 @@ export module Mock {
},
},
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
healthChecks: [],
},
'btc-rpc-proxy': {
versionRange: '>2.0.0', // @TODO
healthChecks: [],
},
},
dependencyInfo: {
bitcoind: {
title: Mock.MockManifestBitcoind.title,
icon: 'assets/img/service-icons/bitcoind.svg',
kind: 'running',
registryUrl: 'https://registry.start9.com',
versionSpec: '>=26.0.0',
healthChecks: [],
},
'btc-rpc-proxy': {
title: Mock.MockManifestBitcoinProxy.title,
icon: 'assets/img/service-icons/btc-rpc-proxy.png',
kind: 'exists',
registryUrl: 'https://community-registry.start9.com',
versionSpec: '>2.0.0', // @TODO
healthChecks: [],
},
},
marketplaceUrl: 'https://registry.start9.com/',

View File

@@ -402,7 +402,6 @@ export const mockPatchData: DataModel = {
},
},
currentDependencies: {},
dependencyInfo: {},
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
@@ -639,23 +638,21 @@ export const mockPatchData: DataModel = {
},
},
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
healthChecks: [],
},
'btc-rpc-proxy': {
versionRange: '>2.0.0',
healthChecks: [],
},
},
dependencyInfo: {
bitcoind: {
title: 'Bitcoin Core',
icon: 'assets/img/service-icons/bitcoind.svg',
kind: 'running',
registryUrl: 'https://registry.start9.com',
versionSpec: '>=26.0.0',
healthChecks: [],
},
'btc-rpc-proxy': {
title: 'Bitcoin Proxy',
icon: 'assets/img/service-icons/btc-rpc-proxy.png',
kind: 'running',
registryUrl: 'https://community-registry.start9.com',
versionSpec: '>2.0.0',
healthChecks: [],
},
},
marketplaceUrl: 'https://registry.start9.com/',

View File

@@ -88,14 +88,14 @@ export class DepErrorService {
}
}
const versionRange = pkg.currentDependencies[depId].versionRange
const versionSpec = pkg.currentDependencies[depId].versionSpec
const depManifest = dep.stateInfo.manifest
// incorrect version
if (!this.emver.satisfies(depManifest.version, versionRange)) {
if (!this.emver.satisfies(depManifest.version, versionSpec)) {
return {
type: DependencyErrorType.IncorrectVersion,
expected: versionRange,
expected: versionSpec,
received: depManifest.version,
}
}

View File

@@ -154,13 +154,7 @@ export type PackageDataEntry<T extends StateInfo = StateInfo> = {
status: Status
actions: Record<string, T.ActionMetadata>
lastBackup: string | null
currentDependencies: { [id: string]: CurrentDependencyInfo }
dependencyInfo: {
[id: string]: {
title: string
icon: Url
}
}
currentDependencies: Record<string, CurrentDependencyInfo>
serviceInterfaces: Record<string, T.ServiceInterfaceWithHostInfo>
marketplaceUrl: string | null
developerKey: string
@@ -197,7 +191,11 @@ export enum PackageState {
}
export interface CurrentDependencyInfo {
versionRange: string
title: string
icon: string
kind: 'exists' | 'running'
registryUrl: string
versionSpec: string
healthChecks: string[] // array of health check IDs
}

View File

@@ -12,8 +12,7 @@ export function dryUpdate(
pkg =>
Object.keys(pkg.currentDependencies || {}).some(
pkgId => pkgId === id,
) &&
!emver.satisfies(version, pkg.currentDependencies[id].versionRange),
) && !emver.satisfies(version, pkg.currentDependencies[id].versionSpec),
)
.map(pkg => getManifest(pkg).title)
}