further porting, cleanups, artifact upload/conversion and space screenshots

This commit is contained in:
Lukas F. Hartmann
2018-04-11 21:14:00 +02:00
parent c549fcf9ec
commit 8dc48a84ba
14 changed files with 164 additions and 355 deletions

View File

@@ -1,6 +1,8 @@
"use strict";
var config = require('config');
const os = require('os');
const db = require('../../models/db');
const Sequelize = require('sequelize');
const Op = Sequelize.Op;
@@ -124,8 +126,7 @@ router.post('/:artifact_id/payload', function(req, res, next) {
var fileName = (req.query.filename || "upload.bin").replace(/[^a-zA-Z0-9_\-\.]/g, '');
// FIXME TODO use portable tmp dir
var localFilePath = "/tmp/" + fileName;
var localFilePath = os.tmpdir() + "/" + fileName;
var writeStream = fs.createWriteStream(localFilePath);
var stream = req.pipe(writeStream);