mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
add clearnet functionality to frontend (#2814)
* add clearnet functionality to frontend * add pattern and add sync db on rpcs * add domain pattern * show acme name instead of url if known * dont blow up if domain not present after delete * use common name for letsencrypt * normalize urls * refactor start-os ui net service * backend migration and rpcs for serverInfo.host * fix cors * implement clearnet for main startos ui * ability to add and remove tor addresses, including vanity * add guard to prevent duplicate addresses * misc bugfixes * better heuristics for launching UIs * fix ipv6 mocks * fix ipv6 display bug * rewrite url selection for launch ui --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
overflow: auto;
|
||||
"
|
||||
>
|
||||
<code id="tor-addr"></code>
|
||||
<code id="tor-addr" style="display:block; white-space:pre-wrap"></code>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ export class SuccessPage {
|
||||
{} as ElementRef<HTMLCanvasElement>
|
||||
private ctx: CanvasRenderingContext2D = {} as CanvasRenderingContext2D
|
||||
|
||||
torAddress?: string
|
||||
torAddresses?: string[]
|
||||
lanAddress?: string
|
||||
cert?: string
|
||||
|
||||
@@ -52,7 +52,7 @@ export class SuccessPage {
|
||||
const torAddress = this.document.getElementById('tor-addr')
|
||||
const lanAddress = this.document.getElementById('lan-addr')
|
||||
|
||||
if (torAddress) torAddress.innerHTML = this.torAddress!
|
||||
if (torAddress) torAddress.innerHTML = this.torAddresses!.join('\n')
|
||||
if (lanAddress) lanAddress.innerHTML = this.lanAddress!
|
||||
|
||||
this.document
|
||||
@@ -76,7 +76,9 @@ export class SuccessPage {
|
||||
try {
|
||||
const ret = await this.api.complete()
|
||||
if (!this.isKiosk) {
|
||||
this.torAddress = ret.torAddress.replace(/^https:/, 'http:')
|
||||
this.torAddresses = ret.torAddresses.map(a =>
|
||||
a.replace(/^https:/, 'http:'),
|
||||
)
|
||||
this.lanAddress = ret.lanAddress.replace(/^https:/, 'http:')
|
||||
this.cert = ret.rootCa
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ export class MockApiService extends ApiService {
|
||||
case 3:
|
||||
return {
|
||||
status: 'complete',
|
||||
torAddress: 'https://asdafsadasdasasdasdfasdfasdf.onion',
|
||||
torAddresses: ['https://asdafsadasdasasdasdfasdfasdf.onion'],
|
||||
hostname: 'adjective-noun',
|
||||
lanAddress: 'https://adjective-noun.local',
|
||||
rootCa: encodeBase64(rootCA),
|
||||
@@ -283,7 +283,7 @@ export class MockApiService extends ApiService {
|
||||
async complete(): Promise<T.SetupResult> {
|
||||
await pauseFor(1000)
|
||||
return {
|
||||
torAddress: 'https://asdafsadasdasasdasdfasdfasdf.onion',
|
||||
torAddresses: ['https://asdafsadasdasasdasdfasdfasdf.onion'],
|
||||
hostname: 'adjective-noun',
|
||||
lanAddress: 'https://adjective-noun.local',
|
||||
rootCa: encodeBase64(rootCA),
|
||||
|
||||
Reference in New Issue
Block a user