Compare commits

...

11 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
9 changed files with 101 additions and 106 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
data/
dist
.vagrant
npm-debug.*

View file

@ -4,33 +4,16 @@
# Run:
# docker run -it tellform-prod
FROM phusion/baseimage:0.9.19
FROM node:10-alpine
MAINTAINER Arielle Baldwynn <team@tellform.com>
# Install Utilities
RUN apt-get update -q \
&& apt-get install -yqq \
curl \
ant \
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 some needed packages
RUN apk add --no-cache \
git \
&& rm -rf /tmp/*
# Install NPM Global Libraries
RUN npm install --quiet -g grunt bower pm2 && npm cache clean
RUN npm install --quiet -g grunt bower pm2 && npm cache clean --force
WORKDIR /opt/tellform
RUN mkdir -p /opt/tellform/public/lib
@ -47,6 +30,39 @@ 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
@ -54,6 +70,8 @@ COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
# Add npm package.json
COPY ./package.json /opt/tellform/package.json
RUN npm install --only=production --quiet
RUN bower install --allow-root
RUN grunt build
# Run TellForm server
CMD ["node", "server.js"]

View file

@ -1,21 +1,34 @@
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.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)
<!--
Moving over to Discord so that I can manage things without hassle.
[![Gitter](https://badges.gitter.im/tellform/Lobby.svg)](https://gitter.im/tellform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
-->
![Discord](https://img.shields.io/discord/586697165980565504.svg?label=Discord%20Chat)
> 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.
![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)
@ -27,11 +40,8 @@ Moving over to Discord so that I can manage things without hassle.
- [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
@ -41,7 +51,6 @@ Moving over to Discord so that I can manage things without hassle.
- 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
@ -50,37 +59,27 @@ Moving over to Discord so that I can manage things without hassle.
- 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
@ -88,103 +87,67 @@ 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
# Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER
MAILER_SMTP_HOST=smtp.domain.com
MAILER_SMTP_PORT=465
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 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
```
## 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 |
@ -213,25 +176,24 @@ TellForm's configuration is done with environment variables. To set an option fo
| 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/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://countable.ca" style="padding: 30px 0">
<img src="https://countable.ca/logo.cb446ab0.svg" height="30px">
</a>
</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">

View file

@ -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",

View file

@ -9,7 +9,14 @@ 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');

View file

@ -3,31 +3,29 @@ services:
redis:
restart: always
image: redis
volumes:
- "${PWD}/.env:/opt/tellform/.env"
networks:
- back-tier
mongo:
restart: always
image: mongo
volumes:
- "$ROOT/mongo:/data"
- ".data/mongo:/data"
networks:
- back-tier
tellform:
build:
context: .
env_file:
- .env
volumes:
# - "${PWD}/.env:/opt/tellform/.env"
- .:/opt/tellform
environment:
CREATE_ADMIN: "TRUE"
MONGODB_URI: mongodb://mongo/tellform
REDIS_URL: redis://redis
# volumes:
# - .:/opt/tellform
links:
- mongo
- redis
ports:
- "5000:5000"
# - "20523:20523"
depends_on:
- mongo
- redis
@ -43,10 +41,10 @@ services:
- "80:80"
- "443:443"
- "20523:20523"
env_file:
- .env
volumes:
- "$ROOT/certs:/certs"
environment:
NODE_ENV: development
#volumes:
# - "$ROOT/certs:/certs"
# - ./nginx/conf.d:/etc/nginx/conf.d
networks:
- back-tier

View file

@ -8,4 +8,12 @@ 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

View file

@ -5,14 +5,14 @@ var config = require('../config/config'),
exports.run = function(app, db, cb) {
var User = mongoose.model('User');
var email = 'admin@admin.com' || config.admin.email;
var email = config.admin.email || 'admin@admin.com';
var newUser = new User({
firstName: 'Admin',
lastName: 'Account',
email: email,
username: 'root' || config.admin.username,
password: 'root' || config.admin.password,
username: config.admin.username || 'root',
password: config.admin.password || 'root',
provider: 'local',
roles: ['admin', 'user']
});

View file

@ -40,7 +40,8 @@ const smtpTransport = nodemailer.createTransport(config.mailer.options);
smtpTransport.verify(function(error, success) {
if (error) {
console.error(chalk.red('Your mail configuration is incorrect: ' + error));
process.exit(-1);
// verify but to abort!
// process.exit(-1);
}
});
@ -48,7 +49,7 @@ smtpTransport.verify(function(error, success) {
var app = require('./config/express')(db);
//Create admin account
if (process.env.CREATE_ADMIN_ACCOUNT === 'TRUE') {
if (process.env.CREATE_ADMIN === 'TRUE') {
var create_admin = require('./scripts/create_admin');
create_admin.run(app, db, function(err){