diff --git a/routes/api/space_exports.js b/routes/api/space_exports.js index 237ba01..0083feb 100644 --- a/routes/api/space_exports.js +++ b/routes/api/space_exports.js @@ -51,8 +51,7 @@ router.get('/png', function(req, res, next) { if (!req.space.thumbnail_updated_at || req.space.thumbnail_updated_at < req.space.updated_at || !req.space.thumbnail_url) { db.Space.update({ thumbnail_updated_at: triggered }, {where : {"_id": req.space._id }}); - phantom.takeScreenshot(req.space, "png", - function(local_path) { + phantom.takeScreenshot(req.space, "png", function(local_path) { var localResizedFilePath = local_path + ".thumb.jpg"; gm(local_path).resize(640, 480).quality(70.0).autoOrient().write(localResizedFilePath, function(err) { @@ -95,7 +94,7 @@ router.get('/png', function(req, res, next) { }, function() { // on_error - console.error("phantom could not create screenshot for space " + req.space_id); + console.error("[space screenshot] could not create screenshot for space " + req.space_id); res.status(404).send("Not found"); }); } else { diff --git a/spacedeck.js b/spacedeck.js index 6b841d1..430cd03 100644 --- a/spacedeck.js +++ b/spacedeck.js @@ -26,6 +26,9 @@ const serveStatic = require('serve-static'); const isProduction = app.get('env') === 'production'; +// workaround for libssl_conf.so error triggered by phantomjs +process.env['OPENSSL_CONF'] = '/dev/null'; + console.log("Booting Spacedeck Open… (environment: " + app.get('env') + ")"); app.use(logger(isProduction ? 'combined' : 'dev')); @@ -72,7 +75,7 @@ app.use(helmet.frameguard()) app.use(helmet.xssFilter()) app.use(helmet.hsts({ maxAge: 7776000000, - includeSubdomains: true + includeSubDomains: true })) app.disable('x-powered-by'); app.use(helmet.noSniff())