Permalink
Browse files

updated mailer for SES, added package.json for dependency installatio…

…n, added non-npm dependency installer in ./bin, updated some install instructions
  • Loading branch information...
1 parent bc58af0 commit 5d9b4aa81077d341b351b94143be0b06f79b21f6 @contra contra committed Sep 7, 2011
Showing with 72 additions and 42 deletions.
  1. +3 −0 .gitignore
  2. +2 −0 bin/install-deps.sh
  3. +2 −2 bin/install.js
  4. +0 −1 deps/nodemon
  5. +12 −11 example_config.js
  6. +2 −0 install.txt
  7. +32 −0 package.json
  8. +19 −28 scripts/mailer.js
View
@@ -5,3 +5,6 @@ proxy/.monitor
scripts/gitrepoclone.sh
ssl/*
bin/.nodester.config
+.DS_Store
+*.log
+node_modules
View
@@ -0,0 +1,2 @@
+#!/bin/sh
+sudo yum install upstart monit cairo-devel libpng git-core curl
View
@@ -80,7 +80,7 @@ add_c(host_base, 'sudo cp ${HOME}/.ssh/authorized_keys ' + app_homedir + '/.ssh/
add_c(host_base, 'sudo chown -R ' + app_username + ':' + app_username + ' ' + app_homedir + '/.ssh', '', false);
add_c(host_base, 'sudo chmod -R 0700 ' + app_homedir + '/.ssh', '', false);
-add_c(host_app, 'git clone http://github.com/DanBUK/nodester.git ./nodester', '', true);
+add_c(host_app, 'git clone http://github.com/nodester/nodester.git ./nodester', '', true);
add_c(host_app, 'cp ./nodester/example_config.js ./nodester/config.js', '', true);
add_c(host_app, 'sed -i -e "s/\\\/var\\\/nodester/' + app_homedir.replace('/', '\\\/') + '/g" ./nodester/config.js', '', false);
add_c(host_app, 'sed -i -e "s/couch_user: \'nodester/couch_user: \'' + couch_db_user + '/" ./nodester/config.js', '', false);
@@ -145,4 +145,4 @@ var run_command = function(cmds) {
if (commands.length > 0) {
run_command(commands);
-}
+}
Submodule nodemon deleted from 173832
View
@@ -4,7 +4,7 @@ exports.opt = {
couch_host: '127.0.0.1',
couch_port: 5984,
couch_prefix: 'nodester',
- couch_tables: ['coupons', 'nodefu', 'nextport', 'apps', 'repos', 'aliasdomains','password_resets'],
+ couch_tables: ['coupons', 'nodefu', 'nextport', 'apps', 'repos', 'aliasdomains', 'password_resets'],
home_dir: '/var/nodester',
app_dir: '/var/nodester/nodester',
git_home_dir: '/git',
@@ -16,19 +16,20 @@ exports.opt = {
git_user: 'nodester',
git_dom: 'testnodester.com',
coupon_code: 'CouponCode',
- blocked_apps: ['www', 'api', 'admin', 'support', 'blog'],
+ blocked_apps: ['www', 'api', 'admin', 'support', 'blog', 'site'],
restart_key: 'KeepThisSecret',
userid: 'nodester',
app_uid: 100,
enable_ssl: false, // Currently SSL forward to the app/api, when I have a wildcard cert to test, then all apps can have SSL.
- ssl_ca_file: "",
- ssl_cert_file: "",
- ssl_key_file: "",
+ ssl_ca_file: '',
+ ssl_cert_file: '',
+ ssl_key_file: '',
node_base_folder: '/opt/node-v0.4.9_npm_v1.0.3',
- smtp_host: "localhost",
- smtp_port: "25",
- smtp_domain: "nodester.com",
- smtp_username: "smtp_username",
- smtp_password: "smtp_password",
- smtp_auth: "login"
+
+ //Amazon SES mail info
+ SES = {
+ AWSAccessKeyID: 'ACCESSKEY',
+ AWSSecretKey: 'SECRETKEY',
+ ServiceUrl: 'https://email.us-east-1.amazonaws.com',
+ }
};
View
@@ -1,3 +1,5 @@
+PLEASE NOTE - THIS IS HORRIBLY OUT OF DATE, UPDATED INSTALL INSTRUCTIONS AND A STREAMLINED INSTALL PROCESS WILL BE DONE SOON
+
Nodester - A node.js hosting platform
Dependencies:
View
@@ -0,0 +1,32 @@
+{
+ "name":"nodester-server",
+ "description":"Nodester Server",
+ "version":"0.0.1",
+ "homepage":"http://github.com/nodester/nodester",
+ "repository":"git://github.com/nodester/nodester.git",
+ "author":"Nodester <contact@nodester.com> (http://nodester.com/)",
+
+ "dependencies":{
+ "coffee-script":"*",
+ "colors":"*",
+ "nodemailer":"*",
+ "pool":"*",
+ "express":"*",
+ "request":"*",
+ "npm-wrapper":"*",
+ "daemon":"*",
+ "forever":"*",
+ "cradle":"*",
+ "nodeinfo":"*",
+ "socket.io":"*"
+ },
+ "engines":{
+ "node":">= 0.4.7"
+ },
+ "licenses":[
+ {
+ "type":"MIT",
+ "url":"http://github.com/nodester/nodester/blob/master/LICENSE.txt"
+ }
+ ]
+}
View
@@ -1,47 +1,38 @@
#!/usr/bin/env node
-var mailer = require('mailer'),
+var mailer = require('nodemailer'),
lib = require('../lib/lib'),
- config = require('../config'),
- username = config.opt.smtp_username,
- password = config.opt.smtp_password,
- host = config.opt.smtp_host,
- port = config.opt.stmp_port;
+ config = require('../config');
var resets = lib.get_couchdb_database('password_resets');
+mailer.SES = config.opt.SES;
+
function send_email(doc) {
- mailer.send({
- port: config.opt.smtp_port,
- domain: config.opt.smtp_domain,
- username: config.opt.smtp_username,
- password: config.opt.smtp_password,
- authentication: config.opt.smtp_auth,
+ nodemailer.send_mail({
+ sender: '<notifier@nodester.com>',
to: doc.id,
- from: "<notifier@nodester.com>",
- subject: "Password reset request",
- body: "That's your password request token: " + doc.value.token + "\n\nYou can reset your password via Nodester API or CLI"
- }, function(err, result) {
- if (!err) {
- console.log("Reset password e-mail sent to: " + doc.id)
- reset_token(doc)
- } else {
- console.log(err)
- }
+ subject: 'Password reset request',
+ body: 'Here is your password request token: ' + doc.value.token + '\n\nYou can reset your password via Nodester API or CLI'
+ }, function (error, success) {
+ console.log('Reset password e-mail sent to: ' + doc.id)
+ console.log('Message ' + success ? 'sent' : 'failed');
+ reset_token(doc)
});
}
function reset_token(doc) {
- resets.merge(doc.id, {email_sent:true}, function(err, res) {
- if (err)
- console.log(err)
+ resets.merge(doc.id, {
+ email_sent: true
+ }, function (err, res) {
+ if (err) console.log(err)
});
}
-resets.view('tokens/unsent', function(err, doc) {
+resets.view('tokens/unsent', function (err, doc) {
if (!err) {
- for (i=0; i<doc.length; i++)
- send_email(doc[i])
+ for (i = 0; i < doc.length; i++)
+ send_email(doc[i])
} else {
console.log(err)
}

0 comments on commit 5d9b4aa

Please sign in to comment.