From 41997b0ee8a1052945f2ca9c9fbd0333330e542a Mon Sep 17 00:00:00 2001
From: Alex Dupre
Date: Tue, 9 Jul 2013 14:42:29 +0200
Subject: [PATCH 01/29] Fix security issue: set 'register_masterkey' field as
autocomplete=off. If a user has restored his wallet from his masterkey, such
secret key is persisted in clear-text into the browser.
---
src/jade/tabs/register.jade | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/jade/tabs/register.jade b/src/jade/tabs/register.jade
index 9bacf67b6..370f05086 100644
--- a/src/jade/tabs/register.jade
+++ b/src/jade/tabs/register.jade
@@ -36,7 +36,7 @@ section.single.content(ng-controller="RegisterCtrl")
label(for='register_masterkey')
| Secret Account Key
a(ng-click="showMasterKeyInput=false;") (hide)
- input#register_masterkey(name='register_masterkey', type='text', ng-model="masterkey", rp-master-key, rp-focus)
+ input#register_masterkey(name='register_masterkey', type='text', autocomplete='off', ng-model="masterkey", rp-master-key, rp-focus)
.errorBox(ng-show="registerForm.register_masterkey.$error.rpMasterKey")
p.text-error Secret Account Key is invalid
.submitsection
From 7e03a69910b45385fc3f67f829ae0cceb77466ef Mon Sep 17 00:00:00 2001
From: Stefan Thomas
Date: Thu, 18 Jul 2013 16:40:13 -0700
Subject: [PATCH 02/29] Upgrade build system.
- Builds now automatically include a version number based on git.
- Ability to create "bundles" - trees assembled based on source files.
- Single index.html template that is processed into different versions.
---
Gruntfile.js | 100 ++++++++++++++++++++++++++++----
index.html | 31 +++++++---
index_debug.html | 96 ------------------------------
package.json | 10 +++-
res/nw/package_linux.json | 5 ++
res/nw/package_linux_debug.json | 5 ++
6 files changed, 132 insertions(+), 115 deletions(-)
delete mode 100644 index_debug.html
create mode 100644 res/nw/package_linux.json
create mode 100644 res/nw/package_linux_debug.json
diff --git a/Gruntfile.js b/Gruntfile.js
index 57e201b62..6557599ea 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,11 +1,16 @@
var path = require("path"),
fs = require("fs");
+
+var BannerPlugin = require("webpack/lib/BannerPlugin");
+
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-webpack');
+ grunt.loadNpmTasks('grunt-preprocess');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-contrib-copy');
// Ripple client dependencies
var deps = ["deps/js/jquery.js",
@@ -65,19 +70,35 @@ module.exports = function(grunt) {
return [{dest:dest, src:compile?src:[]}];
};
+ grunt.registerTask("version", "Describes current git commit", function (prop) {
+ var done = this.async();
+
+ grunt.log.write("Version: ");
+
+ grunt.util.spawn({
+ cmd : "git",
+ args : [ "describe", "--tags", "--always", "--dirty" ]
+ }, function (err, result) {
+ if (err) {
+ grunt.log.error(err);
+ return done(false);
+ }
+
+ grunt.config(prop || "meta.version", result.stdout);
+
+ grunt.log.writeln(result.stdout.green);
+
+ done(result);
+ });
+ });
+
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
- meta: {
- banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
- },
+ meta: {},
recess: {
dist: {
src: ['src/less/ripple/desktop.less'],
- dest: 'build/css/ripple-desktop.css',
+ dest: 'build/dist/ripple-desktop.css',
options: {
compile: true
}
@@ -114,7 +135,10 @@ module.exports = function(grunt) {
"expr" : true,
"asi" : true,
"sub" : true
- }
+ },
+ plugins: [
+ new BannerPlugin("Ripple Client v<%= meta.version %>\nCopyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\nLicensed under the <%= pkg.license %> license.")
+ ]
},
desktop: {
output: {
@@ -173,6 +197,58 @@ module.exports = function(grunt) {
}
}
},
+ preprocess: {
+ web: {
+ src: 'index.html',
+ dest: 'build/dist/index.html',
+ options: {
+ context: {
+ MODE_RELEASE: true,
+ TARGET_WEB: true,
+ VERSION: "<%= meta.version %>"
+ }
+ }
+ },
+ web_debug: {
+ src: 'index.html',
+ dest: 'build/dist/index_debug.html',
+ options: {
+ context: {
+ MODE_DEBUG: true,
+ TARGET_WEB: true,
+ VERSION: "<%= meta.version %>"
+ }
+ }
+ }
+ },
+ copy: {
+ web: {
+ files: [
+ ]
+ },
+ nw_linux: {
+ files: [
+ {expand: true, src: ['build/dist/*.js'], dest: 'build/bundle/nw-linux'},
+ {expand: true, src: ['build/dist/*.css'], dest: 'build/bundle/nw-linux'},
+ {expand: true, src: ['build/dist/*.html'], dest: 'build/bundle/nw-linux', flatten: true},
+ {expand: true, src: ['fonts/*'], dest: 'build/bundle/nw-linux'},
+ {expand: true, src: ['img/*'], dest: 'build/bundle/nw-linux'},
+ {expand: true, src: ['deps/js/modernizr*.js'], dest: 'build/bundle/nw-linux'},
+ {src: 'res/nw/package_linux.json', dest: 'build/bundle/nw-linux/package.json'}
+ ]
+ },
+ nw_linux_debug: {
+ files: [
+ {expand: true, src: ['build/dist/*.js'], dest: 'build/bundle/nw-linux-debug'},
+ {expand: true, src: ['build/dist/*.css'], dest: 'build/bundle/nw-linux-debug'},
+ {expand: true, src: ['build/dist/*.html'], dest: 'build/bundle/nw-linux-debug', flatten: true},
+ {expand: true, src: ['fonts/*'], dest: 'build/bundle/nw-linux-debug'},
+ {expand: true, src: ['img/*'], dest: 'build/bundle/nw-linux-debug'},
+ {expand: true, src: ['deps/js/modernizr*.js'], dest: 'build/bundle/nw-linux-debug'},
+ {src: 'res/nw/package_linux_debug.json', dest: 'build/bundle/nw-linux-debug/package.json'}
+ ]
+ }
+ },
watch: {
livereload: {
options: {
@@ -200,12 +276,16 @@ module.exports = function(grunt) {
});
// Tasks
- grunt.registerTask('default', ['webpack', 'recess',
+ grunt.registerTask('default', ['version',
+ 'preprocess',
+ 'webpack', 'recess',
'uglify:deps',
'concat:deps','concat:deps_debug',
'uglify:deps_ie',
'concat:deps_ie', 'concat:deps_ie_debug']);
grunt.registerTask('deps', ['concat:deps', 'min:deps']);
+ grunt.registerTask('dist', [//'default',
+ 'copy:web', 'copy:nw_linux', 'copy:nw_linux_debug']);
};
// Helpers
function escapeRegExpString(str) { return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); }
diff --git a/index.html b/index.html
index e1e44def6..a7607cd18 100644
--- a/index.html
+++ b/index.html
@@ -17,7 +17,7 @@
-
+
-unprocessed
Bug reports
@@ -89,16 +89,31 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+