dont hard code alpha and beta, use substring detection instead (#2135)

This commit is contained in:
Matt Hill
2023-01-24 11:54:43 -07:00
committed by Aiden McClelland
parent cf70933e21
commit c16404bb2d
4 changed files with 27 additions and 31 deletions

View File

@@ -9,9 +9,7 @@
}, },
"marketplace": { "marketplace": {
"start9": "https://registry.start9.com/", "start9": "https://registry.start9.com/",
"community": "https://community-registry.start9.com/", "community": "https://community-registry.start9.com/"
"beta": "https://beta-registry.start9.com/",
"alpha": "https://alpha-registry-x.start9.com/"
}, },
"mocks": { "mocks": {
"maskAs": "tor", "maskAs": "tor",

View File

@@ -12,8 +12,6 @@ export type WorkspaceConfig = {
marketplace: { marketplace: {
start9: 'https://registry.start9.com/' start9: 'https://registry.start9.com/'
community: 'https://community-registry.start9.com/' community: 'https://community-registry.start9.com/'
beta: 'https://beta-registry.start9.com/'
alpha: 'https://alpha-registry-x.start9.com/'
} }
mocks: { mocks: {
maskAs: 'tor' | 'lan' maskAs: 'tor' | 'lan'

View File

@@ -33,30 +33,31 @@ export class MarketplaceListPage {
readonly details$ = this.marketplaceService.getSelectedHost$().pipe( readonly details$ = this.marketplaceService.getSelectedHost$().pipe(
map(({ url, name }) => { map(({ url, name }) => {
const { start9, community, beta } = this.config.marketplace const { start9, community } = this.config.marketplace
let color: string let color: string
let description: string let description: string
switch (url) {
case start9: if (url === start9) {
color = 'success' color = 'success'
description = description =
'Services from this registry are packaged and maintained by the Start9 team. If you experience an issue or have a questions related to a service from this registry, one of our dedicated support staff will be happy to assist you.' 'Services from this registry are packaged and maintained by the Start9 team. If you experience an issue or have a questions related to a service from this registry, one of our dedicated support staff will be happy to assist you.'
break } else if (url === community) {
case community: color = 'tertiary'
color = 'tertiary' description =
description = 'Services from this registry are packaged and maintained by members of the Start9 community. <b>Install at your own risk</b>. If you experience an issue or have a question related to a service in this marketplace, please reach out to the package developer for assistance.'
'Services from this registry are packaged and maintained by members of the Start9 community. <b>Install at your own risk</b>. If you experience an issue or have a question related to a service in this marketplace, please reach out to the package developer for assistance.' } else if (url.includes('beta')) {
break color = 'warning'
case beta: description =
color = 'primary' 'Services from this registry are undergoing <b>beta</b> testing and may contain bugs. <b>Install at your own risk</b>.'
description = } else if (url.includes('alpha')) {
'Services from this registry are undergoing active testing and may contain bugs. <b>Install at your own risk</b>. If you discover a bug or have a suggestion for improvement, please report it to the Start9 team in our community testing channel on Matrix.' color = 'danger'
break description =
default: 'Services from this registry are undergoing <b>alpha</b> testing. They are expected to contain bugs and could damage your system. <b>Install at your own risk</b>.'
// alt marketplace } else {
color = 'warning' // alt marketplace
description = color = 'warning'
'This is a Custom Registry. Start9 cannot verify the integrity or functionality of services from this registry, and they may cause harm to your system. <b>Install at your own risk</b>.' description =
'This is a Custom Registry. Start9 cannot verify the integrity or functionality of services from this registry, and they could damage your system. <b>Install at your own risk</b>.'
} }
return { return {

View File

@@ -47,10 +47,9 @@ export class UpdatesPage {
]).pipe( ]).pipe(
map(([devMode, knownHosts]) => { map(([devMode, knownHosts]) => {
if (devMode) return knownHosts if (devMode) return knownHosts
return knownHosts.filter(h => { return knownHosts.filter(
const { alpha, beta } = this.config.marketplace ({ url }) => url.includes('alpha') || url.includes('beta'),
return ![alpha, beta].includes(h.url as any) )
})
}), }),
) )