Merge pull request #296 from whiteout-io/dev/WO-865

Dev/wo 865
This commit is contained in:
Felix Hammerl 2015-02-18 17:00:08 +01:00
commit 2c1e1f669e
11 changed files with 46 additions and 20 deletions

View File

@ -12,12 +12,24 @@ module.exports = appCfg;
* Global app configurations * Global app configurations
*/ */
appCfg.config = { appCfg.config = {
cloudUrl: 'https://keys.whiteout.io', keyServerUrl: 'https://keys.whiteout.io',
hkpUrl: 'http://keyserver.ubuntu.com', hkpUrl: 'http://keyserver.ubuntu.com',
privkeyServerUrl: 'https://keychain.whiteout.io', privkeyServerUrl: 'https://keychain.whiteout.io',
adminUrl: 'https://admin-node.whiteout.io', adminUrl: 'https://admin-node.whiteout.io',
settingsUrl: 'https://settings.whiteout.io/autodiscovery/', 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$/], oauthDomains: [/\.gmail\.com$/, /\.googlemail\.com$/],
ignoreUploadOnSentDomains: [/\.gmail\.com$/, /\.googlemail\.com$/], ignoreUploadOnSentDomains: [/\.gmail\.com$/, /\.googlemail\.com$/],
serverPrivateKeyId: 'EE342F0DDBB0F3BE', serverPrivateKeyId: 'EE342F0DDBB0F3BE',
@ -56,7 +68,7 @@ function setConfigParams(manifest) {
} }
// get key server base url // get key server base url
cfg.cloudUrl = getUrl('https://keys'); cfg.keyServerUrl = getUrl('https://keys');
// get keychain server base url // get keychain server base url
cfg.privkeyServerUrl = getUrl('https://keychain'); cfg.privkeyServerUrl = getUrl('https://keychain');
// get the app version // get the app version

View File

