From f99049d155677f087b90555a0066eded687db678 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:01:58 +0300 Subject: [PATCH 1/8] Revert "fix jsep import, add fillin for HTTPS server, remove debug flag" This reverts commit 78082f7152204158a1b7548bdb0dfb1ba49c097d. --- app/views/form.server.view.pug | 3 + app/views/index.server.view.pug | 2 +- app/views/redoc.server.view.pug | 1 + config/express.js | 11 +- gruntfile.js | 2 +- gruntfile.js.save | 354 -------------------------------- package-lock.json | 212 ++++++++++++++++++- package.json | 1 - server.js | 18 +- test.js | 11 - 10 files changed, 217 insertions(+), 398 deletions(-) delete mode 100755 gruntfile.js.save delete mode 100644 test.js diff --git a/app/views/form.server.view.pug b/app/views/form.server.view.pug index d1c26b02..9264b36a 100644 --- a/app/views/form.server.view.pug +++ b/app/views/form.server.view.pug @@ -95,9 +95,12 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') script(type='text/javascript'). socketUrl = "!{socketUrl}" +<<<<<<< HEAD //JSEP script(src='https://cdn.jsdelivr.net/npm/jsep@0.3.4/build/jsep.min.js', type='text/javascript') +======= +>>>>>>> parent of 78082f71... fix jsep import, add fillin for HTTPS server, remove debug flag script(src='/static/lib/jquery/dist/jquery.min.js', type='text/javascript') link(rel='stylesheet', href='/static/lib/font-awesome/css/font-awesome.min.css') link(rel='stylesheet', href='/static/lib/bootstrap/dist/css/bootstrap.min.css') diff --git a/app/views/index.server.view.pug b/app/views/index.server.view.pug index c26cdc99..10c29935 100644 --- a/app/views/index.server.view.pug +++ b/app/views/index.server.view.pug @@ -52,4 +52,4 @@ block content script(src='https://cdn.ravenjs.com/2.3.0/angular/raven.min.js') - script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install(); + script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install(); \ No newline at end of file diff --git a/app/views/redoc.server.view.pug b/app/views/redoc.server.view.pug index dde17ad1..c850dc96 100644 --- a/app/views/redoc.server.view.pug +++ b/app/views/redoc.server.view.pug @@ -32,6 +32,7 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') // Fav Icon link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon') link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900') + //Application CSS Files each cssFile in cssFiles link(rel='stylesheet', href='#{cssFile}') diff --git a/config/express.js b/config/express.js index 2aba4179..1b0bb1d9 100755 --- a/config/express.js +++ b/config/express.js @@ -48,18 +48,9 @@ function containsAnySupportedLanguages(preferredLanguages){ return null; } -var fs = require('fs') -var https = require('https') -var pkey = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/privkey.pem') -var cert = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/fullchain.pem') - module.exports = function(db) { - // Initialize express app var app = express(); - var serv = https.createServer({key: pkey, cert: cert}, app) - serv.listen(443) - app.get('/form', (q, s) => s.redirect('https://register.earlybird.camp/view/#!/forms/5acb2d8e541901c14fa0d907')) var url = require('url'); // Globbing model files @@ -369,5 +360,5 @@ module.exports = function(db) { app = configureSocketIO(app, db); // Return Express server instance - return app + return app; }; diff --git a/gruntfile.js b/gruntfile.js index eeb2c7ff..0b5539b9 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -138,7 +138,7 @@ module.exports = function(grunt) { dev: { script: 'server.js', options: { - //nodeArgs: ['--debug'], + nodeArgs: ['--debug'], ext: 'js,html', watch: watchFiles.serverViews.concat(watchFiles.serverJS) } diff --git a/gruntfile.js.save b/gruntfile.js.save deleted file mode 100755 index 79585c25..00000000 --- a/gruntfile.js.save +++ /dev/null @@ -1,354 +0,0 @@ -'use strict'; - -var bowerArray = ['public/lib/angular/angular.min.js', - 'public/lib/angular-scroll/angular-scroll.min.js', - 'public/lib/angular-ui-select/dist/select.min.js', - 'public/lib/v-button/dist/v-button.min.js', - 'public/lib/angular-resource/angular-resource.min.js', - 'public/lib/angular-ui-router/release/angular-ui-router.min.js', - 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', - 'public/lib/angular-translate/angular-translate.min.js', - 'public/lib/ng-file-upload/ng-file-upload-all.min.js', - 'public/lib/angular-ui-date/src/date.js', - 'public/lib/angular-input-stars/angular-input-stars.js', - 'public/lib/jsep/build/jsep.min.js', - 'public/lib/raven-js/dist/raven.min.js', - 'public/lib/lodash/lodash.min.js', - 'public/lib/mobile-detect/mobile-detect.js', - 'public/lib/js-yaml/dist/js-yaml.js', - 'public/lib/angular-sanitize/angular-sanitize.min.js']; - -module.exports = function(grunt) { - require('jit-grunt')(grunt); - - // Unified Watch Object - var watchFiles = { - serverViews: ['app/views/**/*.pug'], - serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'], - - clientViews: ['public/modules/**/*.html', 'public/form_modules/forms/base/**/*.html', '!public/modules/forms/base/**/*.html',], - clientJS: ['public/form_modules/**/*.js', 'public/modules/**/*.js'], - clientCSS: ['public/modules/**/*.css'], - - serverTests: ['app/tests/**/*.js'], - clientTests: ['public/modules/**/tests/*.js'] - }; - - watchFiles.allTests = watchFiles.serverTests.concat(watchFiles.clientTests); - - // Project Configuration - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - watch: { - serverViews: { - files: watchFiles.serverViews, - options: { - livereload: true, - spawn: false - } - }, - serverJS: { - files: watchFiles.serverJS, - tasks: ['newer:jshint'], - options: { - livereload: true, - spawn: false - } - }, - clientViews: { - files: watchFiles.clientViews, - tasks: ['html2js:main'], - options: { - livereload: true, - spawn: false - } - }, - clientJS: { - files: watchFiles.clientJS, - tasks: ['newer:jshint'], - options: { - livereload: true, - spawn: false - } - }, - clientCSS: { - files: watchFiles.clientCSS, - tasks: ['newer:csslint'], - options: { - livereload: true, - spawn: false - } - }, - mochaTests: { - files: watchFiles.serverTests, - tasks: ['test:server'] - } - }, - jshint: { - all: { - src: watchFiles.clientJS.concat(watchFiles.serverJS), - options: { - jshintrc: true - } - }, - allTests: { - src: watchFiles.allTests, - options: { - jshintrc: true - } - } - }, - csslint: { - options: { - csslintrc: '.csslintrc' - }, - all: { - src: watchFiles.clientCSS - } - }, - uglify: { - productionAdmin: { - options: { - compress: true, - mangled: true - }, - files: { - 'public/dist/application.min.js': 'public/dist/application.js', - 'public/dist/form-application.min.js': 'public/dist/form-application.js' - } - }, - productionForms: { - options: { - mangled: true, - compress: true - }, - files: { - 'public/dist/form-vendor.min.js': bowerArray - } - } - }, - cssmin: { - combine: { - files: { - 'public/dist/application.min.css': '<%= applicationCSSFiles %>' - } - } - }, - nodemon: { - dev: { - script: 'server.js', - options: { - - ext: 'js,html', - watch: watchFiles.serverViews.concat(watchFiles.serverJS) - } - } - }, - ngAnnotate: { - options:{ - add: true, - remove: true - }, - production: { - files: { - 'public/dist/application.js': '<%= applicationJavaScriptFiles %>', - 'public/dist/form-application.js': '<%= formApplicationJavaScriptFiles %>' - } - } - }, - concurrent: { - default: ['nodemon', 'watch'], - debug: ['nodemon', 'watch'], - options: { - logConcurrentOutput: true, - limit: 10 - } - }, - env: { - src: '.env', - - test: { - NODE_ENV: 'test', - }, - secure: { - NODE_ENV: 'secure', - }, - production: { - NODE_ENV: 'production', - }, - dev: { - NODE_ENV: 'development', - } - }, - mochaTest: { - src: watchFiles.serverTests, - options: { - reporter: 'spec', - quiet: false, - require: 'server.js', - ui: 'bdd', - debug: false - } - }, - karma: { - unit: { - configFile: 'karma.conf.js', - singleRun: true - }, - debug: { - configFile: 'karma.conf.js', - browserConsoleLogOptions: { - level: 'log', - terminal: true - }, - singleRun: true - } - }, - protractor: { - options: { - configFile: 'protractor.conf.js', - keepAlive: true, - noColor: false - }, - e2e: { - options: { - args: {} // Target-specific arguments - } - } - }, - mocha_istanbul: { - coverage: { - src: watchFiles.allTests, // a folder works nicely - options: { - mask: '*.test.js', - require: ['server.js'] - } - }, - coverageClient: { - src: watchFiles.clientTests, // specifying file patterns works as well - options: { - coverageFolder: 'coverageClient', - mask: '*.test.js', - require: ['server.js'] - } - }, - coverageServer: { - src: watchFiles.serverTests, - options: { - coverageFolder: 'coverageServer', - mask: '*.test.js', - require: ['server.js'] - } - }, - coveralls: { - src: watchFiles.allTests, // multiple folders also works - options: { - require: ['server.js'], - coverage: true, // this will make the grunt.event.on('coverage') event listener to be triggered - root: './lib', // define where the cover task should consider the root of libraries that are covered by tests - reportFormats: ['cobertura','lcovonly'] - } - } - }, - istanbul_check_coverage: { - default: { - options: { - coverageFolder: 'coverage*', // will check both coverage folders and merge the coverage results - check: { - lines: 80, - statements: 80 - } - } - } - }, - html2js: { - options: { - base: 'public', - watch: true, - singleModule: true, - useStrict: true, - htmlmin: { - collapseBooleanAttributes: true, - collapseWhitespace: true, - removeAttributeQuotes: true, - removeComments: true, - removeEmptyAttributes: true, - removeRedundantAttributes: true - } - }, - forms: { - options: { - module: 'TellForm-Form.form_templates' - }, - src: ['public/form_modules/**/views/**.html', 'public/form_modules/**/views/**/*.html'], - dest: 'public/dist/form_populate_template_cache.js' - }, - main: { - options: { - module: 'TellForm.templates' - }, - src: ['public/modules/**/views/**.html', 'public/modules/**/views/**/*.html', 'public/form_modules/forms/base/**/*.html', '!public/modules/forms/base/**/*.html'], - dest: 'public/dist/populate_template_cache.js' - } - }, - execute: { - target: { - src: ['./scripts/setup.js'] - } - }, - }); - - grunt.event.on('coverage', function(lcov, done){ - var coveralls = require('coveralls'); - coveralls.handleInput(lcov, function(err){ - if (err) { - grunt.log.error('Failed to submit lcov file to coveralls: ' + err); - return done(err); - } - grunt.verbose.ok('Successfully submitted lcov file to coveralls'); - done(); - }); - }); - - // Making grunt default to force in order not to break the project. - grunt.option('force', true); - - // A Task for loading the configuration object - grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() { - require('./config/init')(); - var config = require('./config/config'); - grunt.config.set('applicationJavaScriptFiles', config.assets.js); - grunt.config.set('formApplicationJavaScriptFiles', config.assets.form_js); - grunt.config.set('applicationCSSFiles', config.assets.css); - }); - - // Code coverage tasks. - grunt.registerTask('coveralls', ['env:test','mocha_istanbul:coveralls']); - grunt.registerTask('coverage', ['env:test', 'mocha_istanbul:coverage']); - grunt.registerTask('coverage:client', ['env:test', 'mocha_istanbul:coverageClient']); - grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']); - - // Default task(s). - grunt.registerTask('default', ['lint', 'loadConfig', 'ngAnnotate', 'uglify', 'html2js:main', 'html2js:forms', 'env', 'concurrent:default']); - grunt.registerTask('dev', ['lint', 'html2js:main', 'html2js:forms', 'env:dev', 'concurrent:default']); - - // Debug task. - grunt.registerTask('debug', ['lint', 'html2js:main', 'html2js:forms', 'concurrent:debug']); - - // Lint task(s). - grunt.registerTask('lint', ['jshint', 'csslint', 'i18nlint:client', 'i18nlint:server']); - grunt.registerTask('lint:tests', ['jshint:allTests']); - - // Build task(s). - grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'html2js:main', 'html2js:forms']); - - //Setup task(s). - grunt.registerTask('setup', ['execute']); - - // Test task(s). - grunt.registerTask('test', ['lint:tests', 'test:server', 'test:client']); - grunt.registerTask('test:server', ['lint:tests', 'env:test', 'mochaTest']); - grunt.registerTask('test:client', ['lint:tests', 'html2js:main', 'html2js:forms', 'env:test', 'karma:unit']); - - grunt.registerTask('testdebug', ['env:test', 'karma:debug']); -}; diff --git a/package-lock.json b/package-lock.json index da5ada29..fcb91c18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -505,6 +505,11 @@ "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" }, + "bluebird": { + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", + "integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs=" + }, "body-parser": { "version": "1.14.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.14.2.tgz", @@ -3861,6 +3866,75 @@ "integrity": "sha1-24qsR/+Ap9+CtMgsEm/olwhwYm8=", "dev": true }, + "email-verification": { + "version": "github:tellform/node-email-verification#8b179f34e0943c389b2058c9ec1e6d2135a72857", + "requires": { + "mongoose": "3.8.40", + "nodemailer": "4.0.1", + "rand-token": "0.2.1" + }, + "dependencies": { + "bson": { + "version": "0.2.22", + "resolved": "https://registry.npmjs.org/bson/-/bson-0.2.22.tgz", + "integrity": "sha1-/NoQPybQwHTVpS1Qkn24D9ArSzk=", + "requires": { + "nan": "1.8.4" + } + }, + "mongodb": { + "version": "1.4.38", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-1.4.38.tgz", + "integrity": "sha1-jP/WGBAK86RkiplUmL/Py07Yq9I=", + "requires": { + "bson": "0.2.22", + "kerberos": "0.0.11", + "readable-stream": "2.3.3" + } + }, + "mongoose": { + "version": "3.8.40", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-3.8.40.tgz", + "integrity": "sha1-Ay9bpVWCSXVZqHwfP0s5WcJkBqc=", + "requires": { + "hooks": "0.2.1", + "mongodb": "1.4.38", + "mpath": "0.1.1", + "mpromise": "0.4.3", + "mquery": "1.10.0", + "ms": "0.1.0", + "muri": "1.1.0", + "regexp-clone": "0.0.1", + "sliced": "0.0.5" + } + }, + "ms": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.1.0.tgz", + "integrity": "sha1-8h+sSQ2vHXZn/RgP6QdzicyUQrI=" + }, + "nan": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/nan/-/nan-1.8.4.tgz", + "integrity": "sha1-PHa1OC6rM+RLdY0oE8qdkuk0LzQ=" + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + } + } + }, "encodeurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", @@ -6187,6 +6261,14 @@ "jade": "1.11.0" } }, + "grunt-i18nlint": { + "version": "github:jwarby/grunt-i18nlint#6b398f775c8ca881a16f45a3cb94c5b79ee11e20", + "dev": true, + "requires": { + "chalk": "1.1.3", + "i18n-lint": "git://github.com/jwarby/i18n-lint.git#0a06373c0d880047ad680239c103d60ed414efc1" + } + }, "grunt-karma": { "version": "0.12.2", "resolved": "https://registry.npmjs.org/grunt-karma/-/grunt-karma-0.12.2.tgz", @@ -6613,6 +6695,11 @@ "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" }, + "hooks": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/hooks/-/hooks-0.2.1.tgz", + "integrity": "sha1-D1kbGzRL3LPfWXc/Yvu6+Fv0Aos=" + }, "hooks-fixed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-1.1.0.tgz", @@ -6767,11 +6854,6 @@ "sshpk": "1.13.1" } }, - "https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", - "integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=" - }, "https-proxy-agent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", @@ -6807,6 +6889,48 @@ "sprintf-js": "1.1.1" } }, + "i18n-lint": { + "version": "git://github.com/jwarby/i18n-lint.git#0a06373c0d880047ad680239c103d60ed414efc1", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.8.1", + "glob": "5.0.15", + "htmlparser2": "3.8.3", + "lodash": "3.10.1", + "node.extend": "1.1.6" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, "iconv-lite": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", @@ -6991,6 +7115,12 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.5.tgz", "integrity": "sha1-X6eM8wG4JceKvDBC2BJyMEnqI8c=" }, + "is": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", + "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7805,6 +7935,23 @@ "phantomjs-prebuilt": "2.1.15" } }, + "kerberos": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/kerberos/-/kerberos-0.0.11.tgz", + "integrity": "sha1-yymJHCHCKsGV8xQLl90SIE/qfcI=", + "optional": true, + "requires": { + "nan": "1.8.4" + }, + "dependencies": { + "nan": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/nan/-/nan-1.8.4.tgz", + "integrity": "sha1-PHa1OC6rM+RLdY0oE8qdkuk0LzQ=", + "optional": true + } + } + }, "kew": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", @@ -8875,6 +9022,42 @@ "resolved": "https://registry.npmjs.org/mout/-/mout-1.1.0.tgz", "integrity": "sha512-XsP0vf4As6BfqglxZqbqQ8SR6KQot2AgxvR0gG+WtUkf90vUXchMOZQtPf/Hml1rEffJupqL/tIrU6EYhsUQjw==" }, + "mpath": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.1.1.tgz", + "integrity": "sha1-I9qFK3wjLuCX9HWdKcDunNItXkY=" + }, + "mpromise": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.4.3.tgz", + "integrity": "sha1-7cR6daKhd7DpOCc121Lb7DgIzDM=" + }, + "mquery": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-1.10.0.tgz", + "integrity": "sha1-hgPwKwtSTResBTmoWZYSTuF7fLM=", + "requires": { + "bluebird": "2.10.2", + "debug": "2.2.0", + "regexp-clone": "0.0.1", + "sliced": "0.0.5" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + } + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -9047,6 +9230,15 @@ "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.0.0.tgz", "integrity": "sha1-ICtIAhoMTL3i34DeFaF0Q8i0OYA=" }, + "node.extend": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", + "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", + "dev": true, + "requires": { + "is": "3.2.1" + } + }, "nodemailer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.0.1.tgz", @@ -10557,6 +10749,11 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" }, + "rand-token": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/rand-token/-/rand-token-0.2.1.tgz", + "integrity": "sha1-3GfIEjMGyRInstw/W+pz0wE3YiY=" + }, "random-js": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/random-js/-/random-js-1.0.8.tgz", @@ -11173,6 +11370,11 @@ "resolved": "https://registry.npmjs.org/simple-is/-/simple-is-0.2.0.tgz", "integrity": "sha1-Krt1qt453rXMgVzhDmGRFkhQuvA=" }, + "sliced": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", + "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" + }, "smart-buffer": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz", diff --git a/package.json b/package.json index 9b3b4e17..63c6aa5a 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "grunt-html2js": "~0.3.5", "grunt-ng-annotate": "~1.0.1", "helmet": "3.5.0", - "https": "^1.0.0", "i18n": "^0.8.3", "jit-grunt": "^0.9.1", "lodash": "^4.17.4", diff --git a/server.js b/server.js index d2b091ad..78aeefa6 100755 --- a/server.js +++ b/server.js @@ -1,10 +1,7 @@ - 'use strict'; /** * Module dependencies. */ -var fs = require('fs') -var https = require('https') require('dotenv').config({path: './.env'}); @@ -12,9 +9,6 @@ if(!process.env.NODE_ENV){ process.env.NODE_ENV = 'development'; } -var pkey = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/privkey.pem') -var cert = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/fullchain.pem') - require('events').EventEmitter.prototype._maxListeners = 0; @@ -41,7 +35,7 @@ mongoose.connection.on('error', function (err) { }); const smtpTransport = nodemailer.createTransport(config.mailer.options); -console.log("GOT PAST MONGOOSE") + // verify connection configuration on startup smtpTransport.verify(function(error, success) { if (error) { @@ -67,16 +61,10 @@ if (process.env.CREATE_ADMIN_ACCOUNT === 'TRUE') { // Bootstrap passport config require('./config/passport')(); -console.log("Got past passport!") + // Start the app by listening on -app.listen(80, () => console.log("Listening")); -console.log("Got past Listen1") +app.listen(config.port); -//https.createServer({key: pkey, cert: cert}, app).listen(config.port, () => { -// console.log('Listening on 443') -//}) - -console.log("GOT PAST LISTEN"); // Expose app exports = module.exports = app; diff --git a/test.js b/test.js deleted file mode 100644 index 10251638..00000000 --- a/test.js +++ /dev/null @@ -1,11 +0,0 @@ -var fs = require('fs') -var pkey = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/privkey.pem') -var cert = fs.readFileSync('/etc/letsencrypt/live/register.earlybird.camp/fullchain.pem') - -var express = require('express') -var app = express() -app.get('/', (q, s) => s.send('hello')) -app.listen(80) - -var https = require('https') -https.createServer({key: pkey, cert: cert}, app).listen(443) From eaab2ff3396bc0e584777d82a640a837f4e6c718 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:03:15 +0300 Subject: [PATCH 2/8] Revert "disable signups" This reverts commit ca875ed01d57c69c0001719bda5375f94db4c46e. --- config/express.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/express.js b/config/express.js index 1b0bb1d9..902beb6f 100755 --- a/config/express.js +++ b/config/express.js @@ -61,7 +61,7 @@ module.exports = function(db) { // Setting application local variables app.locals.google_analytics_id = config.app.google_analytics_id; app.locals.title = config.app.title; - app.locals.signupDisabled = true; //config.signupDisabled; + app.locals.signupDisabled = config.signupDisabled; app.locals.description = config.app.description; app.locals.keywords = config.app.keywords; @@ -108,10 +108,6 @@ module.exports = function(db) { return next(); } - if (urlPath.indexOf('signup') > -1) { - res.send(400); return; - } - if (urlPath.indexOf('users') > -1 && urlPath.indexOf('me') > -1) { return next(); } From 808439cf47048c52f963d679ab3edbe588048c97 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:03:36 +0300 Subject: [PATCH 3/8] Revert "Merge branch 'master' into server" This reverts commit 83ca05e64ba6bb7ce8383d5e385e6b141dfd64ed, reversing changes made to 78082f7152204158a1b7548bdb0dfb1ba49c097d. --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c5d55907..0791ee52 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ -TellForm 2.1.EB +TellForm 2.1.0 ======== -## EarlyBird version +[![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/Lobby.svg)](https://gitter.im/tellform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -We've made some changes and will continue to be changing this particular fork of TellForm to comply with our guidelines. +> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires. +<<<<<<< HEAD Below you will find a changelog. ## Changelog @@ -21,6 +25,9 @@ Below you will find a changelog. ======== ======== ======== +======= +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/tellform/tellform/tree/master) +>>>>>>> parent of 623cb865... fix readme ## Table of Contents From 985c3c1aae1551279b466472fa636d510e8c4eca Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:04:16 +0300 Subject: [PATCH 4/8] revert custom Earlybird changes to form --- app/views/form.server.view.pug | 3 +++ app/views/verification.email.view.pug | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/form.server.view.pug b/app/views/form.server.view.pug index 9264b36a..f27809f9 100644 --- a/app/views/form.server.view.pug +++ b/app/views/form.server.view.pug @@ -37,6 +37,7 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249); background-size: 50px 50px; } +<<<<<<< HEAD body { font-family: 'Raleway' !important; } @@ -71,6 +72,8 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') background-color: #755 !important; } +======= +>>>>>>> parent of 45f8fe7a... fix form styling // Fav Icon link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon') diff --git a/app/views/verification.email.view.pug b/app/views/verification.email.view.pug index 2810481d..fb225507 100644 --- a/app/views/verification.email.view.pug +++ b/app/views/verification.email.view.pug @@ -30,7 +30,7 @@ html p a(href='http://${URL}')=__('VERIFICATION_EMAIL_LINK_TEXT') p=__('VERIFICATION_EMAIL_PARAGRAPH_2') - a(href='mailto:hello@earlybird.camp') + a(href='mailto:team@tellform.com') | team@tellform.com p=__('EMAIL_SIGNATURE') td(width='36') From 65fd117b04e440822017927e748c19a5a46b67fe Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:05:05 +0300 Subject: [PATCH 5/8] revert changelog --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 0791ee52..ccc824c1 100755 --- a/README.md +++ b/README.md @@ -15,8 +15,11 @@ Below you will find a changelog. (newest to oldest) +<<<<<<< HEAD - fix responsiveness and mobile design - fix form styling so it isn't terrible (use Raleway, change bg color) +======= +>>>>>>> parent of 7afc7eef... update changelog - disable signups (turn on disable flag, hardcode in automatic 400 if the URL contains `signup`) - build in HTTPS support in `config/express.js` - fix JSEP import so form appears From 0f2cf42cebe839f10ce9f836498af771bd763353 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:05:40 +0300 Subject: [PATCH 6/8] revert changelog --- README.md | 3 +++ app/views/form.server.view.pug | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ccc824c1..b269cf7a 100755 --- a/README.md +++ b/README.md @@ -15,8 +15,11 @@ Below you will find a changelog. (newest to oldest) +<<<<<<< HEAD <<<<<<< HEAD - fix responsiveness and mobile design +======= +>>>>>>> parent of 2835280f... fix mobile responsiveness - fix form styling so it isn't terrible (use Raleway, change bg color) ======= >>>>>>> parent of 7afc7eef... update changelog diff --git a/app/views/form.server.view.pug b/app/views/form.server.view.pug index f27809f9..d74a3897 100644 --- a/app/views/form.server.view.pug +++ b/app/views/form.server.view.pug @@ -43,15 +43,12 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') } label.btn-default { font-size: 14pt !important; - width: 6em !important; + width: 10% !important; padding-right: 30px; background: none !important; color: rgba(0,0,0,0.3) !important; border-color: rgba(0,0,0,0.3) !important; } - .field-directive { - margin-right: 10px !important; margin-left: 10px !important; - } label.btn-default:hover, label.btn-default:visited, label.btn-default:active { color: #000 !important; background: none !important; From 9715088e86ddcc4de06cd71edf82ba1c36c9eec9 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:05:46 +0300 Subject: [PATCH 7/8] Revert "fix styling on form" This reverts commit 9a9c1ae02ec7176c8a38f0556f2f92732d43b077. --- app/views/form.server.view.pug | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/views/form.server.view.pug b/app/views/form.server.view.pug index d74a3897..47d0bd88 100644 --- a/app/views/form.server.view.pug +++ b/app/views/form.server.view.pug @@ -3,8 +3,6 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') head title=title // General META - link(rel='stylesheet', type='text/css', href='https://fonts.googleapis.com/css?family=Raleway') - meta(charset='utf-8') meta(http-equiv='Content-type', content='text/html;charset=UTF-8') meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') @@ -59,15 +57,6 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') #submit_field { height: auto !important; padding-bottom: 2% !important; } - #submit_field > div.text-left { - background-color: #f8f8f8 !important; - color: #755 !important; - margin-top: 12px; - text-align: center !important; - } - #submit_field > button { - background-color: #755 !important; - } ======= >>>>>>> parent of 45f8fe7a... fix form styling From 01ac456f62f4d449ac64e837124dcae0021932f2 Mon Sep 17 00:00:00 2001 From: Priansh Shah Date: Tue, 24 Apr 2018 23:15:52 +0300 Subject: [PATCH 8/8] fix merge --- README.md | 25 ------------------------- app/views/form.server.view.pug | 28 ---------------------------- 2 files changed, 53 deletions(-) diff --git a/README.md b/README.md index b269cf7a..afa7cd57 100755 --- a/README.md +++ b/README.md @@ -8,32 +8,7 @@ TellForm 2.1.0 > An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires. -<<<<<<< HEAD -Below you will find a changelog. - -## Changelog - -(newest to oldest) - -<<<<<<< HEAD -<<<<<<< HEAD -- fix responsiveness and mobile design -======= ->>>>>>> parent of 2835280f... fix mobile responsiveness -- fix form styling so it isn't terrible (use Raleway, change bg color) -======= ->>>>>>> parent of 7afc7eef... update changelog -- disable signups (turn on disable flag, hardcode in automatic 400 if the URL contains `signup`) -- build in HTTPS support in `config/express.js` -- fix JSEP import so form appears - - -======== -======== -======== -======= [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/tellform/tellform/tree/master) ->>>>>>> parent of 623cb865... fix readme ## Table of Contents diff --git a/app/views/form.server.view.pug b/app/views/form.server.view.pug index 47d0bd88..61bfffe8 100644 --- a/app/views/form.server.view.pug +++ b/app/views/form.server.view.pug @@ -35,31 +35,6 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249); background-size: 50px 50px; } -<<<<<<< HEAD - body { - font-family: 'Raleway' !important; - } - label.btn-default { - font-size: 14pt !important; - width: 10% !important; - padding-right: 30px; - background: none !important; - color: rgba(0,0,0,0.3) !important; - border-color: rgba(0,0,0,0.3) !important; - } - label.btn-default:hover, label.btn-default:visited, label.btn-default:active { - color: #000 !important; - background: none !important; - border-color: #000 !important; - font-weight: 400 !important; - } - .navbar { display: none !important; } - #submit_field { - height: auto !important; padding-bottom: 2% !important; - } - -======= ->>>>>>> parent of 45f8fe7a... fix form styling // Fav Icon link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon') @@ -84,12 +59,9 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml') script(type='text/javascript'). socketUrl = "!{socketUrl}" -<<<<<<< HEAD //JSEP script(src='https://cdn.jsdelivr.net/npm/jsep@0.3.4/build/jsep.min.js', type='text/javascript') -======= ->>>>>>> parent of 78082f71... fix jsep import, add fillin for HTTPS server, remove debug flag script(src='/static/lib/jquery/dist/jquery.min.js', type='text/javascript') link(rel='stylesheet', href='/static/lib/font-awesome/css/font-awesome.min.css') link(rel='stylesheet', href='/static/lib/bootstrap/dist/css/bootstrap.min.css')