diff --git a/.gitignore b/.gitignore index 32e21df3..01fc19d8 100755 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,10 @@ dist .vagrant npm-debug.* -docs/Oscar_Credentials.md scripts/test_oscarhost.js -scripts/oscarhost/private/ coverage/ e2e_coverage/ -uploads/ app/e2e_tests/screeshots/* -tmp # iOS / Apple # =========== @@ -25,6 +21,7 @@ Oscar_Credentials.* npm-debug.log node_modules/ public/lib/ +public/dist app/tests/coverage/ .bower-*/ .idea/ diff --git a/README.md b/README.md index ce50b078..4f5a35ce 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ TellForm 2.1.0 [![Build Status](https://travis-ci.org/tellform/tellform.svg?branch=master)](https://travis-ci.org/tellform/tellform) ![Project Status](https://img.shields.io/badge/status-2.1.0-green.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=tellform/tellform&utm_campaign=Badge_Grade) -[![Gitter](https://badges.gitter.im/tellform/tellform.svg)](https://gitter.im/tellform/tellform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Gitter](https://badges.gitter.im/tellform/Lobby.svg)](https://gitter.im/tellform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) > An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires. @@ -119,14 +119,7 @@ Your application should run on port 3000 or the port you specified in your .env To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). -Then run these commands - -``` -$ docker run -p 27017:27017 -d --name some-mongo mongo -$ docker run -p 127.0.0.1:6379:6379 -d --name some-redis redis -$ docker run --rm -p 3000:3000 --link some-redis:redis-db --link some-mongo:db -e "SUBDOMAINS_DISABLED=TRUE" -e "DISABLE_CLUSTER_MODE=TRUE" -e "MAILER_EMAIL_ID=" -e "MAILER_FROM=" -e "MAILER_SERVICE_PROVIDER=" -e "MAILER_PASSWORD=" -e "BASE_URL=localhost" -p 80:80 tellform/development -``` - +Then see this page [here](https://tellform.com/install_docker) for commands on how to deploy your own local TellForm instance. ## Testing Your Application You can run the full test suite included with TellForm with the test task: @@ -201,7 +194,7 @@ TellForm's configuration is done with environment variables. To set an option fo ## Where to get help -[Gitter Chat](https://gitter.im/tellform/tellform) +[Gitter Chat](https://gitter.im/tellform/Lobby) [Official Twitter](https://twitter.com/tellform_real) diff --git a/app.json b/app.json index e76cd024..36ae03d7 100644 --- a/app.json +++ b/app.json @@ -28,5 +28,10 @@ "description": "Which mail service/API you will be using (i.e. SparkPost, Mandrill, etc)", "value": "SendGrid" } - } + }, + "buildpacks": [ + { + "url": "https://github.com/heroku/heroku-buildpack-nodejs#v111" + } + ] } diff --git a/app/models/user.server.model.js b/app/models/user.server.model.js index 51fa3341..fd80602d 100755 --- a/app/models/user.server.model.js +++ b/app/models/user.server.model.js @@ -10,20 +10,8 @@ var mongoose = require('mongoose'), timeStampPlugin = require('../libs/timestamp.server.plugin'), path = require('path'), querystring = require('querystring'), - nodemailer = require('nodemailer'), constants = require('../libs/constants'); -var smtpTransport = nodemailer.createTransport(config.mailer.options); - -// verify connection configuration on startup -smtpTransport.verify(function(error, success) { - if (error) { - console.log('Your mail configuration is incorrect', error); - } else { - console.log('Mail server is ready to take our messages'); - } -}); - /** * User Schema */ diff --git a/app/views/layout.server.view.pug b/app/views/layout.server.view.pug index 7509f3a2..8f870023 100644 --- a/app/views/layout.server.view.pug +++ b/app/views/layout.server.view.pug @@ -51,7 +51,7 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') block content - script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','{{google_analytics_id}}','auto');ga('send','pageview') + script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','#{google_analytics_id}','auto');ga('send','pageview') script(src='https://www.google-analytics.com/analytics.js', async='', defer='') diff --git a/config/env/production.js b/config/env/production.js index 6519fd73..0f8a72a5 100755 --- a/config/env/production.js +++ b/config/env/production.js @@ -28,9 +28,8 @@ module.exports = { domain: process.env.BASE_URL || '.tellform.com' }, assets: { - bower_js: 'public/dist/vendor.min.js', - css: 'public/dist/application.min.css', - js: 'public/dist/application.min.js', - form_js: 'public/dist/form-application.min.js' + css: ['public/dist/application.min.css'], + js: ['public/dist/application.min.js', 'public/dist/populate_template_cache.js'], + form_js: ['public/dist/form-application.min.js', 'public/dist/form_populate_template_cache.js', 'public/dist/form-vendor.min.js'] } }; diff --git a/gruntfile.js b/gruntfile.js index ad0e35b8..13214b16 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -123,7 +123,7 @@ module.exports = function(grunt) { compress: true }, files: { - 'public/dist/vendor.min.js': bowerArray + 'public/dist/form-vendor.min.js': bowerArray } } }, diff --git a/package-lock.json b/package-lock.json index b3ee6f49..6538e5b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3124,13 +3124,10 @@ } }, "connect-mongo": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/connect-mongo/-/connect-mongo-0.8.2.tgz", - "integrity": "sha1-ySh47sDFpaZiW3mgwhTzf4YfxuA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/connect-mongo/-/connect-mongo-2.0.0.tgz", + "integrity": "sha512-2Nj5d4XO55AXSy1GOXDZteSEEUObGm/kvJaXyEQCa8cCHsCiZH+V/+sjk3b+khc4V8oyVi34rCtUxor4TfETLA==", "requires": { - "debug": "3.1.0", - "depd": "1.1.1", - "lodash": "4.17.4", "mongodb": "2.0.55" } }, @@ -4060,6 +4057,36 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" }, + "envfile": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/envfile/-/envfile-2.1.1.tgz", + "integrity": "sha1-jlrmacHyRZ5YkJWdn4obHAXmj50=", + "requires": { + "ambi": "2.5.0", + "eachr": "3.2.0", + "editions": "1.3.3", + "typechecker": "4.4.1" + }, + "dependencies": { + "eachr": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eachr/-/eachr-3.2.0.tgz", + "integrity": "sha1-LDXkPqCGUW95l8+At6pk1VpKRIQ=", + "requires": { + "editions": "1.3.3", + "typechecker": "4.4.1" + } + }, + "typechecker": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.4.1.tgz", + "integrity": "sha1-+XuV9RsDhBchLWd9RaNz7nvO1+Y=", + "requires": { + "editions": "1.3.3" + } + } + } + }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", diff --git a/package.json b/package.json index 06d3ff03..8e83b6eb 100644 --- a/package.json +++ b/package.json @@ -32,12 +32,13 @@ "chalk": "^1.1.3", "compression": "~1.6.0", "connect": "^3.4.1", - "connect-mongo": "~0.8.2", + "connect-mongo": "^2.0.0", "consolidate": "~0.14.5", "cookie-parser": "~1.4.0", "deep-diff": "^0.3.4", "dotenv": "^2.0.0", "email-verification": "github:tellform/node-email-verification", + "envfile": "^2.1.1", "express": "~4.13.3", "express-session": "~1.12.1", "glob": "^7.0.3", diff --git a/public/modules/core/config/core.client.routes.js b/public/modules/core/config/core.client.routes.js index a7487c56..01930695 100755 --- a/public/modules/core/config/core.client.routes.js +++ b/public/modules/core/config/core.client.routes.js @@ -2,7 +2,7 @@ // Setting up route angular.module('core').config(['$stateProvider', '$urlRouterProvider', - function($stateProvider, $urlRouterProvider, Authorization) { + function($stateProvider, $urlRouterProvider) { // Redirect to home view when route not found $urlRouterProvider.otherwise('/forms'); } @@ -20,14 +20,9 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope' state: fromState, params: fromParams } - -<<<<<<< HEAD - var statesToIgnore = ['home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; -======= var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; ->>>>>>> 2.20 //Redirect to listForms if user is authenticated if(statesToIgnore.indexOf(toState.name) > 0){ if(Auth.isAuthenticated()){ diff --git a/public/modules/forms/admin/services/form-fields.client.service.js b/public/modules/forms/admin/services/form-fields.client.service.js index be6ff3c9..302603ae 100644 --- a/public/modules/forms/admin/services/form-fields.client.service.js +++ b/public/modules/forms/admin/services/form-fields.client.service.js @@ -1,18 +1,11 @@ 'use strict'; //TODO: DAVID: URGENT: Make this a $resource that fetches valid field types from server -<<<<<<< HEAD -angular.module('forms').service('FormFields', [ '$rootScope', '$translate', '$window', - function($rootScope, $translate, $window) { - console.log($window.user); - $translate.use($window.user.language); -======= angular.module('forms').service('FormFields', [ '$rootScope', '$translate', 'Auth', function($rootScope, $translate, Auth) { var language = Auth.ensureHasCurrentUser().language; $translate.use(language); ->>>>>>> 2.20 this.types = [ { diff --git a/public/modules/forms/forms.client.module.js b/public/modules/forms/forms.client.module.js index 1c7fb122..d291bd6c 100644 --- a/public/modules/forms/forms.client.module.js +++ b/public/modules/forms/forms.client.module.js @@ -3,10 +3,6 @@ // Use Application configuration module to register a new module ApplicationConfiguration.registerModule('forms', [ 'ngFileUpload', 'ui.date', 'ui.sortable', -<<<<<<< HEAD 'angular-input-stars', 'users', 'ngclipboard', 'textAngular', 'frapontillo.bootstrap-switch' -======= - 'angular-input-stars', 'users', 'ngclipboard' ->>>>>>> 2.20 ]);//, 'colorpicker.module' @TODO reactivate this module diff --git a/scripts/setup.js b/scripts/setup.js index 551dc026..d8e5350c 100644 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -5,7 +5,7 @@ */ process.env.NODE_ENV = 'production'; -var config = require('../config/config'), +var config = require('../config/config'), mongoose = require('mongoose'), inquirer = require('inquirer'), envfile = require('envfile'), diff --git a/server.js b/server.js index afc2cf73..725a6842 100755 --- a/server.js +++ b/server.js @@ -17,7 +17,8 @@ require('events').EventEmitter.prototype._maxListeners = 0; var config = require('./config/config'), mongoose = require('mongoose'), - chalk = require('chalk'); + chalk = require('chalk'), + nodemailer = require('nodemailer'); /** * Main application entry file. @@ -36,6 +37,16 @@ mongoose.connection.on('error', function (err) { process.exit(-1); }); +const smtpTransport = nodemailer.createTransport(config.mailer.options); + +// verify connection configuration on startup +smtpTransport.verify(function(error, success) { + if (error) { + console.error(chalk.red('Your mail configuration is incorrect: ' + error)); + process.exit(-1); + } +}); + // Init the express application var app = require('./config/express')(db);