Compare commits

...

183 commits

Author SHA1 Message Date
Leopere d5c94ce67f
Update README.md 2019-08-22 01:06:07 -04:00
Leopere 6e32ace806
Commented out new sponsor links. 2019-08-22 01:00:01 -04:00
Leopere a6d61ebf35
More tidying up leaving some details for future netizens. 2019-08-22 00:55:03 -04:00
Leopere 98385954dc
Deprecation notice for the time being.
Unfortunately due to many blockers that arose due to time constraints of involved parties a fork ended up being the best possible solution.  Credit will be given to the original codebase and repository.
2019-07-11 18:20:56 -04:00
Leopere 4900d13a47
Fixed Discord Server URL
The old TellForm server was replaced with the OMF server.
2019-07-11 18:13:37 -04:00
Leopere 210c7544e7
Merge pull request #344 from wodka/simplify-docker
improve docker images, fix jsep and initial build
2019-07-03 16:43:59 -04:00
wodka a9e04b4894 add missing bower install 2019-07-03 22:13:28 +02:00
wodka d07063f636 fixes for admin creation 2019-07-03 09:47:52 +02:00
wodka 643954896b fix user creation 2019-07-01 16:13:21 +02:00
wodka 77cabf15e5 attach socket.io to current server if ports are equal 2019-07-01 11:49:27 +02:00
wodka b3bf791d3c improve docker images, fix jsep and initial build 2019-07-01 10:03:29 +02:00
Leopere c3153ed514
Merge pull request #338 from tellform/Leopere-discordmove-1
Going to update the chat to something I can manage.
2019-06-07 19:47:24 -04:00
Leopere e29742f83a
Going to update the chat to something I can manage.
I have no access to manage Gitter and it seems a slight refocus might not be terrible.
2019-06-07 19:36:57 -04:00
Arielle Baldwynn a24f90ce91 added example env 2019-04-29 19:28:21 -07:00
Arielle Baldwynn 4eae4de2ce added countable web productions as sponsor 2019-04-29 19:16:36 -07:00
Arielle Baldwynn 39c656c41e fixed nginx dockerfile 2019-04-29 19:09:25 -07:00
Arielle Baldwynn 15a6324a90 got npm install to work 2019-04-29 16:02:27 -07:00
Arielle Baldwynn 17b428b304 Merge branch 'master' of github.com:tellform/tellform into stable2.1 2019-04-29 14:15:52 -07:00
Arielle Baldwynn 81e66f0025
Update README.md 2019-02-19 10:27:56 -08:00
Arielle Baldwynn b1917c9fdd
Merge pull request #330 from mattiasaxell/master
fix Swedish translations
2019-02-02 13:01:51 -08:00
Mattias 6453716c99 fix translations 2019-01-31 10:15:21 +01:00
Arielle Baldwynn 639ba9fdb8
Merge pull request #328 from bokub/patch-2
Remove dead link from README
2019-01-09 16:31:30 -08:00
Boris K 1a9e847741
Remove dead link from README 2019-01-09 21:05:00 +01:00
Arielle Baldwynn 995e6aa41c
Merge pull request #316 from LoneRifle/patch-2
deleteSubmissions - remove spurious condition
2018-10-23 22:42:44 -07:00
Arielle Baldwynn d7f0cc8127
Merge pull request #317 from spkjess/master
update markdown
2018-10-23 22:42:27 -07:00
Jess Sze e8afc9e7e6 add registry 2018-10-20 17:17:29 +08:00
Jess Sze ad35ae9215 update markdown 2018-10-20 17:03:24 +08:00
LoneRifle 5bc0d623a5
deleteSubmissions - remove spurious condition
`FormSubmission.remove` should not use `admin` as a condition:
 - the field is not present in the schema or in any created submissions
 - the user is unlikely to be the admin of a submission 

Remove this field to facilitate deletes

Fixes #315
2018-10-20 16:33:12 +08:00
David Baldwynn 13d9bd9ece fixed bugs with authentication 2018-09-11 14:09:17 -07:00
David Baldwynn 19c85f9845 fixed css aligment for form multi choice questions 2018-09-11 16:46:59 -04:00
Arielle Baldwynn 188705b640
Merge pull request #301 from pshah123/master
Fix Issues from PR #299
2018-08-31 13:27:24 -07:00
David Baldwynn 386b6be968 got stable release to work 2018-08-31 15:56:49 -04:00
David Baldwynn d9ef557edd u 2018-08-31 15:26:13 -04:00
David Baldwynn 52a1ab2bff got form running and fixed swedish translations 2018-08-31 15:25:43 -04:00
David Baldwynn 80beec8ad2
Merge pull request #305 from drew23c/drew
stored the logos in docs/ folder and added the logos for tellform sponsors...
2018-07-09 12:34:35 -07:00
Andrew Caldwell 3b0dee9ea3 stored the logos in docs/ folder and added the logos for tellform backers in readme.md 2018-07-06 13:47:44 -04:00
Priansh Shah 01ac456f62 fix merge 2018-04-24 23:15:52 +03:00
Priansh Shah 9715088e86 Revert "fix styling on form"
This reverts commit 9a9c1ae02e.
2018-04-24 23:05:46 +03:00
Priansh Shah 0f2cf42ceb revert changelog 2018-04-24 23:05:40 +03:00
Priansh Shah 65fd117b04 revert changelog 2018-04-24 23:05:05 +03:00
Priansh Shah 985c3c1aae revert custom Earlybird changes to form 2018-04-24 23:04:16 +03:00
Priansh Shah 808439cf47 Revert "Merge branch 'master' into server"
This reverts commit 83ca05e64b, reversing
changes made to 78082f7152.
2018-04-24 23:03:36 +03:00
Priansh Shah eaab2ff339 Revert "disable signups"
This reverts commit ca875ed01d.
2018-04-24 23:03:15 +03:00
Priansh Shah f99049d155 Revert "fix jsep import, add fillin for HTTPS server, remove debug flag"
This reverts commit 78082f7152.
2018-04-24 23:01:58 +03:00
David Baldwynn 8c4e519fbe
Merge pull request #299 from earlybird/master
Add JSEP CDN
2018-04-24 09:26:39 -07:00
Priansh Shah 9a9c1ae02e fix styling on form 2018-04-10 00:35:12 +00:00
Priansh Shah 2835280ff3 fix mobile responsiveness 2018-04-09 21:41:37 +00:00
Priansh Shah 7afc7eef87 update changelog 2018-04-09 21:36:17 +00:00
Priansh Shah 45f8fe7a02 fix form styling 2018-04-09 21:34:26 +00:00
Priansh Shah 623cb865c2 fix readme 2018-04-09 20:35:09 +00:00
Priansh Shah d6e48544a4 Merge branch 'master' of https://github.com/earlybird/tellform 2018-04-09 20:31:10 +00:00
Priansh Shah ca875ed01d disable signups 2018-04-09 20:30:44 +00:00
Priansh Shah 33b0fc02c4
Merge pull request #1 from earlybird/server
fix jsep import, add fillin for HTTPS server, remove debug flag
2018-04-09 16:25:04 -04:00
Priansh Shah 83ca05e64b
Merge branch 'master' into server 2018-04-09 16:24:29 -04:00
Priansh Shah 78082f7152 fix jsep import, add fillin for HTTPS server, remove debug flag 2018-04-09 20:22:41 +00:00
Priansh Shah e2ff321ec8
add JSEP cdn 2018-04-09 05:47:04 -04:00
David Baldwynn 38b3618f8b
Merge pull request #291 from mattiasaxell/patch-4
Create swedish.js translation
2018-03-05 12:39:55 -08:00
David Baldwynn f5dc78b6d7
Merge pull request #292 from mattiasaxell/patch-5
Create swedish.js - Swedish translation
2018-03-03 16:18:06 -08:00
David Baldwynn f384f5fee4
Merge pull request #293 from mattiasaxell/patch-6
Create swedish.js first translation
2018-03-03 16:17:57 -08:00
David Baldwynn 3421c92eab
Merge pull request #290 from mattiasaxell/patch-2
Adding Swedish translation to config
2018-03-03 16:17:42 -08:00
David Baldwynn f47a8d41ae
Merge pull request #294 from mattiasaxell/patch-7
Create swedish.js - first Swedish translation
2018-03-03 16:17:29 -08:00
Mattias Axell 53fa777ce0
Create swedish.js first Swedish translation 2018-02-28 18:12:54 +01:00
Mattias Axell e725aa1ea3
Create swedish.js first translation 2018-02-28 17:22:21 +01:00
Mattias Axell c63e905c25
Create swedish.js - Swedish translation 2018-02-28 16:31:35 +01:00
Mattias Axell ee2c59805e
Create swedish.js translation 2018-02-28 16:28:34 +01:00
Mattias Axell a0092baf31
Update typo in Swedish translation 2018-02-28 15:55:06 +01:00
Mattias Axell b6f5c5f897
First translation to Swedish
Proposing first translation of TellForm into Swedish.
2018-02-28 15:52:24 +01:00
David Baldwynn 66765278d2
Merge pull request #285 from MaximePawlakFr/fixFrenchTranslations
Fix french translations in modules, form_modules and locales.
2018-02-14 19:07:22 -08:00
Maxime 1ace06555c Fix french translations in modules, form_modules and locales. 2018-02-14 17:28:19 +01:00
David Baldwynn 4086219189
Merge pull request #283 from theasp/master
Fix MAILER_STMP_SECURE
2018-01-29 16:13:30 -08:00
Andrew Phillips 7357756625 Fix MAILER_STMP_SECURE
This should resolve https://github.com/tellform/tellform/issues/281,
matching the description in the Configuration section of `README.md`.
This also corrects the case of `TRUE` in an example.
2018-01-25 13:31:04 -04:00
David Baldwynn ff24843e3a Merge branch 'master' of github.com:tellform/tellform 2017-11-21 13:36:34 -08:00
David Baldwynn 4447785a56 removed secure grunt task 2017-11-21 13:36:14 -08:00
David Baldwynn 341ce5a88f
Merge pull request #265 from felixcheruiyot/master
Fix wrong vendor.min.js file reference URL
2017-11-20 20:33:33 -08:00
FELIX CHERUIYOT ed662281cd
Merge pull request #1 from felixcheruiyot/felixcheruiyot-patch-1
Fix missing vendor file reference
2017-11-17 07:44:07 +03:00
FELIX CHERUIYOT 13c3263667
Fix missing vendor file reference
vendor.min.js not found
2017-11-17 07:43:21 +03:00
David Baldwynn 084a8005fd fixed form vendor files 2017-11-11 19:56:41 -08:00
David Baldwynn 24cffeee37 fixed problem with production assets 2017-11-08 11:31:46 -08:00
David Baldwynn d132133d67 Merge branch 'master' of github.com:tellform/tellform 2017-11-06 17:55:46 -05:00
David Baldwynn 1539846121 fixed google analytics 2017-11-06 17:55:43 -05:00
David Baldwynn ed815f68e5
Update README.md 2017-11-06 14:35:29 -08:00
David Baldwynn 552f4d8396
Update gitter.im links 2017-11-06 14:29:43 -08:00
David Baldwynn 7c3834dcae Merge branch 'master' of github.com:tellform/tellform 2017-11-06 14:12:37 -08:00
David Baldwynn 5b847b33ec moved grunt to dev dependencies 2017-11-06 14:10:27 -08:00
David Baldwynn 86f74ce85f
Merge pull request #257 from tellform/fixSetupScript
Fixed Setup Script
2017-11-06 13:58:20 -08:00
David Baldwynn 147effe028
Added buildpack for Heroku Deploy Button 2017-11-06 13:57:13 -08:00
David Baldwynn b29d5bad36 fixed admin setup script 2017-11-06 13:44:29 -08:00
David Baldwynn 53658da890 Merge branch 'master' of github.com:tellform/tellform 2017-11-05 16:28:29 -08:00
David Baldwynn 3dc51d9d2c fixed bug in core.routes.js 2017-11-05 19:23:01 -05:00
David Baldwynn f8ac5454d7 Merge branch 'master' of github.com:tellform/tellform 2017-11-05 16:14:15 -08:00
David Baldwynn 4c76e37aba
Merge pull request #253 from tellform/fixGruntfile
Fixed Gruntfile
2017-11-05 16:11:47 -08:00
David Baldwynn be6fc12949 fixed ngAnnotate grunt task 2017-11-05 16:05:58 -08:00
David Baldwynn e2d000e6a0 fixed gruntfile build for form-application.js 2017-11-05 15:56:03 -08:00
David Baldwynn 0f3b59a1ce Merge branch 'master' of github.com:tellform/tellform 2017-11-05 15:51:47 -08:00
David Baldwynn 492783ec49 built correct dist files 2017-11-05 15:50:55 -08:00
David Baldwynn 381df20d3c
Merge pull request #252 from tellform/hotfixes
Hotfixes - Signin Redirection, FormField Service language, Gruntfile Concat
2017-11-05 15:41:42 -08:00
David Baldwynn f7d4394049 removed unused npm deps 2017-11-05 15:28:58 -08:00
David Baldwynn 7451311403 removed empty authentication controller test 2017-11-02 11:37:33 -07:00
David Baldwynn 5c58db879c got server tests to pass 2017-11-02 11:14:25 -07:00
David Baldwynn 076f56bf59 fix language detection bug for FormFields service 2017-11-02 10:41:36 -07:00
David Baldwynn 6927f9d5ac fixed signin redirect bug 2017-11-02 10:37:29 -07:00
David Baldwynn 65a8b2d7cc fixed gruntfile bug 2017-10-29 11:43:20 -04:00
David Baldwynn d304b80913 fixed submission ordering 2017-10-28 05:13:56 -04:00
David Baldwynn a3d203fee3 Merge branch 'master' of github.com:tellform/tellform 2017-10-28 01:51:18 -07:00
David Baldwynn dc3bb54774 fixed submissions bug 2017-10-28 04:30:23 -04:00
David Baldwynn 3b9f01f92a fixed form_fields translation bug 2017-10-28 00:45:04 -07:00
David Baldwynn a829e08d73 fixed errors for password reset, user signup and user signin 2017-10-27 23:54:55 -07:00
David Baldwynn 34b2cba461 added client side validation for email, username and password inputs 2017-10-27 23:23:50 -07:00
David Baldwynn 82d60c5a42 add error for unactivated account login/forgot password 2017-10-27 20:59:47 -07:00
David Baldwynn c45d248c3c internationalized transactional emails 2017-10-27 20:46:00 -07:00
David Baldwynn 4f7d646edd got email pug templates to work 2017-10-27 19:30:05 -07:00
David Baldwynn b0f03d1f0a got i18n transaltions for all serverside views 2017-10-27 17:23:24 -07:00
David Baldwynn 25ce55b4c7 moved to pug from swig and fixed public form when subdomains are disabled 2017-10-27 16:00:04 -07:00
David Baldwynn 62a34f9ab6 fixed all translations on frontend 2017-10-27 12:52:39 -07:00
David Baldwynn e6685154dd added german and italian translateions for user and core views 2017-10-27 12:13:47 -07:00
David Baldwynn fe692d2a7d Removed codeclimate badge 2017-10-26 11:06:10 -07:00
David Baldwynn 8a8f1e9b2e Update README.md 2017-10-26 11:04:50 -07:00
David Baldwynn b3213d5a8a Merge pull request #242 from alexgleason/alexgleason
whitef0x0/tellform --> tellform/tellform
2017-10-26 11:04:17 -07:00
David Baldwynn 6899a5d48f Removed npm run version 2017-10-26 11:00:05 -07:00
David Baldwynn e4ef81af35 fixed verification email signup bug 2017-10-26 11:36:15 -04:00
David Baldwynn 28614fbab4 fixed openEditModal 2017-10-18 17:44:48 -07:00
David Baldwynn 5746920c34 fixed logicJump bug 2017-10-18 17:37:48 -07:00
David Baldwynn 828f4c8bba added defaults for admin user 2017-10-18 17:32:15 -07:00
David Baldwynn accd9dad78 removed unnessecary markdown file 2017-10-18 17:29:11 -07:00
David Baldwynn d2bac982cd fixed config prod 2017-10-18 20:27:07 -04:00
David Baldwynn 3835a8aa3a Merge branch 'master' of github.com:whitef0x0/tellform into HEAD
Conflicts:
	config/env/all.js
	config/env/development.js
2017-10-18 20:20:15 -04:00
David Baldwynn 154fddff75 fixed editField bug 2017-10-18 17:18:18 -07:00
David Baldwynn fc29c7b5ca Merge branch 'master' of github.com:whitef0x0/tellform into HEAD 2017-10-18 19:42:48 -04:00
David Baldwynn 8b93bcf448 fixed analytics service 2017-10-18 19:39:34 -04:00
David Baldwynn cf3348371a Added back overlay 2017-10-18 16:37:42 -07:00
Alex Gleason e110820fcb whitef0x0/tellform --> tellform/tellform 2017-10-17 13:12:27 -04:00
David Baldwynn b14822d1fa Update all.js 2017-10-11 12:12:20 -07:00
David Baldwynn 60abe5a227 got grunt-env to work with .env file 2017-10-10 22:25:39 -07:00
David Baldwynn d1039c7fc2 got all tests to pass 2017-10-10 22:07:13 -07:00
David Baldwynn 92fd374e87 Update production.js 2017-10-10 16:30:12 -07:00
David Baldwynn c4e097275c Update express.js 2017-10-10 16:27:07 -07:00
David Baldwynn 91d5deabcf Update all.js 2017-10-10 16:26:18 -07:00
David Baldwynn 6bf5c6d3ee Update all.js 2017-10-10 16:25:51 -07:00
David Baldwynn 0020427cf8 Update README.md 2017-10-10 15:45:07 -07:00
David Baldwynn 5641057167 Removed process.env from create_admin script 2017-10-10 15:25:32 -07:00
David Baldwynn 101f28ea88 Update all.js 2017-10-10 15:24:45 -07:00
David Baldwynn 08c7bc19e9 Update socket.io.js 2017-10-10 15:21:23 -07:00
David Baldwynn 4d6a337e45 Update all.js 2017-10-10 15:20:03 -07:00
David Baldwynn 8218521a2b Update all.js 2017-10-10 15:12:31 -07:00
David Baldwynn 4e9a68e628 Removed OAuth providers from env/secure.js 2017-10-10 15:09:57 -07:00
David Baldwynn 2c736fe184 Removed upload config from env/all.js 2017-10-10 15:07:24 -07:00
David Baldwynn c13e09bd2e Removed OAuth ENV from test.js 2017-10-10 15:05:35 -07:00
David Baldwynn c3615f1cd6 Removed OAuth ENV from development.js 2017-10-10 15:05:12 -07:00
David Baldwynn b30c3a40e0 Fixed ENV bug with create-admin script 2017-10-10 15:03:37 -07:00
David Baldwynn 533d85eb39 Update package.json 2017-10-10 14:45:19 -07:00
David Baldwynn 8e402f5919 disabled cache 2017-10-07 06:14:36 -04:00
David Baldwynn d1b052b875 fixed ipAddr bug in sockets/analytics.js 2017-10-07 06:03:15 -04:00
David Baldwynn 988b8739c9 fix merging mistake for sockets 2017-10-07 05:44:47 -04:00
David Baldwynn 39cc78d294 Merge branch 'master' of github.com:whitef0x0/tellform 2017-10-07 05:42:23 -04:00
David Baldwynn 7f01627502 removed analytics geoIP 2017-10-07 05:42:18 -04:00
David Baldwynn 3c9c11d9db Merge branch 'master' of https://github.com/tellform/tellform into publicFormImprovments 2017-10-07 02:40:55 -07:00
David Baldwynn 9e351dd520 updated mail templates 2017-10-07 02:40:24 -07:00
David Baldwynn c02dae5a7e Merge branch 'master' of github.com:whitef0x0/tellform 2017-10-07 04:51:04 -04:00
David Baldwynn ef621f03ce fix embedded header bug 2017-10-07 04:50:52 -04:00
David Baldwynn b4d887450e Update package.json 2017-10-07 01:47:54 -07:00
David Baldwynn eabe217cfa Update README.md 2017-10-07 01:47:36 -07:00
David Baldwynn b58d7abaec fixed button css border 2017-10-07 04:47:14 -04:00
David Baldwynn 4a816c786d fixed analytics fieldValue bug 2017-10-07 04:34:01 -04:00
David Baldwynn 1a155e9ef1 Merge branch 'publicFormImprovments' of github.com:whitef0x0/tellform into speed_improvements 2017-10-07 04:23:59 -04:00
David Baldwynn 6a4dcb0874 moved ip lookups to backend 2017-10-07 01:23:42 -07:00
David Baldwynn e620769d32 got tests to pass 2017-10-07 00:35:41 -07:00
David Baldwynn 3ebb4eebff fixed bug in form controller 2017-10-07 00:27:03 -07:00
David Baldwynn 3cc99d7b17 form background color bug 2017-10-06 17:15:35 -07:00
David Baldwynn f33f26d218 Merge pull request #231 from tellform/fixEmailLeakForgotPassword
obfuscated email for forgot password
2017-10-05 22:35:03 -07:00
David Baldwynn c1f88603ca obfuscated email for forgot password 2017-10-05 22:32:50 -07:00
David Baldwynn 5c3a0a5bd4 Merge branch 'master' of https://github.com/tellform/tellform 2017-10-05 21:26:31 -07:00
David Baldwynn d24ba0a439 Merge pull request #229 from tellform/speed_improvements
Speed up rendering of form submission page
2017-10-05 21:18:47 -07:00
David Baldwynn 98bc71a189 Update README.md 2017-10-04 21:00:30 -07:00
David Baldwynn 45b378d16f sped up list forms and fixed analytics bugs 2017-10-02 08:17:39 -07:00
David Baldwynn bb1c7e6c0d fixed bug in list forms view 2017-09-21 02:26:49 -04:00
David Baldwynn 4414b0e390 added cdn version of static assets 2017-09-21 02:08:45 -04:00
David Baldwynn a702ae7e43 Merge branch 'speedup-queries' 2017-09-21 00:07:50 -04:00
David Baldwynn 17596d9e17 fixed form loading animation 2017-09-20 23:08:31 -04:00
David Baldwynn e40b28ed14 fixed startpage css bug 2017-09-20 22:54:12 -04:00
David Baldwynn 7512402c08 fixed production bug 2017-09-20 22:51:42 -04:00
David Baldwynn 86228ed7dc Merge branch 'master' of github.com:tellform/tellform 2017-09-20 22:04:52 -04:00
David Baldwynn 61c9470660 fixed no subdmain form rendering bug 2017-09-20 21:54:23 -04:00
David Baldwynn fdc56dbc87 Removed FORMA section 2017-09-20 15:54:30 -07:00
204 changed files with 18715 additions and 50164 deletions

