From e46f20527c151d7754ca566de5ff0c5ef94f6a54 Mon Sep 17 00:00:00 2001 From: yeouchien Date: Wed, 6 Apr 2016 02:35:52 +0000 Subject: [PATCH] Add nitrous.io Quickstart configs and update README --- README.md | 10 ++++++++++ README.nitrous.md | 13 +++++++++++++ nitrous-post-create.sh | 16 ++++++++++++++++ nitrous.json | 9 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 README.nitrous.md create mode 100755 nitrous-post-create.sh create mode 100644 nitrous.json diff --git a/README.md b/README.md index 6590e23f..abb48674 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,16 @@ Edit [mailtrain.nginx](setup/mailtrain.nginx) (update `server_name` directive) a Edit [mailtrain.conf](setup/mailtrain.conf) (update application folder) and copy it to `/etc/init` +## Nitrous Quickstart + +You can quickly create a free development environment for this Mailtrain project in the cloud on www.nitrous.io: + + + Nitrous Quickstart + + +In the IDE, start Mailtrain via `Run > Start Mailtrain` and access your site via `Preview > 3000`. + ## Bounce handling Mailtrain uses webhooks integration to detect bounces and spam complaints. Currently supported webhooks are: diff --git a/README.nitrous.md b/README.nitrous.md new file mode 100644 index 00000000..a26dc3ac --- /dev/null +++ b/README.nitrous.md @@ -0,0 +1,13 @@ +# Setup + +Welcome to your Mailtrain project on Nitrous. + +## Running the development server: + +In the [Nitrous IDE](https://community.nitrous.io/docs/ide-overview), start Mailtrain via "Run > Start Mailtrain". + +Now you've got a development server running and can see the output in the Nitrous terminal window. You can open up a new shell or utilize [tmux](https://community.nitrous.io/docs/tmux) to open new shells to run other commands. + +## Preview the app + +In the Nitrous IDE, open the "Preview" menu and click "Port 3000". diff --git a/nitrous-post-create.sh b/nitrous-post-create.sh new file mode 100755 index 00000000..6c7e7800 --- /dev/null +++ b/nitrous-post-create.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive +sudo apt-get update +sudo -E apt-get -q -y install mysql-server +sudo apt-get clean + +mysql -u root -e "CREATE USER 'mailtrain'@'localhost' IDENTIFIED BY 'mailtrain';" +mysql -u root -e "GRANT ALL PRIVILEGES ON mailtrain.* TO 'mailtrain'@'%' WITH GRANT OPTION;" +mysql -u mailtrain --password="mailtrain" -e "CREATE database mailtrain;" +mysql -u mailtrain --password="mailtrain" -D mailtrain < setup/mailtrain.sql + +cp config/default.toml config/production.toml +echo "running npm install..." +npm install --no-progress +echo "npm install done" diff --git a/nitrous.json b/nitrous.json new file mode 100644 index 00000000..118c16ec --- /dev/null +++ b/nitrous.json @@ -0,0 +1,9 @@ +{ + "template": "nodejs", + "ports": [3000], + "name": "Mailtrain", + "description": "Self hosted newsletter app.", + "scripts": { + "Start Mailtrain": "cd ~/code/mailtrain && NODE_ENV=production npm start" + } +}