1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

Add key server url to grunt build config

This commit is contained in:
Tankred Hase 2014-06-26 17:21:28 +02:00
parent 636e6ffad9
commit 493c13eac6
3 changed files with 15 additions and 3 deletions

View File

@ -295,7 +295,8 @@ module.exports = function(grunt) {
suffix: ' (Beta)',
version: version,
deleteKey: true,
keyServer: 'https://keys.whiteout.io/'
keyServer: 'https://keys.whiteout.io/',
keychainServer: 'https://keychain.whiteout.io/'
});
});
@ -317,6 +318,10 @@ module.exports = function(grunt) {
var ksIndex = manifest.permissions.indexOf('https://keys-test.whiteout.io/');
manifest.permissions[ksIndex] = options.keyServer;
}
if (options.keychainServer) {
var kcsIndex = manifest.permissions.indexOf('https://keychain-test.whiteout.io/');
manifest.permissions[kcsIndex] = options.keychainServer;
}
if (options.deleteKey) {
delete manifest.key;
}

View File

@ -3,7 +3,7 @@ define(function(require) {
var _ = require('underscore'),
app = {},
appVersion, cloudUrl, clientId;
appVersion, cloudUrl, keychainUrl, clientId;
// parse manifest to get configurations for current runtime
try {
@ -14,6 +14,12 @@ define(function(require) {
});
// remove last '/' from url due to required syntax in manifest
cloudUrl = cloudUrl.substring(0, cloudUrl.length - 1);
// get keychain server base url
keychainUrl = _.find(manifest.permissions, function(permission) {
return typeof permission === 'string' && permission.indexOf('https://keychain') === 0;
});
// remove last '/' from url due to required syntax in manifest
keychainUrl = keychainUrl.substring(0, keychainUrl.length - 1);
// get client ID for OAuth requests
clientId = manifest.oauth2.client_id;
// get the app version
@ -25,7 +31,7 @@ define(function(require) {
*/
app.config = {
cloudUrl: cloudUrl || 'https://keys.whiteout.io',
privkeyServerUrl: 'https://keychain-test.whiteout.io',
privkeyServerUrl: keychainUrl || 'https://keychain.whiteout.io',
serverPrivateKeyId: 'EE342F0DDBB0F3BE',
symKeySize: 256,
symIvSize: 96,

View File

@ -13,6 +13,7 @@
},
"notifications",
"https://keys-test.whiteout.io/",
"https://keychain-test.whiteout.io/",
"https://www.googleapis.com/",
"identity", {
"socket": [