Skip to content

Commit

Permalink
Fix bugs (#2360)
Browse files Browse the repository at this point in the history
* fix reset tor, delete http redirect, show message for tor http, update release notes

* potentially fix doubel req to registries

* change language arund LAN and root ca

* link locally instead of docs
  • Loading branch information
MattDHill authored Jul 18, 2023
1 parent 3cd9e17 commit 11c21b5
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export class EmbassyPage {
await this.navCtrl.navigateForward(`/loading`)
} catch (e: any) {
this.errorToastService.present(e)
console.error(e)
} finally {
loader.dismiss()
}
Expand Down
8 changes: 0 additions & 8 deletions frontend/projects/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ export class AppComponent implements OnDestroy {
) {}

async ngOnInit() {
if (location.hostname !== 'localhost' && location.protocol === 'http:') {
// see if site is available securely
const res = await fetch(window.location.href.replace(/^http:/, 'https:'))
if (res && res.status === 200) {
// redirect
window.location.protocol = 'https:'
}
}
this.patch
.watch$('ui', 'name')
.subscribe(name => this.titleService.setTitle(name || 'StartOS'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const ICONS = [
'file-tray-stacked-outline',
'finger-print-outline',
'flash-outline',
'flask-outline',
'flash-off-outline',
'folder-open-outline',
'globe-outline',
'grid-outline',
'help-circle-outline',
'hammer-outline',
'home-outline',
'information-circle-outline',
'key-outline',
'list-outline',
Expand Down Expand Up @@ -74,6 +74,7 @@ const ICONS = [
'remove-circle-outline',
'remove-outline',
'repeat-outline',
'ribbon-outline',
'rocket-outline',
'save-outline',
'settings-outline',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export class WidgetListComponent {
qp: { back: 'true' },
},
{
title: 'Secure LAN',
icon: 'home-outline',
title: 'Root CA',
icon: 'ribbon-outline',
color: 'var(--alt-orange)',
description: `Download and trust your server's certificate`,
link: '/system/lan',
description: `Download and trust your server's root certificate authority`,
link: '/system/root-ca',
},
{
title: 'Create Backup',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ <h4>0.3.4.4</h4>
</p>
<h6>Highlights</h6>
<ul class="spaced-list">
<li>Enhanced performance for page load times</li>
<li>Improved progress reporting for data transfer to new data drives</li>
<li>Enabled use of IP address for local network backups</li>
<li>Added change password flow to the UI</li>
<li>Disabled LUKS for new Raspberry Pi setups</li>
<li>Fixed miscellaneous bugs</li>
<li>Https over Tor for faster UI loading times</li>
<li>Change password through UI</li>
<li>Use IP address for Network Folder backups</li>
<li>
Multiple bug fixes, performance enhancements, and other small features
</li>
</ul>

<h2>Previous Releases</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,17 @@
<ion-row class="ion-align-items-center">
<ion-col class="ion-text-center">
<h2>
<ion-text color="warning">
You are using an unencrypted http connection
</ion-text>
<ion-text color="warning">Http detected</ion-text>
</h2>
<p class="ion-padding-bottom">
Click the button below to switch to https. Your browser may warn
you that the page is insecure. You can safely bypass this
warning. It will go away after you
Your connection is insecure.
<a
[routerLink]="['/system', 'lan']"
[routerLink]="['/system', 'root-ca']"
style="color: var(--ion-color-dark)"
>
download and trust your server's certificate
Download and trust your server's Root CA
</a>
.
, then switch to https.
</p>
<ion-button (click)="launchHttps()">
Open https
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export class ExperimentalFeaturesPage {
label: 'Wipe state',
type: 'checkbox',
value: 'wipe',
handler: val => {
console.error(val)
},
},
],
buttons: [
Expand All @@ -56,8 +53,7 @@ export class ExperimentalFeaturesPage {
{
text: 'Reset',
handler: (value: string[]) => {
console.error(value)
this.resetTor(value.some(v => 'wipe'))
this.resetTor(value.some(v => v === 'wipe'))
},
cssClass: 'enter-click',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ion-header>
<ion-toolbar>
<ion-title>Secure LAN</ion-title>
<ion-title>Trust Root CA</ion-title>
<ion-buttons slot="start">
<ion-back-button defaultHref="system"></ion-back-button>
</ion-buttons>
Expand All @@ -13,7 +13,7 @@
<ion-item class="ion-padding-bottom">
<ion-label>
<h2>
For a secure local connection,
For a secure local connection and faster Tor experience,
<a
href="https://docs.start9.com/latest/user-manual/connecting/connecting-lan"
target="_blank"
Expand All @@ -29,7 +29,7 @@ <h2>
<ion-item button (click)="installCert()" [disabled]="!(crtName$ | async)">
<ion-icon slot="start" name="download-outline" size="large"></ion-icon>
<ion-label>
<h1>Download Certificate</h1>
<h1>Download Root CA</h1>
</ion-label>
</ion-item>
</ion-item-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const routes: Routes = [
),
},
{
path: 'lan',
path: 'root-ca',
loadChildren: () => import('./lan/lan.module').then(m => m.LANPageModule),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@

<!-- loaded -->
<ion-item-group *ngIf="server$ | async as server; else loading">
<ion-item *ngIf="!secure" color="warning">
<ion-item *ngIf="!secure || isTorHttp" color="warning">
<ion-icon slot="start" name="warning-outline"></ion-icon>
<ion-label>
<h2 style="font-weight: bold">You are using unencrypted http</h2>
<h2 style="font-weight: bold">Http detected</h2>
<p style="font-weight: 600">
Click the button on the right to switch to https. Your browser may
warn you that the page is insecure. You can safely bypass this
warning. It will go away after you download and trust your server's
certificate
{{ isTorHttp ? 'Tor is faster over https.' : 'Your connection is
insecure.' }}
<a
[routerLink]="['/system', 'root-ca']"
style="color: var(--ion-color-light)"
>
Download and trust your server's Root CA
</a>
, then switch to https.
</p>
</ion-label>
<ion-button slot="end" color="light" (click)="launchHttps()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export class ServerShowPage {
readonly showDiskRepair$ = this.ClientStorageService.showDiskRepair$

readonly secure = this.config.isSecure()
readonly isTorHttp =
this.config.isTor() && this.document.location.protocol === 'http:'

constructor(
private readonly alertCtrl: AlertController,
Expand Down Expand Up @@ -499,11 +501,11 @@ export class ServerShowPage {
disabled$: of(false),
},
{
title: 'LAN',
description: `Download and trust your server's certificate for a secure local connection`,
icon: 'home-outline',
title: 'Root CA',
description: `Download and trust your server's root certificate authority`,
icon: 'ribbon-outline',
action: () =>
this.navCtrl.navigateForward(['lan'], { relativeTo: this.route }),
this.navCtrl.navigateForward(['root-ca'], { relativeTo: this.route }),
detail: true,
disabled$: of(false),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export class MarketplaceService implements AbstractMarketplaceService {
> = {},
): Observable<MarketplacePkg[]> {
return this.patch.watch$('server-info', 'eos-version-compat').pipe(
take(1),
switchMap(versionCompat => {
const qp: RR.GetMarketplacePackagesReq = {
...params,
Expand Down
2 changes: 1 addition & 1 deletion frontend/projects/ui/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export const environment = {
production: false,
useServiceWorker: true,
useServiceWorker: false,
}

/*
Expand Down

0 comments on commit 11c21b5

Please sign in to comment.