Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 2c1e1f6

Browse files
author
Felix Hammerl
committed
Merge pull request #296 from whiteout-io/dev/WO-865
Dev/wo 865
2 parents 59dc200 + 91693c6 commit 2c1e1f6

File tree

11 files changed

+46
-20
lines changed

11 files changed

+46
-20
lines changed

src/js/app-config.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@ module.exports = appCfg;
1212
* Global app configurations
1313
*/
1414
appCfg.config = {
15-
cloudUrl: 'https://keys.whiteout.io',
15+
keyServerUrl: 'https://keys.whiteout.io',
1616
hkpUrl: 'http://keyserver.ubuntu.com',
1717
privkeyServerUrl: 'https://keychain.whiteout.io',
1818
adminUrl: 'https://admin-node.whiteout.io',
1919
settingsUrl: 'https://settings.whiteout.io/autodiscovery/',
20-
wmailDomain: 'wmail.io',
20+
mailServer: {
21+
domain: 'wmail.io',
22+
imap: {
23+
hostname: 'imap.wmail.io',
24+
port: 993,
25+
secure: true
26+
},
27+
smtp: {
28+
hostname: 'smtp.wmail.io',
29+
port: 465,
30+
secure: true
31+
}
32+
},
2133
oauthDomains: [/\.gmail\.com$/, /\.googlemail\.com$/],
2234
ignoreUploadOnSentDomains: [/\.gmail\.com$/, /\.googlemail\.com$/],
2335
serverPrivateKeyId: 'EE342F0DDBB0F3BE',
@@ -56,7 +68,7 @@ function setConfigParams(manifest) {
5668
}
5769

5870
// get key server base url
59-
cfg.cloudUrl = getUrl('https://keys');
71+
cfg.keyServerUrl = getUrl('https://keys');
6072
// get keychain server base url
6173
cfg.privkeyServerUrl = getUrl('https://keychain');
6274
// get the app version

src/js/controller/app/account.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var AccountCtrl = function($scope, $q, auth, keychain, pgp, appConfig, download,
2727
var fpr = keyParams.fingerprint;
2828
$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);
2929
$scope.keysize = keyParams.bitSize;
30-
$scope.publicKeyUrl = appConfig.config.cloudUrl + '/' + userId;
30+
$scope.publicKeyUrl = appConfig.config.keyServerUrl + '/' + userId;
3131

3232
//
3333
// scope functions

src/js/controller/app/contacts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var ContactsCtrl = function($scope, $q, keychain, pgp, dialog, appConfig) {
1818
}
1919
};
2020

21-
$scope.whiteoutKeyServer = appConfig.config.cloudUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
21+
$scope.whiteoutKeyServer = appConfig.config.keyServerUrl.replace(/http[s]?:\/\//, ''); // display key server hostname
2222

2323
//
2424
// scope functions

src/js/controller/login/create-account.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi
55

66
// init phone region
77
$scope.region = 'DE';
8+
$scope.domain = '@' + appConfig.config.mailServer.domain;
89

910
$scope.createWhiteoutAccount = function() {
1011
if ($scope.form.$invalid) {
@@ -19,7 +20,7 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi
1920

2021
}).then(function() {
2122
// read form values
22-
var emailAddress = $scope.user + '@' + appConfig.config.wmailDomain;
23+
var emailAddress = $scope.user + $scope.domain;
2324
var phone = PhoneNumber.Parse($scope.dial, $scope.region);
2425
if (!phone || !phone.internationalNumber) {
2526
throw new Error('Invalid phone number!');
@@ -50,6 +51,15 @@ var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admi
5051
$scope.errMsg = err.errMsg || err.message;
5152
});
5253
};
54+
55+
$scope.loginToExisting = function() {
56+
// set server config
57+
$scope.state.login = {
58+
mailConfig: appConfig.config.mailServer
59+
};
60+
// proceed to login
61+
$location.path('/login-set-credentials');
62+
};
5363
};
5464

5565
module.exports = CreateAccountCtrl;

