From 1ace0b3156f02176492a141a544f384512f315cf Mon Sep 17 00:00:00 2001 From: Shawn Date: Sun, 16 Dec 2018 22:28:35 -0600 Subject: [PATCH 1/2] Add short hash when serving bundles --- package-lock.json | 6 ++++++ package.json | 1 + server/render/renderFullPage.js | 9 ++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index febbadf7..c09d0b2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7650,6 +7650,12 @@ "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==", "dev": true }, + "md5-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/md5-file/-/md5-file-4.0.0.tgz", + "integrity": "sha512-UC0qFwyAjn4YdPpKaDNw6gNxRf7Mcx7jC1UGCY4boCzgvU2Aoc1mOGzTtrjjLKhM5ivsnhoKpQVxKPp+1j1qwg==", + "dev": true + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", diff --git a/package.json b/package.json index 3b5d9f17..8f7701b6 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "file-loader": "^2.0.0", "har-validator": "^5.1.3", "husky": "^1.1.3", + "md5-file": "^4.0.0", "mini-css-extract-plugin": "^0.5.0", "mocha": "^5.2.0", "ndb": "^1.0.26", diff --git a/server/render/renderFullPage.js b/server/render/renderFullPage.js index 12e39214..a35a0c1e 100644 --- a/server/render/renderFullPage.js +++ b/server/render/renderFullPage.js @@ -1,3 +1,10 @@ +const md5File = require('md5-file'); +const path = require('path'); + +const bundlePath = path.resolve('./public/bundle/bundle.js'); +const bundleHash = md5File.sync(bundlePath); +const shortBundleHash = bundleHash.substring(0,4); + module.exports = (helmet, html, preloadedState) => { // take the html and preloadedState and return the full page return ` @@ -22,7 +29,7 @@ module.exports = (helmet, html, preloadedState) => { - + `; -- 2.45.2 From ebe928c1588a970257de99250e69c9f82ffc88b4 Mon Sep 17 00:00:00 2001 From: jessop Date: Mon, 17 Dec 2018 19:33:42 -0500 Subject: [PATCH 2/2] clarity changes to ubuntu docs --- docs/ubuntuinstall.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/ubuntuinstall.md b/docs/ubuntuinstall.md index 454cb327..54c83e7f 100644 --- a/docs/ubuntuinstall.md +++ b/docs/ubuntuinstall.md @@ -132,13 +132,14 @@ Log in as username@domainname or username@ip_address `sudo apt-get install mysql-server -y` - ( enter blank password each time if prompted) + ( During install, enter blank password each time if prompted. We'll set one during secure setup.) `sudo systemctl status mysql` (q to exit) ## Secure Setup `sudo mysql_secure_installation` + * Password your_mysql_password * No to password validation * Y to all other options @@ -223,13 +224,10 @@ tmux allows you to run multiple things in different sessions. Useful for manuall Once your wallet has a balance, run this: - `npm run configure` - - (once your wallet balance has cleared) - - `npm run configure` - + `npm run configure` + The script will ask for the following values: + * Database: lbry * Username: root * Password: your_mysql_password @@ -237,6 +235,8 @@ tmux allows you to run multiple things in different sessions. Useful for manuall * Site Title: Your Site Name * Enter your site's domain name: https://example.com or http://localhost:3000 * Enter a directory where uploads should be stored: (/home/lbry/Uploads) + + `npm run build` (or `npm run dev` to build for developing) `npm run start` -- 2.45.2