From 92edd8b32505c4c3c993202cdecbeecfae646ff6 Mon Sep 17 00:00:00 2001 From: Chris McAvoy Date: Tue, 8 Oct 2013 09:48:40 -0500 Subject: [PATCH 1/4] removing hostname from config, re: [change to persona audience setup](https://groups.google.com/forum/#dev/XGJeGGtRtgo) --- README.md | 19 +++++++++---------- lib/environments/local-dist.js | 5 ----- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 34b13f80..82774eb8 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ We intend to provide an open set of specifications, tools and services for generating verifiable badges that users can take with them wherever they go and use however they like. -The latest open standard we released can be found in the new assertion specification: [https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification](https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification). -The assertion includes the open standard, the metadata specification, we defined. +The latest open standard we released can be found in the new assertion specification: [https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification](https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification). +The assertion includes the open standard, the metadata specification, we defined. For more information, check out http://openbadges.org @@ -25,13 +25,13 @@ Usage example: 1. Generate an assertion (see below) for the user recieving the badge. 2. Store that assertion at a public-but-secret URL and serve it with `content-type: application/json` - + * The assertion contains private information about a user, so you want a non-predictable URL scheme to prevent automated scraping. - + * This URL should be stable - any badge issued from it relies on its existence for verification. - + * Both of these problems will be solved in the near-term future by supporting signed assertions, so you'll only need to expose a URL containing your public key. @@ -139,8 +139,7 @@ you have any problems setting up the environment, feel free to post a message to ### Optional: A real hostname I like to be able to use http://openbadges.local for accessing the -project. Assuming you used vagrant, you can change the hostname in `local.js` -and do `sudo echo "33.33.33.11 openbadges.local" >> /etc/hosts` to make it +project. Assuming you used vagrant, you can `sudo echo "33.33.33.11 openbadges.local" >> /etc/hosts` to make it happen. If you're on OS X, you can also use [Gas Mask](http://code.google.com/p/gmask/) for temporary hosts file switching rather than having to manually edit /etc/hosts @@ -157,7 +156,7 @@ migration. You can do this as follows: file preixed with a timestamp in the `migrations` directory. Something like the following should be displayed: - [INFO] Created migration at + [INFO] Created migration at migrations/20130213205310-add-issuer-column.js 3. Edit the new JS file as per the [node-db-migrate][] instructions. @@ -171,12 +170,12 @@ And finally, note that during development, `npm start` automatically runs run this command yourself whenever you deploy changes that involve a schema change. -If you want to write tests for your migration, check out +If you want to write tests for your migration, check out `test/migration.test.js` for inspiration. [node-db-migrate]: https://github.com/nearinfinity/node-db-migrate#creating-migrations -### Production +### Production The codebase behaves slightly differently when run in an environment where environment variable `NODE_ENV=production`. These differences include: diff --git a/lib/environments/local-dist.js b/lib/environments/local-dist.js index 2d80c4b9..39671d46 100644 --- a/lib/environments/local-dist.js +++ b/lib/environments/local-dist.js @@ -3,11 +3,6 @@ exports.config = { // either http or https protocol: 'http', - // hostname is important for authentication, - // if it doesn't match the URL you're serving from, - // backpack won't work. - hostname: 'localhost', - // When starting the application with `node app.js`, this is the port // that the application will try to bind to. When remote_port is *not* // set, this will also be used to construct fully qualified urls to From be63db830b06811d2483b492dd34a459f3afbe90 Mon Sep 17 00:00:00 2001 From: Chris McAvoy Date: Tue, 8 Oct 2013 11:08:47 -0500 Subject: [PATCH 2/4] Revert "removing hostname from config, re: [change to persona audience setup](https://groups.google.com/forum/#dev/XGJeGGtRtgo)" This reverts commit 92edd8b32505c4c3c993202cdecbeecfae646ff6. --- README.md | 19 ++++++++++--------- lib/environments/local-dist.js | 5 +++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 82774eb8..34b13f80 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ We intend to provide an open set of specifications, tools and services for generating verifiable badges that users can take with them wherever they go and use however they like. -The latest open standard we released can be found in the new assertion specification: [https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification](https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification). -The assertion includes the open standard, the metadata specification, we defined. +The latest open standard we released can be found in the new assertion specification: [https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification](https://github.com/mozilla/openbadges/wiki/New-Assertion-Specification). +The assertion includes the open standard, the metadata specification, we defined. For more information, check out http://openbadges.org @@ -25,13 +25,13 @@ Usage example: 1. Generate an assertion (see below) for the user recieving the badge. 2. Store that assertion at a public-but-secret URL and serve it with `content-type: application/json` - + * The assertion contains private information about a user, so you want a non-predictable URL scheme to prevent automated scraping. - + * This URL should be stable - any badge issued from it relies on its existence for verification. - + * Both of these problems will be solved in the near-term future by supporting signed assertions, so you'll only need to expose a URL containing your public key. @@ -139,7 +139,8 @@ you have any problems setting up the environment, feel free to post a message to ### Optional: A real hostname I like to be able to use http://openbadges.local for accessing the -project. Assuming you used vagrant, you can `sudo echo "33.33.33.11 openbadges.local" >> /etc/hosts` to make it +project. Assuming you used vagrant, you can change the hostname in `local.js` +and do `sudo echo "33.33.33.11 openbadges.local" >> /etc/hosts` to make it happen. If you're on OS X, you can also use [Gas Mask](http://code.google.com/p/gmask/) for temporary hosts file switching rather than having to manually edit /etc/hosts @@ -156,7 +157,7 @@ migration. You can do this as follows: file preixed with a timestamp in the `migrations` directory. Something like the following should be displayed: - [INFO] Created migration at + [INFO] Created migration at migrations/20130213205310-add-issuer-column.js 3. Edit the new JS file as per the [node-db-migrate][] instructions. @@ -170,12 +171,12 @@ And finally, note that during development, `npm start` automatically runs run this command yourself whenever you deploy changes that involve a schema change. -If you want to write tests for your migration, check out +If you want to write tests for your migration, check out `test/migration.test.js` for inspiration. [node-db-migrate]: https://github.com/nearinfinity/node-db-migrate#creating-migrations -### Production +### Production The codebase behaves slightly differently when run in an environment where environment variable `NODE_ENV=production`. These differences include: diff --git a/lib/environments/local-dist.js b/lib/environments/local-dist.js index 39671d46..2d80c4b9 100644 --- a/lib/environments/local-dist.js +++ b/lib/environments/local-dist.js @@ -3,6 +3,11 @@ exports.config = { // either http or https protocol: 'http', + // hostname is important for authentication, + // if it doesn't match the URL you're serving from, + // backpack won't work. + hostname: 'localhost', + // When starting the application with `node app.js`, this is the port // that the application will try to bind to. When remote_port is *not* // set, this will also be used to construct fully qualified urls to From a1cd40edccdc1e37b33b0bcd0489f548352d2897 Mon Sep 17 00:00:00 2001 From: Chris McAvoy Date: Tue, 8 Oct 2013 11:10:14 -0500 Subject: [PATCH 3/4] keeping hostname in config, but changing the explanation --- lib/environments/local-dist.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/environments/local-dist.js b/lib/environments/local-dist.js index 2d80c4b9..9b4eba17 100644 --- a/lib/environments/local-dist.js +++ b/lib/environments/local-dist.js @@ -3,9 +3,7 @@ exports.config = { // either http or https protocol: 'http', - // hostname is important for authentication, - // if it doesn't match the URL you're serving from, - // backpack won't work. + // external hostname of the server. hostname: 'localhost', // When starting the application with `node app.js`, this is the port From 2b691c1d42a8ac45b2d56733797ef6241d31aac4 Mon Sep 17 00:00:00 2001 From: Chris McAvoy Date: Tue, 15 Oct 2013 09:38:49 -0500 Subject: [PATCH 4/4] upgrading version of badge-bakery --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 602c9c77..ac77796c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "up-time": "~0.2.1", "optimist": "~0.3.0", "openbadges-validator": "0.0.21", - "openbadges-bakery": "0.2.6", + "openbadges-bakery": "0.2.7", "newrelic": "~0.10.3", "async": "~0.2.6", "messina": "~0.1.0",