mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
Feature/network (#2622)
* Feature: Add in the clear bindings * wip: Working on network * fix: Make it so the config gives the url * chore: Remove the repeated types * chore: Add in the todo's here * chore: UPdate and remove some poorly name var * chore: Remove the clear-bindings impl * chore: Remove the wrapper * handle HostnameInfo for Host bindings Co-authored-by: Jade <Blu-J@users.noreply.github.com> * ?? * chore: Make the install work * Fix: Url's not being created * chore: Fix the local onion in url * include port in hostname * Chore of adding a comment just to modify. --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Jade <Blu-J@users.noreply.github.com>
This commit is contained in:
@@ -18,41 +18,27 @@ const makeManyInterfaceFilled = async ({
|
||||
packageId,
|
||||
callback,
|
||||
})
|
||||
const hostIdsRecord = Object.fromEntries(
|
||||
await Promise.all(
|
||||
Array.from(new Set(serviceInterfaceValues.map((x) => x.id))).map(
|
||||
async (id) =>
|
||||
[
|
||||
id,
|
||||
await effects.getHostInfo({
|
||||
kind: null,
|
||||
packageId,
|
||||
serviceInterfaceId: id,
|
||||
callback,
|
||||
}),
|
||||
] as const,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
const serviceInterfacesFilled: ServiceInterfaceFilled[] = await Promise.all(
|
||||
serviceInterfaceValues.map(async (serviceInterfaceValue) => {
|
||||
const hostInfo = await effects.getHostInfo({
|
||||
kind: null,
|
||||
packageId,
|
||||
serviceInterfaceId: serviceInterfaceValue.id,
|
||||
callback,
|
||||
})
|
||||
const primaryUrl = await effects.getPrimaryUrl({
|
||||
serviceInterfaceId: serviceInterfaceValue.id,
|
||||
Object.values(serviceInterfaceValues).map(async (serviceInterfaceValue) => {
|
||||
const hostId = serviceInterfaceValue.addressInfo.hostId
|
||||
const host = await effects.getHostInfo({
|
||||
packageId,
|
||||
hostId,
|
||||
callback,
|
||||
})
|
||||
const primaryUrl = await effects
|
||||
.getPrimaryUrl({
|
||||
serviceInterfaceId: serviceInterfaceValue.id,
|
||||
packageId,
|
||||
callback,
|
||||
})
|
||||
.catch(() => null)
|
||||
return {
|
||||
...serviceInterfaceValue,
|
||||
primaryUrl: primaryUrl,
|
||||
hostInfo,
|
||||
addressInfo: filledAddress(hostInfo, serviceInterfaceValue.addressInfo),
|
||||
host,
|
||||
addressInfo: filledAddress(host, serviceInterfaceValue.addressInfo),
|
||||
get primaryHostname() {
|
||||
if (primaryUrl == null) return null
|
||||
return getHostname(primaryUrl)
|
||||
|
||||
Reference in New Issue
Block a user