mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Frontend changes for 036 (#2554)
* new interfaces and remove tor http warnings * move sigtermTimeout to stopping main status * lightning, masked, schemeOverride, invert host-iface relationship * update for new sdk * update for latest SDK changes * Update app-interfaces.page.ts * Update config.service.ts
This commit is contained in:
@@ -78,18 +78,6 @@ export module Mock {
|
||||
start: 'Starting Bitcoin is good for your health.',
|
||||
stop: null,
|
||||
},
|
||||
main: {
|
||||
type: 'docker',
|
||||
image: '',
|
||||
system: true,
|
||||
entrypoint: '',
|
||||
args: [],
|
||||
mounts: {},
|
||||
'io-format': DockerIoFormat.Yaml,
|
||||
inject: false,
|
||||
'shm-size': '',
|
||||
'sigterm-timeout': '1ms',
|
||||
},
|
||||
'health-checks': {},
|
||||
config: {
|
||||
get: null,
|
||||
@@ -97,40 +85,6 @@ export module Mock {
|
||||
},
|
||||
volumes: {},
|
||||
'min-os-version': '0.2.12',
|
||||
interfaces: {
|
||||
ui: {
|
||||
name: 'Node Visualizer',
|
||||
description:
|
||||
'Web application for viewing information about your node and the Bitcoin network.',
|
||||
ui: true,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
rpc: {
|
||||
name: 'RPC',
|
||||
description: 'Used by wallets to interact with your Bitcoin Core node.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
p2p: {
|
||||
name: 'P2P',
|
||||
description:
|
||||
'Used by other Bitcoin nodes to communicate and interact with your node.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
create: {
|
||||
type: 'docker',
|
||||
@@ -382,18 +336,6 @@ export module Mock {
|
||||
start: 'Starting LND is good for your health.',
|
||||
stop: null,
|
||||
},
|
||||
main: {
|
||||
type: 'docker',
|
||||
image: '',
|
||||
system: true,
|
||||
entrypoint: '',
|
||||
args: [],
|
||||
mounts: {},
|
||||
'io-format': DockerIoFormat.Yaml,
|
||||
inject: false,
|
||||
'shm-size': '',
|
||||
'sigterm-timeout': '10000µs',
|
||||
},
|
||||
'health-checks': {},
|
||||
config: {
|
||||
get: null,
|
||||
@@ -401,38 +343,6 @@ export module Mock {
|
||||
},
|
||||
volumes: {},
|
||||
'min-os-version': '0.2.12',
|
||||
interfaces: {
|
||||
rpc: {
|
||||
name: 'RPC interface',
|
||||
description: 'Good for connecting to your node at a distance.',
|
||||
ui: true,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {
|
||||
'44': {
|
||||
ssl: true,
|
||||
mapping: 33,
|
||||
},
|
||||
},
|
||||
protocols: [],
|
||||
},
|
||||
grpc: {
|
||||
name: 'GRPC',
|
||||
description: 'Certain wallet use grpc.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {
|
||||
'66': {
|
||||
ssl: true,
|
||||
mapping: 55,
|
||||
},
|
||||
},
|
||||
protocols: [],
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
create: {
|
||||
type: 'docker',
|
||||
@@ -535,39 +445,10 @@ export module Mock {
|
||||
start: null,
|
||||
stop: null,
|
||||
},
|
||||
main: {
|
||||
type: 'docker',
|
||||
image: '',
|
||||
system: true,
|
||||
entrypoint: '',
|
||||
args: [''],
|
||||
mounts: {},
|
||||
'io-format': DockerIoFormat.Yaml,
|
||||
inject: false,
|
||||
'shm-size': '',
|
||||
'sigterm-timeout': '1m',
|
||||
},
|
||||
'health-checks': {},
|
||||
config: { get: {} as any, set: {} as any },
|
||||
volumes: {},
|
||||
'min-os-version': '0.2.12',
|
||||
interfaces: {
|
||||
rpc: {
|
||||
name: 'RPC interface',
|
||||
description: 'Good for connecting to your node at a distance.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {
|
||||
44: {
|
||||
ssl: true,
|
||||
mapping: 33,
|
||||
},
|
||||
},
|
||||
protocols: [],
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
create: {
|
||||
type: 'docker',
|
||||
@@ -1887,18 +1768,219 @@ export module Mock {
|
||||
},
|
||||
'dependency-config-errors': {},
|
||||
},
|
||||
'interface-addresses': {
|
||||
'service-interfaces': {
|
||||
ui: {
|
||||
'tor-address': 'bitcoind-ui-address.onion',
|
||||
'lan-address': 'bitcoind-ui-address.local',
|
||||
id: 'ui',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'Web UI',
|
||||
description:
|
||||
'A launchable web app for you to interact with your Bitcoin node',
|
||||
type: 'ui',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'abcdefg',
|
||||
bindOptions: {
|
||||
scheme: 'http',
|
||||
preferredExternalPort: 80,
|
||||
addSsl: {
|
||||
preferredExternalPort: 443,
|
||||
scheme: 'https',
|
||||
},
|
||||
secure: false,
|
||||
ssl: false,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'abcdefg',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'bitcoin-ui-address.onion',
|
||||
port: 80,
|
||||
sslPort: 443,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 1234,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: null,
|
||||
sslPort: 1234,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 1234,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
rpc: {
|
||||
'tor-address': 'bitcoind-rpc-address.onion',
|
||||
'lan-address': 'bitcoind-rpc-address.local',
|
||||
id: 'rpc',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'RPC',
|
||||
description:
|
||||
'Used by dependent services and client wallets for connecting to your node',
|
||||
type: 'api',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'bcdefgh',
|
||||
bindOptions: {
|
||||
scheme: 'http',
|
||||
preferredExternalPort: 80,
|
||||
addSsl: {
|
||||
preferredExternalPort: 443,
|
||||
scheme: 'https',
|
||||
},
|
||||
secure: false,
|
||||
ssl: false,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'bcdefgh',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'bitcoin-rpc-address.onion',
|
||||
port: 80,
|
||||
sslPort: 443,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 2345,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: null,
|
||||
sslPort: 2345,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 2345,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
p2p: {
|
||||
'tor-address': 'bitcoind-p2p-address.onion',
|
||||
'lan-address': 'bitcoind-p2p-address.local',
|
||||
id: 'p2p',
|
||||
hasPrimary: true,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'P2P',
|
||||
description:
|
||||
'Used for connecting to other nodes on the Bitcoin network',
|
||||
type: 'p2p',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'cdefghi',
|
||||
bindOptions: {
|
||||
scheme: 'bitcoin',
|
||||
preferredExternalPort: 8333,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: false,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'cdefghi',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'bitcoin-p2p-address.onion',
|
||||
port: 8333,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 3456,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 3456,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 3456,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
'system-pointers': [],
|
||||
@@ -1934,10 +2016,110 @@ export module Mock {
|
||||
'dependency-config-errors': {},
|
||||
},
|
||||
manifest: MockManifestBitcoinProxy,
|
||||
'interface-addresses': {
|
||||
rpc: {
|
||||
'tor-address': 'bitcoinproxy-rpc-address.onion',
|
||||
'lan-address': 'bitcoinproxy-rpc-address.local',
|
||||
'service-interfaces': {
|
||||
ui: {
|
||||
id: 'ui',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'Web UI',
|
||||
description: 'A launchable web app for Bitcoin Proxy',
|
||||
type: 'ui',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'hijklmnop',
|
||||
bindOptions: {
|
||||
scheme: 'http',
|
||||
preferredExternalPort: 80,
|
||||
addSsl: {
|
||||
preferredExternalPort: 443,
|
||||
scheme: 'https',
|
||||
},
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'hijklmnop',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'proxy-ui-address.onion',
|
||||
port: 80,
|
||||
sslPort: 443,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.7',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
'system-pointers': [],
|
||||
@@ -1985,14 +2167,213 @@ export module Mock {
|
||||
},
|
||||
},
|
||||
manifest: MockManifestLnd,
|
||||
'interface-addresses': {
|
||||
rpc: {
|
||||
'tor-address': 'lnd-rpc-address.onion',
|
||||
'lan-address': 'lnd-rpc-address.local',
|
||||
},
|
||||
'service-interfaces': {
|
||||
grpc: {
|
||||
'tor-address': 'lnd-grpc-address.onion',
|
||||
'lan-address': 'lnd-grpc-address.local',
|
||||
id: 'grpc',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'GRPC',
|
||||
description:
|
||||
'Used by dependent services and client wallets for connecting to your node',
|
||||
type: 'api',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'qrstuv',
|
||||
bindOptions: {
|
||||
scheme: 'grpc',
|
||||
preferredExternalPort: 10009,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'qrstuv',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-grpc-address.onion',
|
||||
port: 10009,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
lndconnect: {
|
||||
id: 'lndconnect',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: true,
|
||||
name: 'LND Connect',
|
||||
description:
|
||||
'Used by client wallets adhering to LND Connect protocol to connect to your node',
|
||||
type: 'api',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'qrstuv',
|
||||
bindOptions: {
|
||||
scheme: 'lndconnect',
|
||||
preferredExternalPort: 10009,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: 'cert=askjdfbjadnaskjnd&macaroon=ksjbdfnhjasbndjksand',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'qrstuv',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-grpc-address.onion',
|
||||
port: 10009,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
p2p: {
|
||||
id: 'p2p',
|
||||
hasPrimary: true,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'P2P',
|
||||
description:
|
||||
'Used for connecting to other nodes on the Bitcoin network',
|
||||
type: 'p2p',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'rstuvw',
|
||||
bindOptions: {
|
||||
scheme: null,
|
||||
preferredExternalPort: 9735,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'rstuvw',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-p2p-address.onion',
|
||||
port: 9735,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
'system-pointers': [],
|
||||
|
||||
@@ -919,8 +919,10 @@ export class MockApiService extends ApiService {
|
||||
const patch2 = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: path + '/status',
|
||||
value: PackageMainStatus.Stopped,
|
||||
path: path,
|
||||
value: {
|
||||
status: PackageMainStatus.Stopped,
|
||||
},
|
||||
},
|
||||
]
|
||||
this.mockRevision(patch2)
|
||||
@@ -929,13 +931,11 @@ export class MockApiService extends ApiService {
|
||||
const patch = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: path + '/status',
|
||||
value: PackageMainStatus.Stopping,
|
||||
},
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: path + '/health',
|
||||
value: {},
|
||||
path: path,
|
||||
value: {
|
||||
status: PackageMainStatus.Stopping,
|
||||
timeout: '35s',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -116,18 +116,6 @@ export const mockPatchData: DataModel = {
|
||||
start: 'Starting Bitcoin is good for your health.',
|
||||
stop: null,
|
||||
},
|
||||
main: {
|
||||
type: 'docker',
|
||||
image: '',
|
||||
system: true,
|
||||
entrypoint: '',
|
||||
args: [],
|
||||
mounts: {},
|
||||
'io-format': DockerIoFormat.Yaml,
|
||||
inject: false,
|
||||
'shm-size': '',
|
||||
'sigterm-timeout': '.49m',
|
||||
},
|
||||
'health-checks': {
|
||||
'chain-state': {
|
||||
name: 'Chain State',
|
||||
@@ -152,41 +140,6 @@ export const mockPatchData: DataModel = {
|
||||
} as any,
|
||||
volumes: {},
|
||||
'min-os-version': '0.2.12',
|
||||
interfaces: {
|
||||
ui: {
|
||||
name: 'Node Visualizer',
|
||||
description:
|
||||
'Web application for viewing information about your node and the Bitcoin network.',
|
||||
ui: true,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
rpc: {
|
||||
name: 'RPC',
|
||||
description:
|
||||
'Used by wallets to interact with your Bitcoin Core node.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
p2p: {
|
||||
name: 'P2P',
|
||||
description:
|
||||
'Used by other Bitcoin nodes to communicate and interact with your node.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {},
|
||||
protocols: [],
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
create: {
|
||||
type: 'docker',
|
||||
@@ -441,18 +394,110 @@ export const mockPatchData: DataModel = {
|
||||
},
|
||||
'dependency-config-errors': {},
|
||||
},
|
||||
'interface-addresses': {
|
||||
'service-interfaces': {
|
||||
ui: {
|
||||
'tor-address': 'bitcoind-ui-address.onion',
|
||||
'lan-address': 'bitcoind-ui-address.local',
|
||||
},
|
||||
rpc: {
|
||||
'tor-address': 'bitcoind-rpc-address.onion',
|
||||
'lan-address': 'bitcoind-rpc-address.local',
|
||||
},
|
||||
p2p: {
|
||||
'tor-address': 'bitcoind-p2p-address.onion',
|
||||
'lan-address': 'bitcoind-p2p-address.local',
|
||||
id: 'ui',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'Web UI',
|
||||
description: 'A launchable web app for Bitcoin Proxy',
|
||||
type: 'ui',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'hijklmnop',
|
||||
bindOptions: {
|
||||
scheme: 'http',
|
||||
preferredExternalPort: 80,
|
||||
addSsl: {
|
||||
preferredExternalPort: 443,
|
||||
scheme: 'https',
|
||||
},
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'hijklmnop',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'proxy-ui-address.onion',
|
||||
port: 80,
|
||||
sslPort: 443,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.7',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'wlan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: null,
|
||||
sslPort: 4567,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
'system-pointers': [],
|
||||
@@ -506,18 +551,6 @@ export const mockPatchData: DataModel = {
|
||||
start: 'Starting LND is good for your health.',
|
||||
stop: null,
|
||||
},
|
||||
main: {
|
||||
type: 'docker',
|
||||
image: '',
|
||||
system: true,
|
||||
entrypoint: '',
|
||||
args: [],
|
||||
mounts: {},
|
||||
'io-format': DockerIoFormat.Yaml,
|
||||
inject: false,
|
||||
'shm-size': '',
|
||||
'sigterm-timeout': '0.5s',
|
||||
},
|
||||
'health-checks': {},
|
||||
config: {
|
||||
get: null,
|
||||
@@ -525,38 +558,6 @@ export const mockPatchData: DataModel = {
|
||||
},
|
||||
volumes: {},
|
||||
'min-os-version': '0.2.12',
|
||||
interfaces: {
|
||||
rpc: {
|
||||
name: 'RPC interface',
|
||||
description: 'Good for connecting to your node at a distance.',
|
||||
ui: true,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {
|
||||
'44': {
|
||||
ssl: true,
|
||||
mapping: 33,
|
||||
},
|
||||
},
|
||||
protocols: [],
|
||||
},
|
||||
grpc: {
|
||||
name: 'GRPC',
|
||||
description: 'Certain wallet use grpc.',
|
||||
ui: false,
|
||||
'tor-config': {
|
||||
'port-mapping': {},
|
||||
},
|
||||
'lan-config': {
|
||||
'66': {
|
||||
ssl: true,
|
||||
mapping: 55,
|
||||
},
|
||||
},
|
||||
protocols: [],
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
create: {
|
||||
type: 'docker',
|
||||
@@ -642,14 +643,213 @@ export const mockPatchData: DataModel = {
|
||||
'btc-rpc-proxy': 'This is a config unsatisfied error',
|
||||
},
|
||||
},
|
||||
'interface-addresses': {
|
||||
rpc: {
|
||||
'tor-address': 'lnd-rpc-address.onion',
|
||||
'lan-address': 'lnd-rpc-address.local',
|
||||
},
|
||||
'service-interfaces': {
|
||||
grpc: {
|
||||
'tor-address': 'lnd-grpc-address.onion',
|
||||
'lan-address': 'lnd-grpc-address.local',
|
||||
id: 'grpc',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'GRPC',
|
||||
description:
|
||||
'Used by dependent services and client wallets for connecting to your node',
|
||||
type: 'api',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'qrstuv',
|
||||
bindOptions: {
|
||||
scheme: 'grpc',
|
||||
preferredExternalPort: 10009,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'qrstuv',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-grpc-address.onion',
|
||||
port: 10009,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
lndconnect: {
|
||||
id: 'lndconnect',
|
||||
hasPrimary: false,
|
||||
disabled: false,
|
||||
masked: true,
|
||||
name: 'LND Connect',
|
||||
description:
|
||||
'Used by client wallets adhering to LND Connect protocol to connect to your node',
|
||||
type: 'api',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'qrstuv',
|
||||
bindOptions: {
|
||||
scheme: 'lndconnect',
|
||||
preferredExternalPort: 10009,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: 'cert=askjdfbjadnaskjnd&macaroon=ksjbdfnhjasbndjksand',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'qrstuv',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-grpc-address.onion',
|
||||
port: 10009,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 5678,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
p2p: {
|
||||
id: 'p2p',
|
||||
hasPrimary: true,
|
||||
disabled: false,
|
||||
masked: false,
|
||||
name: 'P2P',
|
||||
description:
|
||||
'Used for connecting to other nodes on the Bitcoin network',
|
||||
type: 'p2p',
|
||||
addressInfo: {
|
||||
username: null,
|
||||
hostId: 'rstuvw',
|
||||
bindOptions: {
|
||||
scheme: null,
|
||||
preferredExternalPort: 9735,
|
||||
addSsl: null,
|
||||
secure: true,
|
||||
ssl: true,
|
||||
},
|
||||
suffix: '',
|
||||
},
|
||||
hostInfo: {
|
||||
id: 'rstuvw',
|
||||
kind: 'multi',
|
||||
hostnames: [
|
||||
{
|
||||
kind: 'onion',
|
||||
hostname: {
|
||||
value: 'lnd-p2p-address.onion',
|
||||
port: 9735,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'local',
|
||||
value: 'adjective-noun.local',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv4',
|
||||
value: '192.168.1.5',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ip',
|
||||
networkInterfaceId: 'elan0',
|
||||
public: false,
|
||||
hostname: {
|
||||
kind: 'ipv6',
|
||||
value: '[2001:db8:85a3:8d3:1319:8a2e:370:7348]',
|
||||
port: 6789,
|
||||
sslPort: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
'system-pointers': [],
|
||||
|
||||
@@ -2,8 +2,11 @@ import { DOCUMENT } from '@angular/common'
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
import { WorkspaceConfig } from '@start9labs/shared'
|
||||
import {
|
||||
InterfaceDef,
|
||||
PackageDataEntry,
|
||||
HostnameInfoIp,
|
||||
HostnameInfoOnion,
|
||||
} from '@start9labs/start-sdk/mjs/lib/types'
|
||||
import {
|
||||
InstalledPackageDataEntry,
|
||||
PackageMainStatus,
|
||||
PackageState,
|
||||
} from 'src/app/services/patch-db/data-model'
|
||||
@@ -45,10 +48,6 @@ export class ConfigService {
|
||||
: this.hostname.endsWith('.local')
|
||||
}
|
||||
|
||||
isTorHttp(): boolean {
|
||||
return this.isTor() && !this.isHttps()
|
||||
}
|
||||
|
||||
isLanHttp(): boolean {
|
||||
return !this.isTor() && !this.isLocalhost() && !this.isHttps()
|
||||
}
|
||||
@@ -57,24 +56,60 @@ export class ConfigService {
|
||||
return window.isSecureContext || this.isTor()
|
||||
}
|
||||
|
||||
isLaunchable(
|
||||
state: PackageState,
|
||||
status: PackageMainStatus,
|
||||
interfaces: Record<string, InterfaceDef>,
|
||||
): boolean {
|
||||
isLaunchable(state: PackageState, status: PackageMainStatus): boolean {
|
||||
return (
|
||||
state === PackageState.Installed &&
|
||||
status === PackageMainStatus.Running &&
|
||||
hasUi(interfaces)
|
||||
state === PackageState.Installed && status === PackageMainStatus.Running
|
||||
)
|
||||
}
|
||||
|
||||
launchableURL(pkg: PackageDataEntry): string {
|
||||
if (!this.isTor() && hasLocalUi(pkg.manifest.interfaces)) {
|
||||
return `https://${lanUiAddress(pkg)}`
|
||||
/** ${scheme}://${username}@${host}:${externalPort}${suffix} */
|
||||
launchableAddress(
|
||||
interfaces: InstalledPackageDataEntry['service-interfaces'],
|
||||
): string {
|
||||
const ui = Object.values(interfaces).find(i => i.type === 'ui')
|
||||
|
||||
if (!ui) return ''
|
||||
|
||||
const host = ui.hostInfo
|
||||
const addressInfo = ui.addressInfo
|
||||
const scheme = this.isHttps() ? 'https' : 'http'
|
||||
const username = addressInfo.username ? addressInfo.username + '@' : ''
|
||||
const suffix = addressInfo.suffix || ''
|
||||
const url = new URL(`${scheme}://${username}placeholder${suffix}`)
|
||||
|
||||
if (host.kind === 'multi') {
|
||||
const onionHostname = host.hostnames.find(
|
||||
h => h.kind === 'onion',
|
||||
) as HostnameInfoOnion
|
||||
|
||||
if (this.isTor() && onionHostname) {
|
||||
url.hostname = onionHostname.hostname.value
|
||||
} else {
|
||||
const ipHostname = host.hostnames.find(
|
||||
h => h.kind === 'ip',
|
||||
) as HostnameInfoIp
|
||||
|
||||
if (!ipHostname) return ''
|
||||
|
||||
url.hostname = this.hostname
|
||||
url.port = String(
|
||||
ipHostname.hostname.sslPort || ipHostname.hostname.port,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return `http://${torUiAddress(pkg)}`
|
||||
const hostname = host.hostname
|
||||
|
||||
if (!hostname) return ''
|
||||
|
||||
if (this.isTor() && hostname.kind === 'onion') {
|
||||
url.hostname = hostname.hostname.value
|
||||
} else {
|
||||
url.hostname = this.hostname
|
||||
url.port = String(hostname.hostname.sslPort || hostname.hostname.port)
|
||||
}
|
||||
}
|
||||
|
||||
return url.href
|
||||
}
|
||||
|
||||
getHost(): string {
|
||||
@@ -92,54 +127,8 @@ export class ConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
export function hasTorUi(interfaces: Record<string, InterfaceDef>): boolean {
|
||||
const int = getUiInterfaceValue(interfaces)
|
||||
return !!int?.['tor-config']
|
||||
}
|
||||
|
||||
export function hasLocalUi(interfaces: Record<string, InterfaceDef>): boolean {
|
||||
const int = getUiInterfaceValue(interfaces)
|
||||
return !!int?.['lan-config']
|
||||
}
|
||||
|
||||
export function torUiAddress({
|
||||
manifest,
|
||||
installed,
|
||||
}: PackageDataEntry): string {
|
||||
const key = getUiInterfaceKey(manifest.interfaces)
|
||||
return installed ? installed['interface-addresses'][key]['tor-address'] : ''
|
||||
}
|
||||
|
||||
export function lanUiAddress({
|
||||
manifest,
|
||||
installed,
|
||||
}: PackageDataEntry): string {
|
||||
const key = getUiInterfaceKey(manifest.interfaces)
|
||||
return installed ? installed['interface-addresses'][key]['lan-address'] : ''
|
||||
}
|
||||
|
||||
export function hasUi(interfaces: Record<string, InterfaceDef>): boolean {
|
||||
return hasTorUi(interfaces) || hasLocalUi(interfaces)
|
||||
}
|
||||
|
||||
export function removeProtocol(str: string): string {
|
||||
if (str.startsWith('http://')) return str.slice(7)
|
||||
if (str.startsWith('https://')) return str.slice(8)
|
||||
return str
|
||||
}
|
||||
|
||||
export function removePort(str: string): string {
|
||||
return str.split(':')[0]
|
||||
}
|
||||
|
||||
export function getUiInterfaceKey(
|
||||
interfaces: Record<string, InterfaceDef>,
|
||||
): string {
|
||||
return Object.keys(interfaces).find(key => interfaces[key].ui) || ''
|
||||
}
|
||||
|
||||
export function getUiInterfaceValue(
|
||||
interfaces: Record<string, InterfaceDef>,
|
||||
): InterfaceDef | null {
|
||||
return Object.values(interfaces).find(i => i.ui) || null
|
||||
export function hasUi(
|
||||
interfaces: InstalledPackageDataEntry['service-interfaces'],
|
||||
): boolean {
|
||||
return Object.values(interfaces).some(iface => iface.type === 'ui')
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ConfigSpec } from 'src/app/pkg-config/config-types'
|
||||
import { Url } from '@start9labs/shared'
|
||||
import { MarketplaceManifest } from '@start9labs/marketplace'
|
||||
import { BasicInfo } from 'src/app/pages/developer-routes/developer-menu/form-info'
|
||||
import { ServiceInterfaceWithHostInfo } from '@start9labs/start-sdk/mjs/lib/types'
|
||||
|
||||
export interface DataModel {
|
||||
'server-info': ServerInfo
|
||||
@@ -139,9 +140,7 @@ export interface InstalledPackageDataEntry {
|
||||
icon: Url
|
||||
}
|
||||
}
|
||||
'interface-addresses': {
|
||||
[id: string]: { 'tor-address': string; 'lan-address': string }
|
||||
}
|
||||
'service-interfaces': Record<string, ServiceInterfaceWithHostInfo>
|
||||
'marketplace-url': string | null
|
||||
'developer-key': string
|
||||
}
|
||||
@@ -160,7 +159,6 @@ export interface Manifest extends MarketplaceManifest<DependencyConfig | null> {
|
||||
assets: string // path to assets folder
|
||||
scripts: string // path to scripts folder
|
||||
}
|
||||
main: ActionImpl
|
||||
'health-checks': Record<
|
||||
string,
|
||||
ActionImpl & { name: string; 'success-message': string | null }
|
||||
@@ -168,7 +166,6 @@ export interface Manifest extends MarketplaceManifest<DependencyConfig | null> {
|
||||
config: ConfigActions | null
|
||||
volumes: Record<string, Volume>
|
||||
'min-os-version': string
|
||||
interfaces: Record<string, InterfaceDef>
|
||||
backup: BackupActions
|
||||
migrations: Migrations | null
|
||||
actions: Record<string, Action>
|
||||
@@ -241,15 +238,6 @@ export enum VolumeType {
|
||||
Backup = 'backup',
|
||||
}
|
||||
|
||||
export interface InterfaceDef {
|
||||
name: string
|
||||
description: string
|
||||
'tor-config': TorConfig | null
|
||||
'lan-config': LanConfig | null
|
||||
ui: boolean
|
||||
protocols: string[]
|
||||
}
|
||||
|
||||
export interface TorConfig {
|
||||
'port-mapping': { [port: number]: number }
|
||||
}
|
||||
@@ -297,6 +285,7 @@ export interface MainStatusStopped {
|
||||
|
||||
export interface MainStatusStopping {
|
||||
status: PackageMainStatus.Stopping
|
||||
timeout: string
|
||||
}
|
||||
|
||||
export interface MainStatusStarting {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
import { WINDOW } from '@ng-web-apis/common'
|
||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { InstalledPackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { ConfigService } from './config.service'
|
||||
|
||||
@Injectable({
|
||||
@@ -12,7 +12,11 @@ export class UiLauncherService {
|
||||
private readonly config: ConfigService,
|
||||
) {}
|
||||
|
||||
launch(pkg: PackageDataEntry): void {
|
||||
this.windowRef.open(this.config.launchableURL(pkg), '_blank', 'noreferrer')
|
||||
launch(interfaces: InstalledPackageDataEntry['service-interfaces']): void {
|
||||
this.windowRef.open(
|
||||
this.config.launchableAddress(interfaces),
|
||||
'_blank',
|
||||
'noreferrer',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user