src/js/email/email.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Email.prototype.fetchMessages = function(options) {
347347
bodyParts: message.bodyParts
348348
}).then(function(parsedBodyParts) {
349349
var body = _.pluck(filterBodyParts(parsedBodyParts, MSG_PART_TYPE_TEXT), MSG_PART_ATTR_CONTENT).join('\n'),
350-
verificationUrlPrefix = config.cloudUrl + config.verificationUrl,
350+
verificationUrlPrefix = config.keyServerUrl + config.verificationUrl,
351351
uuid = body.split(verificationUrlPrefix).pop().substr(0, config.verificationUuidLength),
352352
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}/;
353353

@@ -927,7 +927,7 @@ Email.prototype.sendEncrypted = function(options, mailer) {
927927
*/
928928
Email.prototype.sendPlaintext = function(options, mailer) {
929929
// add suffix to plaintext mail
930-
options.email.body += str.signature + config.cloudUrl + '/' + this._account.emailAddress;
930+
options.email.body += str.signature + config.keyServerUrl + '/' + this._account.emailAddress;
931931
// mime encode, sign and send email via smtp
932932
return this._sendGeneric({
933933
smtpclient: options.smtpclient, // filled solely in the integration test, undefined in normal usage

src/js/service/rest.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var ngModule = angular.module('woServices');
55
// rest dao for use in the public key service
66
ngModule.factory('publicKeyRestDao', function(appConfig) {
77
var dao = new RestDAO();
8-
dao.setBaseUri(appConfig.config.cloudUrl);
8+
dao.setBaseUri(appConfig.config.keyServerUrl);
99
return dao;
1010
});
1111

@@ -19,7 +19,7 @@ ngModule.factory('privateKeyRestDao', function(appConfig) {
1919
// rest dao for use in the invitation service
2020
ngModule.factory('invitationRestDao', function(appConfig) {
2121
var dao = new RestDAO();
22-
dao.setBaseUri(appConfig.config.cloudUrl);
22+
dao.setBaseUri(appConfig.config.keyServerUrl);
2323
return dao;
2424
});
2525

@@ -133,7 +133,7 @@ RestDAO.prototype._processRequest = function(options) {
133133
if (options.type === 'json') {
134134
try {
135135
res = JSON.parse(xhr.responseText);
136-
} catch(e) {
136+
} catch (e) {
137137
res = xhr.responseText;
138138
}
139139
} else {

src/sass/blocks/basics/_form.scss

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
font-size: $font-size-base;
106106
padding: 0.5em 0.7em;
107107
outline: none;
108+
box-shadow: none;
108109
// ios
109110
border-radius: 0;
110111
-webkit-appearance: none;

src/tpl/create-account.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
</header>
66
<main class="page__main">
77
<h2 class="typo-title">Create Whiteout account</h2>
8-
<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>
8+
<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>
99
<form class="form" name="form">
1010
<p class="form__error-message" ng-show="errMsg">{{errMsg}}</p>
1111
<div class="form__row">
1212
<div class="input-email-fixed-domain">
13-
<input class="input-text" ng-model="user" required type="text" wo-focus-me="true" tabindex="1"
13+
<input class="input-text" ng-model="user" required type="text" tabindex="1"
1414
pattern='[a-zA-Z0-9\.]+' placeholder="User name"
1515
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
16-
<span>@wmail.io</span>
16+
<span>{{domain}}</span>
1717
</div>
1818
</div>
1919
<div class="form__row">
@@ -288,7 +288,7 @@ <h2 class="typo-title">Create Whiteout account</h2>
288288
</div>
289289
</div>
290290
<div class="form__row">
291-
<input class="input-text" type="text" ng-model="betaCode" required placeholder="Beta access code" tabindex="6">
291+
<input class="input-text" type="text" ng-model="betaCode" required placeholder="Beta access code (for private beta)" tabindex="6">
292292
</div>
293293
<div class="spinner-block" ng-show="busy">
294294
<span class="spinner spinner--big"></span>
@@ -297,6 +297,9 @@ <h2 class="typo-title">Create Whiteout account</h2>
297297
<button class="btn" type="submit" ng-click="createWhiteoutAccount()">Create</button>
298298
</div>
299299
</form>
300+
<p class="typo-paragraph">
301+
<a href="http://eepurl.com/ba09in" target="_blank" title="Sign up for private beta access.">Need a beta access code?</a>
302+
</p>
300303
</main>
301304
<div ng-include="'tpl/page-footer.html'"></div>
302305
</div>

src/tpl/login-set-credentials.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2 class="typo-title">Login</h2>
3232
</div>
3333
<div class="form__row">
3434
<input class="input-text" type="text" ng-model="realname"
35-
placeholder="Full name (optional)" wo-focus-me="true" tabindex="2">
35+
placeholder="Full name (optional)" tabindex="2">
3636
</div>
3737
<div class="form__row" ng-hide="useOAuth">
3838
<input ng-required="!useOAuth" class="input-text" type="password"

test/integration/email-dao-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ describe('Email DAO integration tests', function() {
751751
expect(message.signed).to.be.true;
752752
expect(message.signaturesValid).to.be.true;
753753
expect(message.attachments.length).to.equal(0);
754-
expect(message.body).to.equal(expectedBody + str.signature + config.cloudUrl + '/' + testAccount.user);
754+
expect(message.body).to.equal(expectedBody + str.signature + config.keyServerUrl + '/' + testAccount.user);
755755
done();
756756
});
757757
};

test/unit/email/email-dao-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ describe('Email DAO unit tests', function() {
467467
bodyParts: message.bodyParts
468468
}).returns(resolves([{
469469
type: 'text',
470-
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
470+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
471471
}]));
472472

473473
keychainStub.verifyPublicKey.withArgs(validUuid).returns(resolves());
@@ -500,7 +500,7 @@ describe('Email DAO unit tests', function() {
500500
bodyParts: message.bodyParts
501501
}).returns(resolves([{
502502
type: 'text',
503-
content: '' + cfg.cloudUrl + cfg.verificationUrl + corruptedUuid
503+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + corruptedUuid
504504
}]));
505505

506506
localStoreStub.withArgs({
@@ -531,7 +531,7 @@ describe('Email DAO unit tests', function() {
531531
bodyParts: message.bodyParts
532532
}).returns(resolves([{
533533
type: 'text',
534-
content: '' + cfg.cloudUrl + cfg.verificationUrl + validUuid
534+
content: '' + cfg.keyServerUrl + cfg.verificationUrl + validUuid
535535
}]));
536536

537537
keychainStub.verifyPublicKey.withArgs(validUuid).returns(rejects({}));

0 commit comments

Comments
 (0)