Merge branch 'develop'

This commit is contained in:
Alice Gaudon 2020-07-11 12:08:40 +02:00
commit 7dc0c55a5f
5 changed files with 38 additions and 75 deletions

View File

@ -112,7 +112,6 @@ UploadForm.prototype.start = function () {
const units = ['K', 'M', 'G', 'T'];
UploadForm.prototype.updateSpeed = function (loaded) {
console.log(this.xferSpeed);
const time = new Date().getTime();
if (this.lastTransferTime) {
this.xferSpeed.push((loaded - this.lastLoaded) / (time - this.lastTransferTime));

View File

@ -708,6 +708,7 @@ button, .button {
top: 0;
width: var(--progress);
height: 100%;
transition: width ease-out 150ms;
background: $secondary;
}

View File

@ -1,6 +1,6 @@
{
"name": "ily.li",
"version": "0.4.2",
"version": "0.4.3",
"description": "Self-hosted file pusher",
"repository": "git@gitlab.com:ArisuOngaku/ily.li.git",
"author": "Alice Gaudon <alice@gaudon.pro>",
@ -18,9 +18,14 @@
"@babel/preset-env": "^7.9.5",
"@types/config": "^0.0.36",
"@types/express": "^4.17.6",
"@types/express-session": "^1.17.0",
"@types/formidable": "^1.0.31",
"@types/jest": "^25.2.1",
"@types/mysql": "^2.15.14",
"@types/node": "^13.13.2",
"@types/nodemailer": "^6.4.0",
"@types/nunjucks": "^3.1.3",
"@types/ws": "^7.2.6",
"babel-loader": "^8.1.0",
"concurrently": "^5.1.0",
"css-loader": "^3.5.2",

View File

@ -7,9 +7,9 @@ import config from "config";
import * as fs from "fs";
import AuthToken from "../models/AuthToken";
import {IncomingForm} from "formidable";
import {FILE_UPLOAD_MIDDLEWARE} from "wms-core/components/ExpressAppComponent";
import generateSlug from "../SlugGenerator";
import Logger from "wms-core/Logger";
import FileUploadMiddleware from "wms-core/FileUploadMiddleware";
export default class FileController extends Controller {
@ -122,8 +122,7 @@ export default class FileController extends Controller {
}
}
export const FILE_UPLOAD_FORM_MIDDLEWARE = FILE_UPLOAD_MIDDLEWARE(() => {
export const FILE_UPLOAD_FORM_MIDDLEWARE = new FileUploadMiddleware(() => {
const form = new IncomingForm();
form.uploadDir = 'storage/tmp';
form.maxFileSize = config.get<number>('max_upload_size') * 1024 * 1024;

View File

@ -770,14 +770,6 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"
"@babel/runtime-corejs3@^7.8.3":
version "7.10.4"
resolved "https://registry.toot.party/@babel%2fruntime-corejs3/-/runtime-corejs3-7.10.4.tgz#f29fc1990307c4c57b10dbd6ce667b27159d9e0d"
integrity sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==
dependencies:
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7":
version "7.10.4"
resolved "https://registry.toot.party/@babel%2fruntime/-/runtime-7.10.4.tgz#a6724f1a6b8d2f6ea5236dbfe58c7d7ea9c5eb99"
@ -1223,7 +1215,7 @@
resolved "https://registry.toot.party/@types%2fminimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
"@types/mysql@^2.15.10":
"@types/mysql@^2.15.14":
version "2.15.14"
resolved "https://registry.toot.party/@types%2fmysql/-/mysql-2.15.14.tgz#df60e7b5f531662a8758e74b7685bed2b0ef1835"
integrity sha512-YyNcxZZ4qlb9v41lu8Qfo+quX8eUqz4mr/6Nx7sclc2pUemOvjU7xrpuVave0/sR/VdtDPTXZOWQLC/kthxrHg==
@ -1231,14 +1223,14 @@
"@types/node" "*"
"@types/node@*":
version "14.0.20"
resolved "https://registry.toot.party/@types%2fnode/-/node-14.0.20.tgz#0da05cddbc761e1fa98af88a17244c8c1ff37231"
integrity sha512-MRn/NP3dee8yL5QhbSA6riuwkS+UOcsPUMOIOG3KMUQpuor/2TopdRBu8QaaB4fGU+gz/bzyDWt0FtUbeJ8H1A==
version "14.0.22"
resolved "https://registry.toot.party/@types%2fnode/-/node-14.0.22.tgz#23ea4d88189cec7d58f9e6b66f786b215eb61bdc"
integrity sha512-emeGcJvdiZ4Z3ohbmw93E/64jRzUHAItSHt8nF7M4TGgQTiWqFVGB8KNpLGFmUHmHLvjvBgFwVlqNcq+VuGv9g==
"@types/node@^13.13.2":
version "13.13.13"
resolved "https://registry.toot.party/@types%2fnode/-/node-13.13.13.tgz#71217d90fd9c9c937e28628772d5c0b432c79355"
integrity sha512-UfvBE9oRCAJVzfR+3eWm/sdLFe/qroAPEXP3GPJ1SehQiEVgZT6NQZWYbPMiJ3UdcKM06v4j+S1lTcdWCmw+3g==
version "13.13.14"
resolved "https://registry.toot.party/@types%2fnode/-/node-13.13.14.tgz#20cd7d2a98f0c3b08d379f4ea9e6b315d2019529"
integrity sha512-Az3QsOt1U/K1pbCQ0TXGELTuTkPLOiFIQf3ILzbOyo0FqgV9SxRnxbxM5QlAveERZMHpZY+7u3Jz2tKyl+yg6g==
"@types/nodemailer@^6.4.0":
version "6.4.0"
@ -1277,13 +1269,6 @@
resolved "https://registry.toot.party/@types%2frange-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"
integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==
"@types/redis@^2.8.18":
version "2.8.24"
resolved "https://registry.toot.party/@types%2fredis/-/redis-2.8.24.tgz#164d1d1b9f628d089e63874b072100c30d9d1c1a"
integrity sha512-I5LivNsNdEvBDJnBthjL4YAqD888eSf/k8kM5ROzgRHy7UE7n+ijwFVKqCSM4Ekujfb+3SDz/GbEhXWjnuI04w==
dependencies:
"@types/node" "*"
"@types/serve-static@*":
version "1.13.4"
resolved "https://registry.toot.party/@types%2fserve-static/-/serve-static-1.13.4.tgz#6662a93583e5a6cabca1b23592eb91e12fa80e7c"
@ -1297,7 +1282,7 @@
resolved "https://registry.toot.party/@types%2fstack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
"@types/ws@^7.2.4":
"@types/ws@^7.2.6":
version "7.2.6"
resolved "https://registry.toot.party/@types%2fws/-/ws-7.2.6.tgz#516cbfb818310f87b43940460e065eb912a4178d"
integrity sha512-Q07IrQUSNpr+cXU4E4LtkSIBPie5GLZyyMC1QtQYRLWz701+XcoVygGUZgvLqElq1nU4ICldMYPnexlBsg3dqQ==
@ -2331,9 +2316,9 @@ camelcase@^5.0.0, camelcase@^5.3.1:
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
caniuse-lite@^1.0.30001093:
version "1.0.30001096"
resolved "https://registry.toot.party/caniuse-lite/-/caniuse-lite-1.0.30001096.tgz#5a4541af5317dc21f91f5b24d453030a35f919c0"
integrity sha512-PFTw9UyVfbkcMEFs82q8XVlRayj7HKvnhu5BLcmjGpv+SNyiWasCcWXPGJuO0rK0dhLRDJmtZcJ+LHUfypbw1w==
version "1.0.30001097"
resolved "https://registry.toot.party/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz#1129c40c9f5ee3282158da08fd915d301f4a9bd8"
integrity sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA==
capture-exit@^2.0.0:
version "2.0.0"
@ -2714,10 +2699,10 @@ connect-flash@^0.1.1:
resolved "https://registry.toot.party/connect-flash/-/connect-flash-0.1.1.tgz#d8630f26d95a7f851f9956b1e8cc6732f3b6aa30"
integrity sha1-2GMPJtlaf4UfmVax6MxnMvO2qjA=
connect-redis@^4.0.4:
version "4.0.4"
resolved "https://registry.toot.party/connect-redis/-/connect-redis-4.0.4.tgz#b194abe2f3754551f38086e1a28cb9e68d6c3b28"
integrity sha512-aXk7btMlG0J5LqtPNRpFKa5fglzlTzukYNx+Fq8cghbUIQHN/gyK9c3+b0XEROMwiSxMoZDADqjp9tdpUoZLAg==
connect-redis@^5.0.0:
version "5.0.0"
resolved "https://registry.toot.party/connect-redis/-/connect-redis-5.0.0.tgz#68fe890117e761ee98e13a14b835338bd6bf044c"
integrity sha512-R4nTW5uXeG5s6zr/q4abmtcdloglZrL/A3cpa0JU0RLFJU4mTR553HUY8OZ0ngeySkGDclwQ5xmCcjjKkxdOSg==
console-browserify@^1.1.0:
version "1.2.0"
@ -2806,11 +2791,6 @@ core-js-compat@^3.6.2:
browserslist "^4.8.5"
semver "7.0.0"
core-js-pure@^3.0.0:
version "3.6.5"
resolved "https://registry.toot.party/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813"
integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==
core-js@^2.4.0:
version "2.6.11"
resolved "https://registry.toot.party/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
@ -3082,13 +3062,6 @@ decamelize@^1.1.2, decamelize@^1.2.0:
resolved "https://registry.toot.party/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
decamelize@^3.2.0:
version "3.2.0"
resolved "https://registry.toot.party/decamelize/-/decamelize-3.2.0.tgz#84b8e8f4f8c579f938e35e2cc7024907e0090851"
integrity sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==
dependencies:
xregexp "^4.2.4"
decode-uri-component@^0.2.0:
version "0.2.0"
resolved "https://registry.toot.party/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
@ -3440,9 +3413,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.488:
version "1.3.494"
resolved "https://registry.toot.party/electron-to-chromium/-/electron-to-chromium-1.3.494.tgz#0d2dba65b69d696c5b71abb37552ff055fb32a5c"
integrity sha512-EOZuaDT3L1sCIMAVN5J0nGuGWVq5dThrdl0d8XeDYf4MOzbXqZ19OLKesN8TZj0RxtpYjqHpiw/fR6BKWdMwYA==
version "1.3.496"
resolved "https://registry.toot.party/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz#3f43d32930481d82ad3663d79658e7c59a58af0b"
integrity sha512-TXY4mwoyowwi4Lsrq9vcTUYBThyc1b2hXaTZI13p8/FRhY2CTaq5lK+DVjhYkKiTLsKt569Xes+0J5JsVXFurQ==
elliptic@^6.0.0, elliptic@^6.5.2:
version "6.5.3"
@ -6813,9 +6786,9 @@ negotiator@0.6.2:
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
neo-async@^2.5.0, neo-async@^2.6.1:
version "2.6.1"
resolved "https://registry.toot.party/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
version "2.6.2"
resolved "https://registry.toot.party/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
nice-try@^1.0.4:
version "1.0.5"
@ -9864,22 +9837,15 @@ widest-line@^3.1.0:
string-width "^4.0.0"
wms-core@^0:
version "0.11.0"
resolved "https://registry.toot.party/wms-core/-/wms-core-0.11.0.tgz#fb7216024561ebcaa841e3b2abb2f40e8cb97dcb"
integrity sha512-+oldFhwConda/KbtIV9Pk+VkoZbcoyc66LRVhQfI9tTDw3Jt8+pbyqO/ctg2u17yp21r/q00zLrSqbV45YtGIg==
version "0.13.1"
resolved "https://registry.toot.party/wms-core/-/wms-core-0.13.1.tgz#73771a77cf0f3940f932418f932d77d0d6737cf5"
integrity sha512-DVRz+nLXsaa1CSzJJU310RJ8Qfdq1EIP/TwDfRs89Ko1IwaojP6by9np3nQHrRL3tQ3k9zg3YtHq3m24FOvpQw==
dependencies:
"@types/express" "^4.17.6"
"@types/express-session" "^1.17.0"
"@types/mysql" "^2.15.10"
"@types/nodemailer" "^6.4.0"
"@types/nunjucks" "^3.1.3"
"@types/redis" "^2.8.18"
"@types/ws" "^7.2.4"
argon2 "^0.26.2"
compression "^1.7.4"
config "^3.3.1"
connect-flash "^0.1.1"
connect-redis "^4.0.4"
connect-redis "^5.0.0"
cookie "^0.4.1"
cookie-parser "^1.4.5"
express "^4.17.1"
@ -9961,13 +9927,6 @@ xmlchars@^2.1.1:
resolved "https://registry.toot.party/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==
xregexp@^4.2.4:
version "4.3.0"
resolved "https://registry.toot.party/xregexp/-/xregexp-4.3.0.tgz#7e92e73d9174a99a59743f67a4ce879a04b5ae50"
integrity sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==
dependencies:
"@babel/runtime-corejs3" "^7.8.3"
xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1:
version "4.0.2"
resolved "https://registry.toot.party/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
@ -10021,12 +9980,12 @@ yargs@^13.3.0, yargs@^13.3.2:
yargs-parser "^13.1.2"
yargs@^15.3.1:
version "15.4.0"
resolved "https://registry.toot.party/yargs/-/yargs-15.4.0.tgz#53949fb768309bac1843de9b17b80051e9805ec2"
integrity sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==
version "15.4.1"
resolved "https://registry.toot.party/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
dependencies:
cliui "^6.0.0"
decamelize "^3.2.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"