merged chanegs

This commit is contained in:
David Baldwynn 2016-04-25 12:47:17 -04:00
commit 1ddf23a848
9 changed files with 265 additions and 242 deletions

View file

@ -13,4 +13,4 @@ ENV NODE_ENV development
# Port 3000 for server
# Port 35729 for livereload
EXPOSE 3000 35729
CMD ["grunt default"]
CMD ["grunt"]

View file

@ -55,13 +55,18 @@ $ grunt build
Create your .env file. It should look like this
```
MAILER_EMAIL_ID=example@test.com
GOOGLE_ANALYTICS_ID=yourGAID
PRERENDER_TOKEN=yourPrerender.ioToken
COVERALLS_REPO_TOKEN=yourCoveralls.ioToken
MAILER_EMAIL_ID=SMTP_Injection
MAILER_FROM=noreply@yourdomain.com
MAILER_PASSWORD=yourmandrillapikey
MAILER_SERVICE_PROVIDER=Mandrill
MAILER_PASSWORD=your_sparkpost_apikey
MAILER_SERVICE_PROVIDER=SparkPost
BASE_URL=yourdomain.com
```
Currenty 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
Create this directory or you will get errors.
```
@ -73,6 +78,7 @@ Edit the 'env' config in gruntfile.js to make sure your .env file is being used.
To run development version:
```$ grunt default```
To run production version:
```$ grunt production```

View file

@ -96,14 +96,14 @@
{% endif %}
<script>
// Raven.config('http://db01e03015ce48e2b68240ea8254b17c@sentry.polydaic.com/1', {
// // Raven settings
// })
// .setUser({
// "id": "SERVER_RENDERED_ID",
// "email": "SERVER_RENDERED_EMAIL"
// })
// .install()
Raven.config('http://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2', {
// Raven settings
})
.setUser({
"id": "SERVER_RENDERED_ID",
"email": "SERVER_RENDERED_EMAIL"
})
.install()
</script>
<!-- [if lt IE 9]>
@ -115,6 +115,16 @@
</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>

3
config/env/all.js vendored
View file

@ -2,6 +2,7 @@
module.exports = {
app: {
google_analytics_id: process.env.GOOGLE_ANALYTICS_ID || '',
title: 'TellForm',
description: 'Opensource form builder alternative to TypeForm',
keywords: 'typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs',
@ -18,7 +19,7 @@ module.exports = {
},
//Sentry DSN Client Key
DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.polydaic.com/1',
DSN: process.env.RAVEN_DSN || '',
// The secret should be set to a non-guessable string that
// is used to compute a session hash

View file

@ -38,10 +38,10 @@ module.exports = function(db) {
});
// Setting application local variables
app.locals.google_analytics_id = config.app.google_analytics_id;
app.locals.title = config.app.title;
app.locals.description = config.app.description;
app.locals.keywords = config.app.keywords;
app.locals.facebookAppId = config.facebook.clientID;
app.locals.bowerJSFiles = config.getBowerJSAssets();
app.locals.bowerCssFiles = config.getBowerCSSAssets();

View file

@ -3,25 +3,20 @@ version: '2'
services:
db:
image: mongo:3.2
command: ['bash', '-c', 'mongod --storageEngine wiredTiger'] #['mongod', '--storageEngine', 'wiredTiger']
volumes:
- mongo-data-wt:/data/db
#- /tmp/etc:/etc
networks:
- back-tier
web:
build:
context: .
build: .
volumes:
- .:/usr/src/app
ports:
- "3000:3000"
- "35729:35729"
networks:
- back-tier
environment:
DB_1_PORT_27017_TCP_ADDR: db
PORT: 3000
links:
- db
volumes:
mongo-data-wt:
driver: local
networks:
back-tier:
driver: bridge

View file

@ -1,13 +1,10 @@
Installing Sentry Server
------------------------
#Installing Sentry Server
TellForm is an opensource *form builder* that can create stunning forms from PDFs or from scratch
## Before You Begin
### 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
### Prerequisites
Make sure you have these installed:
* apt-get
* python2.7
@ -15,7 +12,7 @@ Make sure you have these installed:
## Installation Steps
### Installation Steps
1. Add non-root user.
```
sudo adduser sentry
@ -27,7 +24,7 @@ sudo adduser sentry sudo
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get install libxml2-dev libxslt1-dev libffi-dev
sudo apt-get install libxml2-dev libxslt1-dev libffi-dev libpq-dev python-dev
sudo reboot
```
@ -37,9 +34,10 @@ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
sudo easy_install pip
```
4. Install virtualenv and virtualenvwrapper
4. Install virtualenv and lmxl
```
sudo pip install virtualenv
sudo pip install lxml
```
5. Install Sentry and Setup
@ -208,7 +206,8 @@ server {
11. Start the worker processes
```
# restart nginx
sudo service nginx restart
sudo nginx -t
sudo service nginx reload
#start sentry
sentry celery worker -B

View file

@ -10,11 +10,23 @@
"ref" : "origin/master",
"repo" : "git@github.com:whitef0x0/tellform.git",
"path" : "/opt/deploy",
"post-deploy" : "npm install && bower install --allow-root && pm2 startOrRestart ecosystem.json --env production",
"post-deploy" : "npm install && bower install && pm2 startOrRestart ecosystem.json --env production",
"env" : {
"NODE_ENV": "production",
"BASE_URL": "stage.tellform.com"
}
},
"prod" : {
"user" : "polydaic",
"host" : "159.203.33.182",
"ref" : "origin/master",
"repo" : "git@github.com:whitef0x0/tellform.git",
"path" : "/opt/deploy",
"post-deploy" : "npm install && bower install && pm2 startOrRestart ecosystem.json --env production",
"env" : {
"NODE_ENV": "production",
"BASE_URL": "admin.tellform.com"
}
}
}
}

View file

@ -1,7 +1,7 @@
{
"name": "TellForm",
"description": "Opensource alternative to TypeForm",
"version": "1.2.1",
"version": "1.3.0",
"homepage": "https://github.com/whitef0x0/tellform",
"authors": [
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"