From 31c14a55a1827da76fdf2a2dfcbf84c0c3bdd9e3 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 2 Dec 2018 18:56:23 -0800 Subject: [PATCH] Plumbing user password change page Signed-off-by: James Ketrenos --- README.md | 2 +- frontend/src/ketr-photos/ketr-photos.html | 8 ++++++++ package.json | 22 +++++++++++----------- server/scanner.js | 17 ++++++++++++----- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e3fb6d1..0ea720c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #### Upgrade to Node >v6 ```bash -wget -qO- https://deb.nodesource.com/setup_6.x | sudo bash - +wget -qO- https://deb.nodesource.com/setup_8.x | sudo bash - sudo apt-get install --yes nodejs ``` diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html index c652f00..bea7f29 100755 --- a/frontend/src/ketr-photos/ketr-photos.html +++ b/frontend/src/ketr-photos/ketr-photos.html @@ -34,6 +34,7 @@ + @@ -422,6 +423,7 @@
+ logout
@@ -432,6 +434,7 @@
~ Loading ~
+
@@ -786,6 +789,11 @@ }); }, + profile: function(event) { + this.$.profile.user = this.user; + this.mode = "profile"; + }, + logout: function(event) { this.path = ""; window.fetch("api/v1/users/logout", function(error, xhr) { diff --git a/package.json b/package.json index 1771921..7c7979d 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,13 @@ "author": "James Ketrenos", "license": "Apache-2.0", "dependencies": { - "bluebird": "^3.5.1", - "body-parser": "^1.18.2", - "config": "^1.28.1", + "bluebird": "^3.5.3", + "body-parser": "^1.18.3", + "config": "^1.31.0", "connect-sqlite3": "^0.9.11", "cookie-parser": "^1.4.3", "exif-reader": "github:paras20xx/exif-reader", - "express": "^4.16.2", + "express": "^4.16.4", "express-session": "^1.15.6", "face-recognition": "^0.9.4", "handlebars": "^4.0.12", @@ -27,14 +27,14 @@ "mariasql": "^0.2.6", "moment": "^2.22.2", "moment-holiday": "^1.5.1", - "morgan": "^1.9.0", - "mustache": "^3.0.0", - "nodemailer": "^4.6.8", - "qs": "^6.5.2", - "sequelize": "^4.28.6", + "morgan": "^1.9.1", + "mustache": "^3.0.1", + "nodemailer": "^4.7.0", + "qs": "^6.6.0", + "sequelize": "^4.41.2", "sequelize-mysql": "^1.7.0", - "sharp": "^0.20.5", - "sqlite3": "^4.0.2" + "sharp": "^0.20.8", + "sqlite3": "^4.0.4" }, "jshintConfig": { "undef": true, diff --git a/server/scanner.js b/server/scanner.js index cd80d59..46194ff 100755 --- a/server/scanner.js +++ b/server/scanner.js @@ -233,7 +233,7 @@ function processBlock(items) { } /* Even if the hash doesn't need to be updated, the entry needs to be scanned */ - console.log("process needed because of " + query); +// console.log("process needed because of " + query); needsProcessing.push(asset); if (!query) { @@ -394,7 +394,7 @@ function processBlock(items) { } }); }).catch(function(error) { - setStatus("Error processing file. Continuing."); + setStatus("Error processing file. Continuing.", "error"); throw error; }).then(function() { setStatus("Completed processing queue. Marking " + duplicates.length + " duplicates."); @@ -616,10 +616,17 @@ function computeHash(filepath) { return new Promise(function(resolve, reject) { let input = fs.createReadStream(filepath), hash = crypto.createHash("sha256"); + if (!input) { + console.warn("Unable to open " + filepath); return reject(); } + input.on("error", function(error) { + console.warn("Error reading " + filepath); + reject(error); + }); + input.on("readable", function() { const data = input.read(); if (data) { @@ -725,9 +732,9 @@ function doScan() { newEntries++; } if (!asset.scanned || asset.scanned < asset.stats.mtime || !asset.modified) { - if (!asset.scanned) { console.log("no scan date on asset"); } - if (asset.scanned < asset.stats.mtime) { console.log("scan date older than mtime"); } - if (!asset.modified) { console.log("no mtime."); } +// if (!asset.scanned) { console.log("no scan date on asset"); } +// if (asset.scanned < asset.stats.mtime) { console.log("scan date older than mtime"); } +// if (!asset.modified) { console.log("no mtime."); } needsProcessing.push(asset); } else { updateScanned.push(asset.id);