Merge branch 'master' of github.com:whitef0x0/tellform into HEAD
This commit is contained in:
commit
fc29c7b5ca
34
README.md
34
README.md
@ -18,6 +18,7 @@ TellForm 2.1.0
|
||||
- [Quickstart](#quickstart)
|
||||
- [Deploying with Docker](#deploying-with-docker)
|
||||
- [Testing your Application](#testing-your-application)
|
||||
- [Advanced Configuration](#configuration)
|
||||
- [Where to Get Help](#where-to-get-help)
|
||||
- [Sponsors](#sponsors)
|
||||
- [Backers](#backers)
|
||||
@ -166,6 +167,39 @@ To calculate your client-side test coverage with Istanbul, run the coverage task
|
||||
$ grunt coverage:client
|
||||
```
|
||||
|
||||
## 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)
|
||||
|
||||
@ -322,7 +322,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) {
|
||||
|
||||
@ -8,7 +8,16 @@ 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');
|
||||
|
||||
require.extensions['.html'] = function (module, filename) {
|
||||
module.exports = fs.readFileSync(filename, 'utf8');
|
||||
};
|
||||
|
||||
var welcomeEmail = require("../../views/welcome.email.view.html");
|
||||
var verificationEmail = require("../../views/verification.email.view.html");
|
||||
|
||||
|
||||
|
||||
var nev = require('email-verification')(mongoose);
|
||||
@ -26,16 +35,15 @@ var config_nev = function () {
|
||||
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>',
|
||||
subject: '✔ Activate your new TellForm account!',
|
||||
html: welcomeEmail,
|
||||
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>',
|
||||
subject: '✔ Welcome to {{app.title}}!',
|
||||
html: verificationEmail,
|
||||
text: 'Your account has been successfully verified.'
|
||||
},
|
||||
verifySendMailCallback: function(err, info) {
|
||||
|
||||
@ -26,12 +26,15 @@ 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.form_fields = form.form_fields.map(v => Object.assign({}, v, { fieldValue: null }));
|
||||
|
||||
form.save(function (formSaveErr) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
|
||||
@ -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 <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>
|
||||
@ -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 <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>
|
||||
@ -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
|
||||
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>
|
||||
|
||||
|
||||
64
app/views/verification.email.view.html
Normal file
64
app/views/verification.email.view.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<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"/>
|
||||
<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>Welcome to TellForm! Here is a special link to activate your new account:</p>
|
||||
<p><a href="${URL}">Activate my account</a></p>
|
||||
<p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at <a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
|
||||
<p> - The TellForm 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>
|
||||
</head>
|
||||
64
app/views/welcome.email.view.html
Normal file
64
app/views/welcome.email.view.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE 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>We would like to welcome you as our newest member!</p>
|
||||
<p>Thanks so much for using TellForm! If you have any questions, or suggestions, please feel free to email us here at <a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
|
||||
<p> - The TellForm 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>
|
||||
29
config/env/all.js
vendored
29
config/env/all.js
vendored
@ -8,23 +8,31 @@ 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: 'mongodb://'+ (process.env.DB_PORT_27017_TCP_ADDR || process.env.MONGODB_URI || 'localhost')+'/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',
|
||||
|
||||
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',
|
||||
|
||||
subdomainsDisabled: (process.env.SUBDOMAINS_DISABLED === 'TRUE'),
|
||||
@ -52,17 +60,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: {
|
||||
|
||||
28
config/env/development.js
vendored
28
config/env/development.js
vendored
@ -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: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.MONGODB_URI || '0.0.0.0') +'/mean',
|
||||
options: {
|
||||
user: '',
|
||||
pass: ''
|
||||
@ -16,31 +16,7 @@ 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
|
||||
|
||||
1
config/env/production.js
vendored
1
config/env/production.js
vendored
@ -7,6 +7,7 @@ module.exports = {
|
||||
},
|
||||
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
config/env/secure.js
vendored
27
config/env/secure.js
vendored
@ -33,37 +33,12 @@ 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
|
||||
|
||||
25
config/env/test.js
vendored
25
config/env/test.js
vendored
@ -25,31 +25,6 @@ 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
|
||||
|
||||
@ -63,7 +63,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 = '';
|
||||
|
||||
@ -13,7 +13,12 @@ module.exports = function (app, db) {
|
||||
|
||||
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 +28,4 @@ module.exports = function (app, db) {
|
||||
});
|
||||
|
||||
return server;
|
||||
};
|
||||
};
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
"url": "https://github.com/whitef0x0/tellform.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": "6.11.2",
|
||||
"npm": "3.10.10"
|
||||
"node": "6.x.x",
|
||||
"npm": "3.x.x"
|
||||
},
|
||||
"scripts": {
|
||||
"addcontrib": "all-contributors add",
|
||||
|
||||
2
public/dist/application.min.css
vendored
2
public/dist/application.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +1,18 @@
|
||||
/*Modal overlay (for lightbox effect)*/
|
||||
.overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgb(0,0,0);
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 10;
|
||||
}
|
||||
.overlay.submitform {
|
||||
background-color: rgb(256,256,256);
|
||||
background-color: rgba(256,256,256,0.8);
|
||||
}
|
||||
|
||||
form .btn {
|
||||
border-color: grey;
|
||||
@ -19,6 +34,10 @@ form .btn {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
form .btn {
|
||||
border-color: grey;
|
||||
}
|
||||
|
||||
.public-form input.ng-untouched, .public-form textarea.ng-untouched {
|
||||
border-width: 0 0 2px 0;
|
||||
border-color: rgba(246, 255, 181, 0.4);
|
||||
|
||||
@ -5,17 +5,13 @@ var config = require('../config/config'),
|
||||
exports.run = function(app, db, cb) {
|
||||
|
||||
var User = mongoose.model('User');
|
||||
|
||||
var email = config.ADMIN_EMAIL || 'admin@admin.com';
|
||||
var username = config.ADMIN_USERNAME || 'root';
|
||||
var password = config.ADMIN_PASSWORD || 'root';
|
||||
|
||||
|
||||
var newUser = new User({
|
||||
firstName: 'Admin',
|
||||
lastName: 'Account',
|
||||
email: email,
|
||||
username: username,
|
||||
password: password,
|
||||
email: config.admin.email,
|
||||
username: config.admin.username,
|
||||
password: config.admin.password,
|
||||
provider: 'local',
|
||||
roles: ['admin', 'user']
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user