feat(manager): enable servers with valid domains (#1448)

This commit is contained in:
Vinicius Fortuna 2023-11-16 17:39:07 -05:00 committed by GitHub
parent 3d2c3db494
commit 50ad005e43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 8 deletions

View file

@ -193,6 +193,8 @@ function main() {
// prevent window being garbage collected
let mainWindow: Electron.BrowserWindow;
app.userAgentFallback = `OutlineManager/${electron.app.getVersion()} ${app.userAgentFallback}`;
// Mark secure to avoid mixed content warnings when loading DigitalOcean pages via https://.
electron.protocol.registerSchemesAsPrivileged([
{scheme: 'outline', privileges: {standard: true, secure: true}},

View file

@ -103,7 +103,7 @@ export interface Server {
// Manual servers are servers which the user has independently setup to run
// shadowbox, and can be on any cloud provider.
export interface ManualServer extends Server {
getCertificateFingerprint(): string;
getCertificateFingerprint(): string | undefined;
forget(): void;
}
@ -159,7 +159,7 @@ export class MonetaryCost {
// shadowbox.
export interface ManualServerConfig {
apiUrl: string;
certSha256: string;
certSha256?: string;
}
// Repository of ManualServer objects. These are servers the user has setup

View file

@ -38,9 +38,6 @@ export function parseManualServerConfig(userInput: string): ManualServerConfig {
if (!config.apiUrl) {
throw new Error('no apiUrl field');
}
if (!config.certSha256) {
throw new Error('no certSha256 field');
}
return config;
}

View file

@ -25,7 +25,7 @@ class ManualServer extends ShadowboxServer implements server.ManualServer {
private forgetCallback: Function
) {
super(id);
const fingerprint = hexToString(manualServerConfig.certSha256);
const fingerprint = hexToString(manualServerConfig.certSha256 ?? '');
this.setManagementApi(makePathApiClient(manualServerConfig.apiUrl, fingerprint));
}

View file

@ -927,8 +927,6 @@ export class AppRoot extends polymerElementWithLocalize {
const manualEntry = this.$.manualEntry as OutlineManualServerEntry;
if (clickedButtonIndex === 1) {
manualEntry.retryTapped();
} else {
manualEntry.cancelTapped();
}
});
}