5 Commits

Author SHA1 Message Date
mntmn
2fc14e1efe Update README.md 2018-07-25 11:05:35 +02:00
mntmn
79a3d39015 Remove windows prerelease from README
Releases should be tested and built via CI/CD.
2018-07-17 12:21:32 +02:00
Lukas F. Hartmann
628ceb6c3a Merge branch 'master' of https://github.com/spacedeck/spacedeck-open 2018-07-17 12:18:14 +02:00
Lukas F. Hartmann
9889aaa34c Merge branch 'kaleidos-issues/23/deleting-space-user-is-not-possible' 2018-07-17 12:17:56 +02:00
Hirunatan
ea4f40b628 Implement SMTP email service (#28) 2018-07-17 12:05:27 +02:00
5 changed files with 63 additions and 17 deletions

View File

@@ -6,10 +6,6 @@ The spacedeck.com online service was shut down on May 1st 2018. We decided to op
We appreciate filed issues, pull requests and general discussion. We appreciate filed issues, pull requests and general discussion.
**Windows users:** Try the one-click release at https://github.com/spacedeck/spacedeck-open/releases/tag/v0.9
Desktop releases for Linux and Mac will be published here soon. In the meantime, you have to install Node.JS to run Spacedeck.
# Features # Features
- Create virtual whiteboards called *Spaces* with virtually unlimited size - Create virtual whiteboards called *Spaces* with virtually unlimited size
@@ -21,6 +17,12 @@ Desktop releases for Linux and Mac will be published here soon. In the meantime,
- Share Spaces on the web or via email - Share Spaces on the web or via email
- Export your work as printable PDF or ZIP - Export your work as printable PDF or ZIP
# Use Cases
- Education: Virtual classwork with multimedia
- Creative: Mood boards, Brainstorming, Design Thinking
- Visual note taking and planning
# Data Import from Spacedeck.com # Data Import from Spacedeck.com
Spacedeck Open has a data import feature that you can use to migrate your ZIP export from Spacedeck.com. Spacedeck Open has a data import feature that you can use to migrate your ZIP export from Spacedeck.com.

View File

@@ -1,8 +1,10 @@
{ {
//"endpoint": "http://localhost:9000", "team_name": "My Open Spacedeck",
"endpoint": "http://localhost:9666", "contact_email": "support@example.org",
"storage_region": "eu-central-1",
"endpoint": "http://localhost:9666",
"storage_region": "eu-central-1",
//"storage_bucket": "sdeck-development", //"storage_bucket": "sdeck-development",
//"storage_cdn": "http://localhost:9123/sdeck-development", //"storage_cdn": "http://localhost:9123/sdeck-development",
//"storage_endpoint": "http://storage:9000", //"storage_endpoint": "http://storage:9000",
@@ -18,5 +20,14 @@
"google_access" : "", "google_access" : "",
"google_secret" : "", "google_secret" : "",
"admin_pass": "very_secret_admin_password", "admin_pass": "very_secret_admin_password",
"phantom_api_secret": "very_secret_phantom_password" "phantom_api_secret": "very_secret_phantom_password",
// Choose "console" or "smtp"
"mail_provider": "smtp",
"mail_smtp_host": "your.smtp.host",
"mail_smtp_port": 465,
"mail_smtp_secure": true,
"mail_smtp_require_tls": true,
"mail_smtp_user": "your.smtp.user",
"mail_smtp_pass": "your.secret.smtp.password"
} }

View File

@@ -1,18 +1,18 @@
'use strict'; 'use strict';
var swig = require('swig'); const config = require('config');
const nodemailer = require('nodemailer');
const swig = require('swig');
//var AWS = require('aws-sdk'); //var AWS = require('aws-sdk');
module.exports = { module.exports = {
sendMail: (to_email, subject, body, options) => { sendMail: (to_email, subject, body, options) => {
if (!options) { if (!options) {
options = {}; options = {};
} }
// FIXME const teamname = options.teamname || config.get('team_name');
const teamname = options.teamname || "My Open Spacedeck" const from = teamname + ' <' + config.get('contact_email') + '>';
const from = teamname + ' <support@example.org>';
let reply_to = [from]; let reply_to = [from];
if (options.reply_to) { if (options.reply_to) {
@@ -29,9 +29,40 @@ module.exports = {
options: options options: options
}); });
//if (process.env.NODE_ENV === 'development') { if (config.get('mail_provider') === 'console') {
console.log("Email: to " + to_email + " in production.\nreply_to: " + reply_to + "\nsubject: " + subject + "\nbody: \n" + htmlText + "\n\n plaintext:\n" + plaintext); console.log("Email: to " + to_email + " in production.\nreply_to: " + reply_to + "\nsubject: " + subject + "\nbody: \n" + htmlText + "\n\n plaintext:\n" + plaintext);
/*} else {
} else if (config.get('mail_provider') === 'smtp') {
const transporter = nodemailer.createTransport({
host: config.get('mail_smtp_host'),
port: config.get('mail_smtp_port'),
secure: config.get('mail_smtp_secure'),
requireTLS: config.get('mail_smtp_require_tls'),
auth: {
user: config.get('mail_smtp_user'),
pass: config.get('mail_smtp_pass'),
}
});
transporter.sendMail({
from: from,
replyTo: reply_to,
to: to_email,
subject: subject,
text: plaintext,
html: htmlText,
}, function(err, info) {
if (err) {
console.error("Error sending email:", err);
} else {
console.log("Email sent.");
}
});
} else if (config.get('mail_provider') === 'aws') {
/*
AWS.config.update({region: 'eu-west-1'}); AWS.config.update({region: 'eu-west-1'});
var ses = new AWS.SES(); var ses = new AWS.SES();
@@ -56,6 +87,7 @@ module.exports = {
if (err) console.error("Error sending email:", err); if (err) console.error("Error sending email:", err);
else console.log("Email sent."); else console.log("Email sent.");
}); });
}*/ */
}
} }
}; };

View File

@@ -30,6 +30,7 @@
"moment": "^2.19.3", "moment": "^2.19.3",
"morgan": "1.8.1", "morgan": "1.8.1",
"node-phantom-simple": "2.2.4", "node-phantom-simple": "2.2.4",
"nodemailer": "^4.6.7",
"phantomjs-prebuilt": "2.1.14", "phantomjs-prebuilt": "2.1.14",
"read-chunk": "^2.1.0", "read-chunk": "^2.1.0",
"request": "2.81.0", "request": "2.81.0",

View File

@@ -283,7 +283,7 @@ router.post('/password_reset_requests', (req, res, next) => {
router.post('/password_reset_requests/:confirm_token/confirm', function(req, res, next) { router.post('/password_reset_requests/:confirm_token/confirm', function(req, res, next) {
var password = req.body.password; var password = req.body.password;
User db.User
.findOne({where: {"password_reset_token": req.params.confirm_token}}) .findOne({where: {"password_reset_token": req.params.confirm_token}})
.then((user) => { .then((user) => {
if (user) { if (user) {