View file

@ -1,4 +1,5 @@
{
"directory": "public/lib",
"analytics": false
"analytics": false,
"registry": "https://registry.bower.io"
}

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
.git
.idea
.vagrant
coverage
design
e2e_coverage
Vagrantfile
Procfile

124
.env.example Normal file
View file

@ -0,0 +1,124 @@
# TellForm Configuration File
###################################
# Common configuration variables
###################################
# Set this to the path where Mailu data and configuration is stored
# Mac users: Change to a Docker accessible folder
ROOT=/opt/tellform_data
# Set to what environment you will be running TellForm in (production or development)
NODE_ENV=development
# Set to a randomly generated 16 bytes string
SECRET_KEY=ChangeMeChangeMe
# URI of Mongo database that TellForm will connect to
#DO NOT CHANGE
MONGODB_URI=mongodb://mongo/tellform
# URL Redis server that TellForm will connect to
#DO NOT CHANGE
REDIS_URL=redis://redis:6379
# Port that the TellForm Node app will listen on
PORT=5000
# Domain that TellForm's admin panel will be hosted at
BASE_URL=tellform.dev
# Port that SocketIO server (for analytics) will listen on
SOCKET_PORT=20523
#Choose what kind of TLS you want.
#Can be either 'cert' (supply your certificates in ./cert/), 'notls' (no https at all) or 'letsencrypt' that autoconfigures your instance with letsencrypt
TLS_FLAVOR=notls
###################################
# Optional features
###################################
# Set this to enable coveralls.io support
COVERALLS_REPO_TOKEN=
# Disable signups for your TellForm instance
SIGNUP_DISABLED=FALSE
# Disable per-user custom subdomains
SUBDOMAINS_DISABLED=FALSE
# Url that subdomains will be hosted at (has to have domain name as ADMIN_URL)
# Only used when SUBDOMAINS_DISABLED=FALSE
SUBDOMAIN_URL=*.tellform.dev
# Enable running TellForm in pm2's 'cluster' mode
ENABLE_CLUSTER_MODE=FALSE
###################################
# Mail settings
# IMPORTANT: These settings need to be set
# to be set in order for your instance to work
###################################
# Set this to set the username credential of your SMTP service
MAILER_EMAIL_ID=
# Set this to set the password credential of your SMTP service
MAILER_PASSWORD=
# Set this to set the email address that all email should be sent from for signup/verification emails
MAILER_FROM=
# Set this to any services from https://nodemailer.com/smtp/well-known/ to use a 'well-known' email provider
MAILER_SERVICE_PROVIDER=
# Set these if you are not using a 'MAILER_SERVICE_PROVIDER' and want to specify your SMTP server's address and port
MAILER_SMTP_HOST=
MAILER_SMTP_PORT=
# Set this if you are using a custom SMTP server that supports SSL
MAILER_SMTP_SECURE
###################################
# Automatic Admin Creation Settings
###################################
# Set this to "TRUE" if you wish to automatically create an admin user on startup
CREATE_ADMIN=FALSE
# Set this to set the email used by your default admin account
ADMIN_EMAIL=admin@admin.com
# Set this to set the username of your default admin acconut
ADMIN_USERNAME=root
# Set this to set the password of your default admin account
ADMIN_PASSWORD=root
###################################
# Advanced settings
###################################
# Set this to server your websockets server on a seperate URL
SOCKETS_URL=
# Set this to change the port that TellForm will listen on
PORT=5000
# Set this to your Google Analytics ID to enable tracking with GA
GOOGLE_ANALYTICS_ID=
# Set this to your Sentry.io DSN code to enable front-end JS error tracking with Sentry.io
RAVEN_DSN
# Set this to set the 'name' meta property in the HTML <head>
APP_NAME=
# Set this to set the 'keywords' meta property in the HTML <head>
APP_KEYWORDS=
# Set this to set the 'description' meta property in the HTML head
APP_DESC=

6
.gitignore vendored
View file

@ -1,14 +1,11 @@
data/
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 +22,7 @@ Oscar_Credentials.*
npm-debug.log
node_modules/
public/lib/
public/dist
app/tests/coverage/
.bower-*/
.idea/

View file

