Skip to content

Commit

Permalink
Merge pull request #67 from ClickPop/release/1.0.0-alpha.5
Browse files Browse the repository at this point in the history
release/1.0.0 alpha.5
  • Loading branch information
seanmetzgar authored Nov 24, 2020
2 parents 681f041 + 280d77a commit af903f5
Show file tree
Hide file tree
Showing 14 changed files with 481 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- checkout
- run:
name: Update NPM
command: "sudo npm install -g npm"
command: 'sudo npm install -g npm'
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
Expand Down Expand Up @@ -69,14 +69,14 @@ jobs:
at: ~/backtalk-api
- add_ssh_keys
- run:
name: "Add keys to known_hosts"
name: 'Add keys to known_hosts'
command: ssh-keyscan -H api.backtalk.io >> ~/.ssh/known_hosts
- run:
name: "Install rsync"
name: 'Install rsync'
command: sudo apt-get update && sudo apt-get install rsync
- run:
name: "Execute transfer script to setup .env and transfer files via rsync"
name: 'Execute transfer script to setup .env and transfer files via rsync'
command: sudo chmod +x ./scripts/transfer.sh && ./scripts/transfer.sh
- run:
name: "Execute deployment script on remote machine"
name: 'Execute deployment script on remote machine'
command: sudo chmod +x ./scripts/deploy.sh && ./scripts/deploy.sh
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@ services:
- COOKIE_SECRET=${COOKIE_SECRET}
- ACCESS_TOKEN_EXPIRATION=${ACCESS_TOKEN_EXPIRATION}
- REFRESH_TOKEN_EXPIRATION=${REFRESH_TOKEN_EXPIRATION}
command: ${NODE_COMMAND}
- PASSWORD_RESET_EXPIRY=${PASSWORD_RESET_EXPIRY}
- MAIL_HOST=${MAIL_HOST}
- MAIL_USER=${MAIL_USER}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- RESET_EMAIL_URL=${RESET_EMAIL_URL}
command: ${NODE_COMMAND}
30 changes: 30 additions & 0 deletions migrations/20201123221619-user-password-reset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
/**
* Add altering commands here.
*
* Example:
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/

await queryInterface.addColumn('Users', 'passwordResetToken', {
type: Sequelize.DataTypes.STRING,
});
await queryInterface.addColumn('Users', 'passwordResetExpiry', {
type: Sequelize.DataTypes.DATE,
});
},

down: async (queryInterface) => {
/**
* Add reverting commands here.
*
* Example:
* await queryInterface.dropTable('users');
*/
await queryInterface.removeColumn('Users', 'passwordResetToken');
await queryInterface.removeColumn('Users', 'passwordResetExpiry');
},
};
4 changes: 4 additions & 0 deletions models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = (sequelize, DataTypes) => {
email: DataTypes.STRING,
password: DataTypes.STRING,
name: DataTypes.STRING,
passwordResetToken: DataTypes.STRING,
passwordResetExpiry: DataTypes.DATE,
},
{
sequelize,
Expand All @@ -19,6 +21,8 @@ module.exports = (sequelize, DataTypes) => {
User.hasMany(models.Survey);
};

// I don't think this works how we are expecting it to.
// See https://sequelizedocs.fullstackacademy.com/instance-and-class-methods/
User.toJSON = function () {
// hide protected fields
let attributes = Object.assign({}, this.get());
Expand Down
62 changes: 59 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backtalk-api",
"version": "1.0.0-alpha.3",
"version": "1.0.0-alpha.5",
"description": "API Service for backtalk.io",
"main": "./server/server.js",
"scripts": {
Expand Down Expand Up @@ -64,10 +64,12 @@
"supertest": "^4.0.2"
},
"dependencies": {
"@sendgrid/mail": "^7.4.0",
"bcryptjs": "^2.4.3",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"cross-env": "^7.0.2",
"date-fns": "^2.16.1",
"device-detector-js": "^2.2.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
Expand Down
Loading

0 comments on commit af903f5

Please sign in to comment.