diff --git a/src/server_manager/bower.json b/src/server_manager/bower.json index b7635f6c..04c83e3e 100644 --- a/src/server_manager/bower.json +++ b/src/server_manager/bower.json @@ -19,6 +19,7 @@ "font-roboto": "PolymerElements/font-roboto-local#^1.1.0", "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.1.1", "iron-icons": "PolymerElements/iron-icons#^2.0.1", + "iron-collapse": "PolymerElements/iron-collapse#^2.2.1", "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^2.1.0", "iron-pages": "PolymerElements/iron-pages#^2.0.1", "paper-button": "PolymerElements/paper-button#^2.0.0", diff --git a/src/server_manager/electron_app/index.ts b/src/server_manager/electron_app/index.ts index abf2954c..f4bb5104 100644 --- a/src/server_manager/electron_app/index.ts +++ b/src/server_manager/electron_app/index.ts @@ -27,6 +27,8 @@ const shell = electron.shell; const debugMode = process.env.OUTLINE_DEBUG === 'true'; +const IMAGES_URL = `file://${path.join(__dirname, 'server_manager', 'web_app')}`; + interface IpcEvent { returnValue: {}; } @@ -183,6 +185,15 @@ function main() { mainWindow.focus(); }); + ipcMain.on('open-image', (event: IpcEvent, args: string[]) => { + if (!args || args.length === 0) { + console.error('open-image event received no image path.'); + return; + } + const imagePath = args[0]; + shell.openExternal(path.join(IMAGES_URL, imagePath)); + }); + app.on('activate', () => { if (!mainWindow) { mainWindow = createMainWindow(); diff --git a/src/server_manager/electron_app/preload.ts b/src/server_manager/electron_app/preload.ts index cde2781e..cc198863 100644 --- a/src/server_manager/electron_app/preload.ts +++ b/src/server_manager/electron_app/preload.ts @@ -21,7 +21,8 @@ const ipcRenderer = electron.ipcRenderer; interface ElectronGlobal extends NodeJS.Global { whitelistCertificate: (fingerprint: string) => void; onElectronEvent: (event: string, listener: () => void) => void; - sendElectronEvent: (event: string) => void; + // tslint:disable-next-line:no-any + sendElectronEvent: (event: string, ...args: any[]) => void; runDigitalOceanOauth: () => digitalocean_oauth.OauthSession; } @@ -33,8 +34,9 @@ process.once('loaded', () => { electronGlobal.onElectronEvent = (event: string, listener: () => void) => { ipcRenderer.on(event, listener); }; - electronGlobal.sendElectronEvent = (event: string) => { - ipcRenderer.send(event); + // tslint:disable-next-line:no-any + electronGlobal.sendElectronEvent = (event: string, ...args: any[]) => { + ipcRenderer.send(event, args); }; electronGlobal.runDigitalOceanOauth = digitalocean_oauth.runOauth; }); diff --git a/src/server_manager/images/aws-logo.svg b/src/server_manager/images/aws-logo.svg new file mode 100755 index 00000000..a69ebbea --- /dev/null +++ b/src/server_manager/images/aws-logo.svg @@ -0,0 +1 @@ + diff --git a/src/server_manager/images/aws-screenshot-1.png b/src/server_manager/images/aws-screenshot-1.png new file mode 100644 index 00000000..47020aee Binary files /dev/null and b/src/server_manager/images/aws-screenshot-1.png differ diff --git a/src/server_manager/images/aws-screenshot-2.png b/src/server_manager/images/aws-screenshot-2.png new file mode 100644 index 00000000..bd17fcb4 Binary files /dev/null and b/src/server_manager/images/aws-screenshot-2.png differ diff --git a/src/server_manager/images/aws-thumbnail-1.png b/src/server_manager/images/aws-thumbnail-1.png new file mode 100755 index 00000000..1a235f99 Binary files /dev/null and b/src/server_manager/images/aws-thumbnail-1.png differ diff --git a/src/server_manager/images/aws-thumbnail-2.png b/src/server_manager/images/aws-thumbnail-2.png new file mode 100755 index 00000000..d694b043 Binary files /dev/null and b/src/server_manager/images/aws-thumbnail-2.png differ diff --git a/src/server_manager/images/check_blue.svg b/src/server_manager/images/check_blue.svg index 517708af..47cda61d 100644 --- a/src/server_manager/images/check_blue.svg +++ b/src/server_manager/images/check_blue.svg @@ -2,7 +2,7 @@ - + diff --git a/src/server_manager/images/check_gcp_blue.svg b/src/server_manager/images/check_gcp_blue.svg new file mode 100644 index 00000000..86381f69 --- /dev/null +++ b/src/server_manager/images/check_gcp_blue.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/server_manager/images/check_orange.svg b/src/server_manager/images/check_orange.svg new file mode 100644 index 00000000..86381f69 --- /dev/null +++ b/src/server_manager/images/check_orange.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/server_manager/images/check_white.svg b/src/server_manager/images/check_white.svg new file mode 100644 index 00000000..6cc03acb --- /dev/null +++ b/src/server_manager/images/check_white.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/server_manager/images/do_white_logo.svg b/src/server_manager/images/do_white_logo.svg new file mode 100755 index 00000000..235759ce --- /dev/null +++ b/src/server_manager/images/do_white_logo.svg @@ -0,0 +1,19 @@ + + + + DO_Logo_icon_white + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/server_manager/images/gcp-logo.svg b/src/server_manager/images/gcp-logo.svg new file mode 100644 index 00000000..3fa6234e --- /dev/null +++ b/src/server_manager/images/gcp-logo.svg @@ -0,0 +1,29 @@ + + + + logo/google_cloud copy 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/server_manager/images/gcp-screenshot-1.png b/src/server_manager/images/gcp-screenshot-1.png new file mode 100644 index 00000000..62ba66f8 Binary files /dev/null and b/src/server_manager/images/gcp-screenshot-1.png differ diff --git a/src/server_manager/images/gcp-screenshot-2.png b/src/server_manager/images/gcp-screenshot-2.png new file mode 100644 index 00000000..7ef454eb Binary files /dev/null and b/src/server_manager/images/gcp-screenshot-2.png differ diff --git a/src/server_manager/images/gcp-thumbnail-1.png b/src/server_manager/images/gcp-thumbnail-1.png new file mode 100755 index 00000000..7a76f92e Binary files /dev/null and b/src/server_manager/images/gcp-thumbnail-1.png differ diff --git a/src/server_manager/images/gcp-thumbnail-2.png b/src/server_manager/images/gcp-thumbnail-2.png new file mode 100755 index 00000000..b5ee017f Binary files /dev/null and b/src/server_manager/images/gcp-thumbnail-2.png differ diff --git a/src/server_manager/images/terminal.svg b/src/server_manager/images/terminal.svg deleted file mode 100644 index c1265bee..00000000 --- a/src/server_manager/images/terminal.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - terminal - Created with Sketch. - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/server_manager/ui_components/app-root.html b/src/server_manager/ui_components/app-root.html index d75dd13a..302f3917 100644 --- a/src/server_manager/ui_components/app-root.html +++ b/src/server_manager/ui_components/app-root.html @@ -221,7 +221,9 @@ listeners: { 'RegionSelected': 'handleRegionSelected', 'MetricsChoiceSelected': 'handleMetricsChoiceSelected', - 'OpenManualServerEntry': 'handleManualServerSelected', + 'SetUpGenericCloudProviderRequested': 'handleSetUpGenericCloudProviderRequested', + 'SetUpAwsRequested': 'handleSetUpAwsRequested', + 'SetUpGcpRequested': 'handleSetUpGcpRequested', 'ManualServerEntryCancelled': 'handleManualCancelled' }, showIntro: function () { @@ -268,8 +270,18 @@ regionId: this.$.regionPicker.getSelectedRegionId() }); }, - handleManualServerSelected: function() { + handleSetUpGenericCloudProviderRequested: function () { + this.handleManualServerSelected('generic'); + }, + handleSetUpAwsRequested: function() { + this.handleManualServerSelected('aws'); + }, + handleSetUpGcpRequested: function() { + this.handleManualServerSelected('gcp'); + }, + handleManualServerSelected: function(cloudProvider) { this.$.manualEntry.clear(); + this.$.manualEntry.cloudProvider = cloudProvider; this.currentPage = 'manualEntry'; }, handleManualCancelled: function() { diff --git a/src/server_manager/ui_components/outline-cloud-instructions-view.html b/src/server_manager/ui_components/outline-cloud-instructions-view.html new file mode 100644 index 00000000..17f15b55 --- /dev/null +++ b/src/server_manager/ui_components/outline-cloud-instructions-view.html @@ -0,0 +1,104 @@ + + + + + + +
+
+
[[title]]
+
Show me where
+
+
+ +
+ +
+ +
+
+ + + diff --git a/src/server_manager/ui_components/outline-intro-step.html b/src/server_manager/ui_components/outline-intro-step.html index b5c029e1..ac97a352 100644 --- a/src/server_manager/ui_components/outline-intro-step.html +++ b/src/server_manager/ui_components/outline-intro-step.html @@ -25,154 +25,247 @@ - Choose a server, set up Outline. + Choose a cloud service, set up Outline. Don't have a server? Create an account
with DigitalOcean.
-
-
-
RECOMMENDED
- -
-
-
-
Set up Outline on DigitalOcean
+
+
+
+
RECOMMENDED
+
-
-
    -
  • Easiest setup process
  • -
  • Only $5 a month
  • -
  • 1 TB of data transfer
  • -
  • Cancel at anytime
  • -
+
DigitalOcean
+
+
+
    +
  • Easiest setup process
  • +
  • Only $5 a month
  • +
  • 1 TB of data transfer
  • +
  • Cancel at anytime
  • +
+
+
+ - Connect with DigitalOcean
-
-
-
-
ADVANCED
- -
-
-
-
Set up Outline anywhere
-
Outline can run on all major cloud providers. You can also deploy it on your own infrastructure.
+
+
+
ADVANCED
+
-
-
Tested on:
-
    -
  • Amazon EC2
  • -
  • Google Compute Engine
  • -
  • Vultr
  • -
  • Linode
  • -
  • Liquid Web
  • -
+
Google Cloud Platform
+
+
+
    +
  • Step-by-step set-up guide
  • +
  • Firewall instructions
  • +
  • Simple install commands
  • +
+
+
+ - Get started
-
+ +
+
+
ADVANCED
+ +
+
Amazon Web Services
+
+
+
    +
  • Step-by-step set-up guide
  • +
  • EC2 firewall instructions
  • +
  • Simple install commands
  • +
+
+
+ +
+ +
+
+
ADVANCED
+ +
+
Set up Outline anywhere
+
+
+
    +
  • Tested on VULTR, Linode, and Liquid Web
  • +
  • Simple install commands
  • +
+
+
+ +
+ +
@@ -182,8 +275,14 @@ connectToDigitalOceanTapped: function() { this.fire('ConnectToDigitalOcean'); }, - manualServerTapped: function() { - this.fire('OpenManualServerEntry'); + setUpGenericCloudProviderTapped: function() { + this.fire('SetUpGenericCloudProviderRequested'); + }, + setUpAwsTapped: function() { + this.fire('SetUpAwsRequested'); + }, + setUpGcpTapped: function() { + this.fire('SetUpGcpRequested'); } }); diff --git a/src/server_manager/ui_components/outline-manual-server-entry.html b/src/server_manager/ui_components/outline-manual-server-entry.html index 569250e9..a7ef2c12 100644 --- a/src/server_manager/ui_components/outline-manual-server-entry.html +++ b/src/server_manager/ui_components/outline-manual-server-entry.html @@ -14,12 +14,14 @@ limitations under the License. --> + + @@ -36,18 +38,75 @@ border-radius: 2px; margin: 24px; text-align: left; - padding: 24px; + } + .card-section { + padding: 24px 12px; + } + .card-section:not(:first-child) { + border-top: 1px solid rgba(0,0,0,0.12);; + } + .section-header { + padding: 0 6px 0; + display: flex; } .instructions { - color: black; + font-size: 16px; + color: rgba(0,0,0,0.87); + line-height: 26px; + margin-left: 16px; + flex: 2; + } + .stepcircle { + height: 26px; + width: 26px; + font-size: 14px; + background-color: rgba(0, 0, 0, 0.34); + border-radius: 50%; + float: left; + vertical-align: middle; + color: #fff; + background-color: #141414; + margin: auto; + text-align: center; + line-height: 26px; + } + .drop-down > * { + vertical-align: middle; + } + .drop-down span { + margin: 0 6px; + } + .drop-down:hover { + cursor: pointer; + } + .section-content { + margin: 24px 12px 0 48px; + } + .section-content-instructions { + margin: 24px 12px; + } + .section-content-instructions li { + margin-bottom: 24px; + } + .section-content-instructions a { + color: #00BFA5; + } + .section-content-instructions iron-icon { + color: #00BFA5; + width: 16px; + height: 16px; + margin-left: 4px; + vertical-align: middle; } .code { background-color: #ECEFF1; - color: black; + color: rgba(0,0,0,0.87); font-size: 14px; font-family: RobotoMono-Regular, monospace; - margin: 20px 0 40px 0; - padding: 14px; + line-height: 24px; + border-radius: 4px; + border-bottom: 2px solid #263238; + padding: 24px; word-break: break-all; } textarea { @@ -55,26 +114,19 @@ border: none; outline: none; box-sizing: border-box; - border-bottom: 2px solid #263238; } iron-icon { display: inline-block; vertical-align: top; color: black; } - .stepContent { - display: inline-block; - vertical-align: top; - width: 442px; - margin-left: 20px; - } - #buttonRow { - width: 100%; + #button-row { display: flex; justify-content: space-between; + padding: 0 24px 24px 60px; } paper-button { - width: 45%; + margin: 0; } paper-progress { margin: 0; @@ -88,36 +140,119 @@ box-shadow: 0 0 2px 0 rgba(0,0,0,0.14), 0 2px 2px 0 rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20); border-radius: 2px; width: 45%; + background-color: #1DE9B6; + color: rgba(0,0,0,0.87); } - #terminalIcon { - width: 20px; + #aws-logo { + vertical-align: top; } - Set up Outline on your server. - Follow these instructions to install Outline with a
cloud provider or on your own infrastructure.
+ Follow the instructions below + These steps will help you install Outline
on [[cloudProviderName]].
-
-
- -
-
First, log into your server, and run the following command:
-
bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"
+
+ +
+
+ 1 +
Configure your firewall
+ +
+ +
+ +
    +
  1. Add a new firewall rule to your Compute Engine project.
  2. +
  3. Type 'outline' in the 'Name' field.
  4. +
  5. Type 'outline' in the 'Target tags' field.
  6. +
  7. Type '0.0.0.0/0' in the 'Source IP ranges' field.
  8. +
  9. Select 'Allow all' under 'Protocols and ports'.
  10. +
  11. Click 'Create'.
  12. +
+
+
+
+ +
    +
  1. Navigate to the VM instances screen.
  2. +
  3. Click on the instance where you want to host Outline.
  4. +
  5. Click 'EDIT' at the top of the VM Instance details screen.
  6. +
  7. Type 'outline' in the 'Network tags' field.
  8. +
  9. Click 'SAVE'.
  10. +
+
+
+
+
+ +
+
+ 1 +
Configure your firewall
+ +
+ +
+ +
    +
  1. Once you've created your EC2 instance, open the EC2 Management Console.
  2. +
  3. Under 'Network & Security', select 'Security Groups'.
  4. +
  5. Click on 'Create Security Group'.
  6. +
  7. Type 'outline' in the 'Security group name' and 'Description' fields.
  8. +
  9. Click 'Add Rule'.
  10. +
  11. Select 'All traffic' under 'Type', and 'Anywhere' under 'Source'.
  12. +
+
+
+
+ +
    +
  1. Navigate to Instances.
  2. +
  3. Click 'Actions' > 'Networking' > 'Change Security Groups' at the top of the 'Instances' screen.
  4. +
  5. Select the 'outline' Security Group, unselect other security groups.
  6. +
  7. Click 'Assign Security Groups'.
  8. +
+
+
+
+
+ +
+
+ 1 + 2 +
Log into your server, and run this command.
+
+
+
bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"
-
- -
-
Second, paste the output from the installation process here and click 'Done'.
- + +
+
+ 2 + 3 +
Paste your installation output here.
+
+
+
-
- CANCEL - DONE +
+ CANCEL + DONE
-
+
@@ -136,10 +271,30 @@ errorText: String, placeholderText: { type: String, - value: '{"apiUrl":"https://xxx.xxx.xxx.xxx:xxxxx/xxxxxxxxxxxxxxxxxxxxxx","certSha256":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + value: '{"apiUrl":"https://xxx.xxx.xxx.xxx:xxxxx/xxxxxxxxxxxxxxxxxxxxxx","certSha256":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' }, - showConnection: Boolean + showConnection: Boolean, + cloudProvider: { + type: String, + value: 'generic' + }, + cloudProviderName: { + type: String, + computed: '_computeCloudProviderName(cloudProvider)' + }, + isCloudProviderAws: { + type: Boolean, + computed: '_computeIsCloudProviderAws(cloudProvider)' + }, + isCloudProviderGcp: { + type: Boolean, + computed: '_computeIsCloudProviderGcp(cloudProvider)' + }, + isGenericCloudProvider: { + type: Boolean, + computed: '_computeIsGenericCloudProvider(cloudProvider)' + } }, showError: function(errorTitle, errorMessage) { this.showConnection = false; @@ -174,6 +329,34 @@ this.clearError(); this.showConnection = false; this.$.errorDialog.close(); + this.$.awsDropDown.hide(); + this.$.gcpDropDown.hide(); + }, + _computeCloudProviderName: function(cloudProvider) { + switch(cloudProvider) { + case 'aws': return 'Amazon Web Services'; + case 'gcp': return 'Google Cloud Platform'; + default: return 'your server'; + } + }, + _computeIsCloudProviderAws: function(cloudProvider) { + return cloudProvider === 'aws' + }, + _computeIsCloudProviderGcp: function(cloudProvider) { + return cloudProvider === 'gcp' + }, + _computeIsGenericCloudProvider: function(cloudProvider) { + return cloudProvider === 'generic'; + }, + _toggleAwsDropDown: function() { + this._toggleDropDown(this.$.awsDropDown, this.$.awsDropDownIcon) + }, + _toggleGcpDropDown: function() { + this._toggleDropDown(this.$.gcpDropDown, this.$.gcpDropDownIcon); + }, + _toggleDropDown: function(dropDown, icon) { + dropDown.toggle(); + icon.icon = dropDown.opened ? 'arrow-drop-up' : 'arrow-drop-down'; } }); diff --git a/src/server_manager/web_app/app.ts b/src/server_manager/web_app/app.ts index 8a4c8cc0..1a9b840a 100644 --- a/src/server_manager/web_app/app.ts +++ b/src/server_manager/web_app/app.ts @@ -37,7 +37,8 @@ const DIGITALOCEAN_REFERRAL_CODE = '5ddb4219b716'; // These functions are defined in electron_app/preload.ts. declare function onElectronEvent(event: string, listener: () => void): void; -declare function sendElectronEvent(event: string): void; +// tslint:disable-next-line:no-any +declare function sendElectronEvent(event: string, ...args: any[]): void; interface OauthSession { result: Promise; isCancelled(): boolean; @@ -185,6 +186,10 @@ export class App { this.cancelServerCreation(this.selectedServer); }); + appRoot.addEventListener('OpenImageRequested', (event: PolymerEvent) => { + sendElectronEvent('open-image', event.detail.imagePath, event.detail.windowTitle); + }); + onElectronEvent('update-downloaded', this.displayAppUpdateNotification.bind(this)); sendElectronEvent('app-ui-ready'); }