Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Update dependencies and related code changes (#227)
Browse files Browse the repository at this point in the history
Update bcrypt to 3.x.x (from 1.x.x)
Update boom to @hapi/boom (still 7.x.x)
Update confidence to 4.x.x (from 3.x.x)
Update dotenv to 8.x.x (from 5.x.x)
Update eslint-config-hapi to @hapi/eslint-config-hapi 12.x.x (from 11.x.x)
Update eslint-plugin-hapi to @hapi/eslint-plugin-hapi (still 4.x.x)
Update glue to @hapi/glue 6.x.x (from 5.x.x)
Update good to @hapi/good (still 8.x.x)
Update good-console to @hapi/good-console 8.x.x (from 7.x.x)
Update good-squeeze to @hapi/good-squeeze (still 5.x.x)
Update hapi to @hapi/hapi 18.x.x (from 17.x.x)
Update hapi-auth-basic to @hapi/basic (still 5.x.x)
Update hapi-mongo-models to 8.x.x (from 7.x.x)
Update hapi-swagger 10.x.x (from 9.x.x)
Update hoek to @hapi/hoek 7.x.x (from 5.x.x)
Update inert to @hapi/inert 7.x.x (from 5.x.x)
Update joi to @hapi/joi 15.x.x (from 13.x.x)
Update mongo-models to 3.x.x (from 2.x.x)
Update nodemailer to 6.x.x (from 4.x.x)
Update slug to 1.x.x (from 0.9.x)
Update vision to @hapi/vision (still 5.x.x)
Update code to @hapi/code (still 5.x.x)
Update lab to @hapi/lab 19.x.x (from 15.x.x)

Update code's use of @hapi/basic as a result of changes to the module.
- Register the module explicitly in auth.js register() function.
- Add strategy property to auth JSON object
- Wrap roles, session and user properties of the request auth object
within an object named credentials.
- Use real domain for test email addresses (underlying code validates the domain)

Change "new Buffer(string)" to "Buffer.from(string)"

Change Swagger option sortTags to 'alpha'

Fix eslint warnings
- Line spacing

Allow default configuration, setup script and test suite pickup MongoDB URI
from the environment.
  • Loading branch information
BlairCooper authored and jedireza committed Jun 19, 2019
1 parent b59761b commit 4c75947
Show file tree
Hide file tree
Showing 58 changed files with 2,874 additions and 3,288 deletions.
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

const Confidence = require('confidence');
const Dotenv = require('dotenv');

Expand Down Expand Up @@ -31,7 +32,7 @@ const config = {
uri: {
$filter: 'env',
production: process.env.MONGODB_URI,
$default: 'mongodb://localhost:27017/'
$default: process.env.MONGODB_URI || 'mongodb://localhost:27017/'
},
db: {
$filter: 'env',
Expand Down
3 changes: 2 additions & 1 deletion first-time-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

const Account = require('./server/models/account');
const Admin = require('./server/models/admin');
const AdminGroup = require('./server/models/admin-group');
Expand All @@ -17,7 +18,7 @@ const main = async function () {
// get mongodb connection info

options = {
default: 'mongodb://localhost:27017/'
default: process.env.MONGODB_URI || 'mongodb://localhost:27017/'
};
const mongodbUri = await Promptly.prompt(`MongoDB URI: (${options.default})`, options);

Expand Down
15 changes: 8 additions & 7 deletions manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

const Confidence = require('confidence');
const Config = require('./config');
const Package = require('./package.json');
Expand All @@ -24,12 +25,12 @@ const manifest = {
register: {
plugins: [
{
plugin: 'good',
plugin: '@hapi/good',
options: {
reporters: {
myConsoleReporter: [
{
module: 'good-squeeze',
module: '@hapi/good-squeeze',
name: 'Squeeze',
args: [{
error: '*',
Expand All @@ -39,7 +40,7 @@ const manifest = {
}]
},
{
module: 'good-console',
module: '@hapi/good-console',
args: [{
color: {
$filter: 'env',
Expand All @@ -54,16 +55,16 @@ const manifest = {
}
},
{
plugin: 'hapi-auth-basic'
plugin: '@hapi/basic'
},
{
plugin: 'hapi-remote-address'
},
{
plugin: 'inert'
plugin: '@hapi/inert'
},
{
plugin: 'vision'
plugin: '@hapi/vision'
},
{
plugin:'hapi-swagger',
Expand Down Expand Up @@ -97,7 +98,7 @@ More details on [Users, Roles & Groups](https://github.com/jedireza/frame/wiki/U
More details on [Admin & Admin Group Permissions](https://github.com/jedireza/frame/wiki/Admin-&-Admin-Group-Permissions)`
},
grouping: 'tags',
sortTags: 'name',
sortTags: 'alpha',
tags: [
{
name: 'accounts',
Expand Down
Loading

0 comments on commit 4c75947

Please sign in to comment.