Commit e2c4fa7e by Johan

Release 1.1.0

1. Add redis-server command to npm run scripts 2. Remove html file only check when calculating checksum
parent 956a5367
{
"name": "ingress",
"version": "1.0.0",
"version": "1.1.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"precommit": "pretty-quick --staged",
"ipfs": "ipfs daemon --unrestricted-api=true --enable-gc=true",
"hypercored": "hypercored --cwd ./dat",
"redis": "redis-server",
"dev":
"node server.js dev | tee -a log/dev-server.log 2>>log/dev-server-error.log & npm run ipfs>>log/dev-ipfs.log 2>>log/dev-ipfs-error.log & npm run hypercored>>log/dev-hypercored.log 2>>log/dev-hypercored-error.log",
"prod":
......@@ -51,5 +51,10 @@
"ipfs": "^0.28.2",
"prettier": "1.12.1",
"pretty-quick": "^1.4.1"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
......@@ -1031,10 +1031,13 @@ window.onload = async () => {
const fileSource = document.getElementsByName("checksum-file-source")[0].files[0];
let formError = false;
if (fileSource.type !== "text/html") {
/*
else if (fileSource.type !== "text/html") {
$("#checksum-error").text("Ingress only accepts .html file");
formError = true;
} else if (fileSource.size > 20 * 1024 * 1024) {
}
*/
if (fileSource.size > 20 * 1024 * 1024) {
$("#checksum-error").text("File size is too big (Max 20MB)");
formError = true;
}
......@@ -1059,6 +1062,7 @@ window.onload = async () => {
body: data
})
.then((response) => {
console.log(response);
if (response.status !== 200) {
toastr.error("Unable to calculate the checksum of the uploaded file");
return;
......
......@@ -232,11 +232,14 @@ const listDb = (key) => {
const multer = require("multer");
const fileFilter = (req, file, cb) => {
/*
if (file.mimetype !== "text/html") {
cb(null, false);
} else {
cb(null, true);
}
*/
cb(null, true);
};
const upload = multer({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment