mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix cert name and show ca wiz on http ip (#2448)
This commit is contained in:
@@ -104,5 +104,7 @@
|
||||
<a
|
||||
id="install-cert"
|
||||
href="/eos/local.crt"
|
||||
[download]="document.location.hostname"
|
||||
[download]="
|
||||
config.isLocal() ? document.location.hostname + '.crt' : 'startos.crt'
|
||||
"
|
||||
></a>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-content class="content">
|
||||
<!-- Local HTTP -->
|
||||
<ng-container *ngIf="config.isLocalHttp(); else notLanHttp">
|
||||
<ng-container *ngIf="config.isLanHttp(); else notLanHttp">
|
||||
<ca-wizard></ca-wizard>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export class WifiPage {
|
||||
}
|
||||
|
||||
async presentAlertCountry(): Promise<void> {
|
||||
if (!this.config.isLan()) {
|
||||
if (this.config.isTor()) {
|
||||
const alert = await this.alertCtrl.create({
|
||||
header: 'Cannot Complete Action',
|
||||
message:
|
||||
|
||||
@@ -49,23 +49,12 @@ export class ConfigService {
|
||||
: this.hostname.endsWith('.local')
|
||||
}
|
||||
|
||||
isLocalhost(): boolean {
|
||||
return useMocks
|
||||
? mocks.maskAs === 'localhost'
|
||||
: this.hostname === 'localhost'
|
||||
}
|
||||
|
||||
isLan(): boolean {
|
||||
// @TODO will not work once clearnet arrives
|
||||
return !this.isTor()
|
||||
}
|
||||
|
||||
isTorHttp(): boolean {
|
||||
return this.isTor() && !this.isHttps()
|
||||
}
|
||||
|
||||
isLocalHttp(): boolean {
|
||||
return this.isLocal() && !this.isHttps()
|
||||
isLanHttp(): boolean {
|
||||
return !this.isTor() && !this.isLocalhost() && !this.isHttps()
|
||||
}
|
||||
|
||||
isSecure(): boolean {
|
||||
@@ -85,10 +74,9 @@ export class ConfigService {
|
||||
}
|
||||
|
||||
launchableURL(pkg: PackageDataEntry): string {
|
||||
if (this.isLan() && hasLocalUi(pkg.manifest.interfaces)) {
|
||||
if (!this.isTor() && hasLocalUi(pkg.manifest.interfaces)) {
|
||||
return `https://${lanUiAddress(pkg)}`
|
||||
} else {
|
||||
// leave http for services
|
||||
return `http://${torUiAddress(pkg)}`
|
||||
}
|
||||
}
|
||||
@@ -97,6 +85,12 @@ export class ConfigService {
|
||||
return this.host
|
||||
}
|
||||
|
||||
private isLocalhost(): boolean {
|
||||
return useMocks
|
||||
? mocks.maskAs === 'localhost'
|
||||
: this.hostname === 'localhost'
|
||||
}
|
||||
|
||||
private isHttps(): boolean {
|
||||
return useMocks ? mocks.maskAsHttps : this.protocol === 'https:'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user