From 93dc53f7b7f862489c00de9b45b50c5f7dfb56ee Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sat, 14 Feb 2015 16:07:04 +0100 Subject: [PATCH 1/2] Add login to wmail on singup screen Remove red border on required text input on Firefox --- src/js/app-config.js | 14 +++++++++++++- src/js/controller/login/create-account.js | 12 +++++++++++- src/sass/blocks/basics/_form.scss | 1 + src/tpl/create-account.html | 11 +++++++---- src/tpl/login-set-credentials.html | 2 +- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/js/app-config.js b/src/js/app-config.js index 603d7fc..389cd79 100644 --- a/src/js/app-config.js +++ b/src/js/app-config.js @@ -17,7 +17,19 @@ appCfg.config = { privkeyServerUrl: 'https://keychain.whiteout.io', adminUrl: 'https://admin-node.whiteout.io', settingsUrl: 'https://settings.whiteout.io/autodiscovery/', - wmailDomain: 'wmail.io', + mailServer: { + domain: 'wmail.io', + imap: { + hostname: 'imap.wmail.io', + port: 993, + secure: true + }, + smtp: { + hostname: 'smtp.wmail.io', + port: 465, + secure: true + } + }, oauthDomains: [/\.gmail\.com$/, /\.googlemail\.com$/], ignoreUploadOnSentDomains: [/\.gmail\.com$/, /\.googlemail\.com$/], serverPrivateKeyId: 'EE342F0DDBB0F3BE', diff --git a/src/js/controller/login/create-account.js b/src/js/controller/login/create-account.js index faa206f..1556b6d 100644 --- a/src/js/controller/login/create-account.js +++ b/src/js/controller/login/create-account.js @@ -5,6 +5,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi // init phone region $scope.region = 'DE'; + $scope.domain = '@' + appConfig.config.mailServer.domain; $scope.createWhiteoutAccount = function() { if ($scope.form.$invalid) { @@ -19,7 +20,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi }).then(function() { // read form values - var emailAddress = $scope.user + '@' + appConfig.config.wmailDomain; + var emailAddress = $scope.user + $scope.domain; var phone = PhoneNumber.Parse($scope.dial, $scope.region); if (!phone || !phone.internationalNumber) { throw new Error('Invalid phone number!'); @@ -50,6 +51,15 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi $scope.errMsg = err.errMsg || err.message; }); }; + + $scope.loginToExisting = function() { + // set server config + $scope.state.login = { + mailConfig: appConfig.config.mailServer + }; + // proceed to login + $location.path('/login-set-credentials'); + }; }; module.exports = CreateAccountCtrl; \ No newline at end of file diff --git a/src/sass/blocks/basics/_form.scss b/src/sass/blocks/basics/_form.scss index 5b1c1de..b2a56e1 100644 --- a/src/sass/blocks/basics/_form.scss +++ b/src/sass/blocks/basics/_form.scss @@ -105,6 +105,7 @@ font-size: $font-size-base; padding: 0.5em 0.7em; outline: none; + box-shadow: none; // ios border-radius: 0; -webkit-appearance: none; diff --git a/src/tpl/create-account.html b/src/tpl/create-account.html index 13f98c5..cc5fb7e 100644 --- a/src/tpl/create-account.html +++ b/src/tpl/create-account.html @@ -5,15 +5,15 @@

Create Whiteout account

-

Please fill out the following form. You will need a beta access code during the private beta period. To participate in the private beta please sign up.

+

Sign up for an encrypted mailbox hosted in Germany.
Already have an account? Log in here.

{{errMsg}}

- - @wmail.io + {{domain}}
@@ -288,7 +288,7 @@
- +
@@ -297,6 +297,9 @@
+

+ Need a beta access code? +

diff --git a/src/tpl/login-set-credentials.html b/src/tpl/login-set-credentials.html index 3f8f722..66589cc 100644 --- a/src/tpl/login-set-credentials.html +++ b/src/tpl/login-set-credentials.html @@ -32,7 +32,7 @@
+ placeholder="Full name (optional)" tabindex="2">
Date: Mon, 16 Feb 2015 23:16:18 +0100 Subject: [PATCH 2/2] Refactor config.cloudUrl to config.keyServerUrl --- src/js/app-config.js | 4 ++-- src/js/controller/app/account.js | 2 +- src/js/controller/app/contacts.js | 2 +- src/js/email/email.js | 4 ++-- src/js/service/rest.js | 6 +++--- test/integration/email-dao-test.js | 2 +- test/unit/email/email-dao-test.js | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/js/app-config.js b/src/js/app-config.js index 389cd79..392639b 100644 --- a/src/js/app-config.js +++ b/src/js/app-config.js @@ -12,7 +12,7 @@ module.exports = appCfg; * Global app configurations */ appCfg.config = { - cloudUrl: 'https://keys.whiteout.io', + keyServerUrl: 'https://keys.whiteout.io', hkpUrl: 'http://keyserver.ubuntu.com', privkeyServerUrl: 'https://keychain.whiteout.io', adminUrl: 'https://admin-node.whiteout.io', @@ -68,7 +68,7 @@ function setConfigParams(manifest) { } // get key server base url - cfg.cloudUrl = getUrl('https://keys'); + cfg.keyServerUrl = getUrl('https://keys'); // get keychain server base url cfg.privkeyServerUrl = getUrl('https://keychain'); // get the app version diff --git a/src/js/controller/app/account.js b/src/js/controller/app/account.js index 86df281..ce41474 100644 --- a/src/js/controller/app/account.js +++ b/src/js/controller/app/account.js @@ -27,7 +27,7 @@ var AccountCtrl = function($scope, $q, auth, keychain, pgp, appConfig, download, var fpr = keyParams.fingerprint; $scope.fingerprint = fpr.slice(0, 4) + ' ' + fpr.slice(4, 8) + ' ' + fpr.slice(8, 12) + ' ' + fpr.slice(12, 16) + ' ' + fpr.slice(16, 20) + ' ' + fpr.slice(20, 24) + ' ' + fpr.slice(24, 28) + ' ' + fpr.slice(28, 32) + ' ' + fpr.slice(32, 36) + ' ' + fpr.slice(36); $scope.keysize = keyParams.bitSize; - $scope.publicKeyUrl = appConfig.config.cloudUrl + '/' + userId; + $scope.publicKeyUrl = appConfig.config.keyServerUrl + '/' + userId; // // scope functions diff --git a/src/js/controller/app/contacts.js b/src/js/controller/app/contacts.js index 169ff8d..05f5f1f 100644 --- a/src/js/controller/app/contacts.js +++ b/src/js/controller/app/contacts.js @@ -18,7 +18,7 @@ var ContactsCtrl = function($scope, $q, keychain, pgp, dialog, appConfig) { } }; - $scope.whiteoutKeyServer = appConfig.config.cloudUrl.replace(/http[s]?:\/\//, ''); // display key server hostname + $scope.whiteoutKeyServer = appConfig.config.keyServerUrl.replace(/http[s]?:\/\//, ''); // display key server hostname // // scope functions diff --git a/src/js/email/email.js b/src/js/email/email.js index 3c6d477..3f5a0ec 100644 --- a/src/js/email/email.js +++ b/src/js/email/email.js @@ -347,7 +347,7 @@ Email.prototype.fetchMessages = function(options) { bodyParts: message.bodyParts }).then(function(parsedBodyParts) { var body = _.pluck(filterBodyParts(parsedBodyParts, MSG_PART_TYPE_TEXT), MSG_PART_ATTR_CONTENT).join('\n'), - verificationUrlPrefix = config.cloudUrl + config.verificationUrl, + verificationUrlPrefix = config.keyServerUrl + config.verificationUrl, uuid = body.split(verificationUrlPrefix).pop().substr(0, config.verificationUuidLength), uuidRegex = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/; @@ -927,7 +927,7 @@ Email.prototype.sendEncrypted = function(options, mailer) { */ Email.prototype.sendPlaintext = function(options, mailer) { // add suffix to plaintext mail - options.email.body += str.signature + config.cloudUrl + '/' + this._account.emailAddress; + options.email.body += str.signature + config.keyServerUrl + '/' + this._account.emailAddress; // mime encode, sign and send email via smtp return this._sendGeneric({ smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage diff --git a/src/js/service/rest.js b/src/js/service/rest.js index e16f88f..1807a66 100644 --- a/src/js/service/rest.js +++ b/src/js/service/rest.js @@ -5,7 +5,7 @@ var ngModule = angular.module('woServices'); // rest dao for use in the public key service ngModule.factory('publicKeyRestDao', function(appConfig) { var dao = new RestDAO(); - dao.setBaseUri(appConfig.config.cloudUrl); + dao.setBaseUri(appConfig.config.keyServerUrl); return dao; }); @@ -19,7 +19,7 @@ ngModule.factory('privateKeyRestDao', function(appConfig) { // rest dao for use in the invitation service ngModule.factory('invitationRestDao', function(appConfig) { var dao = new RestDAO(); - dao.setBaseUri(appConfig.config.cloudUrl); + dao.setBaseUri(appConfig.config.keyServerUrl); return dao; }); @@ -133,7 +133,7 @@ RestDAO.prototype._processRequest = function(options) { if (options.type === 'json') { try { res = JSON.parse(xhr.responseText); - } catch(e) { + } catch (e) { res = xhr.responseText; } } else { diff --git a/test/integration/email-dao-test.js b/test/integration/email-dao-test.js index d2b0d00..07999c5 100644 --- a/test/integration/email-dao-test.js +++ b/test/integration/email-dao-test.js @@ -751,7 +751,7 @@ describe('Email DAO integration tests', function() { expect(message.signed).to.be.true; expect(message.signaturesValid).to.be.true; expect(message.attachments.length).to.equal(0); - expect(message.body).to.equal(expectedBody + str.signature + config.cloudUrl + '/' + testAccount.user); + expect(message.body).to.equal(expectedBody + str.signature + config.keyServerUrl + '/' + testAccount.user); done(); }); }; diff --git a/test/unit/email/email-dao-test.js b/test/unit/email/email-dao-test.js index b1c6298..6b1f5b2 100644 --- a/test/unit/email/email-dao-test.js +++ b/test/unit/email/email-dao-test.js @@ -467,7 +467,7 @@ describe('Email DAO unit tests', function() { bodyParts: message.bodyParts }).returns(resolves([{ type: 'text', - content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid + content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid }])); keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves()); @@ -500,7 +500,7 @@ describe('Email DAO unit tests', function() { bodyParts: message.bodyParts }).returns(resolves([{ type: 'text', - content: '' + cfg.cloudUrl + cfg.verificationUrl + corruptedUuid + content: '' + cfg.keyServerUrl + cfg.verificationUrl + corruptedUuid }])); localStoreStub.withArgs({ @@ -531,7 +531,7 @@ describe('Email DAO unit tests', function() { bodyParts: message.bodyParts }).returns(resolves([{ type: 'text', - content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid + content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid }])); keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({}));