@ -27,7 +27,7 @@ var AccountCtrl = function($scope, $q, auth, keychain, pgp, appConfig, download,
var fpr = keyParams.fingerprint; 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.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.keysize = keyParams.bitSize;
$scope.publicKeyUrl = appConfig.config.cloudUrl + '/' + userId; $scope.publicKeyUrl = appConfig.config.keyServerUrl + '/' + userId;
// //
// scope functions // scope functions

View File

@ -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 // scope functions

View File

@ -5,6 +5,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi
// init phone region // init phone region
$scope.region = 'DE'; $scope.region = 'DE';
$scope.domain = '@' + appConfig.config.mailServer.domain;
$scope.createWhiteoutAccount = function() { $scope.createWhiteoutAccount = function() {
if ($scope.form.$invalid) { if ($scope.form.$invalid) {
@ -19,7 +20,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi
}).then(function() { }).then(function() {
// read form values // read form values
var emailAddress = $scope.user + '@' + appConfig.config.wmailDomain; var emailAddress = $scope.user + $scope.domain;
var phone = PhoneNumber.Parse($scope.dial, $scope.region); var phone = PhoneNumber.Parse($scope.dial, $scope.region);
if (!phone || !phone.internationalNumber) { if (!phone || !phone.internationalNumber) {
throw new Error('Invalid phone number!'); 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.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; module.exports = CreateAccountCtrl;

View File

@ -347,7 +347,7 @@ Email.prototype.fetchMessages = function(options) {
bodyParts: message.bodyParts bodyParts: message.bodyParts
}).then(function(parsedBodyParts) { }).then(function(parsedBodyParts) {
var body = _.pluck(filterBodyParts(parsedBodyParts, MSG_PART_TYPE_TEXT), MSG_PART_ATTR_CONTENT).join('\n'), 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), 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}/; 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) { Email.prototype.sendPlaintext = function(options, mailer) {
// add suffix to plaintext mail // 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 // mime encode, sign and send email via smtp
return this._sendGeneric({ return this._sendGeneric({
smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage

View File

@ -5,7 +5,7 @@ var ngModule = angular.module('woServices');
// rest dao for use in the public key service // rest dao for use in the public key service
ngModule.factory('publicKeyRestDao', function(appConfig) { ngModule.factory('publicKeyRestDao', function(appConfig) {
var dao = new RestDAO(); var dao = new RestDAO();
dao.setBaseUri(appConfig.config.cloudUrl); dao.setBaseUri(appConfig.config.keyServerUrl);
return dao; return dao;
}); });
@ -19,7 +19,7 @@ ngModule.factory('privateKeyRestDao', function(appConfig) {
// rest dao for use in the invitation service // rest dao for use in the invitation service
ngModule.factory('invitationRestDao', function(appConfig) { ngModule.factory('invitationRestDao', function(appConfig) {
var dao = new RestDAO(); var dao = new RestDAO();
dao.setBaseUri(appConfig.config.cloudUrl); dao.setBaseUri(appConfig.config.keyServerUrl);
return dao; return dao;
}); });
@ -133,7 +133,7 @@ RestDAO.prototype._processRequest = function(options) {
if (options.type === 'json') { if (options.type === 'json') {
try { try {
res = JSON.parse(xhr.responseText); res = JSON.parse(xhr.responseText);
} catch(e) { } catch (e) {
res = xhr.responseText; res = xhr.responseText;
} }
} else { } else {

View File

@ -105,6 +105,7 @@
font-size: $font-size-base; font-size: $font-size-base;
padding: 0.5em 0.7em; padding: 0.5em 0.7em;
outline: none; outline: none;
box-shadow: none;
// ios // ios
border-radius: 0; border-radius: 0;
-webkit-appearance: none; -webkit-appearance: none;

View File

@ -5,15 +5,15 @@
</header> </header>
<main class="page__main"> <main class="page__main">
<h2 class="typo-title">Create Whiteout account</h2> <h2 class="typo-title">Create Whiteout account</h2>
<p class="typo-paragraph">Please fill out the following form. You will need a <em>beta access code</em> during the private beta period. To participate in the private beta please <a href="http://eepurl.com/ba09in" target="_blank">sign up</a>.</p> <p class="typo-paragraph">Sign up for an encrypted mailbox hosted in Germany.<br>Already have an account? <a href="#" wo-touch="$event.preventDefault(); loginToExisting()">Log in here</a>.</p>
<form class="form" name="form"> <form class="form" name="form">
<p class="form__error-message" ng-show="errMsg">{{errMsg}}</p> <p class="form__error-message" ng-show="errMsg">{{errMsg}}</p>
<div class="form__row"> <div class="form__row">
<div class="input-email-fixed-domain"> <div class="input-email-fixed-domain">
<input class="input-text" ng-model="user" required type="text" wo-focus-me="true" tabindex="1" <input class="input-text" ng-model="user" required type="text" tabindex="1"
pattern='[a-zA-Z0-9\.]+' placeholder="User name" pattern='[a-zA-Z0-9\.]+' placeholder="User name"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"> autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
<span>@wmail.io</span> <span>{{domain}}</span>
</div> </div>
</div> </div>
<div class="form__row"> <div class="form__row">
@ -288,7 +288,7 @@
</div> </div>
</div> </div>
<div class="form__row"> <div class="form__row">
<input class="input-text" type="text" ng-model="betaCode" required placeholder="Beta access code" tabindex="6"> <input class="input-text" type="text" ng-model="betaCode" required placeholder="Beta access code (for private beta)" tabindex="6">
</div> </div>
<div class="spinner-block" ng-show="busy"> <div class="spinner-block" ng-show="busy">
<span class="spinner spinner--big"></span> <span class="spinner spinner--big"></span>
@ -297,6 +297,9 @@
<button class="btn" type="submit" ng-click="createWhiteoutAccount()">Create</button> <button class="btn" type="submit" ng-click="createWhiteoutAccount()">Create</button>
</div> </div>
</form> </form>
<p class="typo-paragraph">
<a href="http://eepurl.com/ba09in" target="_blank" title="Sign up for private beta access.">Need a beta access code?</a>
</p>
</main> </main>
<div ng-include="'tpl/page-footer.html'"></div> <div ng-include="'tpl/page-footer.html'"></div>
</div> </div>

View File

@ -32,7 +32,7 @@
</div> </div>
<div class="form__row"> <div class="form__row">
<input class="input-text" type="text" ng-model="realname" <input class="input-text" type="text" ng-model="realname"
placeholder="Full name (optional)" wo-focus-me="true" tabindex="2"> placeholder="Full name (optional)" tabindex="2">
</div> </div>
<div class="form__row" ng-hide="useOAuth"> <div class="form__row" ng-hide="useOAuth">
<input ng-required="!useOAuth" class="input-text" type="password" <input ng-required="!useOAuth" class="input-text" type="password"

View File

@ -751,7 +751,7 @@ describe('Email DAO integration tests', function() {
expect(message.signed).to.be.true; expect(message.signed).to.be.true;
expect(message.signaturesValid).to.be.true; expect(message.signaturesValid).to.be.true;
expect(message.attachments.length).to.equal(0); 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(); done();
}); });
}; };

View File

@ -467,7 +467,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts bodyParts: message.bodyParts
}).returns(resolves([{ }).returns(resolves([{
type: 'text', type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
}])); }]));
keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves()); keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves());
@ -500,7 +500,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts bodyParts: message.bodyParts
}).returns(resolves([{ }).returns(resolves([{
type: 'text', type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + corruptedUuid content: '' + cfg.keyServerUrl + cfg.verificationUrl + corruptedUuid
}])); }]));
localStoreStub.withArgs({ localStoreStub.withArgs({
@ -531,7 +531,7 @@ describe('Email DAO unit tests', function() {
bodyParts: message.bodyParts bodyParts: message.bodyParts
}).returns(resolves([{ }).returns(resolves([{
type: 'text', type: 'text',
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
}])); }]));
keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({})); keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({}));