@ -1,70 +1,77 @@
# Build:
# docker build -t tellform -f ./Dockerfile .
# docker build -t tellform-prod -f ./Dockerfile-production .
#
# Run:
# docker run -it tellform
FROM phusion/baseimage:0.9.19
MAINTAINER David Baldwynn <team@tellform.com>
# docker run -it tellform-prod
# 3000 = TellForm server, 35729 = livereload, 8080 = node-inspector
EXPOSE 3000 35729 8080
FROM node:10-alpine
MAINTAINER Arielle Baldwynn <team@tellform.com>
# Set development environment as default
ENV NODE_ENV development
ENV BASE_URL tellform.dev
ENV PORT 3000
# Install some needed packages
RUN apk add --no-cache \
git \
&& rm -rf /tmp/*
# Install Utilities
RUN apt-get update -q \
&& apt-get install -yqq \
curl \
ant \
default-jdk \
git \
gcc \
make \
build-essential \
libkrb5-dev \
python \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install NPM Global Libraries
RUN npm install --quiet -g grunt bower pm2 && npm cache clean --force
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install MEAN.JS Prerequisites
RUN npm install --quiet -g grunt bower && npm cache clean
RUN mkdir -p /opt/tellform/public/lib
WORKDIR /opt/tellform
RUN mkdir -p /opt/tellform/public/lib
# Add bower.json
COPY bower.json /opt/tellform/bower.json
COPY .bowerrc /opt/tellform/.bowerrc
COPY ./process.yml /opt/tellform/process.yml
COPY ./app /opt/tellform/app
COPY ./public /opt/tellform/public
COPY ./config /opt/tellform/config
COPY ./gruntfile.js /opt/tellform/gruntfile.js
COPY ./server.js /opt/tellform/server.js
COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
# Set default ENV
ENV NODE_ENV=development
ENV SECRET_KEY=ChangeMeChangeMe
#ENV MONGODB_URI=mongodb://mongo/tellform
#ENV REDIS_URL=redis://redis:6379
ENV PORT=5000
ENV BASE_URL=localhost
ENV SOCKET_PORT=20523
ENV SIGNUP_DISABLED=FALSE
ENV SUBDOMAINS_DISABLED=FALSE
ENV ENABLE_CLUSTER_MODE=FALSE
ENV MAILER_EMAIL_ID=tellform@localhost
ENV MAILER_PASSWORD=
ENV MAILER_FROM=tellform@localhost
ENV MAILER_SERVICE_PROVIDER=
ENV MAILER_SMTP_HOST=
ENV MAILER_SMTP_PORT=
ENV MAILER_SMTP_SECURE=
ENV CREATE_ADMIN=FALSE
ENV ADMIN_EMAIL=admin@tellform.com
ENV ADMIN_USERNAME=root
ENV ADMIN_PASSWORD=root
ENV APP_NAME=Tellform
ENV APP_KEYWORDS=
ENV APP_DESC=
# optional ENV settings
ENV COVERALLS_REPO_TOKEN=
ENV GOOGLE_ANALYTICS_ID=
ENV RAVEN_DSN=
# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Add npm package.json
COPY package.json /opt/tellform/package.json
RUN npm install
COPY ./package.json /opt/tellform/package.json
RUN npm install --only=production --quiet
RUN bower install --allow-root
RUN grunt build
# Add bower.json
COPY bower.json /opt/tellform/bower.json
COPY .bowerrc /opt/tellform/.bowerrc
COPY ./app /opt/tellform/app
COPY ./public /opt/tellform/public
COPY ./config /opt/tellform/config
COPY ./gruntfile.js /opt/tellform/gruntfile.js
COPY ./server.js /opt/tellform/server.js
COPY ./.env /opt/tellform/.env
COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
# Run Development TellForm server
COPY ./dev_entrypoint.sh /dev_entrypoint.sh
RUN chmod +x /dev_entrypoint.sh
ENTRYPOINT ["/dev_entrypoint.sh"]
# Run TellForm server
CMD ["node", "server.js"]

View file

@ -1,71 +0,0 @@
# Build:
# docker build -t tellform-prod -f ./Dockerfile-production .
#
# Run:
# docker run -it tellform-prod
FROM phusion/baseimage:0.9.19
MAINTAINER David Baldwynn <team@tellform.com>
# 4545 = TellForm server
EXPOSE 4545
# Set development environment as default
ENV NODE_ENV production
ENV PORT 4545
ENV BASE_URL tellform.com
# Install Utilities
RUN apt-get update -q \
&& apt-get install -yqq \
curl \
ant \
default-jdk \
git \
gcc \
make \
build-essential \
libkrb5-dev \
python \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install MEAN.JS Prerequisites
RUN npm install --quiet -g grunt bower pm2 && npm cache clean
RUN mkdir -p /opt/tellform/public/lib
WORKDIR /opt/tellform
# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Add npm package.json
COPY package.json /opt/tellform/package.json
RUN npm install --production
RUN mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm install
# Add bower.json
COPY bower.json /opt/tellform/bower.json
COPY .bowerrc /opt/tellform/.bowerrc
COPY ./app /opt/tellform/app
COPY ./public /opt/tellform/public
COPY ./config /opt/tellform/config
COPY ./gruntfile.js /opt/tellform/gruntfile.js
COPY ./server.js /opt/tellform/server.js
COPY ./.env /opt/tellform/.env
COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
RUN grunt build
# Run TellForm server
CMD ["pm2-docker","process.yml"]

View file

@ -10,56 +10,7 @@ TellForm Installation Instructions
## Local deployment with Docker
### Prerequisites
Make you sure have the following packages and versions on your machine:
```
"node": ">=6.11.2"
"npm": ">=3.3.6"
"bower": ">=1.8.0"
"grunt-cli": ">=1.2.0"
"grunt": ">=0.4.5"
"docker": ">=17.06.0-ce"
"docker-compose": ">=1.14.0"
```
### Install dependencies
```
$ npm install
```
### Prepare .env file:
Create `.env` file at project root folder. Fill in `MAILER_SERVICE_PROVIDER`, `MAILER_EMAIL_ID`, `MAILER_PASSWORD` and `MAILER_FROM`.
```
APP_NAME=TellForm
BASE_URL=localhost:3000
PORT=3000
DB_PORT_27017_TCP_ADDR=tellform-mongo
REDIS_DB_PORT_6379_TCP_ADDR=tellform-redis
MAILER_SERVICE_PROVIDER=<TO-FILL-IN>
MAILER_EMAIL_ID=<TO-FILL-IN>
MAILER_PASSWORD=<TO-FILL-IN>
MAILER_FROM=<TO-FILL-IN>
SIGNUP_DISABLED=false
SUBDOMAINS_DISABLED=true
DISABLE_CLUSTER_MODE=true
```
### Build docker image
```
$ docker-compose build
```
### Run docker containers with docker-compose
Create and start mongo & redis docker container:
```
$ docker-compose up
```
Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000)
Refer to [docker_files](https://github.com/tellform/docker_files).
## AWS AMI Deployment

234
README.md
View file

@ -1,34 +1,47 @@
TellForm 2.0.0
TellForm 2.1.0
========
DEPRECATION WARNING UNTIL FURTHER NOTICE.
There are many oudated and vulnerable dependencies within this project and I recommend that you use this code repository for internal testing and development only.
There were too many impassable hurdles to really continue forward at the pace that I was hoping with TellForm @leopere~ If you want to follow my progress on an alternative in the mean time check out https://OhMyForm.com or our Discord server. We managed to get the base Docker image fixed before forking the code so you can give this a try however not much has changed at the moment.
<!--
[![Code Shelter](https://www.codeshelter.co/static/badges/badge-flat.svg)](https://www.codeshelter.co/)
[![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.0.0-green.svg)
[![Code Climate](https://codeclimate.com/github/whitef0x0/tellform/badges/gpa.svg)](https://codeclimate.com/github/whitef0x0/tellform)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=whitef0x0/tellform&amp;utm_campaign=Badge_Grade)
[![Gitter](https://badges.gitter.im/whitef0x0/tellform.svg)](https://gitter.im/whitef0x0/tellform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
![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&amp;utm_medium=referral&amp;utm_content=tellform/tellform&amp;utm_campaign=Badge_Grade)
-->
> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires.
To Join the fork's community please follow this Discord button here.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/whitef0x0/tellform/tree/master)
![Discord](https://img.shields.io/discord/595773457862492190.svg?label=Discord%20Chat)
## Readme and Issues
The README.md is still effectively in tact however it's all been commented out so that it's no longer visible on the main github repository page. You may visit it by navigating through the repositories files themselves.
No new or old issues will be tended to so the Issues Board has been closed. We don't recommend using this repositories codebase as its no longer maintained and is only intended for reference code. If you wish to use the fork which should remain backwards compatible feel free to explore [https://ohmyform.com](https://ohmyform.com/) or its GitHub repository at [https://github.com/ohmyform/ohmyform/](https://github.com/ohmyform/ohmyform/) where the code base is started from TellForm we are planning on keeping it reverse compatible however the code is Sublicensed AGPL and is going to have a stable release prepared for the public hopefully but September 12th 2019. It should be a drop in replacement for TellForm which should expand on the vision of TellForm but hopefully bring it all up to date.
<!--
> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires.-->
<!--
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/tellform/tellform/tree/master)
-->
<!--
## Table of Contents
- [Features](#features)
- [How to Contribute](#how-to-contribute)
- [Quickstart](#quickstart)
- [Deploying with Docker](#deploying-with-docker)
- [Testing your Application](#testing-your-application)
- [FORMA](#forma)
- [Advanced Configuration](#configuration)
- [Where to Get Help](#where-to-get-help)
- [Sponsors](#sponsors)
- [Backers](#backers)
- [Contributors](#contributors)
- [Mentions on the Web](#mentions-on-the-web)
## Features
### Currently following features are implemented:
- Multi-Language Support
- 11 possible question types
- Editable start and end pages
@ -38,7 +51,6 @@ TellForm 2.0.0
- Embeddable Forms
- Forms as a Service API
- Deployable with Heroku and DockerHub
### On the Roadmap for v3.0.0
- Implement encryption for all form data
- Add Typeform API integration
@ -47,37 +59,27 @@ TellForm 2.0.0
- Add Stripe/Payment Form field
- Add Custom Background and Dropdown Field Images
- Add File Upload Form Field
## How to Contribute
Please checkout our CONTRIBUTING.md on ways to contribute to TellForm.
All contributors are eligible to get a free [TellForm Sticker](https://www.stickermule.com/marketplace/15987-tellform-round-sticker). All you have to do is submit a PR, get it accepted, email your address to team [at] tellform.com and we'll send you a sticker that you can proudly put on your laptop.
## Quickstart
Before you start, make sure you have
1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379
2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all)
Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX)
Install dependencies first.
```bash
$ npm install
$ bower install
```
Setup environment.
```bash
$ grunt build
```
Create your user account
```bash
$ node ./scripts/setup.js
```
OR create your .env file
```
GOOGLE_ANALYTICS_ID=yourGAID
@ -85,193 +87,113 @@ PRERENDER_TOKEN=yourPrerender.ioToken
COVERALLS_REPO_TOKEN=yourCoveralls.ioToken
BASE_URL=localhost
DSN_KEY=yourPrivateRavenKey
# Mail config
MAILER_EMAIL_ID=user@domain.com
MAILER_PASSWORD=some-pass
MAILER_FROM=user@domain.com
# Use this for one of Nodemailer's pre-configured service providers
MAILER_SERVICE_PROVIDER=SendGrid
# Use these for a custom service provider
# Use these for a custom service provider
# Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER
MAILER_SMTP_HOST=smtp.domain.com
MAILER_SMTP_PORT=465
MAILER_SMTP_SECURE=true
MAILER_SMTP_SECURE=TRUE
```
Side note: ___Currently we are using Raven and Sentry [https://www.getsentry.com](https://www.getsentry.com) for error logging. To use it you must provide a valid private DSN key in your .env file and a public DSN key in app/views/layout.index.html___
#### To run the development version:
Set ```NODE_ENV=development``` in .env file
```$ grunt```
#### To run the production version:
Set ```NODE_ENV=production``` in .env file
```$ grunt```
Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000)
## Deploying with Docker
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=<YourEmailAPI_ID>" -e "MAILER_FROM=<noreply@yourdomain.com>" -e "MAILER_SERVICE_PROVIDER=<YourEmailAPIProvider>" -e "MAILER_PASSWORD=<YourAPIKey>" -e "BASE_URL=localhost" -p 80:80 tellform/development
```
Then run follow these steps:
### Step 1: Clone the repo
`$ git clone https://github.com/tellform/docker_files.git`
### Step 2: Setup TellForm Configuration
Create your .env file by copying the .env.dist file included in the repo and changing it to suit your deployment.
Important: You need to fill out all of the ENV variables in the "Mail Settings" section or your TellForm instance won't work.
If you want to have https, make sure to change 'TLS_FLAVOR'
### Step 3: Start your TellForm instance
`docker-compose up -d`
TellForm should now be accessible on http://localhost
## Testing Your Application
You can run the full test suite included with TellForm with the test task:
```
$ grunt test
```
This will run both the server-side tests (located in the app/tests/ directory) and the client-side tests (located in the public/modules/*/tests/).
To execute only the server tests, run the test:server task:
```
$ grunt test:server
```
And to run only the client tests, run the test:client task:
```
$ grunt test:client
```
Currently the live example uses heroku github deployments. The Docker file is out of date and does not work. If someone wishes to get it working feel free to submit a pull request.
To calculate your total test coverage with Istanbul, run the coverage task
```bash
$ grunt coverage
```
To calculate your server-side test coverage with Istanbul, run the coverage task
```bash
$ grunt coverage:server
```
To calculate your client-side test coverage with Istanbul, run the coverage task
```bash
$ grunt coverage:client
```
## FORMA
#### Prerequisite:
Before you start, make sure you have
1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379
2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all)
3. [Docker](https://docs.docker.com/engine/installation/) installed and running
Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX)
#### Install dependencies:
```
$ npm install
$ bower install
```
#### Prepare .env file:
Create .env file at project root folder. Fill in MAILER_EMAIL_ID and MAILER_PASSWORD, and either MAILER_SERVICE_PROVIDER using a [Nodemailer Well-known service](https://nodemailer.com/smtp/well-known/) or MAILER_SMTP_HOST, MAILER_SMTP_PORT, and MAILER_SMTP_SECURE for a custom SMTP server.
```
APP_NAME=forma
APP_DESC=
APP_KEYWORDS=
NODE_ENV=development
BASE_URL=localhost:5000
PORT=5000
username=forma_admin
SIGNUP_DISABLED=false
SUBDOMAINS_DISABLED=true
DISABLE_CLUSTER_MODE=true
GOOGLE_ANALYTICS_ID=
RAVEN_DSN=
PRERENDER_TOKEN=
COVERALLS_REPO_TOKEN=
# Mail config
MAILER_EMAIL_ID=forma@data.gov.sg
MAILER_PASSWORD=some-pass
MAILER_FROM=forma@data.gov.sg
# Use this for one of Nodemailer's pre-configured service providers
MAILER_SERVICE_PROVIDER=
# Use these for a custom service provider
# Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER
MAILER_SMTP_HOST=
MAILER_SMTP_PORT=465
MAILER_SMTP_SECURE=true
```
**Note**: You can view the compatible types for MAILER_SERVICE_PROVIDER [here](https://nodemailer.com/smtp/well-known/)
#### Deploy with Docker:
Create and start mongo & redis docker container.
```
$ docker run -p 27017:27017 -d --name forma-mongo mongo
$ docker run -p 127.0.0.1:6379:6379 -d --name forma-redis redis
```
After code changes, build and start docker containers.
```
$ docker start forma-mongo && docker start forma-redis
$ docker build -t forma-tellform .
$ docker stop forma-tellform
$ docker run --rm -p 5000:5000 --link forma-redis:redis-db --link forma-mongo:db --name forma-tellform forma-tellform
```
Your application should run on port 5000 or the port you specified in your .env file, so in your browser just go to [http://localhost:5000](http://localhost:5000)
## Configuration
TellForm's configuration is done with environment variables. To set an option for TellForm, open/create your .env file and set add `ENV_VAR=somevalue` to set the ENV_VAR variable to the value `somevalue`.
| Property | Valid Values | Default Value | Description | Required? |
|-------------------------|--------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| NODE_ENV | "development", "production", "test" or "secure" | development | Set which version of the app you want to run (either secure/SSL, dev, prod or test) | No |
| SESSION_SECRET | Any string | CHANGE_ME_PLEASE | Value used to compute session hash | No |
| BASE_URL | A valid URL | localhost:3000 | URL where the admin panel will live | Yes |
| MONGODB_URI | A valid MongoDB URI | localhost/mean | URI of the MONGODB server/db that your server will use | Yes |
| REDIS_URL | A valid Redis URI | redis://127.0.0.1:6379 | URI of the Redis instance that your server will use | Only if ENABLE_CLUSTER_MODE=TRUE |
| SOCKET_PORT | A valid port number from 0 - 65535 | 20523 | Port that your SocketIO server will bind to | No |
| SOCKET_URL | A valid URL | ws.tellform.com | Url that your SocketIO server will bind to | No |
| SIGNUP_DISABLED | "TRUE" or "FALSE" | FALSE | Set this flag to disable signups. | No |
| SUBDOMAINS_DISABLED | "TRUE" or "FALSE" | FALSE | Set this flag to disable subdomains. (Useful if hosting behind an uncontrolled domain or without a wildcard SSL cert) | No |
| ENABLE_CLUSTER_MODE | "TRUE" or "FALSE" | FALSE | Disable support for running TellForm with pm2's cluster mode. Disabling this allows you to not run a Redis instance. | No |
| MAILER_EMAIL_ID | A string | N/A | Username credential for the SMTP MAIL service used to send signup/verification/lost password emails. | Yes |
| MAILER_PASSWORD | A string | | Password credential for the SMTP MAIL service used to send signup/verification/lost password emails. | Yes |
| MAILER_FROM | A valid email | noreply@tellform.com | Email address that all mail should be sent from. | No |
| MAILER_SERVICE_PROVIDER | A service from https://nodemailer.com/smtp/well-known/ | | A "well-known" email service that is supported by nodemail. If MAILER_SMTP_HOST is enabled, this is ignored. | Only if MAILER_SMTP_HOST is not set |
| MAILER_SMTP_HOST | A valid URL | | URL to the SMTP server of your choice | Only if MAILER_SERVICE_PROVIDER is not set |
| MAILER_SMTP_PORT | A valid port number from 0 - 65535 | | Port of the SMTP server of your choice. | Only if MAILER_SMTP_HOST is set |
| MAILER_SMTP_SECURE | "TRUE" or "FALSE" | FALSE | Boolean that enables/disables SSL support for your SMTP client. | Only if MAILER_SMTP_HOST is set |
| CREATE_ADMIN | "TRUE" or "FALSE" | FALSE | Setting this variable will create a admin user on startup with credentials as specified below | No |
| ADMIN_EMAIL | A valid email | admin@admin.com | Email of generated admin user | No |
| ADMIN_USERNAME | A string | root | Username of generated admin user | No |
| ADMIN_PASSWORD | A string | root | Password of generated admin user | No |
| APP_NAME | A string | TellForm | Sets the <title> property of your webapp. | No |
| APP_DESC | A string | Opensource form builder alternative to TypeForm | Sets the,property of your webapp. | No |
| APP_KEYWORDS | A comma-seperated list of phrases/words | typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs | Sets the value of the <meta> description attribute. | No |
| RAVEN_DSN | A valid Sentry.io DSN | N/A | Set this to your Sentry.io Public DSN to enable remote logging | No |
| GOOGLE_ANALYTICS_ID | A valid Google Analytics ID | N/A | Set this to your GA id to enable GA tracking on your TellForm instance | No |
## Where to get help
[Gitter Chat](https://gitter.im/whitef0x0/tellform)
[Gitter Chat](https://gitter.im/tellform/Lobby)
[Official Twitter](https://twitter.com/tellform_real)
-->
## Sponsors
Further Sponsorships are no longer accepted.
<!--
Does your company use TellForm? Help keep the project bug-free and feature rich by [sponsoring the project](https://opencollective.com/tellform#sponsor).
<a href="https://m.do.co/c/a86fd8843e09" style="padding: 30px 0">
<img src="/docs/readme_logos/do_logo.png" height="30px">
</a>
<a href="https://getsentry.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/sentry_logo.png" height="30px">
</a>
<a href="https://statuspage.io/" style="padding: 30px 0">
<img src="/docs/readme_logos/statuspage_logo.png" height="30px">
</a>
<br><br>
<a href="https://www.stickermule.com/unlock?ref_id=0939360701" style="padding: 30px 0">
<img src="/docs/readme_logos/stickermule_logo.png" height="30px">
</a>
<a href="https://sparkpost.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/sparkpost_logo.png" height="30px">
</a>
<a href="https://therooststand.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/roost_logo.png" height="30px">
</a>
<a href="https://countable.ca" style="padding: 30px 0">
<img src="https://countable.ca/logo.cb446ab0.svg" height="30px">
</a> -->
## Backers
Love our work and community? [Become a backer](https://opencollective.com/tellform).
Love our work and community? <!--[Become a backer](https://opencollective.com/tellform).-->
<a href="https://opencollective.com/elliot" target="_blank">
<img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fd1ts43dypk8bqh.cloudfront.net%2Fv1%2Favatars%2F6fd61b2c-62b6-438a-9168-bab7ef1489b8" height= "64">
@ -284,14 +206,12 @@ Love our work and community? [Become a backer](https://opencollective.com/tellfo
## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars2.githubusercontent.com/u/1160417?v=3" width="100px;"/><br /><sub>David Baldwynn</sub>](http://baldwynn.me)<br />[💻](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Code") [🔧](#tool-whitef0x0 "Tools") [🚇](#infra-whitef0x0 "Infrastructure (Hosting, Build-Tools, etc)") [📖](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Documentation") [💡](#example-whitef0x0 "Examples") [🎨](#design-whitef0x0 "Design") [🔍](#fundingFinding-whitef0x0 "Funding Finding") [👀](#review-whitef0x0 "Reviewed Pull Requests") [⚠️](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Tests") | [<img src="https://avatars2.githubusercontent.com/u/313117?v=3" width="100px;"/><br /><sub>Samuel Laulhau</sub>](https://samuellaulhau.fr)<br />[💻](https://github.com/tellform/TellForm/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [<img src="https://avatars0.githubusercontent.com/u/313507?v=3" width="100px;"/><br /><sub>Arun Pattnaik</sub>](http://arun.co)<br />[🎨](#design-arunpattnaik "Design") | [<img src="https://avatars0.githubusercontent.com/u/5405744?v=3" width="100px;"/><br /><sub>Thiên Toán</sub>](https://toanalien.com)<br />[🐛](https://github.com/tellform/TellForm/issues?q=author%3Atoanalien "Bug reports") [💻](https://github.com/tellform/TellForm/commits?author=toanalien "Code") [📖](https://github.com/tellform/TellForm/commits?author=toanalien "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8615608?v=3" width="100px;"/><br /><sub>Adrian Portabales</sub>](https://github.com/AdrianP-)<br />[🐛](https://github.com/tellform/TellForm/issues?q=author%3AAdrianP- "Bug reports") [💻](https://github.com/tellform/TellForm/commits?author=AdrianP- "Code") | [<img src="https://avatars3.githubusercontent.com/u/8433587?v=3" width="100px;"/><br /><sub>Peter Thaleikis</sub>](https://github.com/spekulatius)<br />[📖](https://github.com/tellform/TellForm/commits?author=spekulatius "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1247388?v=3" width="100px;"/><br /><sub>Mickaël Andrieu</sub>](http://www.mickael-andrieu.com)<br />[📖](https://github.com/tellform/TellForm/commits?author=mickaelandrieu "Documentation") |
| [<img src="https://avatars2.githubusercontent.com/u/1160417?v=3" width="100px;"/><br /><sub>David Baldwynn</sub>](http://baldwynn.me)<br />[💻](https://github.com/tellform/tellform/commits?author=whitef0x0 "Code") [🔧](#tool-whitef0x0 "Tools") [🚇](#infra-whitef0x0 "Infrastructure (Hosting, Build-Tools, etc)") [📖](https://github.com/tellform/tellform/commits?author=whitef0x0 "Documentation") [💡](#example-whitef0x0 "Examples") [🎨](#design-whitef0x0 "Design") [🔍](#fundingFinding-whitef0x0 "Funding Finding") [👀](#review-whitef0x0 "Reviewed Pull Requests") [⚠️](https://github.com/tellform/tellform/commits?author=whitef0x0 "Tests") | [<img src="https://avatars2.githubusercontent.com/u/313117?v=3" width="100px;"/><br /><sub>Samuel Laulhau</sub>](https://samuellaulhau.fr)<br />[💻](https://github.com/tellform/tellform/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [<img src="https://avatars0.githubusercontent.com/u/313507?v=3" width="100px;"/><br /><sub>Arun Pattnaik</sub>](http://arun.co)<br />[🎨](#design-arunpattnaik "Design") | [<img src="https://avatars0.githubusercontent.com/u/5405744?v=3" width="100px;"/><br /><sub>Thiên Toán</sub>](https://toanalien.com)<br />[🐛](https://github.com/tellform/tellform/issues?q=author%3Atoanalien "Bug reports") [💻](https://github.com/tellform/tellform/commits?author=toanalien "Code") [📖](https://github.com/tellform/tellform/commits?author=toanalien "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8615608?v=3" width="100px;"/><br /><sub>Adrian Portabales</sub>](https://github.com/AdrianP-)<br />[🐛](https://github.com/tellform/tellform/issues?q=author%3AAdrianP- "Bug reports") [💻](https://github.com/tellform/tellform/commits?author=AdrianP- "Code") | [<img src="https://avatars3.githubusercontent.com/u/8433587?v=3" width="100px;"/><br /><sub>Peter Thaleikis</sub>](https://github.com/spekulatius)<br />[📖](https://github.com/tellform/tellform/commits?author=spekulatius "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1247388?v=3" width="100px;"/><br /><sub>Mickaël Andrieu</sub>](http://www.mickael-andrieu.com)<br />[📖](https://github.com/tellform/tellform/commits?author=mickaelandrieu "Documentation") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars1.githubusercontent.com/u/1522464?v=3" width="100px;"/><br /><sub>Ahmad Luqman</sub>](https://github.com/ahmad-luqman)<br />[📖](https://github.com/tellform/TellForm/commits?author=ahmad-luqman "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3691490?v=3" width="100px;"/><br /><sub>Peter Dave Hello</sub>](https://www.peterdavehello.org/)<br />[📖](https://github.com/tellform/TellForm/commits?author=PeterDaveHello "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/1522464?v=3" width="100px;"/><br /><sub>Ahmad Luqman</sub>](https://github.com/ahmad-luqman)<br />[📖](https://github.com/tellform/tellform/commits?author=ahmad-luqman "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3691490?v=3" width="100px;"/><br /><sub>Peter Dave Hello</sub>](https://www.peterdavehello.org/)<br />[📖](https://github.com/tellform/tellform/commits?author=PeterDaveHello "Documentation") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
## Mentions on the Web
[Mister Ad](http://start.mister-ad.biz/newsticker/open-source-alternative-zu-typeform-tellform-in-der-kurzvorstellung/)
[t3n.de](http://t3n.de/news/open-source-alternative-typeform-tellform-707295/)
[BootCSS Expo](http://expo.bootcss.com/)

View file

@ -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"
}
]
}

View file

@ -13,10 +13,9 @@ exports.index = function(req, res) {
};
exports.form = function(req, res) {
console.log('\n\n\nRENDERING FORM\n\n\n\n');
//Allow form to be embedded
res.set('X-Frame-Options', 'GOFORIT');
res.removeHeader('X-Frame-Options');
res.render('form', {
user: req.user || null,

View file

@ -19,7 +19,7 @@ exports.deleteSubmissions = function(req, res) {
var submission_id_list = req.body.deleted_submissions,
form = req.form;
FormSubmission.remove({ form: req.form, admin: req.user, _id: {$in: submission_id_list} }, function(err){
FormSubmission.remove({ form: req.form, _id: {$in: submission_id_list} }, function(err){
if(err){
res.status(400).send({
@ -48,14 +48,12 @@ exports.deleteSubmissions = function(req, res) {
exports.createSubmission = function(req, res) {
var timeElapsed = 0;
console.log(req.body);
if(typeof req.body.timeElapsed === 'number'){
timeElapsed = req.body.timeElapsed;
}
var submission = new FormSubmission({
form: req.body._id,
title: req.body.title,
form_fields: req.body.form_fields,
timeElapsed: timeElapsed,
percentageComplete: req.body.percentageComplete,
@ -64,7 +62,6 @@ exports.createSubmission = function(req, res) {
device: req.body.device
});
submission.save(function(err, submission){
if (err) {
console.error(err.message);
@ -73,17 +70,6 @@ exports.createSubmission = function(req, res) {
});
}
res.status(200).send('Form submission successfully saved');
/*form.submissions.push(submission);
form.save(function (err) {
if (err) {
console.error(err);
return res.status(500).send({
message: errorHandler.getErrorMessage(err)
});
}
res.status(200).send('Form submission successfully saved');
});*/
});
};
@ -93,7 +79,7 @@ exports.createSubmission = function(req, res) {
exports.listSubmissions = function(req, res) {
var _form = req.form;
FormSubmission.find({ form: _form._id }).sort('-created').lean().exec(function(err, _submissions) {
FormSubmission.find({ form: _form._id }).sort('created').lean().exec(function(err, _submissions) {
if (err) {
console.error(err);
res.status(500).send({
@ -102,14 +88,13 @@ exports.listSubmissions = function(req, res) {
}
res.json(_submissions);
});
};
/**
* Create a new form
*/
exports.create = function(req, res) {
if(!req.body.form){
return res.status(400).send({
message: 'Invalid Input'
@ -120,13 +105,14 @@ exports.create = function(req, res) {
form.admin = req.user._id;
form.save(function(err) {
debugger;
if (err) {
return res.status(405).send({
return res.status(500).send({
message: errorHandler.getErrorMessage(err)
});
}
res.json(form);
return res.json(form);
});
};
@ -137,15 +123,7 @@ exports.read = function(req, res) {
if(!req.user || (req.form.admin.id !== req.user.id) ){
readForRender(req, res);
} else {
FormSubmission.find({ form: req.form._id }).exec(function(err, _submissions) {
if (err) {
res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
}
var newForm = req.form.toJSON();
newForm.submissions = _submissions;
if (req.userId) {
if(req.form.admin._id+'' === req.userId+''){
@ -156,7 +134,6 @@ exports.read = function(req, res) {
});
}
return res.json(newForm);
});
}
};
@ -175,7 +152,7 @@ var readForRender = exports.readForRender = function(req, res) {
delete newForm.__v;
delete newForm.created;
if(!newForm.startPage.showStart){
if(newForm.startPage && !newForm.startPage.showStart){
delete newForm.startPage;
}
@ -186,20 +163,31 @@ var readForRender = exports.readForRender = function(req, res) {
* Update a form
*/
exports.update = function(req, res) {
var form = req.form;
var updatedForm = req.body.form;
if(form.form_fields === undefined){
form.form_fields = [];
}
delete updatedForm.__v;
delete updatedForm.created;
if(form.analytics === undefined){
form.analytics = {
visitors: [],
gaCode: ''
}
}
if (req.body.changes) {
var formChanges = req.body.changes;
formChanges.forEach(function (change) {
diff.applyChange(form, true, change);
diff.applyChange(form._doc, true, change);
});
} else {
//Unless we have 'admin' privileges, updating form admin is disabled
delete updatedForm.__v;
delete updatedForm.created;
//Unless we have 'admin' privileges, updating the form's admin is disabled
if(updatedForm && req.user.roles.indexOf('admin') === -1) {
delete updatedForm.admin;
}
@ -211,7 +199,7 @@ exports.update = function(req, res) {
//Do this so we can create duplicate fields
var checkForValidId = new RegExp('^[0-9a-fA-F]{24}$');
for(var i=0; i<req.body.form.form_fields.length; i++){
for(var i=0; i < req.body.form.form_fields.length; i++){
var field = req.body.form.form_fields[i];
if(!checkForValidId.exec(field._id+'')){
delete field._id;
@ -222,8 +210,7 @@ exports.update = function(req, res) {
form.save(function(err, savedForm) {
if (err) {
console.log(err);
res.status(405).send({
res.status(500).send({
message: errorHandler.getErrorMessage(err)
});
} else {
@ -258,7 +245,7 @@ exports.list = function(req, res) {
Form.find(searchObj)
.sort('-created')
.select('title language submissions admin isLive')
.select('title language admin submissions isLive')
.populate('admin.username', 'admin._id')
.lean()
.exec(function(err, forms) {
@ -290,7 +277,6 @@ exports.formByID = function(req, res, next, id) {
}
Form.findById(id)
.populate('admin')
.populate('submissions')
.exec(function(err, form) {
if (err) {
return next(err);
@ -301,12 +287,12 @@ exports.formByID = function(req, res, next, id) {
}
else {
//Remove sensitive information from User object
var _form = form;
_form.admin.password = null;
_form.admin.salt = null;
_form.provider = null;
var _form = form;
_form.admin.password = null;
_form.admin.salt = null;
_form.provider = null;
req.form = _form;
req.form = _form;
return next();
}
});
@ -323,7 +309,6 @@ exports.formByIDFast = function(req, res, next, id) {
}
Form.findById(id)
.lean()
.cache()
.select('title language form_fields startPage endPage hideFooter isLive design analytics.gaCode')
.exec(function(err, form) {
if (err) {

View file

@ -8,8 +8,11 @@ var errorHandler = require('../errors.server.controller'),
passport = require('passport'),
config = require('../../../config/config'),
User = mongoose.model('User'),
tokgen = require('../../libs/tokenGenerator');
tokgen = require('../../libs/tokenGenerator'),
fs = require('fs'),
i18n = require('i18n'),
async = require('async'),
pug = require('pug');
var nev = require('email-verification')(mongoose);
@ -17,6 +20,15 @@ var nev = require('email-verification')(mongoose);
var config_nev = function () {
nev.configure({
verifyMailOptions: {
from: config.mailer.from
},
confirmMailOptions: {
from: config.mailer.from
},
persistentUserModel: User,
tempUserCollection: config.tempUserCollection,
emailAndUsernameUnique: true,
@ -24,20 +36,7 @@ var config_nev = function () {
verificationURL: config.baseUrl+'/#!/verify/${URL}',
transportOptions: config.mailer.options,
verifyMailOptions: {
from: config.mailer.from,
subject: 'Confirm your account',
html: '<p>Please verify your account by clicking <a href="http://${URL}">this link</a>. If you are unable to do so, copy and ' +
'paste the following link into your browser:</p><p>${URL}</p>',
text: 'Please verify your account by clicking the following link, or by copying and pasting it into your browser: ${URL}'
},
confirmMailOptions: {
from: config.mailer.from,
subject: 'Account successfully verified!',
html: '<p>Your account has been successfully verified.</p>',
text: 'Your account has been successfully verified.'
},
verifySendMailCallback: function(err, info) {
if (err) {
throw err;
@ -55,30 +54,46 @@ var config_nev = function () {
throw err;
}
});
};
config_nev();
exports.validateVerificationToken = function(req, res){
console.log(req.user);
nev.confirmTempUser(req.params.token, function(err, user) {
console.log(err);
const fn = pug.compileFile(__dirname + "/../../views/welcome.email.view.pug");
var renderedHtml = fn(res.locals);
var emailTemplate = {
subject: i18n.__('WELCOME_EMAIL_SUBJECT', config.app.title),
html: renderedHtml,
text: i18n.__('WELCOME_EMAIL_TEXT')
};
nev.confirmTempUser(req.params.token, emailTemplate, function(err, user) {
if(err) {
return res.status(500).send( {message: err } );
}
else if (user){
return res.status(500).send( {message: err } );
} else if (user){
return res.status(200).send('User successfully verified');
}
// redirect to resend verification email
else return res.status(400).send( {message: 'Verification token is invalid or has expired'} );
else {
return res.status(400).send( {message: 'Verification token is invalid or has expired'} );
}
});
};
exports.resendVerificationEmail = function(req, res, next){
nev.resendVerificationEmail(req.body.email, function(err, userFound) {
const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
var renderedHtml = fn(res.locals);
var emailTemplate = {
subject: i18n.__('VERIFICATION_EMAIL_SUBJECT'),
html: renderedHtml,
text: i18n.__('VERIFICATION_EMAIL_TEXT')
};
nev.resendVerificationEmail(req.body.email, emailTemplate, function(err, userFound) {
if(err) {
console.log(errorHandler.getErrorMessage(err));
return res.status(500).send( {message: errorHandler.getErrorMessage(err) } );
}
@ -101,23 +116,35 @@ exports.signup = function(req, res) {
// Init Variables
var user = new User(req.body);
// Set language to visitor's language
user.language = req.cookies['userLang'];
// Add missing user fields
user.provider = 'local';
// Then save the temporary user
nev.createTempUser(user, function (err, existingPersistentUser, newTempUser) {
if (err) {
console.log(err);
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
}
// new user created
if (newTempUser) {
var URL = newTempUser[nev.options.URLFieldName];
nev.sendVerificationEmail(user.email, URL, function (sendEmailErr, info) {
if (sendEmailErr) {
const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
var renderedHtml = fn(res.locals);
var URL = newTempUser[nev.options.URLFieldName];
var emailTemplate = {
subject: i18n.__('VERIFICATION_EMAIL_SUBJECT'),
html: renderedHtml,
text: i18n.__('VERIFICATION_EMAIL_TEXT')
};
nev.sendVerificationEmail(user.email, URL, emailTemplate, function (sendEmailErr, info) {
if (sendEmailErr) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
@ -125,8 +152,7 @@ exports.signup = function(req, res) {
return res.status(200).send('An email has been sent to you. Please check it to verify your account.');
});
} else {
console.log(err);
return res.status(400).send({message: 'Error: User already exists!'});
return res.status(400).send({message: 'User with username/email already exists!'});
}
});
};
@ -135,6 +161,7 @@ exports.signup = function(req, res) {
* Signin after passport authentication
*/
exports.signin = function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err || !user) {
res.status(400).send(info);
@ -150,6 +177,8 @@ exports.signin = function(req, res, next) {
message: errorHandler.getErrorMessage(loginErr)
});
}
res.cookie('langCookie', user.language, { maxAge: 90000, httpOnly: true });
return res.json(user);
});
}
@ -160,138 +189,11 @@ exports.signin = function(req, res, next) {
* Signout
*/
exports.signout = function(req, res) {
if(req.cookies.hasOwnProperty('userLang')){
res.clearCookie('userLang');
}
req.logout();
return res.status(200).send('You have successfully logged out.');
};
/**
* OAuth callback
*/
exports.oauthCallback = function(strategy) {
return function(req, res, next) {
passport.authenticate(strategy, function(err, user, redirectURL) {
if (err || !user) {
return res.redirect('/#!/signin');
}
req.login(user, function(err) {
if (err) {
return res.redirect('/#!/signin');
}
return res.redirect(redirectURL || '/');
});
})(req, res, next);
};
};
/**
* Helper function to save or update a OAuth user profile
*/
exports.saveOAuthUserProfile = function(req, providerUserProfile, done) {
if (!req.user) {
// Define a search query fields
var searchMainProviderIdentifierField = 'providerData.' + providerUserProfile.providerIdentifierField;
var searchAdditionalProviderIdentifierField = 'additionalProvidersData.' + providerUserProfile.provider + '.' + providerUserProfile.providerIdentifierField;
// Define main provider search query
var mainProviderSearchQuery = {};
mainProviderSearchQuery.provider = providerUserProfile.provider;
mainProviderSearchQuery[searchMainProviderIdentifierField] = providerUserProfile.providerData[providerUserProfile.providerIdentifierField];
// Define additional provider search query
var additionalProviderSearchQuery = {};
additionalProviderSearchQuery[searchAdditionalProviderIdentifierField] = providerUserProfile.providerData[providerUserProfile.providerIdentifierField];
// Define a search query to find existing user with current provider profile
var searchQuery = {
$or: [mainProviderSearchQuery, additionalProviderSearchQuery]
};
User.findOne(searchQuery, function(err, user) {
if (err) {
return done(err);
} else {
if (!user) {
var possibleUsername = providerUserProfile.username || ((providerUserProfile.email) ? providerUserProfile.email.split('@')[0] : '');
User.findUniqueUsername(possibleUsername, null, function(availableUsername) {
var newUser = new User({
firstName: providerUserProfile.firstName,
lastName: providerUserProfile.lastName,
username: availableUsername,
displayName: providerUserProfile.displayName,
email: providerUserProfile.email,
provider: providerUserProfile.provider,
providerData: providerUserProfile.providerData
});
// And save the user
newUser.save(function(userSaveErr) {
return done(userSaveErr, user);
});
});
}
return done(err, user);
}
});
} else {
// User is already logged in, join the provider data to the existing user
var user = req.user;
// Check if user exists, is not signed in using this provider, and doesn't have that provider data already configured
if (user.provider !== providerUserProfile.provider && (!user.additionalProvidersData || !user.additionalProvidersData[providerUserProfile.provider])) {
// Add the provider data to the additional provider data field
if (!user.additionalProvidersData) {
user.additionalProvidersData = {};
}
user.additionalProvidersData[providerUserProfile.provider] = providerUserProfile.providerData;
// Then tell mongoose that we've updated the additionalProvidersData field
user.markModified('additionalProvidersData');
// And save the user
user.save(function(err) {
return done(err, user, '/#!/settings/accounts');
});
} else {
return done(new Error('User is already connected using this provider'), user);
}
}
};
/**
* Remove OAuth provider
*/
exports.removeOAuthProvider = function(req, res, next) {
var user = req.user;
var provider = req.param('provider');
if (user && provider) {
// Delete the additional provider
if (user.additionalProvidersData[provider]) {
delete user.additionalProvidersData[provider];
// Then tell mongoose that we've updated the additionalProvidersData field
user.markModified('additionalProvidersData');
}
user.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
req.login(user, function(err) {
if (err) {
res.status(400).send(err);
} else {
res.json(user);
}
});
}
});
}
};
/* Generate API Key for User */

View file

@ -11,14 +11,15 @@ var _ = require('lodash'),
config = require('../../../config/config'),
nodemailer = require('nodemailer'),
async = require('async'),
crypto = require('crypto');
crypto = require('crypto'),
pug = require('pug');
var smtpTransport = nodemailer.createTransport(config.mailer.options);
/**
* Forgot for reset password (forgot POST)
*/
exports.forgot = function(req, res, next) {
exports.forgot = function(req, res) {
async.waterfall([
// Generate random token
function(done) {
@ -32,7 +33,7 @@ exports.forgot = function(req, res, next) {
if (req.body.username) {
User.findOne({
$or: [
{'username': req.body.username},
{'username': req.body.username.toLowerCase()},
{'email': req.body.username}
]
}, '-salt -password', function(err, user) {
@ -42,12 +43,27 @@ exports.forgot = function(req, res, next) {
});
}
if (!user) {
return res.status(400).send({
message: 'No account with that username or email has been found'
});
} else if (user.provider !== 'local') {
return res.status(400).send({
message: 'It seems like you signed up using your ' + user.provider + ' account'
var tempUserModel = mongoose.model(config.tempUserCollection);
tempUserModel.findOne({
$or: [
{'username': req.body.username.toLowerCase()},
{'email': req.body.username}
]
}).lean().exec(function(err, user) {
if(err){
return res.status(500).send({
message: err.message
});
}
if(!user){
return res.status(400).send({
message: 'No account with that username or email has been found'
});
}
return res.status(400).send({
message: 'The account associated with this email has not been activated yet'
});
});
} else {
user.resetPasswordToken = token;
@ -65,13 +81,12 @@ exports.forgot = function(req, res, next) {
}
},
function(token, user, done) {
res.render('templates/reset-password-email', {
name: user.displayName || 'TellForm User',
appName: config.app.title,
url: 'http://' + req.headers.host + '/auth/reset/' + token
}, function(err, emailHTML) {
done(err, emailHTML, user);
});
const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-email.server.view.pug");
res.locals['url'] = 'http://' + req.headers.host + '/auth/reset/' + token;
console.log(res.locals);
var renderedHtml = fn(res.locals);
done(null, renderedHtml, user);
},
// If valid email, send reset email using service
function(emailHTML, user, done) {
@ -81,22 +96,33 @@ exports.forgot = function(req, res, next) {
subject: 'Password Reset',
html: emailHTML
};
smtpTransport.sendMail(mailOptions, function(err) {
if (!err) {
res.send({
message: 'An email has been sent to ' + user.email + ' with further instructions.'
});
} else {
return res.status(400).send({
message: 'Failure sending email'
});
}
done(err);
var userEmail = user.email;
var user = userEmail.split('@')[0];
var domain = userEmail.split('@')[1];
var obfuscatedUser = user.substring(0, 1) + user.substring(1).replace(/./g, '*');
var domainName = domain.split('.')[0];
var tld = domain.split('.')[1];
var obfuscatedDomainName = domainName.replace(/./g, '*');
var obfuscatedEmail = obfuscatedUser + '@' + obfuscatedDomainName + '.' + tld;
smtpTransport.sendMail(mailOptions, function(err) {
done(err, obfuscatedEmail);
});
}
], function(err, obfuscatedEmail) {
if (err) {
console.log(err);
return res.status(400).send({
message: 'Couldn\'t send reset password email due to internal server errors. Please contact support at team@tellform.com.'
});
} else {
return res.send({
message: 'An email has been sent to ' + obfuscatedEmail + ' with further instructions.'
});
}
], function(err) {
if (err) return next(err);
});
};
@ -127,10 +153,21 @@ exports.validateResetToken = function(req, res) {
* Reset password POST from email token
*/
exports.reset = function(req, res, next) {
if(req.body.newPassword.length < 4){
return res.status(400).send({
message: 'Password must be at least 4 characters long'
});
}
if(req.body.newPassword !== req.body.verifyPassword){
return res.status(400).send({
message: 'Passwords do not match'
});
}
// Init Variables
var passwordDetails = req.body;
async.waterfall([
function(done) {
User.findOne({
resetPasswordToken: req.params.token,
@ -139,32 +176,25 @@ exports.reset = function(req, res, next) {
}
}, function(err, user) {
if (!err && user) {
if (passwordDetails.newPassword === passwordDetails.verifyPassword) {
user.password = passwordDetails.newPassword;
user.resetPasswordToken = null;
user.resetPasswordExpires = null;
user.password = passwordDetails.newPassword;
user.resetPasswordToken = null;
user.resetPasswordExpires = null;
user.save(function(err) {
if (err) {
done(err, null);
}
done(null, user);
});
} else {
done('Passwords do not match', null);
}
user.save(function(err, savedUser) {
if (err) {
done(err, null);
}
done(null, savedUser);
});
} else {
done('Password reset token is invalid or has expired.', null);
}
});
},
function(user, done) {
res.render('templates/reset-password-confirm-email', {
name: user.displayName,
appName: config.app.title
}, function(err, emailHTML) {
done(err, emailHTML, user);
});
const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-confirm-email.server.view.pug");
var renderedHtml = fn(res.locals);
done(null, renderedHtml, user);
},
// If valid email, send reset email using service
function(emailHTML, user, done) {

79
app/libs/constants.js Normal file
View file

@ -0,0 +1,79 @@
'use strict';
module.exports = {
fieldTypes: ['textfield',
'date',
'email',
'link',
'legal',
'url',
'textarea',
'statement',
'welcome',
'thankyou',
'file',
'dropdown',
'scale',
'rating',
'radio',
'checkbox',
'hidden',
'yes_no',
'natural',
'stripe',
'number'],
ratingShapeTypes: ['Heart',
'Star',
'thumbs-up',
'thumbs-down',
'Circle',
'Square',
'Check Circle',
'Smile Outlined',
'Hourglass',
'bell',
'Paper Plane',
'Comment',
'Trash'],
deviceTypes: ['desktop', 'phone', 'tablet', 'other'],
languageTypes: ['en', 'fr', 'es', 'it', 'de'],
langCodeToWord: {
'en': 'English',
'fr': 'Français',
'es': 'Español',
'it': 'Italiàno',
'de': 'Deutsch'
},
wordToLangCode: {
'English': 'en',
'Français': 'fr',
'Español': 'es',
'Italiàno': 'it',
'Deutsch': 'de'
},
expressionStringTypes: ['field == static',
'field != static',
'field > static',
'field >= static',
'field <= static',
'field < static',
'field contains static',
'field !contains static',
'field begins static',
'field !begins static',
'field ends static',
'field !ends static'],
userRoleTypes: ['user', 'admin', 'superuser'],
regex: {
url: /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/,
hexCode: /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,
email: /^(([^<>()\[\]\\.,;:\s@']+(\.[^<>()\[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
}
};

View file

@ -0,0 +1,39 @@
'use strict';
// Plugin
module.exports = function timestamp (schema, options) {
options || (options = {})
// Options
var fields = {}
, createdPath = options.createdPath || 'created'
, modifiedPath = options.modifiedPath || 'modified'
, useVirtual = (options.useVirtual !== undefined)
? options.useVirtual
: true
// Add paths to schema if not present
if (!schema.paths[createdPath]) {
fields[modifiedPath] = { type: Date }
}
if (useVirtual) {
// Use the ObjectID for extracting the created time
schema.virtual(createdPath).get(function () {
return new Date(this._id.generationTime * 1000)
})
} else {
if (!schema.paths[createdPath]) {
fields[createdPath] = {
type: Date
, default: Date.now
}
}
}
schema.add(fields)
// Update the modified timestamp on save
schema.pre('save', function (next) {
this[modifiedPath] = new Date
next()
})
}

View file

@ -6,11 +6,12 @@
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
_ = require('lodash'),
mUtilities = require('mongoose-utilities'),
timeStampPlugin = require('../libs/timestamp.server.plugin'),
async = require('async'),
Random = require('random-js'),
mt = Random.engines.mt19937();
mt.autoSeed();
//Mongoose Models
@ -70,7 +71,6 @@ var VisitorDataSchema = new Schema({
userAgent: {
type: String
}
});
var formSchemaOptions = {
@ -218,7 +218,7 @@ FormSchema.virtual('analytics.fields').get(function () {
var visitors = this.analytics.visitors;
var that = this;
if(this.form_fields.length === 0) {
if(!this.form_fields || this.form_fields.length === 0) {
return null;
}
@ -282,7 +282,7 @@ FormSchema.virtual('analytics.fields').get(function () {
return fieldDropoffs;
});
FormSchema.plugin(mUtilities.timestamp, {
FormSchema.plugin(timeStampPlugin, {
createdPath: 'created',
modifiedPath: 'lastModified',
useVirtual: false
@ -303,7 +303,6 @@ FormSchema.pre('save', function (next) {
this.language = 'de';
break;
default:
this.language = 'en';
break;
}
next();
@ -335,54 +334,55 @@ FormSchema.pre('save', function (next) {
var that = this;
var _original;
async.series([function(cb) {
that.constructor
.findOne({_id: that._id}).exec(function (err, original) {
if (err) {
return cb(err);
} else if (!original){
return next();
} else {
_original = original;
return cb(null);
}
});
},
function(cb) {
if(that.form_fields && that.isModified('form_fields') && formFieldsAllHaveIds(that.toObject().form_fields)){
async.series([
function(cb) {
that.constructor
.findOne({_id: that._id}).exec(function (err, original) {
if (err) {
return cb(err);
} else if (!original){
return next();
} else {
_original = original;
return cb(null);
}
});
},
function(cb) {
if(that.form_fields && that.isModified('form_fields') && formFieldsAllHaveIds(that.toObject().form_fields)){
var current_form = that.toObject(),
old_form_fields = _original.toObject().form_fields,
new_ids = _.map(_.map(current_form.form_fields, 'globalId'), function(id){ return ''+id;}),
old_ids = _.map(_.map(old_form_fields, 'globalId'), function(id){ return ''+id;}),
deletedIds = getDeletedIndexes(old_ids, new_ids);
var current_form = that.toObject(),
old_form_fields = _original.toObject().form_fields,
new_ids = _.map(_.map(current_form.form_fields, 'globalId'), function(id){ return ''+id;}),
old_ids = _.map(_.map(old_form_fields, 'globalId'), function(id){ return ''+id;}),
deletedIds = getDeletedIndexes(old_ids, new_ids);
//Check if any form_fileds were deleted
if( deletedIds.length > 0 ){
//Check if any form_fileds were deleted
if( deletedIds.length > 0 ){
var modifiedSubmissions = [];
var modifiedSubmissions = [];
async.forEachOfSeries(deletedIds,
function (deletedIdIndex, key, cb_id) {
async.forEachOfSeries(deletedIds,
function (deletedIdIndex, key, cb_id) {
var deleted_id = old_ids[deletedIdIndex];
//Find FormSubmissions that contain field with _id equal to 'deleted_id'
FormSubmission.
find({ form: that, form_fields: {$elemMatch: {globalId: deleted_id} } }).
exec(function(err, submissions){
if(err) {
return cb_id(err);
}
var deleted_id = old_ids[deletedIdIndex];
//Find FormSubmissions that contain field with _id equal to 'deleted_id'
FormSubmission.
find({ form: that, form_fields: {$elemMatch: {globalId: deleted_id} } }).
exec(function(err, submissions){
if(err) {
return cb_id(err);
}
//Preserve fields that have at least one submission
if (submissions.length) {
//Add submissions
modifiedSubmissions.push.apply(modifiedSubmissions, submissions);
}
//Preserve fields that have at least one submission
if (submissions.length) {
//Add submissions
modifiedSubmissions.push.apply(modifiedSubmissions, submissions);
}
return cb_id(null);
});
},
return cb_id(null);
});
},
function (err) {
if(err){
console.error(err.message);
@ -424,17 +424,20 @@ FormSchema.pre('save', function (next) {
}, function (err) {
return cb(err);
});
}
);
});
} else {
return cb(null);
}
} else {
return cb(null);
}
} else {
return cb(null);
}
}],
function(err, results){
next(err);
],
function(err){
if(err){
return next(err);
}
next();
});
});

View file

@ -5,13 +5,11 @@
*/
var mongoose = require('mongoose'),
util = require('util'),
mUtilities = require('mongoose-utilities'),
timeStampPlugin = require('../libs/timestamp.server.plugin'),
_ = require('lodash'),
Schema = mongoose.Schema,
LogicJumpSchema = require('./logic_jump.server.model');
const UIDGenerator = require('uid-generator');
const uidgen3 = new UIDGenerator(256, UIDGenerator.BASE62);
LogicJumpSchema = require('./logic_jump.server.model'),
tokgen = require('../libs/tokenGenerator');
var FieldOptionSchema = new Schema({
option_id: {
@ -76,8 +74,7 @@ function BaseFieldSchema(){
},
title: {
type: String,
trim: true,
required: 'Field Title cannot be blank'
trim: true
},
description: {
type: String,
@ -106,7 +103,6 @@ function BaseFieldSchema(){
},
fieldType: {
type: String,
required: true,
enum: [
'textfield',
'date',
@ -134,7 +130,7 @@ function BaseFieldSchema(){
fieldValue: Schema.Types.Mixed
});
this.plugin(mUtilities.timestamp, {
this.plugin(timeStampPlugin, {
createdPath: 'created',
modifiedPath: 'lastModified',
useVirtual: false
@ -196,11 +192,8 @@ FormFieldSchema.pre('validate', function(next) {
//LogicJump Save
FormFieldSchema.pre('save', function(next) {
if(this.logicJump && this.logicJump.fieldA) {
if(this.logicJump.jumpTo === '') delete this.logicJump.jumpTo;
}
if(!this.globalId){
this.globalId = uidgen3.generateSync();
this.globalId = tokgen();
}
next();
});

View file

@ -5,17 +5,13 @@
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
mUtilities = require('mongoose-utilities'),
timeStampPlugin = require('../libs/timestamp.server.plugin'),
FieldSchema = require('./form_field.server.model.js');
/**
* Form Submission Schema
*/
var FormSubmissionSchema = new Schema({
title: {
type: String
},
form_fields: [FieldSchema],
form: {
@ -58,6 +54,19 @@ FormSubmissionSchema.pre('save', function (next) {
if(this.form_fields[i].fieldType === 'dropdown'){
this.form_fields[i].fieldValue = this.form_fields[i].fieldValue.option_value;
}
delete form_fields[i].validFieldTypes;
delete form_fields[i].disabled;
delete form_fields[i].required;
delete form_fields[i].isSubmission;
delete form_fields[i].title;
delete form_fields[i].fieldOptions;
delete form_fields[i].ratingOptions;
delete form_fields[i].logicJump;
delete form_fields[i].description;
delete form_fields[i].created;
delete form_fields[i].lastModified;
delete form_fields[i].deletePreserved;
}
next();
});
@ -67,12 +76,26 @@ FormSubmissionSchema.path('form_fields', {
for (var i = 0; i < form_fields.length; i++) {
form_fields[i].isSubmission = true;
form_fields[i]._id = new mongoose.mongo.ObjectID();
delete form_fields[i].validFieldTypes;
delete form_fields[i].disabled;
delete form_fields[i].required;
delete form_fields[i].isSubmission;
delete form_fields[i].title;
delete form_fields[i].fieldOptions;
delete form_fields[i].ratingOptions;
delete form_fields[i].logicJump;
delete form_fields[i].description;
delete form_fields[i].created;
delete form_fields[i].lastModified;
delete form_fields[i].deletePreserved;
}
return form_fields;
}
});
FormSubmissionSchema.plugin(mUtilities.timestamp, {
FormSubmissionSchema.plugin(timeStampPlugin, {
createdPath: 'created',
modifiedPath: 'lastModified',
useVirtual: false

View file

@ -44,6 +44,10 @@ var LogicJumpSchema = new Schema({
jumpTo: {
type: Schema.Types.ObjectId,
ref: 'FormField'
},
enabled: {
type: Schema.Types.Boolean,
default: false
}
}, schemaOptions);

View file

@ -0,0 +1,26 @@
'use strict';
const constants = require('../../libs/constants'),
config = require('../../../config/config');
module.exports = exports = function lastModifiedPlugin (schema, options) {
schema.add({
language: {
type: String,
enum: constants.languageTypes,
default: config.defaultLanguage,
required: options.required || 'Must be a valid language'
}
});
schema.pre('save', function (next) {
var currWord = this.language;
//English is the default backup language
this.language = 'en';
if(constants.wordToLangCode.has(currWord)){
this.language = constants.wordToLangCode[currWord];
}
next();
});
};

View file

@ -7,22 +7,9 @@ var mongoose = require('mongoose'),
Schema = mongoose.Schema,
crypto = require('crypto'),
config = require('../../config/config'),
fs = require('fs-extra'),
mUtilities = require('mongoose-utilities'),
timeStampPlugin = require('../libs/timestamp.server.plugin'),
path = require('path'),
querystring = require('querystring'),
nodemailer = require('nodemailer');
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');
}
});
querystring = require('querystring');
/**
* A Validation function for local strategy properties
@ -38,18 +25,11 @@ var validateLocalStrategyProperty = function(property) {
return ((this.provider !== 'local' && !this.updated) || propHasLength);
};
/**
* A Validation function for local strategy password
*/
var validateLocalStrategyPassword = function(password) {
return (this.provider !== 'local' || (password && password.length > 6));
};
/**
* A Validation function for username
*/
var validateUsername = function(username) {
return (username.match(/^[a-zA-Z0-9]+$/) !== null);
return (username.match(/^[a-zA-Z0-9.-_]+$/) !== null);
};
@ -70,23 +50,17 @@ var UserSchema = new Schema({
email: {
type: String,
trim: true,
lowercase: true,
unique: 'Account already exists with this email',
required: 'Please enter your email',
validate: {
validator: validateLocalStrategyProperty,
message: 'Please fill in your email'
},
match: [/.+\@.+\..+/, 'Please fill a valid email address']
match: [/.+\@.+\..+/, 'Please fill a valid email address'],
required: [true, 'Email is required']
},
username: {
type: String,
unique: true,
required: true,
lowercase: true,
validate: {
validator: validateUsername,
message: 'Please use a valid username'
}
match: [/^[a-zA-Z0-9\-]+$/, 'Username can only contain alphanumeric characters and \'-\''],
required: [true, 'Username is required']
},
passwordHash: {
type: String,
@ -97,7 +71,6 @@ var UserSchema = new Schema({
},
provider: {
type: String,
required: 'Provider is required',
default: 'local'
},
providerData: {},
@ -113,7 +86,6 @@ var UserSchema = new Schema({
type: String,
enum: ['en', 'fr', 'es', 'it', 'de'],
default: 'en',
required: 'User must have a language'
},
lastModified: {
type: Date
@ -143,7 +115,7 @@ UserSchema.virtual('displayName').get(function () {
return this.firstName + ' ' + this.lastName;
});
UserSchema.plugin(mUtilities.timestamp, {
UserSchema.plugin(timeStampPlugin, {
createdPath: 'created',
modifiedPath: 'lastModified',
useVirtual: false

View file

@ -25,10 +25,13 @@ module.exports = function(app) {
} else {
app.route('/forms/:formIdFast([a-zA-Z0-9]+)/render')
.get(forms.readForRender);
app.route('/view/')
.get(core.form);
}
app.route('/forms/:formIdFast([a-zA-Z0-9]+)')
.post(forms.createSubmission)
.post(forms.createSubmission)
app.route('/forms')
.get(auth.isAuthenticatedOrApiKey, forms.list)

View file

@ -14,7 +14,6 @@ module.exports = function(app) {
// Setting up the users profile api
app.route('/users/me').get(auth.isAuthenticatedOrApiKey, users.getUser);
app.route('/users').put(auth.isAuthenticatedOrApiKey, users.update);
app.route('/users/accounts').delete(users.requiresLogin, users.removeOAuthProvider);
// Setting up the users account verification api
app.route('/auth/verify/:token').get(users.validateVerificationToken);
@ -34,34 +33,7 @@ module.exports = function(app) {
app.route('/auth/signout').get(users.signout);
app.route('/auth/genkey').get(users.requiresLogin, users.generateAPIKey);
// // Setting the facebook oauth routes
// app.route('/auth/facebook').get(passport.authenticate('facebook', {
// scope: ['email']
// }));
// app.route('/auth/facebook/callback').get(users.oauthCallback('facebook'));
// // Setting the twitter oauth routes
// app.route('/auth/twitter').get(passport.authenticate('twitter'));
// app.route('/auth/twitter/callback').get(users.oauthCallback('twitter'));
// // Setting the google oauth routes
// app.route('/auth/google').get(passport.authenticate('google', {
// scope: [
// 'https://www.googleapis.com/auth/userinfo.profile',
// 'https://www.googleapis.com/auth/userinfo.email'
// ]
// }));
// app.route('/auth/google/callback').get(users.oauthCallback('google'));
// // Setting the linkedin oauth routes
// app.route('/auth/linkedin').get(passport.authenticate('linkedin'));
// app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin'));
// // Setting the github oauth routes
// app.route('/auth/github').get(passport.authenticate('github'));
// app.route('/auth/github/callback').get(users.oauthCallback('github'));
// Finish by binding the user middleware
app.param('userId', users.userByID);
};

View file

@ -5,13 +5,14 @@
*/
var mongoose = require('mongoose'),
errorHandler = require('../controllers/errors.server.controller'),
Form = mongoose.model('Form');
Form = mongoose.model('Form'),
request = require('request');
// Create the chat configuration
module.exports = function (io, socket) {
var visitorsData = {};
var saveVisitorData = function (data, cb){
var saveVisitorData = function (data, socket, cb){
Form.findById(data.formId, function(err, form) {
if (err) {
console.error(err);
@ -25,22 +26,25 @@ module.exports = function (io, socket) {
timeElapsed: data.timeElapsed,
isSubmitted: data.isSubmitted,
language: data.language,
ipAddr: data.ipAddr,
ipAddr: '',
deviceType: data.deviceType
};
form.analytics.visitors.push(newVisitor);
form.save(function (formSaveErr) {
if (err) {
console.error(err);
throw new Error(errorHandler.getErrorMessage(formSaveErr));
}
if(cb){
return cb();
}
});
form.form_fields = form.form_fields.map(v => Object.assign({}, v, { fieldValue: null }));
form.save(function (formSaveErr) {
if (err) {
console.error(err);
throw new Error(errorHandler.getErrorMessage(formSaveErr));
}
if(cb){
return cb();
}
});
});
};
@ -50,10 +54,11 @@ module.exports = function (io, socket) {
visitorsData[current_socket.id] = data;
visitorsData[current_socket.id].socketId = current_socket.id;
visitorsData[current_socket.id].isSaved = false;
if (data.isSubmitted && !data.isSaved) {
visitorsData[current_socket.id].isSaved = true;
saveVisitorData(data, function() {
console.log("\n\n\n\n\ncurrent_socket.id: "+current_socket.id);
current_socket.disconnect(true);
});
}
@ -72,3 +77,4 @@ module.exports = function (io, socket) {
});
});
};

View file

@ -1,5 +1,7 @@
'use strict';
require('../../server.js');
/**
* Module dependencies.
*/

View file

@ -1,5 +1,4 @@
'use strict';
process.env.NODE_ENV = 'test';
var should = require('should'),
lodash = require('lodash'),
@ -10,7 +9,8 @@ var should = require('should'),
User = mongoose.model('User'),
Form = mongoose.model('Form'),
Field = mongoose.model('Field'),
FormSubmission = mongoose.model('FormSubmission');
FormSubmission = mongoose.model('FormSubmission'),
async = require('async');
/**
* Globals
@ -19,8 +19,8 @@ var user, myForm, userSession;
// Create user credentials
var credentials = {
username: 'test1234',
email: 'test1234@test.com',
username: 'aeokjqjqkqaeoaoe',
email: 'aeoaekjqjqqjkoeoa@test.com',
password: 'password'
};
@ -30,18 +30,17 @@ var credentials = {
describe('Form Routes Unit tests', function() {
beforeEach(function(done) {
// Create a new user
user = new User({
firstName: 'Full',
lastName: 'Name',
displayName: 'Full Name',
email: credentials.email,
username: credentials.username,
password: credentials.password,
provider: 'local'
});
// Save a user to the test db and create new Form
user.save(function(err) {
should.not.exist(err);
@ -65,10 +64,12 @@ describe('Form Routes Unit tests', function() {
});
it(' > should not be able to create a Form if not logged in', function(done) {
userSession.post('/forms')
.send({form: myForm})
.expect(401)
.end(function(FormSaveErr, FormSaveRes) {
console.log(FormSaveRes.text);
// Call the assertion callback
done(FormSaveErr);
});
@ -83,7 +84,7 @@ describe('Form Routes Unit tests', function() {
});
});
it(' > should be able to read/get a Form if not signed in', function(done) {
it(' > should be able to read/get a live Form if not signed in', function(done) {
// Create new Form model instance
var FormObj = new Form(myForm);
@ -105,6 +106,23 @@ describe('Form Routes Unit tests', function() {
});
});
it(' > should be able to read/get a non-live Form if not signed in', function(done) {
// Create new Form model instance
var FormObj = new Form(myForm);
FormObj.isLive = false;
// Save the Form
FormObj.save(function(err, form) {
if(err) return done(err);
userSession.get('/subdomain/' + credentials.username + '/forms/' + form._id + '/render')
.expect(401, {message: 'Form is Not Public'})
.end(function(err, res) {
done(err);
});
});
});
it(' > should not be able to delete an Form if not signed in', function(done) {
// Set Form user
myForm.admin = user;
@ -146,6 +164,16 @@ describe('Form Routes Unit tests', function() {
});
});
it(' > should not be able to create a Form if body is empty', function(done) {
loginSession.post('/forms')
.send({form: null})
.expect(400, {"message":"Invalid Input"})
.end(function(FormSaveErr, FormSaveRes) {
// Call the assertion callback
done(FormSaveErr);
});
});
it(' > should not be able to save a Form if no title is provided', function(done) {
// Set Form with a invalid title field
myForm.title = '';
@ -153,7 +181,7 @@ describe('Form Routes Unit tests', function() {
// Save a new Form
authenticatedSession.post('/forms')
.send({form: myForm})
.expect(405)
.expect(500)
.end(function(FormSaveErr, FormSaveRes) {
// Handle Form save error
if (FormSaveErr) {
@ -165,10 +193,22 @@ describe('Form Routes Unit tests', function() {
done();
});
});
it(' > should be able to update a Form if signed in', function(done) {
it(' > should be able to create a Form if form_fields are undefined', function(done) {
myForm.analytics = null;
myForm.form_fields = null;
loginSession.post('/forms')
.send({form: myForm})
.expect(200)
.end(function(FormSaveErr, FormSaveRes) {
// Call the assertion callback
done(FormSaveErr);
});
});
it(' > should be able to update a Form if signed in and Form is valid', function(done) {
// Save a new Form
loginSession.post('/forms')
@ -182,7 +222,7 @@ describe('Form Routes Unit tests', function() {
}
// Update Form title
myForm.title = 'WHY YOU GOTTA BE SO MEAN?';
myForm.title = 'WHY YOU GOTTA BE SO FORMULAIC?';
// Update an existing Form
loginSession.put('/forms/' + FormSaveRes.body._id)
@ -197,13 +237,12 @@ describe('Form Routes Unit tests', function() {
// Set assertions
(FormUpdateRes.body._id).should.equal(FormSaveRes.body._id);
(FormUpdateRes.body.title).should.match('WHY YOU GOTTA BE SO MEAN?');
(FormUpdateRes.body.title).should.match(myForm.title);
// Call the assertion callback
done();
});
});
});
it(' > should be able to delete a Form if signed in', function(done) {
@ -238,10 +277,9 @@ describe('Form Routes Unit tests', function() {
done();
});
});
});
it('should be able to save new form while logged in', function(done){
it(' > should be able to save new form while logged in', function(done){
// Save a new Form
authenticatedSession.post('/forms')
.send({form: myForm})
@ -271,12 +309,70 @@ describe('Form Routes Unit tests', function() {
});
});
it(' > should be able to get list of users\' forms sorted by date created while logged in', function(done) {
var myForm1 = {
title: 'First Form',
language: 'en',
admin: user.id,
form_fields: [
new Field({'fieldType':'textfield', 'title':'First Name', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'nascar', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'hockey', 'fieldValue': ''})
],
isLive: true
};
var myForm2 = {
title: 'Second Form',
language: 'en',
admin: user.id,
form_fields: [
new Field({'fieldType':'textfield', 'title':'Last Name', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'formula one', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'football', 'fieldValue': ''})
],
isLive: true
};
var FormObj1 = new Form(myForm1);
var FormObj2 = new Form(myForm2);
async.waterfall([
function(callback) {
FormObj1.save(function(err){
callback(err);
});
},
function(callback) {
FormObj2.save(function(err){
callback(err);
});
},
function(callback) {
loginSession.get('/forms')
.expect(200)
.end(function(err, res) {
res.body.length.should.equal(2);
res.body[0].title.should.equal('Second Form');
res.body[1].title.should.equal('First Form');
// Call the assertion callback
callback(err);
});
}
], function (err) {
done(err);
});
});
afterEach('should be able to signout user', function(done){
authenticatedSession.get('/auth/signout')
.expect(200)
.end(function(signoutErr, signoutRes) {
// Handle signout error
if (signoutErr) return done(signoutErr);
if (signoutErr) {
return done(signoutErr);
}
authenticatedSession.destroy();
done();
});

View file

@ -109,9 +109,7 @@ describe('FormSubmission Model Unit Tests:', function() {
myForm.save(function(err, form){
if(err){
console.log(err.errors);
done(err);
return;
return done(err);
}
var submissionFields = _.clone(myForm.form_fields);
@ -170,7 +168,7 @@ describe('FormSubmission Model Unit Tests:', function() {
});
it('should be able to find FormSubmission by $elemMatch on form_fields id', function(done){
FormSubmission.findOne({ form: myForm._id, admin: user, form_fields: {$elemMatch: {_id: myForm.form_fields[0]._id} } })
FormSubmission.findOne({ form: myForm._id, form_fields: {$elemMatch: {globalId: myForm.form_fields[0].globalId} } })
.exec(function(err, submission){
should.not.exist(err);
should.exist(submission);
@ -201,6 +199,7 @@ describe('FormSubmission Model Unit Tests:', function() {
it('should preserve deleted form_fields that have submissions without any problems', function(done) {
var fieldPropertiesToOmit = ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId', 'isSubmission', 'validFieldTypes', 'title'];
var old_fields = myForm.toObject().form_fields;
var new_form_fields = _.clone(myForm.toObject().form_fields);
new_form_fields.splice(0, 1);
@ -212,8 +211,8 @@ describe('FormSubmission Model Unit Tests:', function() {
should.not.exist(err);
should.exist(_form.form_fields);
var actual_fields = _.deepOmit(_form.toObject().form_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']);
old_fields = _.deepOmit(old_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']);
var actual_fields = _.deepOmit(_form.toObject().form_fields, fieldPropertiesToOmit);
old_fields = _.deepOmit(old_fields, fieldPropertiesToOmit);
should.deepEqual(actual_fields, old_fields, 'old form_fields not equal to newly saved form_fields');
done();

View file

@ -21,7 +21,8 @@ var credentials, user;
* Form routes tests
*/
describe('Form Submission Routes Unit tests', function() {
var FormObj, _Submission, submissionSession;
var FormObj, _Submission, submissionSession, _SubmissionBody
beforeEach(function(done) {
@ -60,15 +61,43 @@ describe('Form Submission Routes Unit tests', function() {
if (formSaveErr) done(formSaveErr);
_Submission = {
form_fields: [
{'fieldType':'textfield', 'title':'First Name', 'fieldValue': 'David'},
{'fieldType':'checkbox', 'title':'nascar', 'fieldValue': true},
{'fieldType':'checkbox', 'title':'hockey', 'fieldValue': false}
],
form: form._id,
admin: user._id,
form_fields: [
{'fieldType':'textfield', 'title':'First Name', 'fieldValue': 'David', _id: '', isSubmission: false, deletePreserved: false},
{'fieldType':'checkbox', 'title':'nascar', 'fieldValue': true, _id: '', isSubmission: false, deletePreserved: true},
{'fieldType':'checkbox', 'title':'hockey', 'fieldValue': false, _id: '', isSubmission: false, deletePreserved: false}
],
percentageComplete: 100,
timeElapsed: 11.55
timeElapsed: 11.55,
ipAddr: '123.233.232.232',
geoLocation: {
Country: 'Canada',
City: 'Vancouver'
},
device:{
type: 'Mobile',
name: 'iPhone'
}
};
_SubmissionBody ={
_id: form._id,
form_fields: [
{'fieldType':'textfield', 'title':'First Name', 'fieldValue': 'David', _id: '', isSubmission: false, deletePreserved: false},
{'fieldType':'checkbox', 'title':'nascar', 'fieldValue': true, _id: '', isSubmission: false, deletePreserved: true},
{'fieldType':'checkbox', 'title':'hockey', 'fieldValue': false, _id: '', isSubmission: false, deletePreserved: false}
],
percentageComplete: 100,
timeElapsed: 11.55,
ipAddr: '123.233.232.232',
geoLocation: {
Country: 'Canada',
City: 'Vancouver'
},
device:{
type: 'Mobile',
name: 'iPhone'
}
};
FormObj = form;
@ -86,12 +115,11 @@ describe('Form Submission Routes Unit tests', function() {
//Create Submission
submissionSession.post('/forms/' + FormObj._id)
.send(_Submission)
.send(_SubmissionBody)
.expect(200)
.end(function(err, res) {
should.not.exist(err);
done();
});
});
@ -99,7 +127,7 @@ describe('Form Submission Routes Unit tests', function() {
it(' > should be able to get Form Submissions if signed in', function(done) {
//Create Submission
submissionSession.post('/forms/' + FormObj._id)
.send(_Submission)
.send(_SubmissionBody)
.expect(200)
.end(function(err, res) {

View file

@ -0,0 +1,70 @@
// Dependencies
var util = require('util')
, assert = require('assert')
, mongoose = require('mongoose')
, timestamp = require('../../libs/timestamp.server.plugin')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId
// Run tests
describe('Timestamp', function () {
describe('#default()', function () {
var FooSchema = new Schema()
FooSchema.plugin(timestamp)
var FooModel = mongoose.model('timeFoo', FooSchema)
, bar = new FooModel()
before(function () {
FooModel.remove(function (err) {
assert.strictEqual(err, null)
})
})
it('should have custom properties', function (done) {
assert.strictEqual(typeof FooSchema.virtuals.created, 'object')
assert.strictEqual(typeof FooSchema.paths.modified, 'object')
done()
})
it('should create the default attributes', function (done) {
bar.save(function (err, doc) {
assert.strictEqual(err, null)
assert.strictEqual(util.isDate(doc.created), true)
assert.strictEqual(util.isDate(doc.modified), true)
done()
})
})
})
describe('#custom()', function () {
var FooSchema = new Schema()
FooSchema.plugin(timestamp, {
createdPath: 'oh'
, modifiedPath: 'hai'
, useVirtual: false
})
var BarModel = mongoose.model('timeBar', FooSchema)
, bar = new BarModel()
before(function () {
BarModel.remove(function (err) {
assert.strictEqual(err, null)
})
})
it('should have custom properties', function (done) {
assert.strictEqual(typeof FooSchema.paths.oh, 'object')
assert.strictEqual(typeof FooSchema.paths.hai, 'object')
done()
})
it('should create custom attributes', function (done) {
bar.save(function (err, doc) {
assert.strictEqual(err, null)
assert.strictEqual(util.isDate(doc.oh), true)
assert.strictEqual(util.isDate(doc.hai), true)
done()
})
})
})
})

View file

@ -45,7 +45,6 @@ describe('User CRUD tests', function() {
.send(_User)
.expect(200)
.end(function(FormSaveErr) {
console.log('CREATING USER');
// Handle error
should.not.exist(FormSaveErr);

View file

@ -1,8 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<h1>Page Not Found</h1>
<pre>
{{url}} is not a valid path.
</pre>
{% endblock %}

View file

@ -0,0 +1,8 @@
extends layout.server.view.pug
block content
section.public-form.auth.sigin-view.valign-wrapper
div.row.valign
h3.col-md-12.text-center=__('404_HEADER')
div.col-md-4.col-md-offset-4
div.col-md-12.text-center(style="padding-bottom: 50px;")=__('404_BODY', url)

View file

@ -1,8 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<h1>Server Error</h1>
<pre>
{{error}}
</pre>
{% endblock %}

View file

@ -0,0 +1,12 @@
extends layout.server.view.pug
block content
section.public-form.auth.sigin-view.valign-wrapper
div.row.valign
h3.col-md-12.text-center=__('500_HEADER')
div.col-md-4.col-md-offset-4
if process.env.NODE_ENV == 'development' || process.env.NODE_ENV == 'test'
div.col-md-12.text-center(style="padding-bottom: 50px;")
| #{error}
else
div.col-md-12.text-center(style="padding-bottom: 50px;")=__('500_BODY')

View file

@ -1,142 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}} Form</title>
<!-- General META -->
<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">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<style>
.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249);
background-size: 50px 50px;
}
</style>
<!-- Fav Icon -->
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body ng-cloak>
<div class="loader"></div>
<section class="content">
<section ui-view></section>
</section>
<!--Embedding The User Object signupDisabled, socketPort and socketUrl Boolean -->
<script type="text/javascript">
var user = {{ user | json | safe }};
var signupDisabled = {{signupDisabled | safe}};
var socketPort = false;
{% if socketPort %}
socketPort = {{socketPort | safe }};
{% endif %}
var socketUrl = "{{socketUrl | safe}}";
var subdomainsDisabled = {{subdomainsDisabled | safe}};
</script>
<script src="/static/lib/jquery/dist/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(window).on("load", function() {
$(".loader").fadeOut("slow");
});
</script>
<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">
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}
<link rel="stylesheet" href="{{bowerCssFile}}">
{% endfor %}
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.min.css"/>
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!--Socket.io Client Dependency-->
<script src="/static/lib/socket.io-client/dist/socket.io.min.js"></script>
<script src="/static/lib/jquery-ui/jquery-ui.js" type="text/javascript"></script>
<script src="/static/dist/vendor.min.js"></script>
<script src="/static/lib/angular-ui-date/src/date.js" type="text/javascript"></script>
<!--Application JavaScript Files-->
{% for jsFile in formJSFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>
{% endfor %}
<!-- end Application Javascript dependencies-->
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script async type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
{% endif %}
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
{% if google_analytics_id %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");
</script>
</body>
</html>

View file

@ -0,0 +1,109 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title=title
// General META
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')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content='keywords')
meta(name='description', content='description')
// Facebook META
meta(property='og:site_name', content=title)
meta(property='og:title', content=title)
meta(property='og:description', content='description')
meta(property='og:url', content='url')
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content=title)
meta(name='twitter:description', content='description')
meta(name='twitter:url', content='url')
meta(name='twitter:image', content='/img/brand/logo.png')
style.
.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249);
background-size: 50px 50px;
}
// Fav Icon
link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon')
body(ng-cloak='')
.loader
section.content
section(ui-view='')
//Embedding The User Object signupDisabled, socketPort and socketUrl Boolean
script(type='text/javascript').
var signupDisabled = !{signupDisabled};
var socketPort = false;
var socketUrl = false;
var subdomainsDisabled = !{subdomainsDisabled};
//Embedding socketPort
if socketPort
script(type='text/javascript').
socketPort = !{socketPort}
//Embedding socketUrl
if socketUrl
script(type='text/javascript').
socketUrl = "!{socketUrl}"
//JSEP
script(src='https://cdn.jsdelivr.net/npm/jsep@0.3.4/build/jsep.min.js', type='text/javascript')
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')
//Bower CSS dependencies
each bowerCssFile in bowerCssFiles
link(rel='stylesheet', href=bowerCssFile)
link(rel='stylesheet', href='/static/lib/angular-input-stars/angular-input-stars.css')
link(rel='stylesheet', href='/static/lib/jquery-ui/themes/flick/jquery-ui.min.css')
// end Bower CSS dependencies
//Application CSS Files
each cssFile in cssFiles
link(rel='stylesheet', href=cssFile)
// end Application CSS Files
//Socket.io Client Dependency
script(src='/static/lib/socket.io-client/dist/socket.io.min.js')
script(src='/static/lib/jquery-ui/jquery-ui.js', type='text/javascript')
//Minified Bower Dependencies
script(src='/static/lib/angular/angular.min.js')
script(src='/static/dist/form-vendor.min.js')
script(src='/static/lib/angular-ui-date/src/date.js', type='text/javascript')
//Application JavaScript Files
each jsFile in formJSFiles
script(type='text/javascript', src=jsFile)
// end Application Javascript dependencies
if process.env.NODE_ENV === 'development'
//Livereload script rendered
script(async='', type='text/javascript', src='http://#{request.hostname}:35729/livereload.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
if google_analytics_id
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='')
script(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -1,4 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<section class="content" ui-view></section>
{% endblock %}

View file

@ -0,0 +1,55 @@
extends layout.server.view.pug
block content
section.content(ui-view='', ng-cloak='')
script(src='/static/lib/file-saver.js/FileSaver.js', type='text/javascript')
//Embedding The User Object
script(type='text/javascript').
var user = null;
//Embedding The signupDisabled Boolean
script(type='text/javascript').
var signupDisabled = !{signupDisabled};
var socketPort = false;
var socketUrl = false;
var subdomainsDisabled = !{subdomainsDisabled};
var locale = "en";
//Embedding locale
if locale
script(type='text/javascript').
locale = "!{locale}";
//Embedding socketPort
if socketPort
script(type='text/javascript').
socketPort = !{socketPort}
//Embedding socketUrl
if socketUrl
script(type='text/javascript').
socketUrl = "!{socketUrl}"
//Socket.io Client Dependency
script(src='https://cdn.socket.io/socket.io-1.4.5.js')
//Bower JS dependencies
each bowerJSFile in bowerJSFiles
script(type='text/javascript', src=bowerJSFile)
// end Bower JS dependencies
script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js')
//Application JavaScript Files
each jsFile in jsFiles
script(type='text/javascript', src=jsFile)
// end Application Javascript dependencies
if process.env.NODE_ENV === 'development'
script(type='text/javascript', src='http://#{request.hostname}:35729/livereload.js')
script(src='https://cdn.ravenjs.com/2.3.0/angular/raven.min.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();

View file

@ -1,136 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<!-- General META -->
<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">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<!-- Fav Icon -->
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/lib/bootstrap/dist/css/bootstrap.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900'>
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}
<link rel="stylesheet" href="{{bowerCssFile}}">
{% endfor %}
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.css"/>
<link rel="stylesheet" href="/static/modules/core/css/github-fork-ribbon.css"/>
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body ng-cloak>
{% block content %}{% endblock %}
<script src="/static/lib/file-saver.js/FileSaver.js" type="text/javascript"></script>
<!--Embedding The User Object-->
<script type="text/javascript">
var user = {{ user | json | safe }};
</script>
<!--Embedding The signupDisabled Boolean-->
<script type="text/javascript">
var signupDisabled = {{signupDisabled | safe}};
var socketPort = false;
{% if socketPort %}
socketPort = {{socketPort | safe}};
{% endif %}
var socketUrl = "{{socketUrl | safe}}" || false;
var subdomainsDisabled = {{subdomainsDisabled | safe}};
</script>
<!--Socket.io Client Dependency-->
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<!--Bower JS dependencies-->
{% for bowerJSFile in bowerJSFiles %}
<script type="text/javascript" src="{{bowerJSFile}}"></script>
{% endfor %}
<!-- end Bower JS dependencies-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js"></script>
<!--Application JavaScript Files-->
{% for jsFile in jsFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>
{% endfor %}
<!-- end Application Javascript dependencies-->
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
{% endif %}
<script src="https://cdn.ravenjs.com/2.3.0/angular/raven.min.js"></script>
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
<!-- [if lt IE 9]>
<section class="browsehappy jumbotron hide">
<h1>Hello there!</h1>
<p>You are using an old browser which we unfortunately do not support.</p>
<p>Please <a href="http://browsehappy.com/">click here</a> to update your browser before using the website.</p>
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
</section>
<![endif] -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");
</script>
</body>
</html>

View file

@ -0,0 +1,61 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title=title
// General META
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')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content=keywords)
meta(name='description', content=description)
// Facebook META
meta(property='og:site_name', content=title)
meta(property='og:title', content=title)
meta(property='og:description', content=description)
meta(property='og:url', content=url)
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content=title)
meta(name='twitter:description', content=description)
meta(name='twitter:url', content=url)
meta(name='twitter:image', content='/img/brand/logo.png')
// Fav Icon
link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u', crossorigin='anonymous')
link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900')
//Bower CSS dependencies
each bowerCssFile in bowerCssFiles
link(rel='stylesheet', href=bowerCssFile)
link(rel='stylesheet', href='/static/lib/angular-input-stars/angular-input-stars.css')
link(rel='stylesheet', href='/static/lib/jquery-ui/themes/flick/jquery-ui.css')
link(rel='stylesheet', href='/static/modules/core/css/github-fork-ribbon.css')
// end Bower CSS dependencies
//Application CSS Files
each cssFile in cssFiles
link(rel='stylesheet', href=cssFile)
// end Application CSS Files
body
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(src='https://www.google-analytics.com/analytics.js', async='', defer='')
script(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -1,94 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<!-- General META -->
<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">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<!-- 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'>
<!--Bower CSS dependencies-->
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<redoc spec-url='/static/swagger.json'></redoc>
<script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
<!--Bower JS dependencies-->
{% for bowerJSFile in bowerJSFiles %}
<script type="text/javascript" src="{{bowerJSFile}}"></script>
{% endfor %}
<!-- end Bower JS dependencies-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js"></script>
{% if process.env.NODE_ENV === 'development' %}
<script src="https://cdn.ravenjs.com/2.3.0/angular/raven.min.js"></script>
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
<!-- [if lt IE 9]>
<section class="browsehappy jumbotron hide">
<h1>Hello there!</h1>
<p>You are using an old browser which we unfortunately do not support.</p>
<p>Please <a href="http://browsehappy.com/">click here</a> to update your browser before using the website.</p>
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
</section>
<![endif] -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

View file

@ -0,0 +1,62 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title #{title}
// General META
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')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content='#{keywords}')
meta(name='description', content='#{description}')
// Facebook META
meta(property='og:site_name', content='#{title}')
meta(property='og:title', content='#{title}')
meta(property='og:description', content='#{description}')
meta(property='og:url', content='{{url}}')
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content='#{title}')
meta(name='twitter:description', content='#{description}')
meta(name='twitter:url', content='{{url}}')
meta(name='twitter:image', content='/img/brand/logo.png')
// 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}')
// end Application CSS Files
body
redoc(spec-url='/static/swagger.json')
script(src='https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js')
//Bower JS dependencies
each bowerJSFile in bowerJSFiles
script(type='text/javascript', src='#{bowerJSFile}')
// end Bower JS dependencies
script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js')
if process.env.NODE_ENV === 'development'
script(src='https://cdn.ravenjs.com/2.3.0/angular/raven.min.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
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='')
script(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -1,13 +1,64 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<p>Dear {{name}},</p>
<p></p>
<p>This is a confirmation that the password for your account has just been changed</p>
<br>
<br>
<p>The {{appName}} Support Team</p>
</body>
</html>
<html>
<head>@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,latin-ext);
<style>
a {
color: #007ee6;
text-decoration: none;
}
</style>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body style="padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%;" marginheight="0" marginwidth="0">
<center>
<table cellpadding="8" cellspacing="0" style="*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff;" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" style="border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px;" border="0" align="center">
<tr>
<td colspan="3" height="6"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="line-height: 25px;" border="0" align="center">
<tr>
<td colspan="3" height="30"></td>
</tr>
<tr>
<td width="36"></td>
<td width="454" align="left" style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px;" valign="top">
<p>Hello there!</p>
<p>This is a courtesy message to confirm that your password was just changed.</p>
<p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
<p> - The #{appName} team</p>
</td>
<td width="36"></td>
</tr>
<tr>
<td colspan="3" height="36"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td style="padding: 0; border-collapse: collapse;">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none;">
<td width="400" align="left"></td>
<td width="128" align="right">© TellForm 2017</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>

View file

@ -0,0 +1,41 @@
doctype html
html
head
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1')
p=__("VERIFICATION_EMAIL_PARAGRAPH_2")
a(href='mailto:team@tellform.com') team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -1,18 +1,66 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<p>Dear {{name}},</p>
<br>
<p>
You have requested to have your password reset for your account at {{appName}}
</p>
<p>Please visit this url to reset your password:</p>
<p>{{url}}</p>
<strong>If you didn't make this request, you can ignore this email.</strong>
<br>
<br>
<p>The {{appName}} Support Team</p>
</body>
</html>
<html>
<head>@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,latin-ext);
<style>
a {
color: #007ee6;
text-decoration: none;
}
</style>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body style="padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%;" marginheight="0" marginwidth="0">
<center>
<table cellpadding="8" cellspacing="0" style="*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff;" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" style="border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px;" border="0" align="center">
<tr>
<td colspan="3" height="6"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="line-height: 25px;" border="0" align="center">
<tr>
<td colspan="3" height="30"></td>
</tr>
<tr>
<td width="36"></td>
<td width="454" align="left" style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px;" valign="top">
<p>Hello there!</p>
<p>Here is a special link that will allow you to reset your password. Please note it will expire in one hour for your protection:</p>
<p><a href="{{url}}">Reset Your Password</a></p>
<p>If you did not request this, please ignore this email and your password will remain unchanged.</p>
<p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
<p> - The {{appName}} team</p>
</td>
<td width="36"></td>
</tr>
<tr>
<td colspan="3" height="36"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td style="padding: 0; border-collapse: collapse;">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none;">
<td width="400" align="left"></td>
<td width="128" align="right">© TellForm 2017</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>

View file

@ -0,0 +1,44 @@
doctype html
html
head
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1')
p
a(href=url)=__('RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT')
p=__('RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2')
p=__('VERIFICATION_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com') team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -1,71 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
</head>
<body style="padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%;" marginheight="0" marginwidth="0">
<center>
<table cellpadding="8" cellspacing="0" style="*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff;" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" style="border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px;" border="0" align="center">
<tr>
<td colspan="3" height="6"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="line-height: 25px;" border="0" align="center">
<tr>
<td colspan="3" height="30"></td>
</tr>
<tr>
<td width="36"></td>
<td width="454" align="left" style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px;" valign="top">
//- -----------------------------------------------------------------------------------
//- Only Edit Here
//- -----------------------------------------------------------------------------------
p Hello {{name}}!
p
| Welcome to {{appName}}! Here is a special link to activate your new account:
p
a(href='${URL}') Activate my account
p
| Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;
a(href='mailto:{{contactEmail}}') {{contactEmail}}
| .
p   - The {{appName}} team
//- ----------------------------------------------------------------------------------
</td>
<td width="36"></td>
</tr>
<tr>
<td colspan="3" height="36"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td style="padding: 0; border-collapse: collapse;">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none;"></tr>
<td width="400" align="left">
<td width="128" align="right">© </td>
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>

View file

@ -0,0 +1,49 @@
html
head
style.
a {
color: #007ee6;
text-decoration: none;
}
meta(content='text/html; charset=utf-8', http-equiv='Content-Type')
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('VERIFICATION_EMAIL_PARAGRAPH_1')
p
a(href='http://${URL}')=__('VERIFICATION_EMAIL_LINK_TEXT')
p=__('VERIFICATION_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com')
| team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -0,0 +1,48 @@
html
head
style.
a {
color: #007ee6;
text-decoration: none;
}
meta(content='text/html; charset=utf-8', http-equiv='Content-Type')
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('WELCOME_EMAIL_PARAGRAPH_1')
p=__('WELCOME_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com')
| team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -2,7 +2,7 @@
"name": "tellform",
"description": "Opensource alternative to TypeForm",
"version": "2.0.0",
"homepage": "https://github.com/whitef0x0/tellform",
"homepage": "https://github.com/tellform/tellform",
"authors": [
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
],
@ -37,7 +37,7 @@
"angular-translate": "~2.11.0",
"ng-translate": "*",
"deep-diff": "^0.3.4",
"jsep": "^0.3.1",
"jsep": "0.3.1",
"ngclipboard": "^1.1.1",
"mobile-detect": "^1.3.3",
"socket.io-client": "^1.7.2",

50
config/env/all.js vendored
View file

@ -8,25 +8,52 @@ module.exports = {
keywords: process.env.APP_KEYWORDS || 'typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs'
},
db: {
uri: 'mongodb://'+ (process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || 'localhost')+'/mean',
uri: process.env.MONGOLAB_URI || process.env.MONGODB_URI || 'mongodb://'+ (process.env.DB_PORT_27017_TCP_ADDR || '127.0.0.1') + '/mean',
options: {
user: '',
pass: ''
}
},
admin:{
email: process.env.ADMIN_EMAIL || 'admin@admin.com',
username: process.env.ADMIN_USERNAME || 'root',
password: process.env.ADMIN_PASSWORD || 'root',
},
redisUrl: process.env.REDIS_URL || 'redis://127.0.0.1:6379',
port: process.env.PORT || 3000,
socketPort: process.env.SOCKET_PORT || 20523,
socketPortExternallyVisible: (process.env.SOCKET_PORT_EXTERN_VISIBLE === 'TRUE'),
templateEngine: 'swig',
templateEngine: 'pug',
reCAPTCHA_Key: process.env.reCAPTCHA_KEY || '',
signupDisabled: (process.env.SIGNUP_DISABLED === 'TRUE'),
signupDisabled: (process.env.SIGNUP_DISABLED === 'TRUE'),
enableClusterMode: (process.env.ENABLE_CLUSTER_MODE === 'TRUE'),
baseUrl: '',
baseUrl: process.env.BASE_URL || 'localhost:3000',
tempUserCollection: 'temporary_users',
mailer: {
from: process.env.MAILER_FROM || 'testing@'+process.env.SPARKPOST_SANDBOX_DOMAIN || 'no-reply@tellform.com',
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 465,
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''
}
} : {
service: process.env.MAILER_SERVICE_PROVIDER || '',
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''
}
}
},
subdomainsDisabled: (process.env.SUBDOMAINS_DISABLED === 'TRUE'),
//Sentry DSN Client Key
@ -52,17 +79,6 @@ module.exports = {
// To set the cookie in a specific domain uncomment the following
// setting:
},
/*
* Upload Configuration
*/
//Global upload path
uploadPath : 'uploads/',
//PDF storage path
pdfUploadPath: 'uploads/pdfs/',
//Temp files storage path
tmpUploadPath: 'uploads/tmp/',
// The session cookie name
sessionName: 'connect.sid',
log: {

View file

@ -4,7 +4,7 @@ module.exports = {
baseUrl: process.env.BASE_URL || 'http://localhost:5000',
port: process.env.PORT || 5000,
db: {
uri: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || '0.0.0.0') +'/mean',
uri: process.env.MONGODB_URI || 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || '127.0.0.1') +'/mean',
options: {
user: '',
pass: ''
@ -16,37 +16,12 @@ module.exports = {
// Stream defaults to process.stdout
// Uncomment to enable logging to a log on the file system
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || 'no-reply@tellform.com',
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 465,
secure: process.env.MAILER_SMTP_SECURE || true,
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''

View file

@ -3,10 +3,11 @@
module.exports = {
baseUrl: process.env.BASE_URL || process.env.HEROKU_APP_NAME + '.herokuapp.com' || 'tellform.com',
db: {
uri: process.env.MONGODB_URI || process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || '0.0.0.0') + '/mean',
uri: process.env.MONGODB_URI || process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || '127.0.0.1') + '/mean',
},
port: process.env.PORT || 5000,
socketUrl: process.env.SOCKET_URL || 'ws.tellform.com',
socketPortExternallyVisible: (process.env.SOCKET_PORT_EXTERN_VISIBLE === 'TRUE' || !process.env.SOCKET_PORT_EXTERN_VISIBLE), //socketPortExternallyVisible set to true in production config by default
socketPort: process.env.SOCKET_PORT || 20523,
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
@ -27,52 +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'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || 'testing@'+process.env.SPARKPOST_SANDBOX_DOMAIN || 'no-reply@tellform.com',
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 465,
secure: process.env.MAILER_SMTP_SECURE || true,
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''
}
} : {
service: process.env.MAILER_SERVICE_PROVIDER || '',
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''
}
}
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']
}
};

31
config/env/secure.js vendored
View file

@ -4,7 +4,7 @@ module.exports = {
baseUrl: 'https://forms.polydaic.com',
port: 8443,
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://localhost/mean',
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || process.env.MONGODB_URI || 'mongodb://127.0.0.1/mean',
options: {
user: '',
pass: ''
@ -33,43 +33,18 @@ module.exports = {
maxAge: 7200,
// To set the cookie in a specific domain uncomment the following
// setting:
domain: 'forms.polydaic.com'
domain: process.env.BASE_URL || 'localhost:3000'
},
assets: {
css: 'public/dist/application.min.css',
js: 'public/dist/application.min.js'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: 'https://localhost:443/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: 'https://localhost:443/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: 'https://localhost:443/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: 'https://localhost:443/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: 'https://localhost:443/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || '',
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 587,
secure: process.env.MAILER_SMTP_SECURE || true,
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''

27
config/env/test.js vendored
View file

@ -25,37 +25,12 @@ module.exports = {
sessionCookie: {
maxAge: 24 * 60 * 60 * 1000 // 24 hours
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 587,
secure: process.env.MAILER_SMTP_SECURE || true,
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: {
user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || ''

View file

@ -3,7 +3,7 @@
/**
* Module dependencies.
*/
var fs = require('fs-extra'),
var fs = require('fs'),
https = require('https'),
express = require('express'),
morgan = require('morgan'),
@ -17,22 +17,14 @@ var fs = require('fs-extra'),
passport = require('passport'),
raven = require('raven'),
MongoStore = require('connect-mongo')(session),
flash = require('connect-flash'),
config = require('./config'),
consolidate = require('consolidate'),
path = require('path'),
device = require('express-device'),
client = new raven.Client(config.DSN);
client = new raven.Client(config.DSN),
i18n = require('i18n');
var mongoose = require('mongoose');
var cacheOpts = {
max:100000,
maxAge:1000*60
};
require('mongoose-cache').install(mongoose, cacheOpts)
/**
* Configure Socket.io
*/
@ -44,6 +36,18 @@ var configureSocketIO = function (app, db) {
return server;
};
var supportedLanguages = ['en', 'de', 'fr', 'it', 'es'];
function containsAnySupportedLanguages(preferredLanguages){
for (var i = 0; i < preferredLanguages.length; i++) {
var currIndex = supportedLanguages.indexOf(preferredLanguages[i]);
if (currIndex > -1) {
return supportedLanguages[currIndex];
}
}
return null;
}
module.exports = function(db) {
// Initialize express app
var app = express();
@ -63,7 +67,7 @@ module.exports = function(db) {
app.locals.subdomainsDisabled = config.subdomainsDisabled;
if(config.socketPort && process.env.NODE_ENV !== 'production'){
if(config.socketPortExternallyVisible){
app.locals.socketPort = config.socketPort;
} else {
app.locals.socketPort = '';
@ -144,8 +148,6 @@ module.exports = function(db) {
// reassign url
req.url = subdomainPath;
req.userId = user._id;
// Q.E.D.
return next();
});
@ -184,19 +186,37 @@ module.exports = function(db) {
level: 9
}));
//Setup i18n
i18n.configure({
locales: supportedLanguages,
directory: __dirname + '/locales',
defaultLocale: 'en',
cookie: 'userLang'
});
// Set swig as the template engine
app.engine('server.view.html', consolidate[config.templateEngine]);
app.use(i18n.init);
app.use(function(req, res, next) {
// express helper for natively supported engines
res.locals.__ = res.__ = function() {
return i18n.__.apply(req, arguments);
};
next();
});
// Set template engine as defined in the config files
app.engine('server.view.pug', consolidate.pug);
// Set views path and view engine
app.set('view engine', 'server.view.html');
app.set('view engine', 'server.view.pug');
app.set('views', './app/views');
// Enable logger (morgan)
app.use(morgan(logger.getLogFormat(), logger.getMorganOptions()));
// Environment dependent middleware
if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
// Disable views cache
app.set('view cache', false);
} else if (process.env.NODE_ENV === 'production') {
@ -209,6 +229,7 @@ module.exports = function(db) {
extended: true,
limit: '100mb'
}));
app.use(bodyParser.json({ limit: '100mb' }));
app.use(methodOverride());
@ -229,7 +250,6 @@ module.exports = function(db) {
app.use(cookieParser());
// Express MongoDB session storage
app.use(session({
saveUninitialized: true,
resave: true,
@ -246,24 +266,40 @@ module.exports = function(db) {
app.use(passport.initialize());
app.use(passport.session());
// setup express-device
app.use(device.capture({ parseUserAgent: true }));
// connect flash for flash messages
app.use(flash());
//Visitor Language Detection
app.use(function(req, res, next) {
var acceptLanguage = req.headers['accept-language'];
var languages, supportedLanguage;
if(acceptLanguage){
languages = acceptLanguage.match(/[a-z]{2}(?!-)/g) || [];
supportedLanguage = containsAnySupportedLanguages(languages);
}
if(!req.user && supportedLanguage !== null){
var currLanguage = res.cookie('userLang');
if(currLanguage && currLanguage !== supportedLanguage || !currLanguage){
res.clearCookie('userLang');
res.cookie('userLang', supportedLanguage, { maxAge: 90000, httpOnly: true });
}
} else if(req.user && (!req.cookies.hasOwnProperty('userLang') || req.cookies['userLang'] !== req.user.language) ){
res.cookie('userLang', req.user.language, { maxAge: 90000, httpOnly: true });
}
next();
});
// Globbing routing files
config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) {
require(path.resolve(routePath))(app);
});
// Add headers for Sentry
app.use(function (req, res, next) {
// Website you wish to allow to connect
res.setHeader('Access-Control-Allow-Origin', 'https://sentry.polydaic.com');
res.setHeader('Access-Control-Allow-Origin', 'https://sentry.io');
// Request methods you wish to allow
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
@ -295,16 +331,11 @@ module.exports = function(db) {
// Log it
client.captureError(err);
/*if(process.env.NODE_ENV === 'production'){
res.status(500).render('500', {
error: 'Internal Server Error'
});
} else {*/
// Error page
res.status(500).render('500', {
error: err.stack
});
//}
// Error page
res.status(500).render('500', {
__: i18n.__,
error: err.stack
});
});
// Assume 404 since no middleware responded
@ -312,7 +343,8 @@ module.exports = function(db) {
client.captureError(new Error('Page Not Found'));
res.status(404).render('404', {
url: req.originalUrl,
error: 'Not Found'
error: 'Not Found',
__: i18n.__
});
});

21
config/locales/de.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Seite nicht gefunden",
"500_HEADER": "500 - Interner Serverfehler",
"404_BODY": "%s ist kein gültiger Pfad.",
"500_BODY": "Ein unerwarteter Fehler scheint aufgetreten zu sein, warum nicht versuchen, Ihre Seite zu aktualisieren oder Sie können uns kontaktieren, wenn das Problem weiterhin besteht.",
"EMAIL_GREETING": "Hallo da!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Willkommen bei TellForm! Hier ist ein spezieller Link um deinen neuen Account zu aktivieren:",
"VERIFICATION_EMAIL_LINK_TEXT": "Mein Konto aktivieren",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Vielen Dank für die Nutzung unserer Dienste! Wenn Sie Fragen oder Anregungen haben, senden Sie uns bitte eine E-Mail an",
"VERIFICATION_EMAIL_SUBJECT": "Aktiviere dein neues TellForm-Konto!",
"VERIFICATION_EMAIL_TEXT": "Bitte bestätigen Sie Ihren Account, indem Sie auf den folgenden Link klicken oder ihn in Ihren Browser kopieren und einfügen: $ {URL}",
"EMAIL_SIGNATURE": "- Das TellForm-Team",
"WELCOME_EMAIL_PARAGRAPH_1": "Wir möchten Sie als unser neustes Mitglied begrüßen!",
"WELCOME_EMAIL_PARAGRAPH_2": "Wir wünschen Ihnen viel Spaß mit TellForm! Wenn Sie Probleme haben, senden Sie uns bitte eine E-Mail an",
"WELCOME_EMAIL_SUBJECT": "Willkommen bei %s!",
"WELCOME_EMAIL_TEXT": "Ihr Konto wurde erfolgreich verifiziert.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Dies ist eine Höflichkeitsnachricht, um zu bestätigen, dass Ihr Passwort gerade geändert wurde.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Hier ist ein spezieller Link, mit dem Sie Ihr Passwort zurücksetzen können: Bitte beachten Sie, dass es innerhalb einer Stunde zu Ihrem Schutz abläuft:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Passwort zurücksetzen",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Falls Sie dies nicht gewünscht haben, ignorieren Sie bitte diese E-Mail und Ihr Passwort bleibt unverändert."
}

22
config/locales/en.json Normal file
View file

@ -0,0 +1,22 @@
{
"500_HEADER": "500 - Internal Server Error",
"404_HEADER": "404 - Page not found",
"404_BODY": "%s is not a valid path",
"500_BODY": "An unexpected error seems to have occured. Why not try refreshing your page? Or you can contact us if the problem persists.",
"EMAIL_GREETING": "Hello there!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Welcome to TellForm! Here is a special link to activate your new account:",
"VERIFICATION_EMAIL_LINK_TEXT": "Activate my account",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at",
"VERIFICATION_EMAIL_SUBJECT": "Activate your new TellForm account!",
"VERIFICATION_EMAIL_TEXT": "Please verify your account by clicking the following link, or by copying and pasting it into your browser: ${URL}",
"EMAIL_SIGNATURE": "- The TellForm team",
"WELCOME_EMAIL_PARAGRAPH_1": "We would like to welcome you as our newest member!",
"WELCOME_EMAIL_PARAGRAPH_2": "We hope you enjoy using TellForm! If you have any trouble please feel free to email us here at",
"WELCOME_EMAIL_SUBJECT": "Welcome to %s!",
"WELCOME_EMAIL_TEXT": "Your account has been successfully verified.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "This is a courtesy message to confirm that your password was just changed.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Here is a special link that will allow you to reset your password. Please note it will expire in one hour for your protection:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Reset Your Password",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "If you did not request this, please ignore this email and your password will remain unchanged.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1": "RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1"
}

21
config/locales/es.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Página no encontrada",
"500_HEADER": "500 - Error interno del servidor",
"404_BODY": "%s no es una ruta válida",
"500_BODY": "Parece que se produjo un error inesperado. ¿Por qué no intenta actualizar su página? O puede contactarnos si el problema persiste",
"EMAIL_GREETING": "¡Hola!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Bienvenido a TellForm. Aquí hay un enlace especial para activar su nueva cuenta:",
"VERIFICATION_EMAIL_LINK_TEXT": "Activar mi cuenta",
"VERIFICATION_EMAIL_PARAGRAPH_2": "¡Muchas gracias por utilizar nuestros servicios! Si tiene alguna pregunta o sugerencia, no dude en enviarnos un correo electrónico aquí",
"VERIFICATION_EMAIL_SUBJECT": "¡Active su nueva cuenta TellForm!",
"VERIFICATION_EMAIL_TEXT": "Verifique su cuenta haciendo clic en el siguiente enlace, o copiándolo y pegándolo en su navegador: $ {URL}",
"EMAIL_SIGNATURE": "- El equipo de TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "¡Nos gustaría darle la bienvenida como nuestro miembro más nuevo!",
"WELCOME_EMAIL_PARAGRAPH_2": "Esperamos que disfrute utilizando TellForm. Si tiene algún problema, no dude en enviarnos un correo electrónico aquí",
"WELCOME_EMAIL_SUBJECT": "¡Bienvenido a %s!",
"WELCOME_EMAIL_TEXT": "Su cuenta ha sido verificada con éxito",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Este es un mensaje de cortesía para confirmar que su contraseña acaba de cambiarse",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Aquí hay un enlace especial que le permitirá restablecer su contraseña. Tenga en cuenta que caducará en una hora para su protección:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Restablecer su contraseña",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Si no lo solicitó, ignore este correo electrónico y su contraseña no cambiará".
}

21
config/locales/fr.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Page non trouvée",
"500_HEADER": "500 - Erreur interne du serveur",
"404_BODY": "%s n'est pas un chemin valide.",
"500_BODY": "Une erreur inattendue semble s'être produite, pourquoi ne pas essayer d'actualiser votre page ? Ou vous pouvez nous contacter si le problème persiste.",
"EMAIL_GREETING": "Bonjour !",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Bienvenue sur TellForm ! Voici un lien spécial pour activer votre nouveau compte : ",
"VERIFICATION_EMAIL_LINK_TEXT": "Activer mon compte",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Merci infiniment d'utiliser nos services ! Si vous avez des questions ou des suggestions, n'hésitez pas à nous envoyer un courriel ici",
"VERIFICATION_EMAIL_SUBJECT": "Activer votre nouveau compte TellForm !",
"VERIFICATION_EMAIL_TEXT": "Merci de vérifier votre compte en cliquant sur le lien suivant, ou en le copiant dans votre navigateur web : ${URL}",
"EMAIL_SIGNATURE": "- L'équipe TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "Nous aimerions vous accueillir en tant que nouveau membre !",
"WELCOME_EMAIL_PARAGRAPH_2": "Nous espérons que vous apprécierez l'utilisation de TellForm ! Si vous avez des problèmes, n'hésitez pas à nous envoyer un e-mail ici",
"WELCOME_EMAIL_SUBJECT": "Bienvenue dans %s!",
"WELCOME_EMAIL_TEXT": "Votre compte a été vérifié avec succès.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Ceci est un message de courtoisie pour confirmer que votre mot de passe a été modifié.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Voici un lien spécial qui vous permettra de réinitialiser votre mot de passe. Veuillez noter qu'il expirera dans une heure pour votre protection :",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Réinitialiser votre mot de passe",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Si vous ne l'avez pas demandé, veuillez ignorer cet e-mail et votre mot de passe restera inchangé."
}

21
config/locales/it.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Pagina non trovata",
"500_HEADER": "500 - Errore Server Interno",
"404_BODY": "%s non è un percorso valido",
"500_BODY": "Si è verificato un errore imprevisto: perché non provare a rinfrescare la tua pagina oppure puoi contattarci se il problema persiste",
"EMAIL_GREETING": "Ciao!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Benvenuti a TellForm! Ecco un collegamento speciale per attivare il tuo nuovo account:",
"VERIFICATION_EMAIL_LINK_TEXT": "Attiva il mio account",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Grazie mille per l'utilizzo dei nostri servizi! Se hai domande o suggerimenti, non esitate a contattarci via",
"VERIFICATION_EMAIL_SUBJECT": "Attiva il tuo nuovo account TellForm",
"VERIFICATION_EMAIL_TEXT": "Verifica il tuo account facendo clic sul seguente collegamento o copiandolo e incollandolo nel tuo browser: $ {URL}",
"EMAIL_SIGNATURE": "- Il team TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "Vorremmo darVi il benvenuto come il nostro nuovo membro!",
"WELCOME_EMAIL_PARAGRAPH_2": "Speriamo che ti piace usare TellForm! Se hai problemi, non esitate a contattarci via",
"WELCOME_EMAIL_SUBJECT": "Benvenuto a %s!",
"WELCOME_EMAIL_TEXT": "Il tuo account è stato verificato correttamente.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Si tratta di un messaggio di cortesia per confermare che la password è stata appena modificata".
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Ecco un collegamento speciale che ti permetterà di reimpostare la tua password. Si prega di notare che scadrà in un'ora per la protezione:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Ripristina la tua password",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Se non l'hai richiesta, ignora questa email e la tua password rimane invariata."
}

22
config/locales/sv.json Normal file
View file

@ -0,0 +1,22 @@
{
"500_HEADER": "500 - Internt Serverfel",
"404_HEADER": "404 - Sidan hittades inte",
"404_BODY": "%s är inte en giltig sökväg",
"500_BODY": "Ett oväntat fel verkar ha inträffat. Kan du prova med att uppdatera sidan? Eller kan du kontakta oss om problemet återuppstår igen?",
"EMAIL_GREETING": "Hej där!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Välkommen till TellForm! Här är en speciell länk till dig för att aktivera ditt nya konto:",
"VERIFICATION_EMAIL_LINK_TEXT": "Aktivera mitt konto",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Tack så mycket för att du använder våra tjänster! Om du har några frågor eller förslag är du varmt välkommen att e-posta oss här på",
"VERIFICATION_EMAIL_SUBJECT": "Aktivera ditt nya TellForm-konto!",
"VERIFICATION_EMAIL_TEXT": "Vänligen verifiera ditt konto genom att klicka på den följande länken, eller genom att kopiera och klistra in den i din webbläsare: ${URL}",
"EMAIL_SIGNATURE": "- TellForm-gruppen",
"WELCOME_EMAIL_PARAGRAPH_1": "Vi skulle vilja välkomna dig som vår nyaste medlem!",
"WELCOME_EMAIL_PARAGRAPH_2": "Vi hoppas att du gillar att använda TellForm! Om du stöter på några problem är du varmt välkommen att e-posta oss här på",
"WELCOME_EMAIL_SUBJECT": "Välkommen till %s!",
"WELCOME_EMAIL_TEXT": "Ditt konto har framgångsrikt blivit verifierat.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Detta är ett artigt meddelande för att bekräfta att ditt lösenord just har ändrats.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Här är en speciell länk som kommer tillåta dig att återställa ditt lösenord. Vänligen notera att det kommer utgå om en timma för din säkerhet:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Återställ Ditt Lösenord",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Om du inte begärde detta, vänligen ignorera detta meddelande och ditt lösenord kommer att förbli oförändrat.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1": "RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1"
}

View file

@ -9,11 +9,23 @@ var config = require('./config'),
// Define the Socket.io configuration method
module.exports = function (app, db) {
var server = http.createServer(app);
var io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
var io;
// make it possible to only expose one domain
if (process.env.SOCKET_PORT != process.env.PORT) {
io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
} else {
io = socketio(server, { transports: ['websocket', 'polling'] });
}
if(config.enableClusterMode){
var redis = require('socket.io-redis');
io.adapter(redis( process.env.REDIS_URL || { host: process.env.REDIS_DB_PORT_6379_TCP_ADDR || '127.0.0.1' , port: process.env.REDIS_DB_PORT_6379_TCP_PORT || 6379 }));
if( process.env.REDIS_DB_PORT_6379_TCP_ADDR ){
io.adapter(redis({ host: process.env.REDIS_DB_PORT_6379_TCP_ADDR || '127.0.0.1' , port: process.env.REDIS_DB_PORT_6379_TCP_PORT || 6379 }));
} else {
io.adapter(redis( config.redisUrl ));
}
}
// Add an event listener to the 'connection' event
io.on('connection', function (socket) {
@ -23,4 +35,4 @@ module.exports = function (app, db) {
});
return server;
};
};

View file

@ -1,41 +0,0 @@
'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'),
FacebookStrategy = require('passport-facebook').Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use facebook strategy
passport.use(new FacebookStrategy({
clientID: config.facebook.clientID,
clientSecret: config.facebook.clientSecret,
callbackURL: config.facebook.callbackURL,
passReqToCallback: true
},
function(req, accessToken, refreshToken, profile, done) {
// Set the provider data and include tokens
var providerData = profile._json;
providerData.accessToken = accessToken;
providerData.refreshToken = refreshToken;
// Create the user OAuth profile
var providerUserProfile = {
firstName: profile.name.givenName,
lastName: profile.name.familyName,
displayName: profile.displayName,
email: profile.emails[0].value,
username: profile.username,
provider: 'facebook',
providerIdentifierField: 'id',
providerData: providerData
};
// Save the user OAuth profile
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};

View file

@ -1,46 +0,0 @@
'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'),
GithubStrategy = require('passport-github').Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use github strategy
passport.use(new GithubStrategy({
clientID: config.github.clientID,
clientSecret: config.github.clientSecret,
callbackURL: config.github.callbackURL,
passReqToCallback: true
},
function(req, accessToken, refreshToken, profile, done) {
// Set the provider data and include tokens
var providerData = profile._json;
providerData.accessToken = accessToken;
providerData.refreshToken = refreshToken;
// Create the user OAuth profile
var displayName = profile.displayName.trim();
var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
var providerUserProfile = {
firstName: firstName,
lastName: lastName,
displayName: displayName,
email: profile.emails[0].value,
username: profile.username,
provider: 'github',
providerIdentifierField: 'id',
providerData: providerData
};
// Save the user OAuth profile
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};

View file

@ -1,41 +0,0 @@
'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'),
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use google strategy
passport.use(new GoogleStrategy({
clientID: config.google.clientID,
clientSecret: config.google.clientSecret,
callbackURL: config.google.callbackURL,
passReqToCallback: true
},
function(req, accessToken, refreshToken, profile, done) {
// Set the provider data and include tokens
var providerData = profile._json;
providerData.accessToken = accessToken;
providerData.refreshToken = refreshToken;
// Create the user OAuth profile
var providerUserProfile = {
firstName: profile.name.givenName,
lastName: profile.name.familyName,
displayName: profile.displayName,
email: profile.emails[0].value,
username: profile.username,
provider: 'google',
providerIdentifierField: 'id',
providerData: providerData
};
// Save the user OAuth profile
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};

View file

@ -1,42 +0,0 @@
'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'),
LinkedInStrategy = require('passport-linkedin').Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use linkedin strategy
passport.use(new LinkedInStrategy({
consumerKey: config.linkedin.clientID,
consumerSecret: config.linkedin.clientSecret,
callbackURL: config.linkedin.callbackURL,
passReqToCallback: true,
profileFields: ['id', 'first-name', 'last-name', 'email-address']
},
function(req, accessToken, refreshToken, profile, done) {
// Set the provider data and include tokens
var providerData = profile._json;
providerData.accessToken = accessToken;
providerData.refreshToken = refreshToken;
// Create the user OAuth profile
var providerUserProfile = {
firstName: profile.name.givenName,
lastName: profile.name.familyName,
displayName: profile.displayName,
email: profile.emails[0].value,
username: profile.username,
provider: 'linkedin',
providerIdentifierField: 'id',
providerData: providerData
};
// Save the user OAuth profile
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};

View file

@ -16,7 +16,7 @@ module.exports = function () {
function (username, password, done) {
User.findOne({
$or: [
{'username': username},
{'username': username.toLowerCase()},
{'email': username}
]
}, function (err, user) {

View file

@ -1,45 +0,0 @@
'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'),
TwitterStrategy = require('passport-twitter').Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use twitter strategy
passport.use(new TwitterStrategy({
consumerKey: config.twitter.clientID,
consumerSecret: config.twitter.clientSecret,
callbackURL: config.twitter.callbackURL,
passReqToCallback: true
},
function(req, token, tokenSecret, profile, done) {
// Set the provider data and include tokens
var providerData = profile._json;
providerData.token = token;
providerData.tokenSecret = tokenSecret;
// Create the user OAuth profile
var displayName = profile.displayName.trim();
var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
var providerUserProfile = {
firstName: firstName,
lastName: lastName,
displayName: displayName,
username: profile.username,
provider: 'twitter',
providerIdentifierField: 'id_str',
providerData: providerData
};
// Save the user OAuth profile
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

BIN
design/tellform_mascot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -1,22 +1,55 @@
version: "3"
services:
tellform:
build:
context: ./
dockerfile: dockerfile
image: tellform
ports:
- 3000:3000
links:
- tellform-redis:redis-db
- tellform-mongo:db
env_file:
- .env
tellform-redis:
redis:
restart: always
image: redis
ports:
- 6379
tellform-mongo:
networks:
- back-tier
mongo:
restart: always
image: mongo
volumes:
- ".data/mongo:/data"
networks:
- back-tier
tellform:
build:
context: .
environment:
CREATE_ADMIN: "TRUE"
MONGODB_URI: mongodb://mongo/tellform
REDIS_URL: redis://redis
# volumes:
# - .:/opt/tellform
links:
- mongo
- redis
ports:
- 27017
- "5000:5000"
depends_on:
- mongo
- redis
networks:
- back-tier
web:
# image: tellform/nginx:stable
build:
context: ./nginx
# image: nginx:1.13
restart: always
ports:
- "80:80"
- "443:443"
- "20523:20523"
environment:
NODE_ENV: development
#volumes:
# - "$ROOT/certs:/certs"
# - ./nginx/conf.d:/etc/nginx/conf.d
networks:
- back-tier
networks:
back-tier:
driver: bridge

View file

@ -1,96 +0,0 @@
[
[{
"fieldType": "textfield",
"fieldValue": "snthsnth",
"_id": "55aec5d284bae1a1996210bd",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Short Text2",
"lastModified": "2015-07-21T22:21:06.653Z",
"created": "2015-07-21T22:21:06.653Z",
"$$hashKey": "02J"
}, {
"fieldType": "textfield",
"fieldValue": "duieedi",
"_id": "55aec5b084bae1a1996210b4",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Last Name",
"lastModified": "2015-07-21T22:20:32.053Z",
"created": "2015-07-21T22:20:32.053Z",
"$$hashKey": "02K"
}],
[{
"fieldType": "textfield",
"fieldValue": "snthsnth",
"_id": "55aec5d284bae1a1996210bd",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Short Text2",
"lastModified": "2015-07-21T22:21:06.653Z",
"created": "2015-07-21T22:21:06.653Z",
"$$hashKey": "02J"
}, {
"fieldType": "textfield",
"fieldValue": "duieedi",
"_id": "55aec5b084bae1a1996210b4",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Last Name",
"lastModified": "2015-07-21T22:20:32.053Z",
"created": "2015-07-21T22:20:32.053Z",
"$$hashKey": "02K"
}],
[{
"fieldType": "textfield",
"fieldValue": "snthsnth",
"_id": "55aec5d284bae1a1996210bd",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Short Text2",
"lastModified": "2015-07-21T22:21:06.653Z",
"created": "2015-07-21T22:21:06.653Z",
"$$hashKey": "02J"
}, {
"fieldType": "textfield",
"fieldValue": "duieedi",
"_id": "55aec5b084bae1a1996210b4",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Last Name",
"lastModified": "2015-07-21T22:20:32.053Z",
"created": "2015-07-21T22:20:32.053Z",
"$$hashKey": "02K"
}],
[{
"fieldType": "textfield",
"fieldValue": "snthsnth",
"_id": "55aec5d284bae1a1996210bd",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Short Text2",
"lastModified": "2015-07-21T22:21:06.653Z",
"created": "2015-07-21T22:21:06.653Z",
"$$hashKey": "02J"
}, {
"fieldType": "textfield",
"fieldValue": "duieedi",
"_id": "55aec5b084bae1a1996210b4",
"disabled": false,
"fieldOptions": [],
"description": "",
"title": "Last Name",
"lastModified": "2015-07-21T22:20:32.053Z",
"created": "2015-07-21T22:20:32.053Z",
"$$hashKey": "02K"
}]
]

View file

@ -1,758 +0,0 @@
[
{
"_id": "56450d120761e9d7d68d3543",
"lastModified": "2015-11-12T22:05:06.380Z",
"fdfData": null,
"admin": "55d270df2749c1ceb47c0f8b",
"form": "5644dde5507b2572635dcd50",
"title": "Sample Form",
"timeElapsed": 11.925,
"percentageComplete": 75,
"__v": 0,
"created": "2015-11-12T22:05:06.378Z",
"form_fields": [
{
"_id": "5644e0d5507b2572635dcd56",
"fieldValue": "",
"fieldType": "statement",
"title": "Statement2",
"lastModified": "2015-11-12T18:56:21.730Z",
"created": "2015-11-12T18:56:21.660Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": true,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.769Z",
"title": "Short Text2",
"fieldType": "textfield",
"fieldValue": "first",
"_id": "5644dde7507b2572635dcd51",
"created": "2015-11-12T18:43:51.290Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.770Z",
"title": "Short Text3",
"fieldType": "textfield",
"fieldValue": "first",
"_id": "5644dde7507b2572635dcd52",
"created": "2015-11-12T18:43:51.977Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Paragraph Text2",
"fieldType": "textarea",
"fieldValue": "first",
"_id": "5644ddea507b2572635dcd54",
"created": "2015-11-12T18:43:54.594Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Rating2",
"fieldType": "rating",
"fieldValue": 1,
"_id": "5644e0d4507b2572635dcd55",
"created": "2015-11-12T18:56:20.324Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
}
]
},
{
"_id": "56450d1d0761e9d7d68d3544",
"lastModified": "2015-11-12T22:05:17.806Z",
"fdfData": null,
"admin": "55d270df2749c1ceb47c0f8b",
"form": "5644dde5507b2572635dcd50",
"title": "Sample Form",
"timeElapsed": 10.301,
"percentageComplete": 75,
"__v": 0,
"created": "2015-11-12T22:05:17.805Z",
"form_fields": [
{
"_id": "5644e0d5507b2572635dcd56",
"fieldValue": "",
"fieldType": "statement",
"title": "Statement2",
"lastModified": "2015-11-12T18:56:21.730Z",
"created": "2015-11-12T18:56:21.660Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": true,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.769Z",
"title": "Short Text2",
"fieldType": "textfield",
"fieldValue": "second",
"_id": "5644dde7507b2572635dcd51",
"created": "2015-11-12T18:43:51.290Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.770Z",
"title": "Short Text3",
"fieldType": "textfield",
"fieldValue": "second",
"_id": "5644dde7507b2572635dcd52",
"created": "2015-11-12T18:43:51.977Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Paragraph Text2",
"fieldType": "textarea",
"fieldValue": "second",
"_id": "5644ddea507b2572635dcd54",
"created": "2015-11-12T18:43:54.594Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Rating2",
"fieldType": "rating",
"fieldValue": 3,
"_id": "5644e0d4507b2572635dcd55",
"created": "2015-11-12T18:56:20.324Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
}
]
},
{
"_id": "56450d260761e9d7d68d3545",
"lastModified": "2015-11-12T22:05:26.874Z",
"fdfData": null,
"admin": "55d270df2749c1ceb47c0f8b",
"form": "5644dde5507b2572635dcd50",
"title": "Sample Form",
"timeElapsed": 7.975,
"percentageComplete": 75,
"__v": 0,
"created": "2015-11-12T22:05:26.874Z",
"form_fields": [
{
"_id": "5644e0d5507b2572635dcd56",
"fieldValue": "",
"fieldType": "statement",
"title": "Statement2",
"lastModified": "2015-11-12T18:56:21.730Z",
"created": "2015-11-12T18:56:21.660Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": true,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.769Z",
"title": "Short Text2",
"fieldType": "textfield",
"fieldValue": "third",
"_id": "5644dde7507b2572635dcd51",
"created": "2015-11-12T18:43:51.290Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.770Z",
"title": "Short Text3",
"fieldType": "textfield",
"fieldValue": "third",
"_id": "5644dde7507b2572635dcd52",
"created": "2015-11-12T18:43:51.977Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Paragraph Text2",
"fieldType": "textarea",
"fieldValue": "third",
"_id": "5644ddea507b2572635dcd54",
"created": "2015-11-12T18:43:54.594Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Rating2",
"fieldType": "rating",
"fieldValue": 2,
"_id": "5644e0d4507b2572635dcd55",
"created": "2015-11-12T18:56:20.324Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
}
]
},
{
"_id": "56450d320761e9d7d68d3546",
"lastModified": "2015-11-12T22:05:38.717Z",
"fdfData": null,
"admin": "55d270df2749c1ceb47c0f8b",
"form": "5644dde5507b2572635dcd50",
"title": "Sample Form",
"timeElapsed": 10.47,
"percentageComplete": 75,
"__v": 0,
"created": "2015-11-12T22:05:38.716Z",
"form_fields": [
{
"_id": "5644e0d5507b2572635dcd56",
"fieldValue": "",
"fieldType": "statement",
"title": "Statement2",
"lastModified": "2015-11-12T18:56:21.730Z",
"created": "2015-11-12T18:56:21.660Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": true,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.769Z",
"title": "Short Text2",
"fieldType": "textfield",
"fieldValue": "fourth",
"_id": "5644dde7507b2572635dcd51",
"created": "2015-11-12T18:43:51.290Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.770Z",
"title": "Short Text3",
"fieldType": "textfield",
"fieldValue": "fourth",
"_id": "5644dde7507b2572635dcd52",
"created": "2015-11-12T18:43:51.977Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Paragraph Text2",
"fieldType": "textarea",
"fieldValue": "fourth",
"_id": "5644ddea507b2572635dcd54",
"created": "2015-11-12T18:43:54.594Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
},
{
"lastModified": "2015-11-12T21:30:20.771Z",
"title": "Rating2",
"fieldType": "rating",
"fieldValue": 2,
"_id": "5644e0d4507b2572635dcd55",
"created": "2015-11-12T18:56:20.324Z",
"validFieldTypes": [
"textfield",
"date",
"email",
"link",
"legal",
"url",
"textarea",
"statement",
"welcome",
"thankyou",
"file",
"dropdown",
"scale",
"rating",
"radio",
"checkbox",
"hidden",
"yes_no",
"natural",
"number"
],
"deletePreserved": false,
"disabled": false,
"required": true,
"fieldOptions": [],
"description": ""
}
]
}
]

View file

@ -1,22 +0,0 @@
##First Form Auto-Update
1. Added field CLIENT
time: 2553
2. Finding form SERVER
time: 2841
3. Update form CLIENT
time: 2870
4.Updated form SERVER
time: 2863
##Second Form Auto-Update
1. Added field CLIENT
time: 2755
2. Finding form SERVER
time: 2898

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View file

@ -1,249 +0,0 @@
#Installing Sentry Server
### Before You Begin
Make sure you understand what sentry server does. You can view documentation for sentry server [here](https://sentry.readthedocs.org/). This document was written for a server running *Ubuntu 14.04 LTS server* (we used Azure).
### Prerequisites
Make sure you have these installed:
* apt-get
* python2.7
* vim
### Installation Steps
1. Add non-root user.
```
sudo adduser sentry
sudo adduser sentry sudo
```
2. Update all apt-get packages
```
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get install libxml2-dev libxslt1-dev libffi-dev libpq-dev python-dev
sudo reboot
```
3. Install easy_install and pip
```
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
sudo easy_install pip
```
4. Install virtualenv and lmxl
```
sudo pip install virtualenv
sudo pip install lxml
```
5. Install Sentry and Setup
```
# make server directory
mkdir ~/SentryServer; cd ~/SentryServer;
# make virtualenv
virtualenv ./
#activate virtualenv
source ./bin/activate
# install sentry and its postgresql dependencies
pip install -U sentry[postgres]
```
6. Install postgresql
```
# install postgres
sudo apt-get install postgresql postgresql-contrib libpq-dev
# install postgres adminpack
sudo -u postgres psql
CREATE EXTENSION "adminpack";
\q
```
7. Setup postgresql DB
```
# change postgres password & create database
sudo passwd postgres
sudo su - postgres
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'changeme';"
createdb sentry
createuser sentry_user --pwprompt
psql -d template1 -U postgres
GRANT ALL PRIVILEGES ON DATABASE sentry to sentry_user;
\q
exit
```
8. Setup Sentry Configuration
```
# initialize conf file
sentry init
#edit sentry configuration
vim ~/.sentry/sentry.conf.py
```
The following are the contents of my sentry.conf.py file (replace name, user and password with your that of your DB)
```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'sentry',
'USER': 'sentry_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
}
}
# No trailing slash!
SENTRY_URL_PREFIX = 'http://sentry.example.com'
SENTRY_WEB_HOST = '0.0.0.0'
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
'workers': 3, # the number of gunicorn workers
'secure_scheme_headers': {'X-FORWARDED-PROTO': 'https'}, # detect HTTPS mode from X-Forwarded-Proto header
}
#CONFIGURE REDIS
SENTRY_REDIS_OPTIONS = {
'hosts': {
0: {
'host': '127.0.0.1',
'port': 6379,
'timeout': 3,
#'password': 'redis auth password'
}
}
}
#CONFIGURE OUTGOING MAIL
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'your_gmail_username@gmail.com'
EMAIL_HOST_PASSWORD = 'your_gmail_password'
DEFAULT_FROM_EMAIL = 'testing@testing.com
```
9. Setup Database and Start Sentry
```
#install and run redis-server
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
cd utils
sudo ./install_server.sh
#Go back to app directory
cd ~/SentryServer
sudo service redis_6379 start
# set up databse
sentry upgrade
# let's try it out!
sentry start
```
10. Install nginx
```
# install nginx
sudo apt-get install nginx
# remove the default symbolic link
sudo rm /etc/nginx/sites-enabled/default
# create a new blank config, and make a symlink to it
sudo touch /etc/nginx/sites-available/sentry
cd /etc/nginx/sites-enabled
sudo ln -s ../sites-available/sentry
# edit the nginx configuration file
sudo vim /etc/nginx/sites-available/sentry
```
*Here are the contents of my nginx file:*
```
server {
# listen on port 80
listen 80;
# for requests to these domains
server_name yourdomain.com www.yourdomain.com;
# keep logs in these files
access_log /var/log/nginx/sentry.access.log;
error_log /var/log/nginx/sentry.error.log;
# You need this to allow users to upload large files
# See http://wiki.nginx.org/HttpCoreModule#client_max_body_size
# I'm not sure where it goes, so I put it in twice. It works.
client_max_body_size 0;
location / {
proxy_pass http://localhost:9000;
proxy_redirect off;
proxy_read_timeout 5m;
# make sure these HTTP headers are set properly
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
```
11. Start the worker processes
```
# restart nginx
sudo nginx -t
sudo service nginx reload
#start sentry
sentry celery worker -B
```
12. Install and Configure supervisord
```
pip install supervisord
sudo echo_supervisord_conf > ~/SentryServer/etc/supervisord.conf
#Edit yuour supervisord Config
vim /etc/supervisord.conf
```
Configuration file should look like this
```
[program:sentry-web]
directory=~/SentryServer/
command=~/SentryServer/bin/sentry start
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=syslog
stderr_logfile=syslog
[program:sentry-worker]
directory=~/SentryServer/
command=~/SentryServer/bin/sentry celery worker -B
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=syslog
stderr_logfile=syslog
```
13. Run Server (with supervisord)
```
supervisord
```

View file

@ -1,29 +0,0 @@
UX of Updating Forms
====================
##Form Updating
- Action: Update Configuration
1. User clicks on Form from FormList page (visits form admin page)
2. User clicks on "Configure Form" Tab
3. User changes inputs in form page
4. Save Button is Pressed
5. Loading/Busy Indicator fills the screen
6. Loading/Busy Indicator exits the screen
7. Configuration page is shown with updated settings
- Action: Add Form Field
1. User clicks on Form from FormList page
2. User clicks on a Tab in "AddField" column
3. Loading/Busy Indicator fills the screen
4. Loading/Busy Indicator exits the screen
- Action: Edit Form Field Title
1. User clicks on Form from FormList page (visits form admin page)
2. User clicks on a current Form Input accordion (must be either the name or the caret)
3. The clicked accordion (the one interacted with in Step#2) expands
4. User clicks on 'Question Title' text input (aka focuses on said text input)
5. User starts typing in text input
6. User defocuses/clicks off of text input
7. Loading/Busy Indicator fills the screen
8. Loading/Busy Indicator exits the screen
9. Field Accordion heading is updated

View file

@ -23,15 +23,15 @@ module.exports = function(grunt) {
// Unified Watch Object
var watchFiles = {
serverViews: ['app/views/**/*.*'],
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/js/*.js', 'public/form_modules/**/*.js', 'public/modules/**/*.js'],
clientCSS: ['public/modules/**/*.css', 'public/form_modules/**/*.css', '!public/modules/**/demo/**/*.css', '!public/modules/**/dist/**/*.css'],
clientJS: ['public/form_modules/**/*.js', 'public/modules/**/*.js'],
clientCSS: ['public/modules/**/*.css'],
serverTests: ['app/tests/**/*.js'],
clientTests: ['public/modules/**/tests/*.js', '!public/modules/**/demo/**/*.js', '!public/modules/**/dist/**/*.js', '!public/modules/**/node_modules/**/*.js']
clientTests: ['public/modules/**/tests/*.js']
};
watchFiles.allTests = watchFiles.serverTests.concat(watchFiles.clientTests);
@ -123,20 +123,7 @@ module.exports = function(grunt) {
compress: true
},
files: {
'public/dist/vendor.min.js': bowerArray
}
}
},
'closure-compiler': {
vendor_file: {
closurePath: './scripts',
js: 'public/dist/vendor_forms_uglified.js',
jsOutputFile: 'public/dist/vendor.min.js',
maxBuffer: 10000000000,
options: {
warning_level: 'QUIET',
compilation_level: 'SIMPLE_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5'
'public/dist/form-vendor.min.js': bowerArray
}
}
},
@ -157,20 +144,11 @@ module.exports = function(grunt) {
}
}
},
'node-inspector': {
custom: {
options: {
'web-port': 1337,
'web-host': 'localhost',
'debug-port': 5858,
'save-live-edit': true,
'no-preload': true,
'stack-trace-limit': 50,
'hidden': []
}
}
},
ngAnnotate: {
options:{
add: true,
remove: true
},
production: {
files: {
'public/dist/application.js': '<%= applicationJavaScriptFiles %>',
@ -180,28 +158,26 @@ module.exports = function(grunt) {
},
concurrent: {
default: ['nodemon', 'watch'],
debug: ['nodemon', 'watch', 'node-inspector'],
debug: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true,
limit: 10
}
},
env: {
src: '.env',
test: {
NODE_ENV: 'test',
src: '.env'
},
secure: {
NODE_ENV: 'secure',
src: '/opt/deploy/.env'
},
production: {
NODE_ENV: 'production',
src: '/opt/deploy/.env'
},
dev: {
NODE_ENV: 'development',
src: '.env'
}
},
mochaTest: {
@ -211,7 +187,7 @@ module.exports = function(grunt) {
quiet: false,
require: 'server.js',
ui: 'bdd',
debug: true
debug: false
}
},
karma: {
@ -319,7 +295,7 @@ module.exports = function(grunt) {
target: {
src: ['./scripts/setup.js']
}
}
},
});
grunt.event.on('coverage', function(lcov, done){
@ -353,17 +329,14 @@ module.exports = function(grunt) {
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
// Default task(s).
grunt.registerTask('default', ['lint', 'html2js:main', 'html2js:forms', 'env', 'concurrent:default']);
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']);
// Secure task(s).
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']);
// Lint task(s).
grunt.registerTask('lint', ['jshint', 'csslint']);
grunt.registerTask('lint', ['jshint', 'csslint', 'i18nlint:client', 'i18nlint:server']);
grunt.registerTask('lint:tests', ['jshint:allTests']);
// Build task(s).

19
nginx/Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM alpine:edge
RUN apk add --no-cache nginx certbot openssl python py-jinja2
COPY *.py /
COPY conf /conf
RUN chmod +x /start.py
RUN chmod +x /letsencrypt.py
RUN chmod +x /config.py
ENV NODE_ENV=development
ENV PORT=5000
ENV SOCKET_PORT=20523
ENV TLS_FLAVOR=notls
ENV BASE_URL=localhost
ENV SUBDOMAIN_URL=*.localhost
ENV SOCKETS_URL=ws.localhost
CMD /start.py

116
nginx/conf/nginx.conf Normal file
View file

@ -0,0 +1,116 @@
# Basic configuration
user nginx;
worker_processes 1;
error_log /dev/stderr info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Standard HTTP configuration with slight hardening
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
server_tokens off;
#Websockets Server
server {
{% if NODE_ENV == "development" %}
listen {{SOCKET_PORT}};
{% else %}
listen 80;
listen [::]:80;
server_name {{ SOCKETS_URL }};
# Only enable HTTPS if TLS is enabled with no error
{% if TLS and not TLS_ERROR %}
listen 443 ssl;
listen [::]:443 ssl;
include /etc/nginx/tls.conf;
add_header Strict-Transport-Security max-age=15768000;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
{% endif %}
{% endif %}
location / {
proxy_pass http://tellform:20523;
proxy_read_timeout 90;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
{% if TLS and not TLS_ERROR %}
proxy_set_header X-Forwarded-Proto https;
{% endif %}
}
{% if TLS_FLAVOR == 'letsencrypt' %}
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://127.0.0.1:8008;
}
{% endif %}
}
server {
#Add server_name for per-user subdomains
{% if SUBDOMAINS_DISABLED == "FALSE" %}
server_name {{BASE_URL}} {{SUBDOMAIN_URL}};
{% else %}
server_name {{BASE_URL}};
{% endif %}
listen 80;
listen [::]:80;
# Only enable HTTPS if TLS is enabled with no error
{% if TLS and not TLS_ERROR %}
listen 443 ssl;
listen [::]:443 ssl;
include /etc/nginx/tls.conf;
add_header Strict-Transport-Security max-age=15768000;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
{% endif %}
root /usr/share/nginx/html;
index index.html index.htm;
location / {
proxy_pass http://tellform:5000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
{% if TLS and not TLS_ERROR %}
proxy_set_header X-Forwarded-Proto https;
{% endif %}
}
{% if TLS_FLAVOR == 'letsencrypt' %}
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://127.0.0.1:8008;
}
{% endif %}
}
}

7
nginx/conf/tls.conf Normal file
View file

@ -0,0 +1,7 @@
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384';
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_certificate {{ TLS[0] }};
ssl_certificate_key {{ TLS[1] }};
ssl_dhparam /certs/dhparam.pem;

26
nginx/config.py Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/python
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
# TLS configuration
args["TLS"] = {
"cert": ("/certs/cert.pem", "/certs/key.pem"),
"letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
"/certs/letsencrypt/live/mailu/privkey.pem"),
"notls": None
}[args["TLS_FLAVOR"]]
if args["TLS"] and not all(os.path.exists(file_path) for file_path in args["TLS"]):
print("Missing cert or key file, disabling TLS")
args["TLS_ERROR"] = "yes"
# Build final configuration paths
convert("/conf/tls.conf", "/etc/nginx/tls.conf", args)
convert("/conf/nginx.conf", "/etc/nginx/nginx.conf", args)
os.system("nginx -s reload")

29
nginx/letsencrypt.py Normal file
View file

@ -0,0 +1,29 @@
#!/usr/bin/python
import os
import time
import subprocess
command = [
"certbot",
"-n", "--agree-tos", # non-interactive
"-d", os.environ["HOSTNAMES"],
"-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
"certonly", "--standalone",
"--server", "https://acme-v02.api.letsencrypt.org/directory",
"--cert-name", "tellform",
"--preferred-challenges", "http", "--http-01-port", "8008",
"--keep-until-expiring",
"--rsa-key-size", "4096",
"--config-dir", "/certs/letsencrypt",
"--post-hook", "./config.py"
]
# Wait for nginx to start
time.sleep(5)
# Run certbot every hour
while True:
subprocess.call(command)
time.sleep(3600)

25
nginx/start.py Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/python
import os
import subprocess
#Set default port
if not os.environ["PORT"]:
os.environ["PORT"] = "5000"
#Set default sockets port
if not os.environ["SOCKET_PORT"]:
os.environ["SOCKET_PORT"] = "20523"
# Actual startup script
if not os.path.exists("/certs/dhparam.pem") and os.environ["TLS_FLAVOR"] != "notls":
os.system("openssl dhparam -out /certs/dhparam.pem 2048")
if os.environ["TLS_FLAVOR"] == "letsencrypt":
subprocess.Popen(["/letsencrypt.py"])
elif os.environ["TLS_FLAVOR"] == "cert":
if not os.path.exists("/certs/cert.pem"):
os.system("openssl req -newkey rsa:2048 -x509 -keyout /certs/key.pem -out /certs/cert.pem -days 365 -nodes -subj '/C=NA/ST=None/L=None/O=None/CN=" + os.environ["BASE_URL"] + "'")
subprocess.call(["/config.py"])
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])

14204
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
{
"name": "TellForm",
"description": "Opensource alternative to TypeForm",
"version": "2.0.0",
"homepage": "https://github.com/whitef0x0/tellform",
"version": "2.1.0",
"homepage": "https://github.com/tellform/tellform",
"authors": [
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
],
@ -10,97 +10,71 @@
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/whitef0x0/tellform.git"
"url": "https://github.com/tellform/tellform.git"
},
"engines": {
"node": "6.11.2",
"npm": "3.10.10"
"node": "6.x.x",
"npm": "3.x.x"
},
"scripts": {
"addcontrib": "all-contributors add",
"generate": "all-contributors generate",
"start": "npm run version && grunt",
"test": "npm run version && grunt test",
"postinstall": "bower install --config.interactive=false; grunt build;",
"init": "node scripts/setup.js",
"version": "check-node-version --package"
"start": "grunt",
"test": "grunt test",
"postinstall": "bower install --config.interactive=false",
"init": "node scripts/setup.js"
},
"dependencies": {
"async": "^1.4.2",
"async-boolean-expression-evaluator": "^1.1.1",
"bcrypt": "^0.8.7",
"bcrypt-nodejs": "0.0.3",
"body-parser": "~1.14.1",
"bower": "~1.6.5",
"body-parser": "^1.19.0",
"bower": "^1.8.8",
"chalk": "^1.1.3",
"check-node-version": "^2.1.0",
"compression": "~1.6.0",
"compression": "^1.7.4",
"connect": "^3.4.1",
"connect-flash": "~0.1.1",
"connect-mongo": "~0.8.2",
"consolidate": "~0.13.1",
"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": "~0.4.1",
"envfile": "^2.0.1",
"express": "~4.13.3",
"express-device": "~0.4.2",
"express-session": "~1.12.1",
"forever": "~0.15.1",
"fs-extra": "~0.26.2",
"email-verification": "github:tellform/node-email-verification",
"envfile": "^2.1.1",
"express": "^4.16.4",
"express-session": "^1.16.1",
"glob": "^7.0.3",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.13",
"grunt-concurrent": "~2.3.0",
"grunt-contrib-csslint": "~1.0.0",
"grunt-contrib-cssmin": "~1.0.1",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~0.11.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-env": "~0.4.1",
"grunt-html2js": "~0.3.5",
"grunt-karma": "~0.12.1",
"grunt-newer": "~1.1.1",
"grunt-html2js": "^0.6.0",
"grunt-ng-annotate": "~1.0.1",
"grunt-node-inspector": "~0.4.1",
"grunt-nodemon": "~0.4.0",
"helmet": "3.5.0",
"inquirer": "^1.0.2",
"helmet": "^3.16.0",
"i18n": "^0.8.3",
"jit-grunt": "^0.9.1",
"lodash": "^4.17.4",
"main-bower-files": "~2.9.0",
"lodash": "^4.17.11",
"main-bower-files": "^2.13.1",
"method-override": "~2.3.0",
"mkdirp": "^0.5.1",
"mongoose": "~4.4.19",
"mongoose-cache": "^0.1.5",
"mongoose-utilities": "~0.1.1",
"morgan": "~1.8.1",
"multer": "^1.3.0",
"morgan": "^1.9.1",
"nodemailer": "~4.0.0",
"nodemailer-sendgrid-transport": "^0.2.0",
"nodemailer-sparkpost-transport": "^1.0.0",
"passport": "~0.3.0",
"passport-anonymous": "^1.0.1",
"passport-facebook": "~2.0.0",
"passport-github": "~1.0.0",
"passport-google-oauth": "~0.2.0",
"passport-linkedin": "~1.0.0",
"passport-local": "~1.0.0",
"passport-localapikey-update": "^0.5.0",
"passport-twitter": "~1.0.2",
"path-exists": "^2.1.0",
"prerender-node": "^2.2.1",
"pug": "^2.0.3",
"random-js": "^1.0.8",
"raven": "^0.9.0",
"request": "^2.88.0",
"socket.io": "^1.4.6",
"socket.io-redis": "^1.0.0",
"swig": "~1.4.1",
"uid-generator": "^0.1.1",
"uuid-token-generator": "^0.5.0",
"wildcard-subdomains": "github:tellform/wildcard-subdomains",
"winston": "^2.3.1",
"winston-logrotate": "^1.2.0"
"winston": "^2.3.1"
},
"devDependencies": {
"all-contributors-cli": "^4.3.0",
@ -108,14 +82,19 @@
"coveralls": "^2.11.4",
"cross-spawn": "^5.0.0",
"del": "^2.2.2",
"email-verification": "github:tellform/node-email-verification",
"grunt-cli": "~0.1.13",
"grunt-closure-compiler": "0.0.21",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^0.11.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-execute": "^0.2.2",
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
"grunt-karma": "~0.12.1",
"grunt-mocha-istanbul": "^3.0.1",
"grunt-mocha-test": "~0.12.1",
"grunt-newer": "~1.1.1",
"grunt-nodemon": "~0.4.0",
"grunt-usemin": "^3.1.1",
"grunt-wiredep": "^3.0.1",
"istanbul": "^0.4.0",
@ -129,11 +108,9 @@
"karma-mocha-reporter": "^1.1.1",
"karma-ng-html2js-preprocessor": "^0.2.0",
"karma-phantomjs-launcher": "^1.0.4",
"mailosaur": "^1.0.1",
"mocha": "^3.1.2",
"mocha-lcov-reporter": "^1.0.0",
"nightwatch": "^0.9.8",
"node-mandrill": "^1.0.1",
"phantomjs": "^1.9.18",
"selenium-server": "^3.0.1",
"should": "~7.1.1",

View file

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more