Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/server_manager/electron_app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ function main() {
// prevent window being garbage collected
let mainWindow: Electron.BrowserWindow;

app.userAgentFallback = `OutlineManager/${electron.app.getVersion()} ${app.userAgentFallback}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to allow the use of ngrok without the interstitial of the free version. But I also think it's helpful to tell we are using the Outline Manager.


// Mark secure to avoid mixed content warnings when loading DigitalOcean pages via https://.
electron.protocol.registerSchemesAsPrivileged([
{scheme: 'outline', privileges: {standard: true, secure: true}},
Expand Down
4 changes: 2 additions & 2 deletions src/server_manager/model/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/server_manager/web_app/management_urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/server_manager/web_app/manual_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

this.setManagementApi(makePathApiClient(manualServerConfig.apiUrl, fingerprint));
}

Expand Down
2 changes: 0 additions & 2 deletions src/server_manager/web_app/ui_components/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,6 @@ export class AppRoot extends polymerElementWithLocalize {
const manualEntry = this.$.manualEntry as OutlineManualServerEntry;
if (clickedButtonIndex === 1) {
manualEntry.retryTapped();
} else {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to dismiss the add server screen when we dismiss the dialogue!

manualEntry.cancelTapped();
}
});
}
Expand Down
Loading