From 50dbb5b2774e873212bd4efb0dc972d6dd7bc99c Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 2 Jun 2014 12:55:32 -0300 Subject: [PATCH 1/4] works without config.js, and improved docs --- README.md | 23 ++++++++++++++------- config.template.js | 51 ++++++++++++++++++++++++++++++++++------------ index.html | 2 ++ 3 files changed, 56 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 80dd940dc..e2f0e0863 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ [![Build Status](https://secure.travis-ci.org/bitpay/copay.png)](http://travis-ci.org/bitpay/copay) -Copay -===== +# Copay -Installation: +## Installation: ``` git clone https://github.com/bitpay/copay.git @@ -31,6 +30,8 @@ node app.js Then visit localhost:3000 in your browser. + +## Running copay To run on a different port: ``` PORT=3001 node app.js @@ -45,14 +46,22 @@ PORT=3004 node app.js PORT=3005 node app.js ``` -To open n different instances just run: +To open n different instances more easily, just run: ``` -node launch.js n +n=5 +node launch.js $n & ``` +## Configuration +Default configuration can be found in the config.template.js file. +If you want to configure Copay differently, you can copy that file +to config.js and change the values. -About Copay -=========== +See config.template.js for more info on configuration options. + + + +# About Copay General ------- diff --git a/config.template.js b/config.template.js index 20b3988e9..bb7389bb7 100644 --- a/config.template.js +++ b/config.template.js @@ -1,26 +1,44 @@ 'use strict'; var defaultConfig = { + // livenet or testnet networkName: 'testnet', + + // wallet limits + limits: { + totalCopayers: 12, + mPlusN: 100 + }, + + // network layer (PeerJS) config network: { - // key: 'lwjd5qra8257b9', //Copay API key for public PeerJS server - // This is for running local peerJs with params: ./peerjs -p 10009 -k 'sdfjhwefh' - //key: 'sdfjhwefh', - //host: 'localhost', - //port: 10009, - //path: '/', - // - key: 'satoshirocks', // api key for the peerjs server - host: '162.242.219.26', // peerjs server + // Use this to run your own local PeerJS server + // with params: ./peerjs -p 10009 -k '6d6d751ea61e26f2' + /* + key: '6d6d751ea61e26f2', + host: 'localhost', + port: 10009, + path: '/', + */ + + // Use this to connect to bitpay's PeerJS server + key: 'satoshirocks', + host: '162.242.219.26', port: 80, path: '/', + + // other PeerJS config maxPeers: 15, debug: 3, + + // Network encryption config sjclParams: { salt: 'mjuBtGybi/4=', // choose your own salt (base64) iter: 1000, mode: 'ccm', ts: parseInt(64), }, + + // PeerJS internal config object config: { 'iceServers': [ // Pass in STUN and TURN servers for maximum network compatibility @@ -78,28 +96,35 @@ var defaultConfig = { ] } }, - limits: { - totalCopayers: 12, - mPlusN: 100 - }, + + // wallet default config wallet: { requiredCopayers: 2, totalCopayers: 3, spendUnconfirmed: 1, verbose: 1, }, + + // blockchain service API config blockchain: { host: 'test.insight.is', port: 3001 }, + // socket service API config socket: { host: 'test.insight.is', port: 3001 }, + + // local encryption/security config passphrase: { iterations: 100, storageSalt: 'mjuBtGybi/4=', }, + + // theme list themes: ['default'], + + verbose: 1, }; diff --git a/index.html b/index.html index 0c020d33a..048553274 100644 --- a/index.html +++ b/index.html @@ -725,6 +725,8 @@ on supported browsers please check http://www.w

go back...

+ + From 8e93cac7cabf6079c42f63338ee8760e06926be0 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 2 Jun 2014 14:07:55 -0300 Subject: [PATCH 2/4] make changes suggested by matiu --- .gitignore | 1 - README.md | 8 ++------ config.template.js => config.js | 0 index.html | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) rename config.template.js => config.js (100%) diff --git a/.gitignore b/.gitignore index 86e427483..a0d54ca79 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ lib/* !lib/socket.io.js js/copayBundle.js -config.js webapp/copay-webapp webapp/download diff --git a/README.md b/README.md index e2f0e0863..2b200720f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ Build Copay: npm install bower install grunt shell --target=dev -cp config.template.js config.js ``` Open Copay: @@ -53,11 +52,8 @@ node launch.js $n & ``` ## Configuration -Default configuration can be found in the config.template.js file. -If you want to configure Copay differently, you can copy that file -to config.js and change the values. - -See config.template.js for more info on configuration options. +Default configuration can be found in the config.js file. +See config.js for more info on configuration options. diff --git a/config.template.js b/config.js similarity index 100% rename from config.template.js rename to config.js diff --git a/index.html b/index.html index 048553274..5631834a3 100644 --- a/index.html +++ b/index.html @@ -726,7 +726,6 @@ on supported browsers please check http://www.w - From 1a15519903566e28760c9ed2e7b4246d428e3f2a Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Mon, 2 Jun 2014 14:39:12 -0300 Subject: [PATCH 3/4] Add password strenght tooltip --- index.html | 4 ++-- js/directives.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 5631834a3..3fef2b20b 100644 --- a/index.html +++ b/index.html @@ -209,7 +209,7 @@

Join a Wallet in Creation

- +
@@ -300,7 +300,7 @@
Your Wallet Password(doesn't need to be shared) Required
+ ng-model="walletPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
Wallet name Optional
diff --git a/js/directives.js b/js/directives.js index 822fdae85..33fad2040 100644 --- a/js/directives.js +++ b/js/directives.js @@ -124,7 +124,7 @@ angular.module('copay.directives') return { replace: false, restrict: 'EACM', - scope: { model: '=checkStrength' }, + require: 'ngModel', link: function(scope, element, attrs) { var _grep = function(elems, callback, invert) { var callbackInverse, @@ -146,6 +146,7 @@ angular.module('copay.directives') }; var strength = { + messages: ['too weak', 'weak', 'weak', 'medium', 'strong'], colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'], mesureStrength: function (p) { var _force = 0; @@ -178,14 +179,15 @@ angular.module('copay.directives') else if (s <= 40) { idx = 3; } else { idx = 4; } - return { idx: idx + 1, col: this.colors[idx] }; + return { idx: idx + 1, col: this.colors[idx], message: this.messages[idx] }; } }; - - scope.$watch('model', function (newValue, oldValue) { + + scope.$watch(attrs.ngModel, function (newValue, oldValue) { if (newValue && newValue !== '') { var c = strength.getColor(strength.mesureStrength(newValue)); - element.css({ 'border-color': c.col }) + element.css({ 'border-color': c.col }); + scope[attrs.checkStrength] = c.message; } }); } From 329a48b35443e0f6d1a4925c57c2595394857160 Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Mon, 2 Jun 2014 16:52:33 -0300 Subject: [PATCH 4/4] Add warning message on new Copay version --- index.html | 9 +++++++++ js/controllers/header.js | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 3fef2b20b..3915052a1 100644 --- a/index.html +++ b/index.html @@ -73,6 +73,15 @@
+
+
diff --git a/js/controllers/header.js b/js/controllers/header.js index 36c40e123..9c76edf88 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copay.header').controller('HeaderController', - function($scope, $rootScope, $location, $notification, walletFactory, controllerUtils) { + function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) { $scope.menu = [ { 'title': 'Addresses', @@ -23,6 +23,18 @@ angular.module('copay.header').controller('HeaderController', var beep = new Audio('sound/transaction.mp3'); + $http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data){ + var toInt = function (s) { return parseInt(s); }; + var latestVersion = data[0].name.replace('v', '').split('.').map(toInt); + var currentVersion = copay.version.split('.').map(toInt); + + if (currentVersion[0] < latestVersion[0]){ + $scope.updateVersion = 'error'; + } else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) { + $scope.updateVersion = 'info'; + } + }); + // Initialize alert notification (not show when init wallet) $rootScope.txAlertCount = 0; $rootScope.$watch('txAlertCount', function(txAlertCount) {