mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
environment-based default registry
This commit is contained in:
@@ -13,7 +13,6 @@ mount -t tmpfs tmpfs /tmp
|
|||||||
mkdir -p /tmp/lower /tmp/upper /tmp/work /tmp/combined
|
mkdir -p /tmp/lower /tmp/upper /tmp/work /tmp/combined
|
||||||
mount -o loop debian.${ARCH}.squashfs /tmp/lower
|
mount -o loop debian.${ARCH}.squashfs /tmp/lower
|
||||||
mount -t overlay -olowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/work overlay /tmp/combined
|
mount -t overlay -olowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/work overlay /tmp/combined
|
||||||
echo mounted overlay
|
|
||||||
|
|
||||||
mkdir -p /tmp/combined/usr/lib/startos/
|
mkdir -p /tmp/combined/usr/lib/startos/
|
||||||
rsync -a --copy-unsafe-links --info=progress2 dist/ /tmp/combined/usr/lib/startos/init/
|
rsync -a --copy-unsafe-links --info=progress2 dist/ /tmp/combined/usr/lib/startos/init/
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export type WorkspaceConfig = {
|
|||||||
skipStartupAlerts: boolean
|
skipStartupAlerts: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defaultRegistry: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultRegistries = {
|
export const defaultRegistries = {
|
||||||
@@ -24,4 +25,5 @@ export const knownRegistries = {
|
|||||||
...defaultRegistries,
|
...defaultRegistries,
|
||||||
start9Alpha: 'https://alpha-registry-x.start9.com/',
|
start9Alpha: 'https://alpha-registry-x.start9.com/',
|
||||||
start9Beta: 'https://beta-registry.start9.com/',
|
start9Beta: 'https://beta-registry.start9.com/',
|
||||||
|
communityBeta: 'https://community-beta-registry.start9.com/',
|
||||||
} as const
|
} as const
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ export class MarketplaceNotificationComponent {
|
|||||||
@Input() url = ''
|
@Input() url = ''
|
||||||
|
|
||||||
get status() {
|
get status() {
|
||||||
const { start9, community, start9Beta, start9Alpha } = knownRegistries
|
const { start9, community, start9Beta, communityBeta, start9Alpha } =
|
||||||
|
knownRegistries
|
||||||
|
|
||||||
if (sameUrl(this.url, start9)) {
|
if (sameUrl(this.url, start9)) {
|
||||||
return 'success'
|
return 'success'
|
||||||
@@ -66,7 +67,7 @@ export class MarketplaceNotificationComponent {
|
|||||||
return 'info'
|
return 'info'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sameUrl(this.url, start9Beta)) {
|
if (sameUrl(this.url, start9Beta) || sameUrl(this.url, communityBeta)) {
|
||||||
return 'warning'
|
return 'warning'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { MarketplaceMenuComponent } from './components/menu.component'
|
|||||||
import { MarketplaceNotificationComponent } from './components/notification.component'
|
import { MarketplaceNotificationComponent } from './components/notification.component'
|
||||||
import { MarketplaceTileComponent } from './components/tile.component'
|
import { MarketplaceTileComponent } from './components/tile.component'
|
||||||
import { StorageService } from 'src/app/services/storage.service'
|
import { StorageService } from 'src/app/services/storage.service'
|
||||||
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
@@ -160,6 +161,7 @@ import { StorageService } from 'src/app/services/storage.service'
|
|||||||
export default class MarketplaceComponent {
|
export default class MarketplaceComponent {
|
||||||
private readonly categoryService = inject(AbstractCategoryService)
|
private readonly categoryService = inject(AbstractCategoryService)
|
||||||
private readonly marketplaceService = inject(MarketplaceService)
|
private readonly marketplaceService = inject(MarketplaceService)
|
||||||
|
private readonly configService = inject(ConfigService)
|
||||||
private readonly router = inject(Router)
|
private readonly router = inject(Router)
|
||||||
private readonly storage = inject(StorageService)
|
private readonly storage = inject(StorageService)
|
||||||
private readonly route = inject(ActivatedRoute)
|
private readonly route = inject(ActivatedRoute)
|
||||||
@@ -175,7 +177,7 @@ export default class MarketplaceComponent {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
registry:
|
registry:
|
||||||
this.storage.get('selectedRegistry') ||
|
this.storage.get('selectedRegistry') ||
|
||||||
defaultRegistries.start9,
|
this.configService.defaultRegistry,
|
||||||
},
|
},
|
||||||
queryParamsHandling: 'merge',
|
queryParamsHandling: 'merge',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const {
|
|||||||
gitHash,
|
gitHash,
|
||||||
useMocks,
|
useMocks,
|
||||||
ui: { api, mocks },
|
ui: { api, mocks },
|
||||||
|
defaultRegistry,
|
||||||
} = require('../../../../../config.json') as WorkspaceConfig
|
} = require('../../../../../config.json') as WorkspaceConfig
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -26,6 +27,7 @@ export class ConfigService {
|
|||||||
api = api
|
api = api
|
||||||
skipStartupAlerts = useMocks && mocks.skipStartupAlerts
|
skipStartupAlerts = useMocks && mocks.skipStartupAlerts
|
||||||
supportsWebSockets = !!window.WebSocket
|
supportsWebSockets = !!window.WebSocket
|
||||||
|
defaultRegistry = defaultRegistry
|
||||||
|
|
||||||
isTor(): boolean {
|
isTor(): boolean {
|
||||||
return useMocks ? mocks.maskAs === 'tor' : this.hostname.endsWith('.onion')
|
return useMocks ? mocks.maskAs === 'tor' : this.hostname.endsWith('.onion')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { RR } from 'src/app/services/api/api.types'
|
|||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { DataModel } from 'src/app/services/patch-db/data-model'
|
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
const { start9, community } = defaultRegistries
|
// const { start9, community } = defaultRegistries
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@@ -46,10 +46,10 @@ export class MarketplaceService {
|
|||||||
.watch$('ui', 'registries')
|
.watch$('ui', 'registries')
|
||||||
.pipe(
|
.pipe(
|
||||||
map(registries => [
|
map(registries => [
|
||||||
toStoreIdentity(start9, registries[start9]),
|
// toStoreIdentity(start9, registries[start9]),
|
||||||
toStoreIdentity(community, registries[community]),
|
// toStoreIdentity(community, registries[community]),
|
||||||
...Object.entries(registries)
|
...Object.entries(registries)
|
||||||
.filter(([u, _]) => !sameUrl(start9, u) && !sameUrl(community, u))
|
// .filter(([u, _]) => !sameUrl(start9, u) && !sameUrl(community, u))
|
||||||
.map(([url, name]) => toStoreIdentity(url, name)),
|
.map(([url, name]) => toStoreIdentity(url, name)),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user