diff --git a/www/static/work1.html b/www/static/work1.html deleted file mode 100644 index 4f1061c..0000000 --- a/www/static/work1.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - 中草药识别 - - - - - - - - -

欢迎您,尊敬的

-

欢迎访问中草药识别系统!

- - -
-
识别查询
-
后台管理
-
- - - - - - -

联系我们

-

如有任何关于系统的疑问或建议,请联系我们:

-
- 电子邮件:aa893824054@163.com
- 电话:184-7635-1355 -
- - - - \ No newline at end of file diff --git a/www2/.vscode/launch.json b/www2/.vscode/launch.json new file mode 100644 index 0000000..602e063 --- /dev/null +++ b/www2/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\main.js" + } + ] +} \ No newline at end of file diff --git a/www/main.js b/www2/main.js similarity index 57% rename from www/main.js rename to www2/main.js index c156563..db91c7f 100644 --- a/www/main.js +++ b/www2/main.js @@ -1,74 +1,62 @@ var mysql = require('mysql'); +var express = require('express'); +var app = express(); +var bodyParser = require('body-parser'); +const crypto = require('crypto'); +const fs = require('fs'); +const path = require('path'); +const fileUpload = require('express-fileupload'); +const session = require('express-session'); +const multer = require('multer'); var connection = mysql.createConnection({ host : 'localhost', - port : '13307', + port : '13307 ', user : 'root', password : '123456', database : 'mailbox' }); -var express = require('express'); -var app = express(); -var bodyParser = require('body-parser'); // 创建 application/x-www-form-urlencoded 编码解析 var urlencodedParser = bodyParser.urlencoded({ extended: false }) - app.use(express.static('static')); + app.get('/', function (req, res) { //var result_string = build_html_head('识别系统') + '

欢迎来到识别系统!

\r\n'; var result_string = build_html_head('识别系统') + '

欢迎来到识别系统!

\r\n'; - - - //result_string +='\r\n'; - //result_string +='\r\n'; - + result_string +='
用户名密码身份备注
\r\n'; + result_string +='\r\n'; connection.query('SELECT * FROM mail;', function (error, results, fields) { if (error) { console.log('[SELECT ERROR] - ',error.message); return; } console.log('[SELECT SUCCESS]'); - // for (var i = results.length - 1; i >= 0; i--) { - // result_string +='\r\n'; - // result_string += (' \r\n'); - // result_string +='\r\n'; - // } - //result_string +='
用户名密码身份邮箱
' - // + results[i].name - // + '' - // + results[i].passwd - // + '' - // + results[i].id - // + '' - // + results[i].msg - // + '
\r\n'; - result_string +='注册用户\r\n' + for (var i = results.length - 1; i >= 0; i--) { + result_string +='\r\n'; + result_string += ('' + + results[i].name + + '' + + results[i].passwd + + '' + + results[i].id + + '' + + results[i].msg + + '\r\n'); + result_string +='\r\n'; + } + result_string +='\r\n'; + result_string +='注册账户\r\n' result_string +='
\r\n'; - result_string +='登陆界面\r\n'; + result_string +='前往登陆\r\n'; result_string +='
\r\n'; res.send(result_string + build_html_foot()) }); }) -// 文件上传接口 -app.post('/fileUpload', function(req, res){ - // 上传的文件在req.files中 - const filename = req.files[0].path + pathLib.parse(req.files[0].originalname).ext - console.log(filename); - fs.rename(req.files[0].path, filename, function(err){ - if(err){ - res.send(err) - }else{ - res.send('upload successfully') - console.log('[上传成功]' + filename); - } - }) -}) -const session = require('express-session'); app.use(session({ // 这里是在Express应用程序中使用会话中间件,并传入一个包含会话配置选项的对象。 secret: 'your_secret_key', // 指定会话的密钥,用于加密会话数据,确保会话数据的安全性。 resave: false, // 在会话数据没有发生变化的情况下,是否强制重新保存会话数据。这里设置为false,表示不强制重新保存。 @@ -78,11 +66,10 @@ app.use(session({ // 这里是在Express应用 } })); -//登录功能 -app.post('/login', urlencodedParser, function(req, res) { + +app.post('/login', urlencodedParser, function(req, res) {//用户登录功能 var username = req.body.username; var password = req.body.passwd; - // 查询数据库中是否存在匹配的用户名和密码 connection.query('SELECT * FROM mail WHERE name = ? AND passwd = ?', [username, password], function(error, results, fields) { if (error) { @@ -101,6 +88,7 @@ app.post('/login', urlencodedParser, function(req, res) { }); }) + app.post('/idcheck', urlencodedParser, function(req, res) {//处理一个POST请求,路径为/idcheck,并传入一个中间件urlencodedParser用于解析POST请求中的表单数据。回调函数包含了请求对象req和响应对象res。 var username = req.body.username; connection.query('SELECT id FROM mail WHERE name = ?', [username], function(error, results, fields) {//查询结果通过回调函数传递给results @@ -118,10 +106,9 @@ app.post('/idcheck', urlencodedParser, function(req, res) {//处理一个POST请 }); -app.post('/insertrecord', urlencodedParser, function (req, res) { +app.post('/insertrecord', urlencodedParser, function (req, res) {//注册用户功能 var insert_sql = 'INSERT INTO mail(name, passwd, id, msg) VALUES(?,?,?,?)'; var insert_params = [req.body.name, req.body.passwd, req.body.id, req.body.msg]; - connection.query(insert_sql, insert_params, function(error, result) { if (error) { console.log('[INSERT ERROR] - ',error.message); @@ -133,7 +120,101 @@ app.post('/insertrecord', urlencodedParser, function (req, res) { }) -function build_html_head(title) { + +app.get('/api/users', function (req, res) { + // 查询所有用户 + connection.query('SELECT * FROM mail', function (error, users) { + if (error) { + console.log('[SELECT ERROR] - ', error.message); + res.status(500).send('数据库查询错误!'); + return; + } + + // 遍历所有用户,查询每个用户的图片上传次数 + let completedRequests = 0; + users.forEach(user => { + connection.query('SELECT COUNT(*) AS imageCount FROM images WHERE username = ?', [user.name], function (error, results) { + if (error) { + console.log('[SELECT ERROR] - ', error.message); + res.status(500).send('数据库查询错误!'); + return; + } + + // 将查询结果添加到用户对象中 + user.imageCount = results[0].imageCount; + + // 检查是否所有查询都已完成 + completedRequests++; + if (completedRequests === users.length) { + res.json(users); + } + }); + }); + }); +}); + +app.get('/api/user-images-count', function (req, res) { + const username = req.query.username; + + if (!username) { + res.status(400).json({ error: '用户名不能为空' }); + return; + } + + connection.query('SELECT COUNT(*) AS imageCount FROM images WHERE username = ?', [username], function (error, results) { + if (error) { + console.log('[SELECT ERROR] - ', error.message); + res.status(500).send('数据库查询错误!'); + return; + } + + res.json({ imageCount: results[0].imageCount }); + }); +}); + + +app.get('/api/userUploads', function (req, res) { + const sql = 'SELECT username, COUNT(*) AS upload_count FROM images GROUP BY username'; + connection.query(sql, function (error, results) { + if (error) { + console.log('[SELECT ERROR] - ', error.message); + res.status(500).send('数据库查询错误!'); + return; + } + res.json(results); + }); +}); + +app.post('/api/updateUser', urlencodedParser, function (req, res) { + const { name, passwd, id, msg, oldName } = req.body; + const sql = 'UPDATE mail SET name = ?, passwd = ?, id = ?, msg = ? WHERE name = ?'; + connection.query(sql, [name, passwd, id, msg, oldName], function (error, result) { + if (error) { + console.log('[UPDATE ERROR] - ', error.message); + res.status(500).send('更新用户信息失败!'); + return; + } + res.json({ message: '用户信息更新成功' }); + }); +}); + +app.post('/api/deleteUser', urlencodedParser, function (req, res) { + const { name } = req.body; + const sql = 'DELETE FROM mail WHERE name = ?'; + connection.query(sql, [name], function (error, result) { + if (error) { + console.log('[DELETE ERROR] - ', error.message); + res.status(500).send('删除用户失败!'); + return; + } + res.json({ message: '用户删除成功' }); + }); +}); + + + + +function build_html_head(title) {//页面头创建 var html_fragment = '\r\n'; html_fragment += '\r\n'; @@ -145,11 +226,11 @@ function build_html_head(title) { html_fragment += '\r\n'; return html_fragment; } -function build_html_foot() { +function build_html_foot() {//no'de页面尾部 return '\r\n'; } -var server = app.listen(8081, function () { +var server = app.listen(8083, '0.0.0.0', function () { var host = server.address().address var port = server.address().port diff --git a/www2/main2.js b/www2/main2.js new file mode 100644 index 0000000..449ef23 --- /dev/null +++ b/www2/main2.js @@ -0,0 +1,92 @@ +var mysql = require('mysql'); +var express = require('express'); +var cors = require('cors'); +var app = express(); +var bodyParser = require('body-parser'); +const crypto = require('crypto'); +const fs = require('fs'); +const path = require('path'); +const fileUpload = require('express-fileupload'); +const session = require('express-session'); +const multer = require('multer'); + +var connection = mysql.createConnection({ + host : 'localhost', + port : '13307', + user : 'root', + password : '123456', + database : 'mailbox' +}); + + +app.use(cors()) + +//上传并识别功能 +const upload = multer({ dest: 'uploads/' }); // 上传文件的临时存储目录 // Multer是一个Node.js中间件,用于处理multipart/form-data类型的表单数据 +app.post('/api/upload', upload.single('image'), function(req, res) {// 单文件上传 + if (!req.file) { + return res.status(400).send('No file uploaded.'); + } + + const file = req.file; + const tempFilePath = file.path; + + const hash = crypto.createHash('sha256'); + const input = fs.createReadStream(tempFilePath); + + input.on('data', (data) => { + hash.update(data); + }); + input.on('end', () => { + const fileHash = hash.digest('hex'); + const fileName = file.originalname; + const filePath = path.join(__dirname, 'uploads', fileName); + const user_name = req.query.user_name + // Check if file with same hash already exists in database + const sqlCheck = 'SELECT * FROM images WHERE hash = ?'; + connection.query(sqlCheck, [fileHash], function(err, result) { + if (err) { + console.log(err); + return res.status(500).send('Error checking file in database'); + } + + if (result.length > 0) { + // If file with same hash exists, return "has been uploaded" + fs.unlinkSync(tempFilePath); // Delete the uploaded file + return res.json({ message: 'File with same hash already uploaded', fileName: '识别成功,结果为:' + result[0].goods});//如果文件已经存在,则返回这个文件的对应的匹配结果 + } else { + fs.rename(tempFilePath, filePath, function(err) { + if (err) { + console.log(err); + return res.status(500).send('Error uploading file'); + } else { + const sql = 'INSERT INTO images (name, path, hash, username) VALUES (?, ?, ?, ?)'; + connection.query(sql, [fileName, filePath, fileHash, user_name], function(err, result) { + if (err) { + console.log(err); + return res.status(500).send('Error uploading file to database'); + } + res.json({ message: 'File uploaded successfully', fileName: "识别失败,请重传文件:" + fileName }); + }); + } + }); + } + }); + }); +}); + + +var server = app.listen(8084, '0.0.0.0', function () { + + var host = server.address().address + var port = server.address().port + + connection.connect(function(err){ + if(err){ + console.log('[query] - :'+err); + return; + } + console.log('[connection connect] succeed!'); + }); + console.log("应用实例,访问地址为 http://%s:%s", host, port) +}) \ No newline at end of file diff --git a/www/node_modules/.bin/mime b/www2/node_modules/.bin/mime similarity index 100% rename from www/node_modules/.bin/mime rename to www2/node_modules/.bin/mime diff --git a/www/node_modules/.bin/mime.cmd b/www2/node_modules/.bin/mime.cmd similarity index 100% rename from www/node_modules/.bin/mime.cmd rename to www2/node_modules/.bin/mime.cmd diff --git a/www/node_modules/.bin/mime.ps1 b/www2/node_modules/.bin/mime.ps1 similarity index 100% rename from www/node_modules/.bin/mime.ps1 rename to www2/node_modules/.bin/mime.ps1 diff --git a/www/node_modules/.bin/mkdirp b/www2/node_modules/.bin/mkdirp similarity index 100% rename from www/node_modules/.bin/mkdirp rename to www2/node_modules/.bin/mkdirp diff --git a/www/node_modules/.bin/mkdirp.cmd b/www2/node_modules/.bin/mkdirp.cmd similarity index 100% rename from www/node_modules/.bin/mkdirp.cmd rename to www2/node_modules/.bin/mkdirp.cmd diff --git a/www/node_modules/.bin/mkdirp.ps1 b/www2/node_modules/.bin/mkdirp.ps1 similarity index 100% rename from www/node_modules/.bin/mkdirp.ps1 rename to www2/node_modules/.bin/mkdirp.ps1 diff --git a/www/node_modules/.package-lock.json b/www2/node_modules/.package-lock.json similarity index 97% rename from www/node_modules/.package-lock.json rename to www2/node_modules/.package-lock.json index eaae2eb..4c58d3a 100644 --- a/www/node_modules/.package-lock.json +++ b/www2/node_modules/.package-lock.json @@ -1,5 +1,5 @@ { - "name": "www", + "name": "www2", "lockfileVersion": 3, "requires": true, "packages": { @@ -149,6 +149,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -276,6 +288,17 @@ "node": ">= 0.10.0" } }, + "node_modules/express-fileupload": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.5.0.tgz", + "integrity": "sha512-jSW3w9evqM37VWkEPkL2Ck5wUo2a8qa03MH+Ou/0ZSTpNlQFBvSLjU12k2nYcHhaMPv4JVvv6+Ac1OuLgUZb7w==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/express-session": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.0.tgz", diff --git a/www/node_modules/accepts/HISTORY.md b/www2/node_modules/accepts/HISTORY.md similarity index 100% rename from www/node_modules/accepts/HISTORY.md rename to www2/node_modules/accepts/HISTORY.md diff --git a/www/node_modules/accepts/LICENSE b/www2/node_modules/accepts/LICENSE similarity index 100% rename from www/node_modules/accepts/LICENSE rename to www2/node_modules/accepts/LICENSE diff --git a/www/node_modules/accepts/README.md b/www2/node_modules/accepts/README.md similarity index 100% rename from www/node_modules/accepts/README.md rename to www2/node_modules/accepts/README.md diff --git a/www/node_modules/accepts/index.js b/www2/node_modules/accepts/index.js similarity index 100% rename from www/node_modules/accepts/index.js rename to www2/node_modules/accepts/index.js diff --git a/www/node_modules/accepts/package.json b/www2/node_modules/accepts/package.json similarity index 100% rename from www/node_modules/accepts/package.json rename to www2/node_modules/accepts/package.json diff --git a/www/node_modules/append-field/.npmignore b/www2/node_modules/append-field/.npmignore similarity index 100% rename from www/node_modules/append-field/.npmignore rename to www2/node_modules/append-field/.npmignore diff --git a/www/node_modules/append-field/LICENSE b/www2/node_modules/append-field/LICENSE similarity index 100% rename from www/node_modules/append-field/LICENSE rename to www2/node_modules/append-field/LICENSE diff --git a/www/node_modules/append-field/README.md b/www2/node_modules/append-field/README.md similarity index 100% rename from www/node_modules/append-field/README.md rename to www2/node_modules/append-field/README.md diff --git a/www/node_modules/append-field/index.js b/www2/node_modules/append-field/index.js similarity index 100% rename from www/node_modules/append-field/index.js rename to www2/node_modules/append-field/index.js diff --git a/www/node_modules/append-field/lib/parse-path.js b/www2/node_modules/append-field/lib/parse-path.js similarity index 100% rename from www/node_modules/append-field/lib/parse-path.js rename to www2/node_modules/append-field/lib/parse-path.js diff --git a/www/node_modules/append-field/lib/set-value.js b/www2/node_modules/append-field/lib/set-value.js similarity index 100% rename from www/node_modules/append-field/lib/set-value.js rename to www2/node_modules/append-field/lib/set-value.js diff --git a/www/node_modules/append-field/package.json b/www2/node_modules/append-field/package.json similarity index 100% rename from www/node_modules/append-field/package.json rename to www2/node_modules/append-field/package.json diff --git a/www/node_modules/append-field/test/forms.js b/www2/node_modules/append-field/test/forms.js similarity index 100% rename from www/node_modules/append-field/test/forms.js rename to www2/node_modules/append-field/test/forms.js diff --git a/www/node_modules/array-flatten/LICENSE b/www2/node_modules/array-flatten/LICENSE similarity index 100% rename from www/node_modules/array-flatten/LICENSE rename to www2/node_modules/array-flatten/LICENSE diff --git a/www/node_modules/array-flatten/README.md b/www2/node_modules/array-flatten/README.md similarity index 100% rename from www/node_modules/array-flatten/README.md rename to www2/node_modules/array-flatten/README.md diff --git a/www/node_modules/array-flatten/array-flatten.js b/www2/node_modules/array-flatten/array-flatten.js similarity index 100% rename from www/node_modules/array-flatten/array-flatten.js rename to www2/node_modules/array-flatten/array-flatten.js diff --git a/www/node_modules/array-flatten/package.json b/www2/node_modules/array-flatten/package.json similarity index 100% rename from www/node_modules/array-flatten/package.json rename to www2/node_modules/array-flatten/package.json diff --git a/www/node_modules/bignumber.js/CHANGELOG.md b/www2/node_modules/bignumber.js/CHANGELOG.md similarity index 100% rename from www/node_modules/bignumber.js/CHANGELOG.md rename to www2/node_modules/bignumber.js/CHANGELOG.md diff --git a/www/node_modules/bignumber.js/LICENCE b/www2/node_modules/bignumber.js/LICENCE similarity index 100% rename from www/node_modules/bignumber.js/LICENCE rename to www2/node_modules/bignumber.js/LICENCE diff --git a/www/node_modules/bignumber.js/README.md b/www2/node_modules/bignumber.js/README.md similarity index 100% rename from www/node_modules/bignumber.js/README.md rename to www2/node_modules/bignumber.js/README.md diff --git a/www/node_modules/bignumber.js/bignumber.d.ts b/www2/node_modules/bignumber.js/bignumber.d.ts similarity index 100% rename from www/node_modules/bignumber.js/bignumber.d.ts rename to www2/node_modules/bignumber.js/bignumber.d.ts diff --git a/www/node_modules/bignumber.js/bignumber.js b/www2/node_modules/bignumber.js/bignumber.js similarity index 100% rename from www/node_modules/bignumber.js/bignumber.js rename to www2/node_modules/bignumber.js/bignumber.js diff --git a/www/node_modules/bignumber.js/bignumber.min.js b/www2/node_modules/bignumber.js/bignumber.min.js similarity index 100% rename from www/node_modules/bignumber.js/bignumber.min.js rename to www2/node_modules/bignumber.js/bignumber.min.js diff --git a/www/node_modules/bignumber.js/bignumber.min.js.map b/www2/node_modules/bignumber.js/bignumber.min.js.map similarity index 100% rename from www/node_modules/bignumber.js/bignumber.min.js.map rename to www2/node_modules/bignumber.js/bignumber.min.js.map diff --git a/www/node_modules/bignumber.js/bignumber.mjs b/www2/node_modules/bignumber.js/bignumber.mjs similarity index 100% rename from www/node_modules/bignumber.js/bignumber.mjs rename to www2/node_modules/bignumber.js/bignumber.mjs diff --git a/www/node_modules/bignumber.js/doc/API.html b/www2/node_modules/bignumber.js/doc/API.html similarity index 100% rename from www/node_modules/bignumber.js/doc/API.html rename to www2/node_modules/bignumber.js/doc/API.html diff --git a/www/node_modules/bignumber.js/package.json b/www2/node_modules/bignumber.js/package.json similarity index 100% rename from www/node_modules/bignumber.js/package.json rename to www2/node_modules/bignumber.js/package.json diff --git a/www/node_modules/body-parser/HISTORY.md b/www2/node_modules/body-parser/HISTORY.md similarity index 100% rename from www/node_modules/body-parser/HISTORY.md rename to www2/node_modules/body-parser/HISTORY.md diff --git a/www/node_modules/body-parser/LICENSE b/www2/node_modules/body-parser/LICENSE similarity index 100% rename from www/node_modules/body-parser/LICENSE rename to www2/node_modules/body-parser/LICENSE diff --git a/www/node_modules/body-parser/README.md b/www2/node_modules/body-parser/README.md similarity index 100% rename from www/node_modules/body-parser/README.md rename to www2/node_modules/body-parser/README.md diff --git a/www/node_modules/body-parser/SECURITY.md b/www2/node_modules/body-parser/SECURITY.md similarity index 100% rename from www/node_modules/body-parser/SECURITY.md rename to www2/node_modules/body-parser/SECURITY.md diff --git a/www/node_modules/body-parser/index.js b/www2/node_modules/body-parser/index.js similarity index 100% rename from www/node_modules/body-parser/index.js rename to www2/node_modules/body-parser/index.js diff --git a/www/node_modules/body-parser/lib/read.js b/www2/node_modules/body-parser/lib/read.js similarity index 100% rename from www/node_modules/body-parser/lib/read.js rename to www2/node_modules/body-parser/lib/read.js diff --git a/www/node_modules/body-parser/lib/types/json.js b/www2/node_modules/body-parser/lib/types/json.js similarity index 100% rename from www/node_modules/body-parser/lib/types/json.js rename to www2/node_modules/body-parser/lib/types/json.js diff --git a/www/node_modules/body-parser/lib/types/raw.js b/www2/node_modules/body-parser/lib/types/raw.js similarity index 100% rename from www/node_modules/body-parser/lib/types/raw.js rename to www2/node_modules/body-parser/lib/types/raw.js diff --git a/www/node_modules/body-parser/lib/types/text.js b/www2/node_modules/body-parser/lib/types/text.js similarity index 100% rename from www/node_modules/body-parser/lib/types/text.js rename to www2/node_modules/body-parser/lib/types/text.js diff --git a/www/node_modules/body-parser/lib/types/urlencoded.js b/www2/node_modules/body-parser/lib/types/urlencoded.js similarity index 100% rename from www/node_modules/body-parser/lib/types/urlencoded.js rename to www2/node_modules/body-parser/lib/types/urlencoded.js diff --git a/www/node_modules/body-parser/package.json b/www2/node_modules/body-parser/package.json similarity index 100% rename from www/node_modules/body-parser/package.json rename to www2/node_modules/body-parser/package.json diff --git a/www/node_modules/buffer-from/LICENSE b/www2/node_modules/buffer-from/LICENSE similarity index 100% rename from www/node_modules/buffer-from/LICENSE rename to www2/node_modules/buffer-from/LICENSE diff --git a/www/node_modules/buffer-from/index.js b/www2/node_modules/buffer-from/index.js similarity index 100% rename from www/node_modules/buffer-from/index.js rename to www2/node_modules/buffer-from/index.js diff --git a/www/node_modules/buffer-from/package.json b/www2/node_modules/buffer-from/package.json similarity index 100% rename from www/node_modules/buffer-from/package.json rename to www2/node_modules/buffer-from/package.json diff --git a/www/node_modules/buffer-from/readme.md b/www2/node_modules/buffer-from/readme.md similarity index 100% rename from www/node_modules/buffer-from/readme.md rename to www2/node_modules/buffer-from/readme.md diff --git a/www/node_modules/busboy/.eslintrc.js b/www2/node_modules/busboy/.eslintrc.js similarity index 100% rename from www/node_modules/busboy/.eslintrc.js rename to www2/node_modules/busboy/.eslintrc.js diff --git a/www/node_modules/busboy/.github/workflows/ci.yml b/www2/node_modules/busboy/.github/workflows/ci.yml similarity index 100% rename from www/node_modules/busboy/.github/workflows/ci.yml rename to www2/node_modules/busboy/.github/workflows/ci.yml diff --git a/www/node_modules/busboy/.github/workflows/lint.yml b/www2/node_modules/busboy/.github/workflows/lint.yml similarity index 100% rename from www/node_modules/busboy/.github/workflows/lint.yml rename to www2/node_modules/busboy/.github/workflows/lint.yml diff --git a/www/node_modules/busboy/LICENSE b/www2/node_modules/busboy/LICENSE similarity index 100% rename from www/node_modules/busboy/LICENSE rename to www2/node_modules/busboy/LICENSE diff --git a/www/node_modules/busboy/README.md b/www2/node_modules/busboy/README.md similarity index 100% rename from www/node_modules/busboy/README.md rename to www2/node_modules/busboy/README.md diff --git a/www/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js b/www2/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js similarity index 100% rename from www/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js rename to www2/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js diff --git a/www/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js b/www2/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js similarity index 100% rename from www/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js rename to www2/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js diff --git a/www/node_modules/busboy/bench/bench-multipart-files-100mb-big.js b/www2/node_modules/busboy/bench/bench-multipart-files-100mb-big.js similarity index 100% rename from www/node_modules/busboy/bench/bench-multipart-files-100mb-big.js rename to www2/node_modules/busboy/bench/bench-multipart-files-100mb-big.js diff --git a/www/node_modules/busboy/bench/bench-multipart-files-100mb-small.js b/www2/node_modules/busboy/bench/bench-multipart-files-100mb-small.js similarity index 100% rename from www/node_modules/busboy/bench/bench-multipart-files-100mb-small.js rename to www2/node_modules/busboy/bench/bench-multipart-files-100mb-small.js diff --git a/www/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js b/www2/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js similarity index 100% rename from www/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js rename to www2/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js diff --git a/www/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js b/www2/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js similarity index 100% rename from www/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js rename to www2/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js diff --git a/www/node_modules/busboy/lib/index.js b/www2/node_modules/busboy/lib/index.js similarity index 100% rename from www/node_modules/busboy/lib/index.js rename to www2/node_modules/busboy/lib/index.js diff --git a/www/node_modules/busboy/lib/types/multipart.js b/www2/node_modules/busboy/lib/types/multipart.js similarity index 100% rename from www/node_modules/busboy/lib/types/multipart.js rename to www2/node_modules/busboy/lib/types/multipart.js diff --git a/www/node_modules/busboy/lib/types/urlencoded.js b/www2/node_modules/busboy/lib/types/urlencoded.js similarity index 100% rename from www/node_modules/busboy/lib/types/urlencoded.js rename to www2/node_modules/busboy/lib/types/urlencoded.js diff --git a/www/node_modules/busboy/lib/utils.js b/www2/node_modules/busboy/lib/utils.js similarity index 100% rename from www/node_modules/busboy/lib/utils.js rename to www2/node_modules/busboy/lib/utils.js diff --git a/www/node_modules/busboy/package.json b/www2/node_modules/busboy/package.json similarity index 100% rename from www/node_modules/busboy/package.json rename to www2/node_modules/busboy/package.json diff --git a/www/node_modules/busboy/test/common.js b/www2/node_modules/busboy/test/common.js similarity index 100% rename from www/node_modules/busboy/test/common.js rename to www2/node_modules/busboy/test/common.js diff --git a/www/node_modules/busboy/test/test-types-multipart-charsets.js b/www2/node_modules/busboy/test/test-types-multipart-charsets.js similarity index 100% rename from www/node_modules/busboy/test/test-types-multipart-charsets.js rename to www2/node_modules/busboy/test/test-types-multipart-charsets.js diff --git a/www/node_modules/busboy/test/test-types-multipart-stream-pause.js b/www2/node_modules/busboy/test/test-types-multipart-stream-pause.js similarity index 100% rename from www/node_modules/busboy/test/test-types-multipart-stream-pause.js rename to www2/node_modules/busboy/test/test-types-multipart-stream-pause.js diff --git a/www/node_modules/busboy/test/test-types-multipart.js b/www2/node_modules/busboy/test/test-types-multipart.js similarity index 100% rename from www/node_modules/busboy/test/test-types-multipart.js rename to www2/node_modules/busboy/test/test-types-multipart.js diff --git a/www/node_modules/busboy/test/test-types-urlencoded.js b/www2/node_modules/busboy/test/test-types-urlencoded.js similarity index 100% rename from www/node_modules/busboy/test/test-types-urlencoded.js rename to www2/node_modules/busboy/test/test-types-urlencoded.js diff --git a/www/node_modules/busboy/test/test.js b/www2/node_modules/busboy/test/test.js similarity index 100% rename from www/node_modules/busboy/test/test.js rename to www2/node_modules/busboy/test/test.js diff --git a/www/node_modules/bytes/History.md b/www2/node_modules/bytes/History.md similarity index 100% rename from www/node_modules/bytes/History.md rename to www2/node_modules/bytes/History.md diff --git a/www/node_modules/bytes/LICENSE b/www2/node_modules/bytes/LICENSE similarity index 100% rename from www/node_modules/bytes/LICENSE rename to www2/node_modules/bytes/LICENSE diff --git a/www/node_modules/bytes/Readme.md b/www2/node_modules/bytes/Readme.md similarity index 100% rename from www/node_modules/bytes/Readme.md rename to www2/node_modules/bytes/Readme.md diff --git a/www/node_modules/bytes/index.js b/www2/node_modules/bytes/index.js similarity index 100% rename from www/node_modules/bytes/index.js rename to www2/node_modules/bytes/index.js diff --git a/www/node_modules/bytes/package.json b/www2/node_modules/bytes/package.json similarity index 100% rename from www/node_modules/bytes/package.json rename to www2/node_modules/bytes/package.json diff --git a/www/node_modules/call-bind/.eslintignore b/www2/node_modules/call-bind/.eslintignore similarity index 100% rename from www/node_modules/call-bind/.eslintignore rename to www2/node_modules/call-bind/.eslintignore diff --git a/www/node_modules/call-bind/.eslintrc b/www2/node_modules/call-bind/.eslintrc similarity index 100% rename from www/node_modules/call-bind/.eslintrc rename to www2/node_modules/call-bind/.eslintrc diff --git a/www/node_modules/call-bind/.github/FUNDING.yml b/www2/node_modules/call-bind/.github/FUNDING.yml similarity index 100% rename from www/node_modules/call-bind/.github/FUNDING.yml rename to www2/node_modules/call-bind/.github/FUNDING.yml diff --git a/www/node_modules/call-bind/.nycrc b/www2/node_modules/call-bind/.nycrc similarity index 100% rename from www/node_modules/call-bind/.nycrc rename to www2/node_modules/call-bind/.nycrc diff --git a/www/node_modules/call-bind/CHANGELOG.md b/www2/node_modules/call-bind/CHANGELOG.md similarity index 100% rename from www/node_modules/call-bind/CHANGELOG.md rename to www2/node_modules/call-bind/CHANGELOG.md diff --git a/www/node_modules/call-bind/LICENSE b/www2/node_modules/call-bind/LICENSE similarity index 100% rename from www/node_modules/call-bind/LICENSE rename to www2/node_modules/call-bind/LICENSE diff --git a/www/node_modules/call-bind/README.md b/www2/node_modules/call-bind/README.md similarity index 100% rename from www/node_modules/call-bind/README.md rename to www2/node_modules/call-bind/README.md diff --git a/www/node_modules/call-bind/callBound.js b/www2/node_modules/call-bind/callBound.js similarity index 100% rename from www/node_modules/call-bind/callBound.js rename to www2/node_modules/call-bind/callBound.js diff --git a/www/node_modules/call-bind/index.js b/www2/node_modules/call-bind/index.js similarity index 100% rename from www/node_modules/call-bind/index.js rename to www2/node_modules/call-bind/index.js diff --git a/www/node_modules/call-bind/package.json b/www2/node_modules/call-bind/package.json similarity index 100% rename from www/node_modules/call-bind/package.json rename to www2/node_modules/call-bind/package.json diff --git a/www/node_modules/call-bind/test/callBound.js b/www2/node_modules/call-bind/test/callBound.js similarity index 100% rename from www/node_modules/call-bind/test/callBound.js rename to www2/node_modules/call-bind/test/callBound.js diff --git a/www/node_modules/call-bind/test/index.js b/www2/node_modules/call-bind/test/index.js similarity index 100% rename from www/node_modules/call-bind/test/index.js rename to www2/node_modules/call-bind/test/index.js diff --git a/www/node_modules/concat-stream/LICENSE b/www2/node_modules/concat-stream/LICENSE similarity index 100% rename from www/node_modules/concat-stream/LICENSE rename to www2/node_modules/concat-stream/LICENSE diff --git a/www/node_modules/concat-stream/index.js b/www2/node_modules/concat-stream/index.js similarity index 100% rename from www/node_modules/concat-stream/index.js rename to www2/node_modules/concat-stream/index.js diff --git a/www/node_modules/concat-stream/package.json b/www2/node_modules/concat-stream/package.json similarity index 100% rename from www/node_modules/concat-stream/package.json rename to www2/node_modules/concat-stream/package.json diff --git a/www/node_modules/concat-stream/readme.md b/www2/node_modules/concat-stream/readme.md similarity index 100% rename from www/node_modules/concat-stream/readme.md rename to www2/node_modules/concat-stream/readme.md diff --git a/www/node_modules/content-disposition/HISTORY.md b/www2/node_modules/content-disposition/HISTORY.md similarity index 100% rename from www/node_modules/content-disposition/HISTORY.md rename to www2/node_modules/content-disposition/HISTORY.md diff --git a/www/node_modules/content-disposition/LICENSE b/www2/node_modules/content-disposition/LICENSE similarity index 100% rename from www/node_modules/content-disposition/LICENSE rename to www2/node_modules/content-disposition/LICENSE diff --git a/www/node_modules/content-disposition/README.md b/www2/node_modules/content-disposition/README.md similarity index 100% rename from www/node_modules/content-disposition/README.md rename to www2/node_modules/content-disposition/README.md diff --git a/www/node_modules/content-disposition/index.js b/www2/node_modules/content-disposition/index.js similarity index 100% rename from www/node_modules/content-disposition/index.js rename to www2/node_modules/content-disposition/index.js diff --git a/www/node_modules/content-disposition/package.json b/www2/node_modules/content-disposition/package.json similarity index 100% rename from www/node_modules/content-disposition/package.json rename to www2/node_modules/content-disposition/package.json diff --git a/www/node_modules/content-type/HISTORY.md b/www2/node_modules/content-type/HISTORY.md similarity index 100% rename from www/node_modules/content-type/HISTORY.md rename to www2/node_modules/content-type/HISTORY.md diff --git a/www/node_modules/content-type/LICENSE b/www2/node_modules/content-type/LICENSE similarity index 100% rename from www/node_modules/content-type/LICENSE rename to www2/node_modules/content-type/LICENSE diff --git a/www/node_modules/content-type/README.md b/www2/node_modules/content-type/README.md similarity index 100% rename from www/node_modules/content-type/README.md rename to www2/node_modules/content-type/README.md diff --git a/www/node_modules/content-type/index.js b/www2/node_modules/content-type/index.js similarity index 100% rename from www/node_modules/content-type/index.js rename to www2/node_modules/content-type/index.js diff --git a/www/node_modules/content-type/package.json b/www2/node_modules/content-type/package.json similarity index 100% rename from www/node_modules/content-type/package.json rename to www2/node_modules/content-type/package.json diff --git a/www/node_modules/cookie-signature/.npmignore b/www2/node_modules/cookie-signature/.npmignore similarity index 100% rename from www/node_modules/cookie-signature/.npmignore rename to www2/node_modules/cookie-signature/.npmignore diff --git a/www/node_modules/cookie-signature/History.md b/www2/node_modules/cookie-signature/History.md similarity index 100% rename from www/node_modules/cookie-signature/History.md rename to www2/node_modules/cookie-signature/History.md diff --git a/www/node_modules/cookie-signature/Readme.md b/www2/node_modules/cookie-signature/Readme.md similarity index 100% rename from www/node_modules/cookie-signature/Readme.md rename to www2/node_modules/cookie-signature/Readme.md diff --git a/www/node_modules/cookie-signature/index.js b/www2/node_modules/cookie-signature/index.js similarity index 100% rename from www/node_modules/cookie-signature/index.js rename to www2/node_modules/cookie-signature/index.js diff --git a/www/node_modules/cookie-signature/package.json b/www2/node_modules/cookie-signature/package.json similarity index 100% rename from www/node_modules/cookie-signature/package.json rename to www2/node_modules/cookie-signature/package.json diff --git a/www/node_modules/cookie/HISTORY.md b/www2/node_modules/cookie/HISTORY.md similarity index 100% rename from www/node_modules/cookie/HISTORY.md rename to www2/node_modules/cookie/HISTORY.md diff --git a/www/node_modules/cookie/LICENSE b/www2/node_modules/cookie/LICENSE similarity index 100% rename from www/node_modules/cookie/LICENSE rename to www2/node_modules/cookie/LICENSE diff --git a/www/node_modules/cookie/README.md b/www2/node_modules/cookie/README.md similarity index 100% rename from www/node_modules/cookie/README.md rename to www2/node_modules/cookie/README.md diff --git a/www/node_modules/cookie/SECURITY.md b/www2/node_modules/cookie/SECURITY.md similarity index 100% rename from www/node_modules/cookie/SECURITY.md rename to www2/node_modules/cookie/SECURITY.md diff --git a/www/node_modules/cookie/index.js b/www2/node_modules/cookie/index.js similarity index 100% rename from www/node_modules/cookie/index.js rename to www2/node_modules/cookie/index.js diff --git a/www/node_modules/cookie/package.json b/www2/node_modules/cookie/package.json similarity index 100% rename from www/node_modules/cookie/package.json rename to www2/node_modules/cookie/package.json diff --git a/www/node_modules/core-util-is/LICENSE b/www2/node_modules/core-util-is/LICENSE similarity index 100% rename from www/node_modules/core-util-is/LICENSE rename to www2/node_modules/core-util-is/LICENSE diff --git a/www/node_modules/core-util-is/README.md b/www2/node_modules/core-util-is/README.md similarity index 100% rename from www/node_modules/core-util-is/README.md rename to www2/node_modules/core-util-is/README.md diff --git a/www/node_modules/core-util-is/lib/util.js b/www2/node_modules/core-util-is/lib/util.js similarity index 100% rename from www/node_modules/core-util-is/lib/util.js rename to www2/node_modules/core-util-is/lib/util.js diff --git a/www/node_modules/core-util-is/package.json b/www2/node_modules/core-util-is/package.json similarity index 100% rename from www/node_modules/core-util-is/package.json rename to www2/node_modules/core-util-is/package.json diff --git a/www2/node_modules/cors/CONTRIBUTING.md b/www2/node_modules/cors/CONTRIBUTING.md new file mode 100644 index 0000000..591b09a --- /dev/null +++ b/www2/node_modules/cors/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# contributing to `cors` + +CORS is a node.js package for providing a [connect](http://www.senchalabs.org/connect/)/[express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. Learn more about the project in [the README](README.md). + +## The CORS Spec + +[http://www.w3.org/TR/cors/](http://www.w3.org/TR/cors/) + +## Pull Requests Welcome + +* Include `'use strict';` in every javascript file. +* 2 space indentation. +* Please run the testing steps below before submitting. + +## Testing + +```bash +$ npm install +$ npm test +``` + +## Interactive Testing Harness + +[http://node-cors-client.herokuapp.com](http://node-cors-client.herokuapp.com) + +Related git repositories: + +* [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server) +* [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client) + +## License + +[MIT License](http://www.opensource.org/licenses/mit-license.php) diff --git a/www2/node_modules/cors/HISTORY.md b/www2/node_modules/cors/HISTORY.md new file mode 100644 index 0000000..5762bce --- /dev/null +++ b/www2/node_modules/cors/HISTORY.md @@ -0,0 +1,58 @@ +2.8.5 / 2018-11-04 +================== + + * Fix setting `maxAge` option to `0` + +2.8.4 / 2017-07-12 +================== + + * Work-around Safari bug in default pre-flight response + +2.8.3 / 2017-03-29 +================== + + * Fix error when options delegate missing `methods` option + +2.8.2 / 2017-03-28 +================== + + * Fix error when frozen options are passed + * Send "Vary: Origin" when using regular expressions + * Send "Vary: Access-Control-Request-Headers" when dynamic `allowedHeaders` + +2.8.1 / 2016-09-08 +================== + +This release only changed documentation. + +2.8.0 / 2016-08-23 +================== + + * Add `optionsSuccessStatus` option + +2.7.2 / 2016-08-23 +================== + + * Fix error when Node.js running in strict mode + +2.7.1 / 2015-05-28 +================== + + * Move module into expressjs organization + +2.7.0 / 2015-05-28 +================== + + * Allow array of matching condition as `origin` option + * Allow regular expression as `origin` option + +2.6.1 / 2015-05-28 +================== + + * Update `license` in package.json + +2.6.0 / 2015-04-27 +================== + + * Add `preflightContinue` option + * Fix "Vary: Origin" header added for "*" diff --git a/www2/node_modules/cors/LICENSE b/www2/node_modules/cors/LICENSE new file mode 100644 index 0000000..fd10c84 --- /dev/null +++ b/www2/node_modules/cors/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Troy Goode + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/www2/node_modules/cors/README.md b/www2/node_modules/cors/README.md new file mode 100644 index 0000000..732b847 --- /dev/null +++ b/www2/node_modules/cors/README.md @@ -0,0 +1,243 @@ +# cors + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +CORS is a node.js package for providing a [Connect](http://www.senchalabs.org/connect/)/[Express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. + +**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** + +* [Installation](#installation) +* [Usage](#usage) + * [Simple Usage](#simple-usage-enable-all-cors-requests) + * [Enable CORS for a Single Route](#enable-cors-for-a-single-route) + * [Configuring CORS](#configuring-cors) + * [Configuring CORS Asynchronously](#configuring-cors-asynchronously) + * [Enabling CORS Pre-Flight](#enabling-cors-pre-flight) +* [Configuration Options](#configuration-options) +* [Demo](#demo) +* [License](#license) +* [Author](#author) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install cors +``` + +## Usage + +### Simple Usage (Enable *All* CORS Requests) + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.use(cors()) + +app.get('/products/:id', function (req, res, next) { + res.json({msg: 'This is CORS-enabled for all origins!'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Enable CORS for a Single Route + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.get('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a Single Route'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Configuring CORS + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var corsOptions = { + origin: 'http://example.com', + optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 +} + +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for only example.com.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +### Configuring CORS w/ Dynamic Origin + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var whitelist = ['http://example1.com', 'http://example2.com'] +var corsOptions = { + origin: function (origin, callback) { + if (whitelist.indexOf(origin) !== -1) { + callback(null, true) + } else { + callback(new Error('Not allowed by CORS')) + } + } +} + +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +If you do not want to block REST tools or server-to-server requests, +add a `!origin` check in the origin function like so: + +```javascript +var corsOptions = { + origin: function (origin, callback) { + if (whitelist.indexOf(origin) !== -1 || !origin) { + callback(null, true) + } else { + callback(new Error('Not allowed by CORS')) + } + } +} +``` + +### Enabling CORS Pre-Flight + +Certain CORS requests are considered 'complex' and require an initial +`OPTIONS` request (called the "pre-flight request"). An example of a +'complex' CORS request is one that uses an HTTP verb other than +GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable +pre-flighting, you must add a new OPTIONS handler for the route you want +to support: + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.options('/products/:id', cors()) // enable pre-flight request for DELETE request +app.del('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for all origins!'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +You can also enable pre-flight across-the-board like so: + +```javascript +app.options('*', cors()) // include before other routes +``` + +### Configuring CORS Asynchronously + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var whitelist = ['http://example1.com', 'http://example2.com'] +var corsOptionsDelegate = function (req, callback) { + var corsOptions; + if (whitelist.indexOf(req.header('Origin')) !== -1) { + corsOptions = { origin: true } // reflect (enable) the requested origin in the CORS response + } else { + corsOptions = { origin: false } // disable CORS for this request + } + callback(null, corsOptions) // callback expects two parameters: error and options +} + +app.get('/products/:id', cors(corsOptionsDelegate), function (req, res, next) { + res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) +}) + +app.listen(80, function () { + console.log('CORS-enabled web server listening on port 80') +}) +``` + +## Configuration Options + +* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values: + - `Boolean` - set `origin` to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS. + - `String` - set `origin` to a specific origin. For example if you set it to `"http://example.com"` only requests from "http://example.com" will be allowed. + - `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com". + - `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com". + - `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (which expects the signature `err [object], allow [bool]`) as the second. +* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`). +* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header. +* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed. +* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted. +* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted. +* `preflightContinue`: Pass the CORS preflight response to the next handler. +* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`. + +The default configuration is the equivalent of: + +```json +{ + "origin": "*", + "methods": "GET,HEAD,PUT,PATCH,POST,DELETE", + "preflightContinue": false, + "optionsSuccessStatus": 204 +} +``` + +For details on the effect of each CORS header, read [this](http://www.html5rocks.com/en/tutorials/cors/) article on HTML5 Rocks. + +## Demo + +A demo that illustrates CORS working (and not working) using jQuery is available here: [http://node-cors-client.herokuapp.com/](http://node-cors-client.herokuapp.com/) + +Code for that demo can be found here: + +* Client: [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client) +* Server: [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server) + +## License + +[MIT License](http://www.opensource.org/licenses/mit-license.php) + +## Author + +[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) + +[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master +[downloads-image]: https://img.shields.io/npm/dm/cors.svg +[downloads-url]: https://npmjs.org/package/cors +[npm-image]: https://img.shields.io/npm/v/cors.svg +[npm-url]: https://npmjs.org/package/cors +[travis-image]: https://img.shields.io/travis/expressjs/cors/master.svg +[travis-url]: https://travis-ci.org/expressjs/cors diff --git a/www2/node_modules/cors/lib/index.js b/www2/node_modules/cors/lib/index.js new file mode 100644 index 0000000..5475aec --- /dev/null +++ b/www2/node_modules/cors/lib/index.js @@ -0,0 +1,238 @@ +(function () { + + 'use strict'; + + var assign = require('object-assign'); + var vary = require('vary'); + + var defaults = { + origin: '*', + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', + preflightContinue: false, + optionsSuccessStatus: 204 + }; + + function isString(s) { + return typeof s === 'string' || s instanceof String; + } + + function isOriginAllowed(origin, allowedOrigin) { + if (Array.isArray(allowedOrigin)) { + for (var i = 0; i < allowedOrigin.length; ++i) { + if (isOriginAllowed(origin, allowedOrigin[i])) { + return true; + } + } + return false; + } else if (isString(allowedOrigin)) { + return origin === allowedOrigin; + } else if (allowedOrigin instanceof RegExp) { + return allowedOrigin.test(origin); + } else { + return !!allowedOrigin; + } + } + + function configureOrigin(options, req) { + var requestOrigin = req.headers.origin, + headers = [], + isAllowed; + + if (!options.origin || options.origin === '*') { + // allow any origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: '*' + }]); + } else if (isString(options.origin)) { + // fixed origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: options.origin + }]); + headers.push([{ + key: 'Vary', + value: 'Origin' + }]); + } else { + isAllowed = isOriginAllowed(requestOrigin, options.origin); + // reflect origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: isAllowed ? requestOrigin : false + }]); + headers.push([{ + key: 'Vary', + value: 'Origin' + }]); + } + + return headers; + } + + function configureMethods(options) { + var methods = options.methods; + if (methods.join) { + methods = options.methods.join(','); // .methods is an array, so turn it into a string + } + return { + key: 'Access-Control-Allow-Methods', + value: methods + }; + } + + function configureCredentials(options) { + if (options.credentials === true) { + return { + key: 'Access-Control-Allow-Credentials', + value: 'true' + }; + } + return null; + } + + function configureAllowedHeaders(options, req) { + var allowedHeaders = options.allowedHeaders || options.headers; + var headers = []; + + if (!allowedHeaders) { + allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers + headers.push([{ + key: 'Vary', + value: 'Access-Control-Request-Headers' + }]); + } else if (allowedHeaders.join) { + allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string + } + if (allowedHeaders && allowedHeaders.length) { + headers.push([{ + key: 'Access-Control-Allow-Headers', + value: allowedHeaders + }]); + } + + return headers; + } + + function configureExposedHeaders(options) { + var headers = options.exposedHeaders; + if (!headers) { + return null; + } else if (headers.join) { + headers = headers.join(','); // .headers is an array, so turn it into a string + } + if (headers && headers.length) { + return { + key: 'Access-Control-Expose-Headers', + value: headers + }; + } + return null; + } + + function configureMaxAge(options) { + var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString() + if (maxAge && maxAge.length) { + return { + key: 'Access-Control-Max-Age', + value: maxAge + }; + } + return null; + } + + function applyHeaders(headers, res) { + for (var i = 0, n = headers.length; i < n; i++) { + var header = headers[i]; + if (header) { + if (Array.isArray(header)) { + applyHeaders(header, res); + } else if (header.key === 'Vary' && header.value) { + vary(res, header.value); + } else if (header.value) { + res.setHeader(header.key, header.value); + } + } + } + } + + function cors(options, req, res, next) { + var headers = [], + method = req.method && req.method.toUpperCase && req.method.toUpperCase(); + + if (method === 'OPTIONS') { + // preflight + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options, req)); + headers.push(configureMethods(options, req)); + headers.push(configureAllowedHeaders(options, req)); + headers.push(configureMaxAge(options, req)); + headers.push(configureExposedHeaders(options, req)); + applyHeaders(headers, res); + + if (options.preflightContinue) { + next(); + } else { + // Safari (and potentially other browsers) need content-length 0, + // for 204 or they just hang waiting for a body + res.statusCode = options.optionsSuccessStatus; + res.setHeader('Content-Length', '0'); + res.end(); + } + } else { + // actual response + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options, req)); + headers.push(configureExposedHeaders(options, req)); + applyHeaders(headers, res); + next(); + } + } + + function middlewareWrapper(o) { + // if options are static (either via defaults or custom options passed in), wrap in a function + var optionsCallback = null; + if (typeof o === 'function') { + optionsCallback = o; + } else { + optionsCallback = function (req, cb) { + cb(null, o); + }; + } + + return function corsMiddleware(req, res, next) { + optionsCallback(req, function (err, options) { + if (err) { + next(err); + } else { + var corsOptions = assign({}, defaults, options); + var originCallback = null; + if (corsOptions.origin && typeof corsOptions.origin === 'function') { + originCallback = corsOptions.origin; + } else if (corsOptions.origin) { + originCallback = function (origin, cb) { + cb(null, corsOptions.origin); + }; + } + + if (originCallback) { + originCallback(req.headers.origin, function (err2, origin) { + if (err2 || !origin) { + next(err2); + } else { + corsOptions.origin = origin; + cors(corsOptions, req, res, next); + } + }); + } else { + next(); + } + } + }); + }; + } + + // can pass either an options hash, an options delegate, or nothing + module.exports = middlewareWrapper; + +}()); diff --git a/www2/node_modules/cors/package.json b/www2/node_modules/cors/package.json new file mode 100644 index 0000000..ff37d98 --- /dev/null +++ b/www2/node_modules/cors/package.json @@ -0,0 +1,41 @@ +{ + "name": "cors", + "description": "Node.js CORS middleware", + "version": "2.8.5", + "author": "Troy Goode (https://github.com/troygoode/)", + "license": "MIT", + "keywords": [ + "cors", + "express", + "connect", + "middleware" + ], + "repository": "expressjs/cors", + "main": "./lib/index.js", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "devDependencies": { + "after": "0.8.2", + "eslint": "2.13.1", + "express": "4.16.3", + "mocha": "5.2.0", + "nyc": "13.1.0", + "supertest": "3.3.0" + }, + "files": [ + "lib/index.js", + "CONTRIBUTING.md", + "HISTORY.md", + "LICENSE", + "README.md" + ], + "engines": { + "node": ">= 0.10" + }, + "scripts": { + "test": "npm run lint && nyc --reporter=html --reporter=text mocha --require test/support/env", + "lint": "eslint lib test" + } +} diff --git a/www/node_modules/debug/.coveralls.yml b/www2/node_modules/debug/.coveralls.yml similarity index 100% rename from www/node_modules/debug/.coveralls.yml rename to www2/node_modules/debug/.coveralls.yml diff --git a/www/node_modules/debug/.eslintrc b/www2/node_modules/debug/.eslintrc similarity index 100% rename from www/node_modules/debug/.eslintrc rename to www2/node_modules/debug/.eslintrc diff --git a/www/node_modules/debug/.npmignore b/www2/node_modules/debug/.npmignore similarity index 100% rename from www/node_modules/debug/.npmignore rename to www2/node_modules/debug/.npmignore diff --git a/www/node_modules/debug/.travis.yml b/www2/node_modules/debug/.travis.yml similarity index 100% rename from www/node_modules/debug/.travis.yml rename to www2/node_modules/debug/.travis.yml diff --git a/www/node_modules/debug/CHANGELOG.md b/www2/node_modules/debug/CHANGELOG.md similarity index 100% rename from www/node_modules/debug/CHANGELOG.md rename to www2/node_modules/debug/CHANGELOG.md diff --git a/www/node_modules/debug/LICENSE b/www2/node_modules/debug/LICENSE similarity index 100% rename from www/node_modules/debug/LICENSE rename to www2/node_modules/debug/LICENSE diff --git a/www/node_modules/debug/Makefile b/www2/node_modules/debug/Makefile similarity index 100% rename from www/node_modules/debug/Makefile rename to www2/node_modules/debug/Makefile diff --git a/www/node_modules/debug/README.md b/www2/node_modules/debug/README.md similarity index 100% rename from www/node_modules/debug/README.md rename to www2/node_modules/debug/README.md diff --git a/www/node_modules/debug/component.json b/www2/node_modules/debug/component.json similarity index 100% rename from www/node_modules/debug/component.json rename to www2/node_modules/debug/component.json diff --git a/www/node_modules/debug/karma.conf.js b/www2/node_modules/debug/karma.conf.js similarity index 100% rename from www/node_modules/debug/karma.conf.js rename to www2/node_modules/debug/karma.conf.js diff --git a/www/node_modules/debug/node.js b/www2/node_modules/debug/node.js similarity index 100% rename from www/node_modules/debug/node.js rename to www2/node_modules/debug/node.js diff --git a/www/node_modules/debug/package.json b/www2/node_modules/debug/package.json similarity index 100% rename from www/node_modules/debug/package.json rename to www2/node_modules/debug/package.json diff --git a/www/node_modules/debug/src/browser.js b/www2/node_modules/debug/src/browser.js similarity index 100% rename from www/node_modules/debug/src/browser.js rename to www2/node_modules/debug/src/browser.js diff --git a/www/node_modules/debug/src/debug.js b/www2/node_modules/debug/src/debug.js similarity index 100% rename from www/node_modules/debug/src/debug.js rename to www2/node_modules/debug/src/debug.js diff --git a/www/node_modules/debug/src/index.js b/www2/node_modules/debug/src/index.js similarity index 100% rename from www/node_modules/debug/src/index.js rename to www2/node_modules/debug/src/index.js diff --git a/www/node_modules/debug/src/inspector-log.js b/www2/node_modules/debug/src/inspector-log.js similarity index 100% rename from www/node_modules/debug/src/inspector-log.js rename to www2/node_modules/debug/src/inspector-log.js diff --git a/www/node_modules/debug/src/node.js b/www2/node_modules/debug/src/node.js similarity index 100% rename from www/node_modules/debug/src/node.js rename to www2/node_modules/debug/src/node.js diff --git a/www/node_modules/define-data-property/.eslintrc b/www2/node_modules/define-data-property/.eslintrc similarity index 100% rename from www/node_modules/define-data-property/.eslintrc rename to www2/node_modules/define-data-property/.eslintrc diff --git a/www/node_modules/define-data-property/.github/FUNDING.yml b/www2/node_modules/define-data-property/.github/FUNDING.yml similarity index 100% rename from www/node_modules/define-data-property/.github/FUNDING.yml rename to www2/node_modules/define-data-property/.github/FUNDING.yml diff --git a/www/node_modules/define-data-property/.nycrc b/www2/node_modules/define-data-property/.nycrc similarity index 100% rename from www/node_modules/define-data-property/.nycrc rename to www2/node_modules/define-data-property/.nycrc diff --git a/www/node_modules/define-data-property/CHANGELOG.md b/www2/node_modules/define-data-property/CHANGELOG.md similarity index 100% rename from www/node_modules/define-data-property/CHANGELOG.md rename to www2/node_modules/define-data-property/CHANGELOG.md diff --git a/www/node_modules/define-data-property/LICENSE b/www2/node_modules/define-data-property/LICENSE similarity index 100% rename from www/node_modules/define-data-property/LICENSE rename to www2/node_modules/define-data-property/LICENSE diff --git a/www/node_modules/define-data-property/README.md b/www2/node_modules/define-data-property/README.md similarity index 100% rename from www/node_modules/define-data-property/README.md rename to www2/node_modules/define-data-property/README.md diff --git a/www/node_modules/define-data-property/index.d.ts b/www2/node_modules/define-data-property/index.d.ts similarity index 100% rename from www/node_modules/define-data-property/index.d.ts rename to www2/node_modules/define-data-property/index.d.ts diff --git a/www/node_modules/define-data-property/index.js b/www2/node_modules/define-data-property/index.js similarity index 100% rename from www/node_modules/define-data-property/index.js rename to www2/node_modules/define-data-property/index.js diff --git a/www/node_modules/define-data-property/package.json b/www2/node_modules/define-data-property/package.json similarity index 100% rename from www/node_modules/define-data-property/package.json rename to www2/node_modules/define-data-property/package.json diff --git a/www/node_modules/define-data-property/test/index.js b/www2/node_modules/define-data-property/test/index.js similarity index 100% rename from www/node_modules/define-data-property/test/index.js rename to www2/node_modules/define-data-property/test/index.js diff --git a/www/node_modules/define-data-property/tsconfig.json b/www2/node_modules/define-data-property/tsconfig.json similarity index 100% rename from www/node_modules/define-data-property/tsconfig.json rename to www2/node_modules/define-data-property/tsconfig.json diff --git a/www/node_modules/depd/History.md b/www2/node_modules/depd/History.md similarity index 100% rename from www/node_modules/depd/History.md rename to www2/node_modules/depd/History.md diff --git a/www/node_modules/depd/LICENSE b/www2/node_modules/depd/LICENSE similarity index 100% rename from www/node_modules/depd/LICENSE rename to www2/node_modules/depd/LICENSE diff --git a/www/node_modules/depd/Readme.md b/www2/node_modules/depd/Readme.md similarity index 100% rename from www/node_modules/depd/Readme.md rename to www2/node_modules/depd/Readme.md diff --git a/www/node_modules/depd/index.js b/www2/node_modules/depd/index.js similarity index 100% rename from www/node_modules/depd/index.js rename to www2/node_modules/depd/index.js diff --git a/www/node_modules/depd/lib/browser/index.js b/www2/node_modules/depd/lib/browser/index.js similarity index 100% rename from www/node_modules/depd/lib/browser/index.js rename to www2/node_modules/depd/lib/browser/index.js diff --git a/www/node_modules/depd/package.json b/www2/node_modules/depd/package.json similarity index 100% rename from www/node_modules/depd/package.json rename to www2/node_modules/depd/package.json diff --git a/www/node_modules/destroy/LICENSE b/www2/node_modules/destroy/LICENSE similarity index 100% rename from www/node_modules/destroy/LICENSE rename to www2/node_modules/destroy/LICENSE diff --git a/www/node_modules/destroy/README.md b/www2/node_modules/destroy/README.md similarity index 100% rename from www/node_modules/destroy/README.md rename to www2/node_modules/destroy/README.md diff --git a/www/node_modules/destroy/index.js b/www2/node_modules/destroy/index.js similarity index 100% rename from www/node_modules/destroy/index.js rename to www2/node_modules/destroy/index.js diff --git a/www/node_modules/destroy/package.json b/www2/node_modules/destroy/package.json similarity index 100% rename from www/node_modules/destroy/package.json rename to www2/node_modules/destroy/package.json diff --git a/www/node_modules/ee-first/LICENSE b/www2/node_modules/ee-first/LICENSE similarity index 100% rename from www/node_modules/ee-first/LICENSE rename to www2/node_modules/ee-first/LICENSE diff --git a/www/node_modules/ee-first/README.md b/www2/node_modules/ee-first/README.md similarity index 100% rename from www/node_modules/ee-first/README.md rename to www2/node_modules/ee-first/README.md diff --git a/www/node_modules/ee-first/index.js b/www2/node_modules/ee-first/index.js similarity index 100% rename from www/node_modules/ee-first/index.js rename to www2/node_modules/ee-first/index.js diff --git a/www/node_modules/ee-first/package.json b/www2/node_modules/ee-first/package.json similarity index 100% rename from www/node_modules/ee-first/package.json rename to www2/node_modules/ee-first/package.json diff --git a/www/node_modules/encodeurl/HISTORY.md b/www2/node_modules/encodeurl/HISTORY.md similarity index 100% rename from www/node_modules/encodeurl/HISTORY.md rename to www2/node_modules/encodeurl/HISTORY.md diff --git a/www/node_modules/encodeurl/LICENSE b/www2/node_modules/encodeurl/LICENSE similarity index 100% rename from www/node_modules/encodeurl/LICENSE rename to www2/node_modules/encodeurl/LICENSE diff --git a/www/node_modules/encodeurl/README.md b/www2/node_modules/encodeurl/README.md similarity index 100% rename from www/node_modules/encodeurl/README.md rename to www2/node_modules/encodeurl/README.md diff --git a/www/node_modules/encodeurl/index.js b/www2/node_modules/encodeurl/index.js similarity index 100% rename from www/node_modules/encodeurl/index.js rename to www2/node_modules/encodeurl/index.js diff --git a/www/node_modules/encodeurl/package.json b/www2/node_modules/encodeurl/package.json similarity index 100% rename from www/node_modules/encodeurl/package.json rename to www2/node_modules/encodeurl/package.json diff --git a/www/node_modules/es-define-property/.eslintrc b/www2/node_modules/es-define-property/.eslintrc similarity index 100% rename from www/node_modules/es-define-property/.eslintrc rename to www2/node_modules/es-define-property/.eslintrc diff --git a/www/node_modules/es-define-property/.github/FUNDING.yml b/www2/node_modules/es-define-property/.github/FUNDING.yml similarity index 100% rename from www/node_modules/es-define-property/.github/FUNDING.yml rename to www2/node_modules/es-define-property/.github/FUNDING.yml diff --git a/www/node_modules/es-define-property/.nycrc b/www2/node_modules/es-define-property/.nycrc similarity index 100% rename from www/node_modules/es-define-property/.nycrc rename to www2/node_modules/es-define-property/.nycrc diff --git a/www/node_modules/es-define-property/CHANGELOG.md b/www2/node_modules/es-define-property/CHANGELOG.md similarity index 100% rename from www/node_modules/es-define-property/CHANGELOG.md rename to www2/node_modules/es-define-property/CHANGELOG.md diff --git a/www/node_modules/es-define-property/LICENSE b/www2/node_modules/es-define-property/LICENSE similarity index 100% rename from www/node_modules/es-define-property/LICENSE rename to www2/node_modules/es-define-property/LICENSE diff --git a/www/node_modules/es-define-property/README.md b/www2/node_modules/es-define-property/README.md similarity index 100% rename from www/node_modules/es-define-property/README.md rename to www2/node_modules/es-define-property/README.md diff --git a/www/node_modules/es-define-property/index.d.ts b/www2/node_modules/es-define-property/index.d.ts similarity index 100% rename from www/node_modules/es-define-property/index.d.ts rename to www2/node_modules/es-define-property/index.d.ts diff --git a/www/node_modules/es-define-property/index.js b/www2/node_modules/es-define-property/index.js similarity index 100% rename from www/node_modules/es-define-property/index.js rename to www2/node_modules/es-define-property/index.js diff --git a/www/node_modules/es-define-property/package.json b/www2/node_modules/es-define-property/package.json similarity index 100% rename from www/node_modules/es-define-property/package.json rename to www2/node_modules/es-define-property/package.json diff --git a/www/node_modules/es-define-property/test/index.js b/www2/node_modules/es-define-property/test/index.js similarity index 100% rename from www/node_modules/es-define-property/test/index.js rename to www2/node_modules/es-define-property/test/index.js diff --git a/www/node_modules/es-define-property/tsconfig.json b/www2/node_modules/es-define-property/tsconfig.json similarity index 100% rename from www/node_modules/es-define-property/tsconfig.json rename to www2/node_modules/es-define-property/tsconfig.json diff --git a/www/node_modules/es-errors/.eslintrc b/www2/node_modules/es-errors/.eslintrc similarity index 100% rename from www/node_modules/es-errors/.eslintrc rename to www2/node_modules/es-errors/.eslintrc diff --git a/www/node_modules/es-errors/.github/FUNDING.yml b/www2/node_modules/es-errors/.github/FUNDING.yml similarity index 100% rename from www/node_modules/es-errors/.github/FUNDING.yml rename to www2/node_modules/es-errors/.github/FUNDING.yml diff --git a/www/node_modules/es-errors/CHANGELOG.md b/www2/node_modules/es-errors/CHANGELOG.md similarity index 100% rename from www/node_modules/es-errors/CHANGELOG.md rename to www2/node_modules/es-errors/CHANGELOG.md diff --git a/www/node_modules/es-errors/LICENSE b/www2/node_modules/es-errors/LICENSE similarity index 100% rename from www/node_modules/es-errors/LICENSE rename to www2/node_modules/es-errors/LICENSE diff --git a/www/node_modules/es-errors/README.md b/www2/node_modules/es-errors/README.md similarity index 100% rename from www/node_modules/es-errors/README.md rename to www2/node_modules/es-errors/README.md diff --git a/www/node_modules/es-errors/eval.d.ts b/www2/node_modules/es-errors/eval.d.ts similarity index 100% rename from www/node_modules/es-errors/eval.d.ts rename to www2/node_modules/es-errors/eval.d.ts diff --git a/www/node_modules/es-errors/eval.js b/www2/node_modules/es-errors/eval.js similarity index 100% rename from www/node_modules/es-errors/eval.js rename to www2/node_modules/es-errors/eval.js diff --git a/www/node_modules/es-errors/index.d.ts b/www2/node_modules/es-errors/index.d.ts similarity index 100% rename from www/node_modules/es-errors/index.d.ts rename to www2/node_modules/es-errors/index.d.ts diff --git a/www/node_modules/es-errors/index.js b/www2/node_modules/es-errors/index.js similarity index 100% rename from www/node_modules/es-errors/index.js rename to www2/node_modules/es-errors/index.js diff --git a/www/node_modules/es-errors/package.json b/www2/node_modules/es-errors/package.json similarity index 100% rename from www/node_modules/es-errors/package.json rename to www2/node_modules/es-errors/package.json diff --git a/www/node_modules/es-errors/range.d.ts b/www2/node_modules/es-errors/range.d.ts similarity index 100% rename from www/node_modules/es-errors/range.d.ts rename to www2/node_modules/es-errors/range.d.ts diff --git a/www/node_modules/es-errors/range.js b/www2/node_modules/es-errors/range.js similarity index 100% rename from www/node_modules/es-errors/range.js rename to www2/node_modules/es-errors/range.js diff --git a/www/node_modules/es-errors/ref.d.ts b/www2/node_modules/es-errors/ref.d.ts similarity index 100% rename from www/node_modules/es-errors/ref.d.ts rename to www2/node_modules/es-errors/ref.d.ts diff --git a/www/node_modules/es-errors/ref.js b/www2/node_modules/es-errors/ref.js similarity index 100% rename from www/node_modules/es-errors/ref.js rename to www2/node_modules/es-errors/ref.js diff --git a/www/node_modules/es-errors/syntax.d.ts b/www2/node_modules/es-errors/syntax.d.ts similarity index 100% rename from www/node_modules/es-errors/syntax.d.ts rename to www2/node_modules/es-errors/syntax.d.ts diff --git a/www/node_modules/es-errors/syntax.js b/www2/node_modules/es-errors/syntax.js similarity index 100% rename from www/node_modules/es-errors/syntax.js rename to www2/node_modules/es-errors/syntax.js diff --git a/www/node_modules/es-errors/test/index.js b/www2/node_modules/es-errors/test/index.js similarity index 100% rename from www/node_modules/es-errors/test/index.js rename to www2/node_modules/es-errors/test/index.js diff --git a/www/node_modules/es-errors/tsconfig.json b/www2/node_modules/es-errors/tsconfig.json similarity index 100% rename from www/node_modules/es-errors/tsconfig.json rename to www2/node_modules/es-errors/tsconfig.json diff --git a/www/node_modules/es-errors/type.d.ts b/www2/node_modules/es-errors/type.d.ts similarity index 100% rename from www/node_modules/es-errors/type.d.ts rename to www2/node_modules/es-errors/type.d.ts diff --git a/www/node_modules/es-errors/type.js b/www2/node_modules/es-errors/type.js similarity index 100% rename from www/node_modules/es-errors/type.js rename to www2/node_modules/es-errors/type.js diff --git a/www/node_modules/es-errors/uri.d.ts b/www2/node_modules/es-errors/uri.d.ts similarity index 100% rename from www/node_modules/es-errors/uri.d.ts rename to www2/node_modules/es-errors/uri.d.ts diff --git a/www/node_modules/es-errors/uri.js b/www2/node_modules/es-errors/uri.js similarity index 100% rename from www/node_modules/es-errors/uri.js rename to www2/node_modules/es-errors/uri.js diff --git a/www/node_modules/escape-html/LICENSE b/www2/node_modules/escape-html/LICENSE similarity index 100% rename from www/node_modules/escape-html/LICENSE rename to www2/node_modules/escape-html/LICENSE diff --git a/www/node_modules/escape-html/Readme.md b/www2/node_modules/escape-html/Readme.md similarity index 100% rename from www/node_modules/escape-html/Readme.md rename to www2/node_modules/escape-html/Readme.md diff --git a/www/node_modules/escape-html/index.js b/www2/node_modules/escape-html/index.js similarity index 100% rename from www/node_modules/escape-html/index.js rename to www2/node_modules/escape-html/index.js diff --git a/www/node_modules/escape-html/package.json b/www2/node_modules/escape-html/package.json similarity index 100% rename from www/node_modules/escape-html/package.json rename to www2/node_modules/escape-html/package.json diff --git a/www/node_modules/etag/HISTORY.md b/www2/node_modules/etag/HISTORY.md similarity index 100% rename from www/node_modules/etag/HISTORY.md rename to www2/node_modules/etag/HISTORY.md diff --git a/www/node_modules/etag/LICENSE b/www2/node_modules/etag/LICENSE similarity index 100% rename from www/node_modules/etag/LICENSE rename to www2/node_modules/etag/LICENSE diff --git a/www/node_modules/etag/README.md b/www2/node_modules/etag/README.md similarity index 100% rename from www/node_modules/etag/README.md rename to www2/node_modules/etag/README.md diff --git a/www/node_modules/etag/index.js b/www2/node_modules/etag/index.js similarity index 100% rename from www/node_modules/etag/index.js rename to www2/node_modules/etag/index.js diff --git a/www/node_modules/etag/package.json b/www2/node_modules/etag/package.json similarity index 100% rename from www/node_modules/etag/package.json rename to www2/node_modules/etag/package.json diff --git a/www2/node_modules/express-fileupload/.circleci/config.yml b/www2/node_modules/express-fileupload/.circleci/config.yml new file mode 100644 index 0000000..95d2b89 --- /dev/null +++ b/www2/node_modules/express-fileupload/.circleci/config.yml @@ -0,0 +1,54 @@ +version: 2.1 +orbs: + node: circleci/node@5.1.0 +jobs: + lintandcoverage: + docker: + - image: cimg/node:16.20.2 + steps: + - checkout + - run: npm install + - run: npm run lint + - run: npm run test + - run: npm run coveralls +workflows: + test: + jobs: + - lintandcoverage: + context: + - COVERALLS + - node/test: + version: '16.20.2' + pkg-manager: npm + filters: + tags: + ignore: + - /.*/ + - node/test: + version: '17.9.1' + pkg-manager: npm + filters: + tags: + ignore: + - /.*/ + - node/test: + version: '18.17.1' + pkg-manager: npm + filters: + tags: + ignore: + - /.*/ + - node/test: + version: '19.9.0' + pkg-manager: npm + filters: + tags: + ignore: + - /.*/ + - node/test: + version: '20.6.0' + pkg-manager: npm + filters: + tags: + ignore: + - /.*/ diff --git a/www2/node_modules/express-fileupload/.eslintignore b/www2/node_modules/express-fileupload/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/www2/node_modules/express-fileupload/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/www2/node_modules/express-fileupload/.eslintrc b/www2/node_modules/express-fileupload/.eslintrc new file mode 100644 index 0000000..37a6f3a --- /dev/null +++ b/www2/node_modules/express-fileupload/.eslintrc @@ -0,0 +1,23 @@ +{ + "extends": [ + "eslint:recommended" + ], + "env": { + "node": true, + "mocha": true, + "es6": true + }, + "parserOptions": { + "ecmaVersion": 6 + }, + "rules": { + "comma-dangle": [2, "never"], + "max-len": [2, { + "code": 100, + "tabWidth": 2 + }], + "semi": 2, + "keyword-spacing": 2, + "indent": [2, 2, { "SwitchCase": 1 }] + } +} \ No newline at end of file diff --git a/www2/node_modules/express-fileupload/.mocharc.json b/www2/node_modules/express-fileupload/.mocharc.json new file mode 100644 index 0000000..a254e02 --- /dev/null +++ b/www2/node_modules/express-fileupload/.mocharc.json @@ -0,0 +1,3 @@ +{ + "spec": "test/**/*.spec.js" +} \ No newline at end of file diff --git a/www2/node_modules/express-fileupload/.prettierrc b/www2/node_modules/express-fileupload/.prettierrc new file mode 100644 index 0000000..af22500 --- /dev/null +++ b/www2/node_modules/express-fileupload/.prettierrc @@ -0,0 +1 @@ +{singleQuote: true} \ No newline at end of file diff --git a/www2/node_modules/express-fileupload/LICENSE b/www2/node_modules/express-fileupload/LICENSE new file mode 100644 index 0000000..cd64be5 --- /dev/null +++ b/www2/node_modules/express-fileupload/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Richard Girges + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/www2/node_modules/express-fileupload/README.md b/www2/node_modules/express-fileupload/README.md new file mode 100644 index 0000000..31e1270 --- /dev/null +++ b/www2/node_modules/express-fileupload/README.md @@ -0,0 +1,132 @@ +# express-fileupload +Simple express middleware for uploading files. + +[![npm](https://img.shields.io/npm/v/express-fileupload.svg)](https://www.npmjs.org/package/express-fileupload) +[![downloads per month](http://img.shields.io/npm/dm/express-fileupload.svg)](https://www.npmjs.org/package/express-fileupload) +[![CircleCI](https://circleci.com/gh/richardgirges/express-fileupload/tree/master.svg?style=svg)](https://circleci.com/gh/richardgirges/express-fileupload/tree/master) +[![Coverage Status](https://img.shields.io/coveralls/richardgirges/express-fileupload.svg)](https://coveralls.io/r/richardgirges/express-fileupload) + +# Help us Improve express-fileupload +This package is still very much supported and maintained. But the more help the better. If you're interested any of the following: +* Ticket and PR triage +* Feature scoping and implementation +* Maintenance (upgrading packages, fixing security vulnerabilities, etc) + +...please contact richardgirges '-at-' gmail.com + +# Install +```bash +# With NPM +npm i express-fileupload + +# With Yarn +yarn add express-fileupload +``` + +# Usage +When you upload a file, the file will be accessible from `req.files`. + +Example: +* You're uploading a file called **car.jpg** +* Your input's name field is **foo**: `` +* In your express server request, you can access your uploaded file from `req.files.foo`: +```javascript +app.post('/upload', function(req, res) { + console.log(req.files.foo); // the uploaded file object +}); +``` + +The **req.files.foo** object will contain the following: +* `req.files.foo.name`: "car.jpg" +* `req.files.foo.mv`: A function to move the file elsewhere on your server. Can take a callback or return a promise. +* `req.files.foo.mimetype`: The mimetype of your file +* `req.files.foo.data`: A buffer representation of your file, returns empty buffer in case useTempFiles option was set to true. +* `req.files.foo.tempFilePath`: A path to the temporary file in case useTempFiles option was set to true. +* `req.files.foo.truncated`: A boolean that represents if the file is over the size limit +* `req.files.foo.size`: Uploaded size in bytes +* `req.files.foo.md5`: MD5 checksum of the uploaded file + +**Notes about breaking changes with MD5 handling:** + +* Before 1.0.0, `md5` is an MD5 checksum of the uploaded file. +* From 1.0.0 until 1.1.1, `md5` is a function to compute an MD5 hash ([Read about it here.](https://github.com/richardgirges/express-fileupload/releases/tag/v1.0.0-alpha.1)). +* From 1.1.1 onward, `md5` is reverted back to MD5 checksum value and also added full MD5 support in case you are using temporary files. + + +### Examples +* [Example Project](https://github.com/richardgirges/express-fileupload/tree/master/example) +* [Basic File Upload](https://github.com/richardgirges/express-fileupload/tree/master/example#basic-file-upload) +* [Multi-File Upload](https://github.com/richardgirges/express-fileupload/tree/master/example#multi-file-upload) + +### Using Busboy Options +Pass in Busboy options directly to the express-fileupload middleware. [Check out the Busboy documentation here](https://github.com/mscdex/busboy#api). + +```javascript +app.use(fileUpload({ + limits: { fileSize: 50 * 1024 * 1024 }, +})); +``` + +### Using useTempFile Options +Use temp files instead of memory for managing the upload process. + +```javascript +// Note that this option available for versions 1.0.0 and newer. +app.use(fileUpload({ + useTempFiles : true, + tempFileDir : '/tmp/' +})); +``` + +### Using debug option + +You can set `debug` option to `true` to see some logging about upload process. +In this case middleware uses `console.log` and adds `Express-file-upload` prefix for outputs. +You can set a custom logger having `.log()` method to the `logger` option. + +It will show you whether the request is invalid and also common events triggered during upload. +That can be really useful for troubleshooting and ***we recommend attaching debug output to each issue on Github***. + +***Output example:*** + +``` +Express-file-upload: Temporary file path is /node/express-fileupload/test/temp/tmp-16-1570084843942 +Express-file-upload: New upload started testFile->car.png, bytes:0 +Express-file-upload: Uploading testFile->car.png, bytes:21232... +Express-file-upload: Uploading testFile->car.png, bytes:86768... +Express-file-upload: Upload timeout testFile->car.png, bytes:86768 +Express-file-upload: Cleaning up temporary file /node/express-fileupload/test/temp/tmp-16-1570084843942... +``` + +***Description:*** + +* `Temporary file path is...` says that `useTempfiles` was set to true and also shows you temp file name and path. +* `New upload started testFile->car.png` says that new upload started with field `testFile` and file name `car.png`. +* `Uploading testFile->car.png, bytes:21232...` shows current progress for each new data chunk. +* `Upload timeout` means that no data came during `uploadTimeout`. +* `Cleaning up temporary file` Here finaly we see cleaning up of the temporary file because of upload timeout reached. + +### Available Options +Pass in non-Busboy options directly to the middleware. These are express-fileupload specific options. + +Option | Acceptable Values | Details +--- | --- | --- +createParentPath |
  • false **(default)**
  • true
| Automatically creates the directory path specified in `.mv(filePathName)` +uriDecodeFileNames |
  • false **(default)**
  • true
| Applies uri decoding to file names if set true. +safeFileNames |
  • false **(default)**
  • true
  • regex
| Strips characters from the upload's filename. You can use custom regex to determine what to strip. If set to `true`, non-alphanumeric characters _except_ dashes and underscores will be stripped. This option is off by default.

**Example #1 (strip slashes from file names):** `app.use(fileUpload({ safeFileNames: /\\/g }))`
**Example #2:** `app.use(fileUpload({ safeFileNames: true }))` +preserveExtension |
  • false **(default)**
  • true
  • *Number*
| Preserves filename extension when using safeFileNames option. If set to true, will default to an extension length of 3. If set to *Number*, this will be the max allowable extension length. If an extension is smaller than the extension length, it remains untouched. If the extension is longer, it is shifted.

**Example #1 (true):**
app.use(fileUpload({ safeFileNames: true, preserveExtension: true }));
*myFileName.ext* --> *myFileName.ext*

**Example #2 (max extension length 2, extension shifted):**
app.use(fileUpload({ safeFileNames: true, preserveExtension: 2 }));
*myFileName.ext* --> *myFileNamee.xt* +abortOnLimit |
  • false **(default)**
  • true
| Returns a HTTP 413 when the file is bigger than the size limit if true. Otherwise, it will add a truncated = true to the resulting file structure. +responseOnLimit |
  • 'File size limit has been reached' **(default)**
  • *String*
| Response which will be send to client if file size limit exceeded when abortOnLimit set to true. +limitHandler |
  • false **(default)**
  • function(req, res, next)
| User defined limit handler which will be invoked if the file is bigger than configured limits. +useTempFiles |
  • false **(default)**
  • true
| By default this module uploads files into RAM. Setting this option to True turns on using temporary files instead of utilising RAM. This avoids memory overflow issues when uploading large files or in case of uploading lots of files at same time. +tempFileDir |
  • String **(path)**
| Path to store temporary files.
Used along with the useTempFiles option. By default this module uses 'tmp' folder in the current working directory.
You can use trailing slash, but it is not necessary. +parseNested |
  • false **(default)**
  • true
| By default, req.body and req.files are flattened like this: {'name': 'John', 'hobbies[0]': 'Cinema', 'hobbies[1]': 'Bike'}

When this option is enabled they are parsed in order to be nested like this: {'name': 'John', 'hobbies': ['Cinema', 'Bike']} +debug |
  • false **(default)**
  • true
| Turn on/off upload process logging. Can be useful for troubleshooting. +logger |
  • console **(default)**
  • {log: function(msg: string)}
| Customizable logger to write debug messages to. Console is default. +uploadTimeout |
  • 60000 **(default)**
  • Integer
| This defines how long to wait for data before aborting. Set to 0 if you want to turn off timeout checks. + +# Help Wanted +Looking for additional maintainers. Please contact `richardgirges [ at ] gmail.com` if you're interested. Pull Requests are welcome! + +# Thanks & Credit +[Brian White](https://github.com/mscdex) for his stellar work on the [Busboy Package](https://github.com/mscdex/busboy) and the [connect-busboy Package](https://github.com/mscdex/connect-busboy) diff --git a/www2/node_modules/express-fileupload/SECURITY.md b/www2/node_modules/express-fileupload/SECURITY.md new file mode 100644 index 0000000..1340777 --- /dev/null +++ b/www2/node_modules/express-fileupload/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 1.3.x | :white_check_mark: | +| 1.2.1 | :white_check_mark: | +| < 1.2.1 | :x: | + +## Reporting a Vulnerability +Please report (suspected) security vulnerabilities to richardgirges@gmail.com. You will receive a response from us within 72 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days. diff --git a/www2/node_modules/express-fileupload/example/README.md b/www2/node_modules/express-fileupload/example/README.md new file mode 100644 index 0000000..ab5f7de --- /dev/null +++ b/www2/node_modules/express-fileupload/example/README.md @@ -0,0 +1,70 @@ +# express-fileupload Examples + +## Basic File Upload +**Your node.js code:** +```javascript +const express = require('express'); +const fileUpload = require('express-fileupload'); +const app = express(); + +// default options +app.use(fileUpload()); + +app.post('/upload', function(req, res) { + let sampleFile; + let uploadPath; + + if (!req.files || Object.keys(req.files).length === 0) { + return res.status(400).send('No files were uploaded.'); + } + + // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file + sampleFile = req.files.sampleFile; + uploadPath = __dirname + '/somewhere/on/your/server/' + sampleFile.name; + + // Use the mv() method to place the file somewhere on your server + sampleFile.mv(uploadPath, function(err) { + if (err) + return res.status(500).send(err); + + res.send('File uploaded!'); + }); +}); +``` + +**Your HTML file upload form:** +```html + + +
+ + +
+ + +``` + +## Multi-File Upload +express-fileupload supports multiple file uploads at the same time. + +Let's say you have three files in your form, each of the inputs with the name `my_profile_pic`, `my_pet`, and `my_cover_photo`: +```html + + + +``` + +These uploaded files would be accessible like so: +```javascript +app.post('/upload', function(req, res) { + // Uploaded files: + console.log(req.files.my_profile_pic.name); + console.log(req.files.my_pet.name); + console.log(req.files.my_cover_photo.name); +}); +``` + diff --git a/www2/node_modules/express-fileupload/example/index.html b/www2/node_modules/express-fileupload/example/index.html new file mode 100644 index 0000000..26630f6 --- /dev/null +++ b/www2/node_modules/express-fileupload/example/index.html @@ -0,0 +1,12 @@ + + +
+ + +
+ + diff --git a/www2/node_modules/express-fileupload/example/server.js b/www2/node_modules/express-fileupload/example/server.js new file mode 100644 index 0000000..e8c736c --- /dev/null +++ b/www2/node_modules/express-fileupload/example/server.js @@ -0,0 +1,41 @@ +const express = require('express'); +const fileUpload = require('../lib/index'); +const app = express(); + +const PORT = 8000; +app.use('/form', express.static(__dirname + '/index.html')); + +// default options +app.use(fileUpload()); + +app.get('/ping', function(req, res) { + res.send('pong'); +}); + +app.post('/upload', function(req, res) { + let sampleFile; + let uploadPath; + + if (!req.files || Object.keys(req.files).length === 0) { + res.status(400).send('No files were uploaded.'); + return; + } + + console.log('req.files >>>', req.files); // eslint-disable-line + + sampleFile = req.files.sampleFile; + + uploadPath = __dirname + '/uploads/' + sampleFile.name; + + sampleFile.mv(uploadPath, function(err) { + if (err) { + return res.status(500).send(err); + } + + res.send('File uploaded to ' + uploadPath); + }); +}); + +app.listen(PORT, function() { + console.log('Express server listening on port ', PORT); // eslint-disable-line +}); diff --git a/www2/node_modules/express-fileupload/example/uploads/placeholder.txt b/www2/node_modules/express-fileupload/example/uploads/placeholder.txt new file mode 100644 index 0000000..32172e2 --- /dev/null +++ b/www2/node_modules/express-fileupload/example/uploads/placeholder.txt @@ -0,0 +1 @@ +files are placed here when uploaded using the upload.test.js express server \ No newline at end of file diff --git a/www2/node_modules/express-fileupload/lib/fileFactory.js b/www2/node_modules/express-fileupload/lib/fileFactory.js new file mode 100644 index 0000000..02b82df --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/fileFactory.js @@ -0,0 +1,65 @@ +'use strict'; + +const { + isFunc, + debugLog, + moveFile, + promiseCallback, + checkAndMakeDir, + saveBufferToFile +} = require('./utilities'); + +/** + * Returns Local function that moves the file to a different location on the filesystem + * which takes two function arguments to make it compatible w/ Promise or Callback APIs + * @param {String} filePath - destination file path. + * @param {Object} options - file factory options. + * @param {Object} fileUploadOptions - middleware options. + * @returns {Function} + */ +const moveFromTemp = (filePath, options, fileUploadOptions) => (resolve, reject) => { + debugLog(fileUploadOptions, `Moving temporary file ${options.tempFilePath} to ${filePath}`); + moveFile(options.tempFilePath, filePath, promiseCallback(resolve, reject)); +}; + +/** + * Returns Local function that moves the file from buffer to a different location on the filesystem + * which takes two function arguments to make it compatible w/ Promise or Callback APIs + * @param {String} filePath - destination file path. + * @param {Object} options - file factory options. + * @param {Object} fileUploadOptions - middleware options. + * @returns {Function} + */ +const moveFromBuffer = (filePath, options, fileUploadOptions) => (resolve, reject) => { + debugLog(fileUploadOptions, `Moving uploaded buffer to ${filePath}`); + saveBufferToFile(options.buffer, filePath, promiseCallback(resolve, reject)); +}; + +module.exports = (options, fileUploadOptions = {}) => { + // see: https://github.com/richardgirges/express-fileupload/issues/14 + // firefox uploads empty file in case of cache miss when f5ing page. + // resulting in unexpected behavior. if there is no file data, the file is invalid. + // if (!fileUploadOptions.useTempFiles && !options.buffer.length) return; + + // Create and return file object. + return { + name: options.name, + data: options.buffer, + size: options.size, + encoding: options.encoding, + tempFilePath: options.tempFilePath, + truncated: options.truncated, + mimetype: options.mimetype, + md5: options.hash, + mv: (filePath, callback) => { + // Define a propper move function. + const moveFunc = fileUploadOptions.useTempFiles + ? moveFromTemp(filePath, options, fileUploadOptions) + : moveFromBuffer(filePath, options, fileUploadOptions); + // Create a folder for a file. + checkAndMakeDir(fileUploadOptions, filePath); + // If callback is passed in, use the callback API, otherwise return a promise. + return isFunc(callback) ? moveFunc(callback) : new Promise(moveFunc); + } + }; +}; diff --git a/www2/node_modules/express-fileupload/lib/index.js b/www2/node_modules/express-fileupload/lib/index.js new file mode 100644 index 0000000..5537c29 --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/index.js @@ -0,0 +1,40 @@ +'use strict'; + +const path = require('path'); +const processMultipart = require('./processMultipart'); +const isEligibleRequest = require('./isEligibleRequest'); +const { buildOptions, debugLog } = require('./utilities'); +const busboy = require('busboy'); // eslint-disable-line no-unused-vars + +const DEFAULT_OPTIONS = { + debug: false, + logger: console, + uploadTimeout: 60000, + fileHandler: false, + uriDecodeFileNames: false, + safeFileNames: false, + preserveExtension: false, + abortOnLimit: false, + responseOnLimit: 'File size limit has been reached', + limitHandler: false, + createParentPath: false, + parseNested: false, + useTempFiles: false, + tempFileDir: path.join(process.cwd(), 'tmp') +}; + +/** + * Expose the file upload middleware + * @param {DEFAULT_OPTIONS & busboy.BusboyConfig} options - Middleware options. + * @returns {Function} - express-fileupload middleware. + */ +module.exports = (options) => { + const uploadOptions = buildOptions(DEFAULT_OPTIONS, options); + return (req, res, next) => { + if (!isEligibleRequest(req)) { + debugLog(uploadOptions, 'Request is not eligible for file upload!'); + return next(); + } + processMultipart(uploadOptions, req, res, next); + }; +}; diff --git a/www2/node_modules/express-fileupload/lib/isEligibleRequest.js b/www2/node_modules/express-fileupload/lib/isEligibleRequest.js new file mode 100644 index 0000000..0d194fc --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/isEligibleRequest.js @@ -0,0 +1,46 @@ +const ACCEPTABLE_CONTENT_TYPE = /^multipart\/[\w'"()+-_?/:=,.]+(?:; ?[\w'"()+-_?/:=,.]*)+$/i; +const UNACCEPTABLE_METHODS = new Set(['GET', 'HEAD', 'DELETE', 'OPTIONS', 'CONNECT', 'TRACE']); + +/** + * Ensures the request contains a content body + * @param {Object} req Express req object + * @returns {Boolean} + */ +const hasBody = (req) => { + return ('transfer-encoding' in req.headers) || + ('content-length' in req.headers && req.headers['content-length'] !== '0'); +}; + +/** + * Ensures the request is not using a non-compliant multipart method + * such as GET or HEAD + * @param {Object} req Express req object + * @returns {Boolean} + */ +const hasAcceptableMethod = (req) => !UNACCEPTABLE_METHODS.has(req.method); + +/** + * Ensures that only multipart requests are processed by express-fileupload + * ACCEPTABLE_CONTENT_TYPE REgex is based on the RFC 2046 + * Validates special characters according to RFC 2046, section 5.1.1: '"()+_-=?/: + * Also checks for the presence of boundary in the header. + * @param {Object} req Express req object + * @returns {Boolean} + */ +const hasAcceptableContentType = (req) => { + const contType = req.headers['content-type']; + return contType.includes('boundary=') && ACCEPTABLE_CONTENT_TYPE.test(contType); +}; + +/** + * Ensures that the request in question is eligible for file uploads + * @param {Object} req Express req object + * @returns {Boolean} + */ +module.exports = (req) => { + try { + return hasBody(req) && hasAcceptableMethod(req) && hasAcceptableContentType(req); + } catch (e) { + return false; + } +}; diff --git a/www2/node_modules/express-fileupload/lib/memHandler.js b/www2/node_modules/express-fileupload/lib/memHandler.js new file mode 100644 index 0000000..09accfe --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/memHandler.js @@ -0,0 +1,42 @@ +const crypto = require('crypto'); +const { debugLog } = require('./utilities'); + +/** + * memHandler - In memory upload handler + * @param {Object} options + * @param {String} fieldname + * @param {String} filename + * @returns {Object} + */ +module.exports = (options, fieldname, filename) => { + const buffers = []; + const hash = crypto.createHash('md5'); + let fileSize = 0; + let completed = false; + + const getBuffer = () => Buffer.concat(buffers, fileSize); + + return { + dataHandler: (data) => { + if (completed === true) { + debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`); + return; + } + buffers.push(data); + hash.update(data); + fileSize += data.length; + debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`); + }, + getBuffer: getBuffer, + getFilePath: () => '', + getFileSize: () => fileSize, + getHash: () => hash.digest('hex'), + complete: () => { + debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`); + completed = true; + return getBuffer(); + }, + cleanup: () => { completed = true; }, + getWritePromise: () => Promise.resolve() + }; +}; diff --git a/www2/node_modules/express-fileupload/lib/processMultipart.js b/www2/node_modules/express-fileupload/lib/processMultipart.js new file mode 100644 index 0000000..5f3d24c --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/processMultipart.js @@ -0,0 +1,185 @@ +const Busboy = require('busboy'); +const UploadTimer = require('./uploadtimer'); +const fileFactory = require('./fileFactory'); +const memHandler = require('./memHandler'); +const tempFileHandler = require('./tempFileHandler'); +const processNested = require('./processNested'); +const { + isFunc, + debugLog, + buildFields, + buildOptions, + parseFileName +} = require('./utilities'); + +const waitFlushProperty = Symbol('wait flush property symbol'); + +/** + * Processes multipart request + * Builds a req.body object for fields + * Builds a req.files object for files + * @param {Object} options expressFileupload and Busboy options + * @param {Object} req Express request object + * @param {Object} res Express response object + * @param {Function} next Express next method + * @return {void} + */ +module.exports = (options, req, res, next) => { + req.files = null; + + // Build busboy options and init busboy instance. + const busboyOptions = buildOptions(options, { headers: req.headers }); + const busboy = Busboy(busboyOptions); + + /** + * Closes connection with specified reason and http code. + * @param {number} code HTTP response code, default: 400. + * @param {*} reason Reason to close connection, default: 'Bad Request'. + */ + const closeConnection = (code, reason) => { + req.unpipe(busboy); + req.resume(); + if (res.headersSent) { + debugLog(options, 'Headers already sent, can\'t close connection.'); + return; + } + const resCode = code || 400; + const resReason = reason || 'Bad Request'; + debugLog(options, `Closing connection with ${resCode}: ${resReason}`); + res.writeHead(resCode, { Connection: 'close' }); + res.end(resReason); + }; + + // Express proxies sometimes attach multipart data to a buffer + if (req.body instanceof Buffer) { + req.body = Object.create(null); + } + // Build multipart req.body fields + busboy.on('field', (field, val) => req.body = buildFields(req.body, field, val)); + + // Build req.files fields + busboy.on('file', (field, file, info) => { + // Parse file name(cutting huge names, decoding, etc..). + const {filename:name, encoding, mimeType: mime} = info; + const filename = parseFileName(options, name); + // Define methods and handlers for upload process. + const { + dataHandler, + getFilePath, + getFileSize, + getHash, + complete, + cleanup, + getWritePromise + } = options.useTempFiles + ? tempFileHandler(options, field, filename) // Upload into temporary file. + : memHandler(options, field, filename); // Upload into RAM. + + const writePromise = options.useTempFiles + ? getWritePromise().catch(err => { + req.unpipe(busboy); + req.resume(); + cleanup(); + next(err); + }) : getWritePromise(); + + // Define upload timer. + const uploadTimer = new UploadTimer(options.uploadTimeout, () => { + file.removeAllListeners('data'); + file.resume(); + // After destroy an error event will be emitted and file clean up will be done. + // In some cases file.destroy() doesn't exist, so we need to check this, see issue: + // https://github.com/richardgirges/express-fileupload/issues/259. + const err = new Error(`Upload timeout for ${field}->${filename}, bytes:${getFileSize()}`); + return isFunc(file.destroy) ? file.destroy(err) : file.emit('error', err); + }); + + file.on('limit', () => { + debugLog(options, `Size limit reached for ${field}->${filename}, bytes:${getFileSize()}`); + // Reset upload timer in case of file limit reached. + uploadTimer.clear(); + // Run a user defined limit handler if it has been set. + if (isFunc(options.limitHandler)) { + options.limitHandler(req, res, next); + } + // Close connection with 413 code and do cleanup if abortOnLimit set(default: false). + if (options.abortOnLimit) { + debugLog(options, `Aborting upload because of size limit ${field}->${filename}.`); + closeConnection(413, options.responseOnLimit); + cleanup(); + } + }); + + file.on('data', (data) => { + uploadTimer.refresh(); // Refresh upload timer each time new data chunk came. + dataHandler(data); // Handle new piece of data. + }); + + file.on('end', () => { + const size = getFileSize(); + // Debug logging for file upload ending. + debugLog(options, `Upload finished ${field}->${filename}, bytes:${size}`); + // Reset upload timer in case of end event. + uploadTimer.clear(); + // See https://github.com/richardgirges/express-fileupload/issues/191 + // Do not add file instance to the req.files if original name and size are empty. + // Empty name and zero size indicates empty file field in the posted form. + if (!name && size === 0) { + if (options.useTempFiles) { + cleanup(); + debugLog(options, `Removing the empty file ${field}->${filename}`); + } + return debugLog(options, `Don't add file instance if original name and size are empty`); + } + req.files = buildFields(req.files, field, fileFactory({ + buffer: complete(), + name: filename, + tempFilePath: getFilePath(), + hash: getHash(), + size, + encoding, + truncated: file.truncated, + mimetype: mime + }, options)); + + if (!req[waitFlushProperty]) { + req[waitFlushProperty] = []; + } + req[waitFlushProperty].push(writePromise); + }); + + file.on('error', (err) => { + uploadTimer.clear(); // Reset upload timer in case of errors. + debugLog(options, err); + cleanup(); + next(); + }); + + // Debug logging for a new file upload. + debugLog(options, `New upload started ${field}->${filename}, bytes:${getFileSize()}`); + // Set new upload timeout for a new file. + uploadTimer.set(); + }); + + busboy.on('finish', () => { + debugLog(options, `Busboy finished parsing request.`); + if (options.parseNested) { + req.body = processNested(req.body); + req.files = processNested(req.files); + } + + if (!req[waitFlushProperty]) return next(); + Promise.all(req[waitFlushProperty]) + .then(() => { + delete req[waitFlushProperty]; + next(); + }); + }); + + busboy.on('error', (err) => { + debugLog(options, `Busboy error`); + next(err); + }); + + req.pipe(busboy); +}; diff --git a/www2/node_modules/express-fileupload/lib/processNested.js b/www2/node_modules/express-fileupload/lib/processNested.js new file mode 100644 index 0000000..9c8b648 --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/processNested.js @@ -0,0 +1,35 @@ +const { isSafeFromPollution } = require("./utilities"); + +module.exports = function(data){ + if (!data || data.length < 1) return Object.create(null); + + let d = Object.create(null), + keys = Object.keys(data); + + for (let i = 0; i < keys.length; i++) { + let key = keys[i], + value = data[key], + current = d, + keyParts = key + .replace(new RegExp(/\[/g), '.') + .replace(new RegExp(/\]/g), '') + .split('.'); + + for (let index = 0; index < keyParts.length; index++){ + let k = keyParts[index]; + + // Ensure we don't allow prototype pollution + if (!isSafeFromPollution(current, k)) { + continue; + } + + if (index >= keyParts.length - 1){ + current[k] = value; + } else { + if (!current[k]) current[k] = !isNaN(keyParts[index + 1]) ? [] : Object.create(null); + current = current[k]; + } + } + } + return d; +}; diff --git a/www2/node_modules/express-fileupload/lib/tempFileHandler.js b/www2/node_modules/express-fileupload/lib/tempFileHandler.js new file mode 100644 index 0000000..d24416a --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/tempFileHandler.js @@ -0,0 +1,64 @@ +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const { + debugLog, + checkAndMakeDir, + getTempFilename, + deleteFile +} = require('./utilities'); + +module.exports = (options, fieldname, filename) => { + const dir = path.normalize(options.tempFileDir); + const tempFilePath = path.join(dir, getTempFilename()); + checkAndMakeDir({ createParentPath: true }, tempFilePath); + + debugLog(options, `Temporary file path is ${tempFilePath}`); + + const hash = crypto.createHash('md5'); + let fileSize = 0; + let completed = false; + + debugLog(options, `Opening write stream for ${fieldname}->${filename}...`); + const writeStream = fs.createWriteStream(tempFilePath); + const writePromise = new Promise((resolve, reject) => { + writeStream.on('finish', () => resolve()); + writeStream.on('error', (err) => { + debugLog(options, `Error write temp file: ${err}`); + reject(err); + }); + }); + + return { + dataHandler: (data) => { + if (completed === true) { + debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`); + return; + } + writeStream.write(data); + hash.update(data); + fileSize += data.length; + debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`); + }, + getFilePath: () => tempFilePath, + getFileSize: () => fileSize, + getHash: () => hash.digest('hex'), + complete: () => { + completed = true; + debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`); + if (writeStream !== false) writeStream.end(); + // Return empty buff since data was uploaded into a temp file. + return Buffer.concat([]); + }, + cleanup: () => { + completed = true; + debugLog(options, `Cleaning up temporary file ${tempFilePath}...`); + writeStream.end(); + deleteFile(tempFilePath, err => (err + ? debugLog(options, `Cleaning up temporary file ${tempFilePath} failed: ${err}`) + : debugLog(options, `Cleaning up temporary file ${tempFilePath} done.`) + )); + }, + getWritePromise: () => writePromise + }; +}; diff --git a/www2/node_modules/express-fileupload/lib/uploadtimer.js b/www2/node_modules/express-fileupload/lib/uploadtimer.js new file mode 100644 index 0000000..007e517 --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/uploadtimer.js @@ -0,0 +1,47 @@ +class UploadTimer { + /** + * @constructor + * @param {number} timeout - timer timeout in msecs. + * @param {Function} callback - callback to run when timeout reached. + */ + constructor(timeout, callback) { + this.timeout = timeout || 0; + this.callback = callback || (() => {}); + this.timer = null; + } + + /** + * Sets the timer. + * Initializes & starts the timer. + * @returns {boolean} True if timer has been set. + */ + set() { + if (this.timer || !this.timeout) return false; + this.timer = setTimeout(() => { + this.clear(); + this.callback(); + }, this.timeout); + return true; + } + + /** + * Clears the timer. + * If timer cleared, it has to be re-initialized again with set method. + */ + clear() { + clearTimeout(this.timer); + } + + /** + * Refreshes timer. + * @returns {boolean} True if timer has been refreshed. + */ + refresh() { + // Do nothing if zero/empty timeout or timer hasn't been initialized. + if (!this.timer) return false; + this.timer.refresh(); + return true; + } +} + +module.exports = UploadTimer; diff --git a/www2/node_modules/express-fileupload/lib/utilities.js b/www2/node_modules/express-fileupload/lib/utilities.js new file mode 100644 index 0000000..475333d --- /dev/null +++ b/www2/node_modules/express-fileupload/lib/utilities.js @@ -0,0 +1,335 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const { Readable } = require('stream'); + +// Parameters for safe file name parsing. +const SAFE_FILE_NAME_REGEX = /[^\w-]/g; +const MAX_EXTENSION_LENGTH = 3; + +// Parameters to generate unique temporary file names: +const TEMP_COUNTER_MAX = 65536; +const TEMP_PREFIX = 'tmp'; +let tempCounter = 0; + +/** + * Logs message to console if debug option set to true. + * @param {Object} options - options object. + * @param {string} msg - message to log. + * @returns {boolean} - false if debug is off. + */ +const debugLog = (options, msg) => { + const opts = options || {}; + if (!opts.debug || !opts.logger || typeof opts.logger.log !== "function") return false; + opts.logger.log(`Express-file-upload: ${msg}`); + return true; +}; + +/** + * Generates unique temporary file name. e.g. tmp-5000-156788789789. + * @param {string} prefix - a prefix for generated unique file name. + * @returns {string} + */ +const getTempFilename = (prefix = TEMP_PREFIX) => { + tempCounter = tempCounter >= TEMP_COUNTER_MAX ? 1 : tempCounter + 1; + return `${prefix}-${tempCounter}-${Date.now()}`; +}; + +/** + * isFunc: Checks if argument is a function. + * @returns {boolean} - Returns true if argument is a function. + */ +const isFunc = func => func && func.constructor && func.call && func.apply ? true: false; + +/** + * Set errorFunc to the same value as successFunc for callback mode. + * @returns {Function} + */ +const errorFunc = (resolve, reject) => isFunc(reject) ? reject : resolve; + +/** + * Return a callback function for promise resole/reject args. + * Ensures that callback is called only once. + * @returns {Function} + */ +const promiseCallback = (resolve, reject) => { + let hasFired = false; + return (err) => { + if (hasFired) { + return; + } + + hasFired = true; + return err ? errorFunc(resolve, reject)(err) : resolve(); + }; +}; + +/** + * Builds instance options from arguments objects(can't be arrow function). + * @returns {Object} - result options. + */ +const buildOptions = function() { + const result = {}; + [...arguments].forEach(options => { + if (!options || typeof options !== 'object') return; + Object.keys(options).forEach(i => result[i] = options[i]); + }); + return result; +}; + +// The default prototypes for both objects and arrays. +// Used by isSafeFromPollution +const OBJECT_PROTOTYPE_KEYS = Object.getOwnPropertyNames(Object.prototype); +const ARRAY_PROTOTYPE_KEYS = Object.getOwnPropertyNames(Array.prototype); + +/** + * Determines whether a key insertion into an object could result in a prototype pollution + * @param {Object} base - The object whose insertion we are checking + * @param {string} key - The key that will be inserted + */ +const isSafeFromPollution = (base, key) => { + // We perform an instanceof check instead of Array.isArray as the former is more + // permissive for cases in which the object as an Array prototype but was not constructed + // via an Array constructor or literal. + const TOUCHES_ARRAY_PROTOTYPE = (base instanceof Array) && ARRAY_PROTOTYPE_KEYS.includes(key); + const TOUCHES_OBJECT_PROTOTYPE = OBJECT_PROTOTYPE_KEYS.includes(key); + + return !TOUCHES_ARRAY_PROTOTYPE && !TOUCHES_OBJECT_PROTOTYPE; +}; + +/** + * Builds request fields (using to build req.body and req.files) + * @param {Object} instance - request object. + * @param {string} field - field name. + * @param {any} value - field value. + * @returns {Object} + */ +const buildFields = (instance, field, value) => { + // Do nothing if value is not set. + if (value === null || value === undefined) return instance; + instance = instance || Object.create(null); + + if (!isSafeFromPollution(instance, field)) { + return instance; + } + // Non-array fields + if (!instance[field]) { + instance[field] = value; + return instance; + } + // Array fields + if (instance[field] instanceof Array) { + instance[field].push(value); + } else { + instance[field] = [instance[field], value]; + } + return instance; +}; + +/** + * Creates a folder for file specified in the path variable + * @param {Object} fileUploadOptions + * @param {string} filePath + * @returns {boolean} + */ +const checkAndMakeDir = (fileUploadOptions, filePath) => { + // Check upload options were set. + if (!fileUploadOptions) return false; + if (!fileUploadOptions.createParentPath) return false; + // Check whether folder for the file exists. + if (!filePath) return false; + const parentPath = path.dirname(filePath); + // Create folder if it doesn't exist. + if (!fs.existsSync(parentPath)) fs.mkdirSync(parentPath, { recursive: true }); + // Checks folder again and return a results. + return fs.existsSync(parentPath); +}; + +/** + * Deletes a file. + * @param {string} file - Path to the file to delete. + * @param {Function} callback + */ +const deleteFile = (file, callback) => fs.unlink(file, callback); + +/** + * Copy file via streams + * @param {string} src - Path to the source file + * @param {string} dst - Path to the destination file. + */ +const copyFile = (src, dst, callback) => { + // cbCalled flag and runCb helps to run cb only once. + let cbCalled = false; + let runCb = (err) => { + if (cbCalled) return; + cbCalled = true; + callback(err); + }; + // Create read stream + let readable = fs.createReadStream(src); + readable.on('error', runCb); + // Create write stream + let writable = fs.createWriteStream(dst); + writable.on('error', (err)=>{ + readable.destroy(); + runCb(err); + }); + writable.on('close', () => runCb()); + // Copy file via piping streams. + readable.pipe(writable); +}; + +/** + * moveFile: moves the file from src to dst. + * Firstly trying to rename the file if no luck copying it to dst and then deleteing src. + * @param {string} src - Path to the source file + * @param {string} dst - Path to the destination file. + * @param {Function} callback - A callback function with renamed flag. + */ +const moveFile = (src, dst, callback) => fs.rename(src, dst, (err) => { + if (err) { + // Try to copy file if rename didn't work. + copyFile(src, dst, (cpErr) => (cpErr ? callback(cpErr) : deleteFile(src, callback))); + return; + } + // File was renamed successfully: Add true to the callback to indicate that. + callback(null, true); +}); + +/** + * Save buffer data to a file. + * @param {Buffer} buffer - buffer to save to a file. + * @param {string} filePath - path to a file. + */ +const saveBufferToFile = (buffer, filePath, callback) => { + if (!Buffer.isBuffer(buffer)) { + return callback(new Error('buffer variable should be type of Buffer!')); + } + // Setup readable stream from buffer. + let streamData = buffer; + let readStream = Readable(); + readStream._read = () => { + readStream.push(streamData); + streamData = null; + }; + // Setup file system writable stream. + let fstream = fs.createWriteStream(filePath); + // console.log("Calling saveBuffer"); + fstream.on('error', err => { + // console.log("err cb") + callback(err); + }); + fstream.on('close', () => { + // console.log("close cb"); + callback(); + }); + // Copy file via piping streams. + readStream.pipe(fstream); +}; + +/** + * Decodes uriEncoded file names. + * @param {Object} opts - middleware options. + * @param fileName {String} - file name to decode. + * @returns {String} + */ +const uriDecodeFileName = (opts, fileName) => { + if (!opts || !opts.uriDecodeFileNames) { + return fileName; + } + // Decode file name from URI with checking URI malformed errors. + // See Issue https://github.com/richardgirges/express-fileupload/issues/342. + try { + return decodeURIComponent(fileName); + } catch (err) { + const matcher = /(%[a-f0-9]{2})/gi; + return fileName.split(matcher) + .map((str) => { + try { + return decodeURIComponent(str); + } catch (err) { + return ''; + } + }) + .join(''); + } +}; + +/** + * Parses filename and extension and returns object {name, extension}. + * @param {boolean|integer} preserveExtension - true/false or number of characters for extension. + * @param {string} fileName - file name to parse. + * @returns {Object} - { name, extension }. + */ +const parseFileNameExtension = (preserveExtension, fileName) => { + const preserveExtensionLength = parseInt(preserveExtension); + const result = {name: fileName, extension: ''}; + if (!preserveExtension && preserveExtensionLength !== 0) return result; + // Define maximum extension length + const maxExtLength = isNaN(preserveExtensionLength) + ? MAX_EXTENSION_LENGTH + : Math.abs(preserveExtensionLength); + + const nameParts = fileName.split('.'); + if (nameParts.length < 2) return result; + + let extension = nameParts.pop(); + if ( + extension.length > maxExtLength && + maxExtLength > 0 + ) { + nameParts[nameParts.length - 1] += + '.' + + extension.substr(0, extension.length - maxExtLength); + extension = extension.substr(-maxExtLength); + } + + result.extension = maxExtLength ? extension : ''; + result.name = nameParts.join('.'); + return result; +}; + +/** + * Parse file name and extension. + * @param {Object} opts - middleware options. + * @param {string} fileName - Uploaded file name. + * @returns {string} + */ +const parseFileName = (opts, fileName) => { + // Check fileName argument + if (!fileName || typeof fileName !== 'string') return getTempFilename(); + // Cut off file name if it's lenght more then 255. + let parsedName = fileName.length <= 255 ? fileName : fileName.substr(0, 255); + // Decode file name if uriDecodeFileNames option set true. + parsedName = uriDecodeFileName(opts, parsedName); + // Stop parsing file name if safeFileNames options hasn't been set. + if (!opts.safeFileNames) return parsedName; + // Set regular expression for the file name. + const nameRegex = typeof opts.safeFileNames === 'object' && opts.safeFileNames instanceof RegExp + ? opts.safeFileNames + : SAFE_FILE_NAME_REGEX; + // Parse file name extension. + let {name, extension} = parseFileNameExtension(opts.preserveExtension, parsedName); + if (extension.length) extension = '.' + extension.replace(nameRegex, ''); + + return name.replace(nameRegex, '').concat(extension); +}; + +module.exports = { + isFunc, + debugLog, + copyFile, // For testing purpose. + moveFile, + errorFunc, + deleteFile, // For testing purpose. + buildFields, + buildOptions, + parseFileName, + getTempFilename, + promiseCallback, + checkAndMakeDir, + saveBufferToFile, + uriDecodeFileName, + isSafeFromPollution +}; diff --git a/www2/node_modules/express-fileupload/package.json b/www2/node_modules/express-fileupload/package.json new file mode 100644 index 0000000..a5f2785 --- /dev/null +++ b/www2/node_modules/express-fileupload/package.json @@ -0,0 +1,44 @@ +{ + "name": "express-fileupload", + "version": "1.5.0", + "author": "Richard Girges ", + "description": "Simple express file upload middleware that wraps around Busboy", + "main": "./lib/index", + "scripts": { + "pretest": "node ./test/pretests.js", + "posttest": "node ./test/posttests.js", + "test": "nyc --reporter=html --reporter=text mocha -- -R spec", + "lint": "eslint ./", + "lint:fix": "eslint --fix ./", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "keywords": [ + "express", + "file-upload", + "upload", + "forms", + "multipart", + "files", + "busboy", + "middleware" + ], + "license": "MIT", + "repository": "richardgirges/express-fileupload", + "devDependencies": { + "coveralls": "^3.1.1", + "eslint": "^7.31.0", + "express": "^4.18.1", + "md5": "^2.3.0", + "mocha": "^10.0.0", + "nyc": "^15.1.0", + "rimraf": "^3.0.2", + "rnd-file": "^0.0.1", + "supertest": "^6.1.5" + } +} diff --git a/www2/node_modules/express-fileupload/test/fileFactory.spec.js b/www2/node_modules/express-fileupload/test/fileFactory.spec.js new file mode 100644 index 0000000..d005ef8 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/fileFactory.spec.js @@ -0,0 +1,78 @@ +'use strict'; + +const fs = require('fs'); +const md5 = require('md5'); +const path = require('path'); +const assert = require('assert'); +const server = require('./server'); +const {isFunc} = require('../lib/utilities'); +const fileFactory = require('../lib/fileFactory'); + +const mockFileName = 'basketball.png'; +const mockFile = path.join(server.fileDir, mockFileName); +const mockBuffer = fs.readFileSync(mockFile); +const mockMd5 = md5(mockBuffer); + +const mockFileOpts = { + name: mockFileName, + buffer: mockBuffer, + encoding: 'utf-8', + mimetype: 'image/png', + hash: mockMd5, + tempFilePath: mockFile +}; + +describe('fileFactory: Test of the fileFactory factory', function() { + beforeEach(() => server.clearUploadsDir()); + + it('return a file object', () => assert.ok(fileFactory(mockFileOpts))); + + describe('Properties', function() { + it('contains the name property', () => { + assert.equal(fileFactory(mockFileOpts).name, mockFileName); + }); + it('contains the data property', () => assert.ok(fileFactory(mockFileOpts).data)); + it('contains the encoding property', () => { + assert.equal(fileFactory(mockFileOpts).encoding, 'utf-8'); + }); + it('contains the mimetype property', () => { + assert.equal(fileFactory(mockFileOpts).mimetype, 'image/png'); + }); + it('contains the md5 property', () => assert.equal(fileFactory(mockFileOpts).md5, mockMd5)); + it('contains the mv method', () => assert.equal(isFunc(fileFactory(mockFileOpts).mv), true)); + }); + + describe('File object behavior for in memory upload', function() { + const file = fileFactory(mockFileOpts); + it('move the file to the specified folder', (done) => { + file.mv(path.join(server.uploadDir, mockFileName), (err) => { + assert.ifError(err); + done(); + }); + }); + it('reject the mv if the destination does not exists', (done) => { + file.mv(path.join(server.uploadDir, 'unknown', mockFileName), (err) => { + assert.ok(err); + done(); + }); + }); + }); + + describe('File object behavior for upload into temporary file', function() { + const file = fileFactory(mockFileOpts, { useTempFiles: true }); + it('move the file to the specified folder', (done) => { + file.mv(path.join(server.uploadDir, mockFileName), (err) => { + assert.ifError(err); + // Place back moved file. + fs.renameSync(path.join(server.uploadDir, mockFileName), mockFile); + done(); + }); + }); + it('reject the mv if the destination does not exists', (done) => { + file.mv(path.join(server.uploadDir, 'unknown', mockFileName), (err) => { + assert.ok(err); + done(); + }); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/fileLimitUploads.spec.js b/www2/node_modules/express-fileupload/test/fileLimitUploads.spec.js new file mode 100644 index 0000000..e6f4e84 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/fileLimitUploads.spec.js @@ -0,0 +1,99 @@ +'use strict'; + +const path = require('path'); +const request = require('supertest'); +const assert = require('assert'); +const server = require('./server'); +const clearUploadsDir = server.clearUploadsDir; +const fileDir = server.fileDir; + +describe('fileLimitUloads: Test Single File Upload With File Size Limit', function() { + let app, limitHandlerRun; + + beforeEach(function() { + clearUploadsDir(); + }); + + describe('abort connection on limit reached', function() { + before(function() { + app = server.setup({ + limits: {fileSize: 200 * 1024}, // set 200kb upload limit + abortOnLimit: true + }); + }); + + it(`upload 'basketball.png' (~154kb) with 200kb size limit`, function(done) { + let filePath = path.join(fileDir, 'basketball.png'); + + request(app) + .post('/upload/single/truncated') + .attach('testFile', filePath) + .expect(200) + .end(done); + }); + + it(`fail when uploading 'car.png' (~269kb) with 200kb size limit`, function(done) { + let filePath = path.join(fileDir, 'car.png'); + + request(app) + .post('/upload/single/truncated') + .attach('testFile', filePath) + .expect(413) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); + }); + + describe('Run limitHandler on limit reached.', function(){ + before(function() { + app = server.setup({ + limits: {fileSize: 200 * 1024}, // set 200kb upload limit + limitHandler: (req, res) => { // set limit handler + res.writeHead(500, { Connection: 'close', 'Content-Type': 'application/json'}); + res.end(JSON.stringify({response: 'Limit reached!'})); + limitHandlerRun = true; + } + }); + }); + + it(`Run limit handler when uploading 'car.png' (~269kb) with 200kb size limit`, function(done) { + let filePath = path.join(fileDir, 'car.png'); + limitHandlerRun = false; + + request(app) + .post('/upload/single/truncated') + .attach('testFile', filePath) + .expect(500, {response: 'Limit reached!'}) + .end(function(err) { + // err.code === 'ECONNRESET' that means upload has been aborted. + if (err && err.code !== 'ECONNRESET') return done(err); + if (!limitHandlerRun) return done('handler did not run'); + done(); + }); + }); + + }); + + describe('pass truncated file to the next handler', function() { + before(function() { + app = server.setup({ + limits: {fileSize: 200 * 1024} // set 200kb upload limit + }); + }); + + it(`fail when uploading 'car.png' (~269kb) with 200kb size limit`, function(done) { + let filePath = path.join(fileDir, 'car.png'); + + request(app) + .post('/upload/single/truncated') + .attach('testFile', filePath) + .expect(400) + .end(function(err, res) { + assert.ok(res.error.text === 'File too big'); + done(); + }); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/isEligibleRequest.spec.js b/www2/node_modules/express-fileupload/test/isEligibleRequest.spec.js new file mode 100644 index 0000000..b9a88cd --- /dev/null +++ b/www2/node_modules/express-fileupload/test/isEligibleRequest.spec.js @@ -0,0 +1,128 @@ +'use strict'; + +const assert = require('assert'); +const isEligibleRequest = require('../lib/isEligibleRequest'); + +describe('isEligibleRequest function tests', () => { + it('should return true if the request method is POST & headers set', () => { + const req = { + method: 'POST', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, true); + }); + it('should return true if the request method is PUT & headers set', () => { + const req = { + method: 'PUT', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, true); + }); + it('should return true if the request method is PATCH & headers set', () => { + const req = { + method: 'PATCH', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, true); + }); + it('should return false if the request method is POST & content length 0', () => { + const req = { + method: 'POST', + headers: { + 'content-length': '0', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is POST & no content-length', () => { + const req = { + method: 'POST', + headers: { + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is POST & no boundary', () => { + const req = { + method: 'POST', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; ----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is not POST, PUT or PATCH', () => { + const req = { + method: 'GET', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is not POST, PUT or PATCH', () => { + const req = { + method: 'DELETE', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is not POST, PUT or PATCH', () => { + const req = { + method: 'OPTIONS', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request method is not POST, PUT or PATCH', () => { + const req = { + method: 'HEAD', + headers: { + 'content-length': '768751', + 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryz2D47BnVMA7w5N36' + } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); + it('should return false if the request is empty or not provided', () => { + const result = isEligibleRequest(); + assert.equal(result, false); + }); + it('should return false if content-type is not specified.', () => { + const req = { + method: 'POST', + headers: { 'content-length': '768751' } + }; + const result = isEligibleRequest(req); + assert.equal(result, false); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/multipartFields.spec.js b/www2/node_modules/express-fileupload/test/multipartFields.spec.js new file mode 100644 index 0000000..f26e9ec --- /dev/null +++ b/www2/node_modules/express-fileupload/test/multipartFields.spec.js @@ -0,0 +1,85 @@ +'use strict'; + +const request = require('supertest'); +const server = require('./server'); +const app = server.setup(); + +let mockUser = { + firstName: 'Joe', + lastName: 'Schmo', + email: 'joe@mailinator.com' +}; + +let mockCars = [ + 'rsx', + 'tsx', + 'civic', + 'integra' +]; + +describe('multipartFields: Test Multipart Form Single Field Submissions', function() { + it('submit multipart user data with POST', function(done) { + request(app) + .post('/fields/user') + .field('firstName', mockUser.firstName) + .field('lastName', mockUser.lastName) + .field('email', mockUser.email) + .expect('Content-Type', /json/) + .expect(200, { + firstName: mockUser.firstName, + lastName: mockUser.lastName, + email: mockUser.email + }, done); + }); + + it('submit multipart user data with PUT', function(done) { + request(app) + .post('/fields/user') + .field('firstName', mockUser.firstName) + .field('lastName', mockUser.lastName) + .field('email', mockUser.email) + .expect('Content-Type', /json/) + .expect(200, { + firstName: mockUser.firstName, + lastName: mockUser.lastName, + email: mockUser.email + }, done); + }); + + it('fail when user data submitted without multipart', function(done) { + request(app) + .post('/fields/user') + .send(mockUser) + .expect(400) + .end(done); + }); + + it('fail when user data not submitted', function(done) { + request(app) + .post('/fields/user') + .expect(400) + .end(done); + }); +}); + +describe('multipartFields: Test Multipart Form Array Field Submissions', function() { + it('submit array of data with POST', function(done) { + let req = request(app).post('/fields/array'); + + for (let i = 0; i < mockCars.length; i++) { + req.field('testField', mockCars[i]); + } + + req + .expect(200) + .end(function(err, res) { + if (err) { + return done(err); + } + + let responseMatchesRequest = res.body.join(',') === mockCars.join(','); + + done(responseMatchesRequest ? null : 'Data was returned as expected.'); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/multipartUploads.spec.js b/www2/node_modules/express-fileupload/test/multipartUploads.spec.js new file mode 100644 index 0000000..67e9f68 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/multipartUploads.spec.js @@ -0,0 +1,475 @@ +'use strict'; + +const fs = require('fs'); +const md5 = require('md5'); +const path = require('path'); +const request = require('supertest'); +const server = require('./server'); + +const fileDir = server.fileDir; +const tempDir = server.tempDir; +const uploadDir = server.uploadDir; +const clearTempDir = server.clearTempDir; +const clearUploadsDir = server.clearUploadsDir; + +const mockFiles = ['car.png', 'tree.png', 'basketball.png', 'emptyfile.txt']; + +const mockUser = { + firstName: 'Joe', + lastName: 'Schmo', + email: 'joe@mailinator.com' +}; + +// Reset response body.uploadDir/uploadPath for testing. +const resetBodyUploadData = (res) => { + res.body.uploadDir = ''; + res.body.uploadPath = ''; +}; + +const genUploadResult = (fileName, filePath) => { + const fileStat = fs.statSync(filePath); + const fileBuffer = fs.readFileSync(filePath); + return { + name: fileName, + md5: md5(fileBuffer), + size: fileStat.size, + uploadDir: '', + uploadPath: '' + }; +}; + +describe('multipartUploads: Test Directory Cleaning Method', function() { + it('emptied "uploads" directory', function(done) { + clearUploadsDir(); + const filesFound = fs.readdirSync(uploadDir).length; + done(filesFound ? `Directory not empty. Found ${filesFound} files.` : null); + }); +}); + +describe('multipartUploads: Test Single File Upload', function() { + const app = server.setup(); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} with PUT`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); + + it('fail when no files were attached', function(done) { + request(app) + .post('/upload/single') + .expect(400) + .end(done); + }); + + it('fail when using GET', function(done) { + request(app) + .get('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); + + it('fail when using HEAD', function(done) { + request(app) + .head('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); +}); + +describe('multipartUploads: Test Single File Upload w/ .mv()', function() { + const app = server.setup(); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST w/ .mv()`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} with PUT w/ .mv()`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); +}); + +describe('multipartUploads: Test Single File Upload w/ useTempFiles option.', function() { + const app = server.setup({ useTempFiles: true, tempFileDir: tempDir }); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} with PUT`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); + + it('fail when no files were attached', function(done) { + request(app) + .post('/upload/single') + .expect(400) + .end(done); + }); + + it('fail when using GET', function(done) { + request(app) + .get('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); + + it('fail when using HEAD', function(done) { + request(app) + .head('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); +}); + +describe('multipartUploads: Single File Upload w/ useTempFiles & empty tempFileDir.', function() { + const app = server.setup({ useTempFiles: true, tempFileDir: '' }); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); +}); + +describe('multipartUploads: Test Single File Upload w/ .mv() Promise', function() { + const app = server.setup(); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST w/ .mv() Promise`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single/promise') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} with PUT w/ .mv() Promise`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single/promise') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); + + it('fail when no files were attached', function(done) { + request(app) + .post('/upload/single') + .expect(400) + .end(done); + }); + + it('fail when using GET', function(done) { + request(app) + .get('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); + + it('fail when using HEAD', function(done) { + request(app) + .head('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); +}); + +describe('multipartUploads: Test Single File Upload w/ .mv() Promise & useTempFiles', function() { + const app = server.setup({ useTempFiles: true, tempFileDir: tempDir }); + + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + const result = genUploadResult(fileName, filePath); + + it(`upload ${fileName} with POST w/ .mv() Promise`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single/promise') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} with PUT w/ .mv() Promise`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single/promise') + .attach('testFile', filePath) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); + + it('fail when no files were attached', (done) => { + request(app) + .post('/upload/single') + .expect(400) + .end(done); + }); + + it('fail when using GET', (done) => { + request(app) + .get('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); + + it('fail when using HEAD', (done) => { + request(app) + .head('/upload/single') + .attach('testFile', path.join(fileDir, mockFiles[0])) + .expect(400) + .end((err) => { + // err.code === 'ECONNRESET' that means upload has been aborted. + done(err && err.code !== 'ECONNRESET' ? err : null); + }); + }); +}); + +describe('multipartUploads: Test Multi-File Upload', function() { + const app = server.setup(); + + it('upload multiple files with POST', (done) => { + clearUploadsDir(); + const req = request(app).post('/upload/multiple'); + const expectedResult = []; + const expectedResultSorted = []; + const uploadedFilesPath = []; + mockFiles.forEach((fileName, index) => { + const filePath = path.join(fileDir, fileName); + req.attach(`testFile${index + 1}`, filePath); + uploadedFilesPath.push(path.join(uploadDir, fileName)); + expectedResult.push(genUploadResult(fileName, filePath)); + }); + + req + .expect((res) => { + res.body.forEach((fileInfo) => { + fileInfo.uploadDir = ''; + fileInfo.uploadPath = ''; + const index = mockFiles.indexOf(fileInfo.name); + expectedResultSorted.push(expectedResult[index]); + }); + }) + .expect(200, expectedResultSorted) + .end((err) => { + if (err) return done(err); + fs.stat(uploadedFilesPath[0], (err) => { + if (err) return done(err); + fs.stat(uploadedFilesPath[1], (err) => { + if (err) return done(err); + fs.stat(uploadedFilesPath[2], done); + }); + }); + }); + }); +}); + +describe('multipartUploads: Test File Array Upload', function() { + const app = server.setup(); + + it('upload array of files with POST', (done) => { + clearUploadsDir(); + const req = request(app).post('/upload/array'); + const expectedResult = []; + const expectedResultSorted = []; + const uploadedFilesPath = []; + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + uploadedFilesPath.push(path.join(uploadDir, fileName)); + expectedResult.push(genUploadResult(fileName, filePath)); + req.attach('testFiles', filePath); + }); + + req + .expect((res)=>{ + res.body.forEach((fileInfo) => { + fileInfo.uploadDir = ''; + fileInfo.uploadPath = ''; + const index = mockFiles.indexOf(fileInfo.name); + expectedResultSorted.push(expectedResult[index]); + }); + }) + .expect(200, expectedResultSorted) + .end((err) => { + if (err) return done(err); + uploadedFilesPath.forEach((uploadedFilePath) => { + fs.statSync(uploadedFilePath); + }); + done(); + }); + }); +}); + +describe('multipartUploads: Test Upload With Fields', function() { + const app = server.setup(); + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + const uploadedFilePath = path.join(uploadDir, fileName); + // Expected results + const result = genUploadResult(fileName, filePath); + result.firstName = mockUser.firstName; + result.lastName = mockUser.lastName; + result.email = mockUser.email; + + it(`upload ${fileName} and submit fields at the same time with POST`, function(done) { + clearUploadsDir(); + request(app) + .post('/upload/single/withfields') + .attach('testFile', filePath) + .field('firstName', mockUser.firstName) + .field('lastName', mockUser.lastName) + .field('email', mockUser.email) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + + it(`upload ${fileName} and submit fields at the same time with PUT`, function(done) { + clearUploadsDir(); + request(app) + .put('/upload/single/withfields') + .attach('testFile', filePath) + .field('firstName', mockUser.firstName) + .field('lastName', mockUser.lastName) + .field('email', mockUser.email) + .expect(resetBodyUploadData) + .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done))); + }); + }); +}); + +describe('multipartUploads: Test Aborting/Canceling during upload', function() { + this.timeout(4000); // Set timeout for async tests. + const uploadTimeout = 1000; + + const app = server.setup({ + useTempFiles: true, + tempFileDir: tempDir, + debug: true, + uploadTimeout + }); + + clearTempDir(); + clearUploadsDir(); + mockFiles.forEach((fileName) => { + const filePath = path.join(fileDir, fileName); + + it(`Delete temp file if ${fileName} upload was aborted`, (done) => { + const req = request(app) + .post('/upload/single') + .attach('testFile', filePath) + .on('progress', (e) => { + const progress = (e.loaded * 100) / e.total; + // Aborting request, use req.req since it is original superagent request. + if (progress > 50) req.req.abort(); + }) + .end((err) => { + if (!err) return done(`Connection hasn't been aborted!`); + if (err.code !== 'ECONNRESET') return done(err); + // err.code === 'ECONNRESET' that means upload has been aborted. + // Checking temp directory after upload timeout. + setTimeout(() => { + fs.readdir(tempDir, (err, files) => { + if (err) return done(err); + return files.length ? done(`Temporary directory contains files!`) : done(); + }); + }, uploadTimeout * 2); + }); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/options.spec.js b/www2/node_modules/express-fileupload/test/options.spec.js new file mode 100644 index 0000000..8695872 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/options.spec.js @@ -0,0 +1,219 @@ +const fs = require('fs'); +const path = require('path'); +const request = require('supertest'); +const server = require('./server'); +const clearUploadsDir = server.clearUploadsDir; +const fileDir = server.fileDir; +const uploadDir = server.uploadDir; + +describe('options: File Upload Options Tests', function() { + afterEach(function(done) { + clearUploadsDir(); + done(); + }); + + /** + * Upload the file for testing and verify the expected filename. + * @param {object} options The expressFileUpload options. + * @param {string} actualFileNameToUpload The name of the file to upload. + * @param {string} expectedFileNameOnFileSystem The name of the file after upload. + * @param {function} done The mocha continuation function. + */ + function executeFileUploadTestWalk(options, + actualFileNameToUpload, + expectedFileNameOnFileSystem, + done) { + request(server.setup(options)) + .post('/upload/single') + .attach('testFile', path.join(fileDir, actualFileNameToUpload)) + .expect(200) + .end(function(err) { + if (err) { + return done(err); + } + + const uploadedFilePath = path.join(uploadDir, expectedFileNameOnFileSystem); + + fs.stat(uploadedFilePath, done); + }); + } + + describe('Testing [safeFileNames] option to ensure:', function() { + it('Does nothing to your filename when disabled.', + function(done) { + const fileUploadOptions = {safeFileNames: false}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'my$Invalid#fileName.png123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Is disabled by default.', + function(done) { + const fileUploadOptions = null; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'my$Invalid#fileName.png123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Strips away all non-alphanumeric characters (excluding hyphens/underscores) when enabled.', + function(done) { + const fileUploadOptions = {safeFileNames: true}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Accepts a regex for stripping (decidedly) "invalid" characters from filename.', + function(done) { + const fileUploadOptions = {safeFileNames: /[$#]/g}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileName.png123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + }); + + describe('Testing [preserveExtension] option to ensure:', function() { + it('Does not preserve the extension of your filename when disabled.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: false}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Is disabled by default.', + function(done) { + const fileUploadOptions = {safeFileNames: true}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Shortens your extension to the default(3) when enabled, if the extension found is larger.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: true}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng.123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Leaves your extension alone when enabled, if the extension found is <= default(3) length', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: true}; + const actualFileName = 'car.png'; + const expectedFileName = 'car.png'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Can be configured for an extension length > default(3).', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: 7}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileName.png123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Can be configured for an extension length < default(3).', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: 2}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng1.23'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Will use the absolute value of your extension length when negative.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: -5}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamep.ng123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Will leave no extension when the extension length == 0.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: 0}; + const actualFileName = 'car.png'; + const expectedFileName = 'car'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Will accept numbers as strings, if they can be resolved with parseInt.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: '3'}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng.123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Will be evaluated for truthy-ness if it cannot be parsed as an int.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: 'not-a-#-but-truthy'}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng.123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Will ignore any decimal amount when evaluating for extension length.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: 4.98}; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepn.g123'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + + it('Only considers the last dotted part as the extension.', + function(done) { + const fileUploadOptions = {safeFileNames: true, preserveExtension: true}; + const actualFileName = 'basket.ball.bp'; + const expectedFileName = 'basketball.bp'; + + executeFileUploadTestWalk(fileUploadOptions, actualFileName, expectedFileName, done); + }); + }); + + describe('Testing [parseNested] option to ensure:', function() { + it('When [parseNested] is enabled result are nested', function(done){ + const app = server.setup({parseNested: true}); + request(app) + .post('/fields/nested') + .field('name', 'John') + .field('hobbies[0]', 'Cinema') + .field('hobbies[1]', 'Bike') + .expect('Content-Type', /json/) + .expect(200, { + name: 'John', + hobbies: ['Cinema', 'Bike'] + }, done); + }); + + it('When [parseNested] is disabled are flattened', function(done){ + const app = server.setup({parseNested: false}); + request(app) + .post('/fields/flattened') + .field('name', 'John') + .field('hobbies[0]', 'Cinema') + .field('hobbies[1]', 'Bike') + .expect('Content-Type', /json/) + .expect(200, { + name: 'John', + 'hobbies[0]': 'Cinema', + 'hobbies[1]': 'Bike' + }, done); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/posttests.js b/www2/node_modules/express-fileupload/test/posttests.js new file mode 100644 index 0000000..24480b1 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/posttests.js @@ -0,0 +1,5 @@ +const { clearFileDir } = require('./server'); + +console.log('clearing test files...'); +clearFileDir(); +console.log('done'); diff --git a/www2/node_modules/express-fileupload/test/pretests.js b/www2/node_modules/express-fileupload/test/pretests.js new file mode 100644 index 0000000..dd5f096 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/pretests.js @@ -0,0 +1,5 @@ +const { createTestFiles } = require('./server'); + +console.log('creating test files...'); +createTestFiles() + .then(() => console.log('done')); diff --git a/www2/node_modules/express-fileupload/test/processNested.spec.js b/www2/node_modules/express-fileupload/test/processNested.spec.js new file mode 100644 index 0000000..4cfcad5 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/processNested.spec.js @@ -0,0 +1,59 @@ +'use strict'; + +const assert = require('assert'); +const processNested = require('../lib/processNested'); + +describe('processNested: Test Convert Flatten object to Nested object', function() { + it('With no nested data', () => { + const data = { + 'firstname': 'John', + 'lastname': 'Doe', + 'age': 22 + }, + excerpt = { firstname: 'John', lastname: 'Doe', age: 22 }, + processed = processNested(data); + + assert.deepEqual(processed, excerpt); + }); + + it('With nested data', () => { + const data = { + 'firstname': 'John', + 'lastname': 'Doe', + 'age': 22, + 'hobbies[0]': 'Cinema', + 'hobbies[1]': 'Bike', + 'address[line]': '78 Lynch Street', + 'address[city]': 'Milwaukee', + 'friends[0][name]': 'Jane', + 'friends[0][lastname]': 'Doe', + 'friends[1][name]': 'Joe', + 'friends[1][lastname]': 'Doe' + }, + excerpt = { + firstname: 'John', + lastname: 'Doe', + age: 22, + hobbies: [ 'Cinema', 'Bike' ], + address: { line: '78 Lynch Street', city: 'Milwaukee' }, + friends: [ + { name: 'Jane', lastname: 'Doe' }, + { name: 'Joe', lastname: 'Doe' } + ] + }, + processed = processNested(data); + + assert.deepEqual(processed, excerpt); + }); + + it('Do not allow prototype pollution', () => { + const pollutionOb1 = JSON.parse(`{"__proto__.POLLUTED1": "FOOBAR"}`); + const pollutionOb2 = JSON.parse(`{"constructor.prototype.POLLUTED2": "FOOBAR"}`); + + processNested(pollutionOb1); + processNested(pollutionOb2); + + assert.equal(global.POLLUTED1, undefined); + assert.equal(global.POLLUTED2, undefined); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/server.js b/www2/node_modules/express-fileupload/test/server.js new file mode 100644 index 0000000..6233fbe --- /dev/null +++ b/www2/node_modules/express-fileupload/test/server.js @@ -0,0 +1,295 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const rimraf = require('rimraf'); +const randomFile = require('rnd-file'); + +const fileDir = path.join(__dirname, 'files'); +const tempDir = path.join(__dirname, 'temp'); +const uploadDir = path.join(__dirname, 'uploads'); + +const mockFiles = [ + { name: 'emptyfile.txt', size: 0 }, + { name: 'basket.ball.bp', size: 151 * 1024 }, + { name: 'basketball.png', size: 151 * 1024 }, + { name: 'car.png', size: 263 * 1024 }, + { name: 'my$Invalid#fileName.png123', size: 263 * 1024 }, + { name: 'tree.png', size: 266 * 1024 } +]; + +const clearDir = (dir) => { + try { + try { + const stats = fs.statSync(dir); + if (stats.isDirectory()) rimraf.sync(dir); + } catch (statsErr) { + if (statsErr.code !== 'ENOENT') { + throw statsErr; + } + } + fs.mkdirSync(dir, { recursive: true }); + } catch (err) { + console.error(err); // eslint-disable-line + } +}; + +const createTestFiles = () => Promise.all(mockFiles.map((file) => { + return randomFile({ filePath: fileDir, fileName: file.name, fileSize: file.size }); +})); + +const getUploadedFileData = (file) => ({ + md5: file.md5, + name: file.name, + size: file.size, + uploadPath: path.join(uploadDir, file.name), + uploadDir: uploadDir +}); + +const setup = (fileUploadOptions) => { + const express = require('express'); + const expressFileupload = require('../lib/index'); + + const app = express(); + + app.use(expressFileupload(fileUploadOptions || {})); + + app.all('/upload/single', (req, res) => { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + const testFile = req.files.testFile; + const fileData = getUploadedFileData(testFile); + + testFile.mv(fileData.uploadPath, (err) => { + if (err) { + console.log('ERR', err); // eslint-disable-line + return res.status(500).send(err); + } + res.json(fileData); + }); + }); + + app.all('/upload/single/promise', (req, res) => { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + const testFile = req.files.testFile; + const fileData = getUploadedFileData(testFile); + + testFile + .mv(fileData.uploadPath) + .then(() => { + res.json(fileData); + }) + .catch(err => { + res.status(500).send(err); + }); + }); + + app.all('/upload/single/withfields', (req, res) => { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + if (!req.body) { + return res.status(400).send('No request body found'); + } + + const fields = ['firstName', 'lastName', 'email']; + for (let i = 0; i < fields.length; i += 1) { + if (!req.body[fields[i]] || !req.body[fields[i]].trim()) { + return res.status(400).send(`Invalid field: ${fields[i]}`); + } + } + + const testFile = req.files.testFile; + const fileData = getUploadedFileData(testFile); + fields.forEach((field) => { fileData[field] = req.body[field]; }); + + testFile.mv(fileData.uploadPath, (err) => { + if (err) { + return res.status(500).send(err); + } + res.json(fileData); + }); + }); + + app.all('/upload/single/truncated', (req, res) => { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + // status 400 to differentiate from ending the request in the on limit + return req.files.testFile.truncated + ? res.status(400).send(`File too big`) + : res.status(200).send('Upload succeed'); + }); + + app.all('/upload/multiple', function(req, res) { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + const fileNames = ['testFile1', 'testFile2', 'testFile3']; + + const testFiles = fileNames.map(file => req.files[file]); + for (let i = 0; i < testFiles.length; i += 1) { + if (!testFiles[i]) { + return res.status(400).send(`${fileNames[i]} was not uploaded!`); + } + } + + const filesData = testFiles.map(file => getUploadedFileData(file)); + + testFiles[0].mv(filesData[0].uploadPath, (err) => { + if (err) { + return res.status(500).send(err); + } + + testFiles[1].mv(filesData[1].uploadPath, (err) => { + if (err) { + return res.status(500).send(err); + } + + testFiles[2].mv(filesData[2].uploadPath, (err) => { + if (err) { + return res.status(500).send(err); + } + + res.json(filesData); + }); + }); + }); + }); + + app.all('/upload/array', function(req, res) { + if (!req.files) { + return res.status(400).send('No files were uploaded.'); + } + + const testFiles = req.files.testFiles; + + if (!testFiles) { + return res.status(400).send('No files were uploaded'); + } + + if (!Array.isArray(testFiles)) { + return res.status(400).send('Files were not uploaded as an array'); + } + + if (!testFiles.length) { + return res.status(400).send('Files array is empty'); + } + + const filesData = testFiles.map(file => getUploadedFileData(file)); + + let uploadCount = 0; + for (let i = 0; i < testFiles.length; i += 1) { + + testFiles[i].mv(filesData[i].uploadPath, (err) => { + if (err) { + return res.status(500).send(err); + } + + uploadCount += 1; + if (uploadCount === testFiles.length) { + res.json(filesData); + } + }); + } + }); + + app.all('/fields/user', function(req, res) { + if (!req.body) { + return res.status(400).send('No request body found'); + } + + const fields = ['firstName', 'lastName', 'email']; + for (let i = 0; i < fields.length; i += 1) { + if (!req.body[fields[i]] || !req.body[fields[i]].trim()) { + return res.status(400).send(`Invalid field: ${fields[i]}`); + } + } + + res.json({ + firstName: req.body.firstName, + lastName: req.body.lastName, + email: req.body.email + }); + }); + + app.all('/fields/nested', function(req, res) { + if (!req.body) { + return res.status(400).send('No request body found'); + } + + if (!req.body.name || !req.body.name.trim()) { + return res.status(400).send('Invalid name'); + } + + if (!req.body.hobbies || !req.body.hobbies.length == 2) { + return res.status(400).send('Invalid hobbies'); + } + + res.json({ + name: req.body.name, + hobbies: req.body.hobbies + }); + }); + + app.all('/fields/flattened', function(req, res) { + if (!req.body) { + return res.status(400).send('No request body found'); + } + + if (!req.body.name || !req.body.name.trim()) { + return res.status(400).send('Invalid name'); + } + + if (!req.body['hobbies[0]'] || !req.body['hobbies[0]'].trim()) { + return res.status(400).send('Invalid hobbies[0]'); + } + + if (!req.body['hobbies[1]'] || !req.body['hobbies[1]'].trim()) { + return res.status(400).send('Invalid hobbies[1]'); + } + + res.json({ + name: req.body.name, + 'hobbies[0]': req.body['hobbies[0]'], + 'hobbies[1]': req.body['hobbies[1]'] + }); + }); + + app.all('/fields/array', function(req, res) { + if (!req.body) { + return res.status(400).send('No request body found'); + } + + if (!req.body.testField) { + return res.status(400).send('Invalid field'); + } + + if (!Array.isArray(req.body.testField)) { + return res.status(400).send('Field is not an array'); + } + + res.json(req.body.testField); + }); + + return app; +}; + +module.exports = { + setup, + fileDir, + tempDir, + uploadDir, + clearFileDir: () => clearDir(fileDir), + clearTempDir: () => clearDir(tempDir), + clearUploadsDir: () => clearDir(uploadDir), + createTestFiles +}; diff --git a/www2/node_modules/express-fileupload/test/tempFile.spec.js b/www2/node_modules/express-fileupload/test/tempFile.spec.js new file mode 100644 index 0000000..8090448 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/tempFile.spec.js @@ -0,0 +1,126 @@ +const fs = require('fs'); +const md5 = require('md5'); +const path = require('path'); +const request = require('supertest'); +const server = require('./server'); + +const clearUploadsDir = server.clearUploadsDir; +const fileDir = server.fileDir; +const uploadDir = server.uploadDir; + +describe('tempFile: Test fileupload w/ useTempFiles.', function() { + afterEach(function(done) { + clearUploadsDir(); + done(); + }); + /** + * Upload the file for testing and verify the expected filename. + * @param {object} options The expressFileUpload options. + * @param {string} actualFileNameToUpload The name of the file to upload. + * @param {string} expectedFileNameOnFileSystem The name of the file after upload. + * @param {function} done The mocha continuation function. + */ + function executeFileUploadTestWalk( + options, + actualFileNameToUpload, + expectedFileNameOnFileSystem, + done + ) { + + let filePath = path.join(fileDir, actualFileNameToUpload); + let fileBuffer = fs.readFileSync(filePath); + let fileHash = md5(fileBuffer); + let fileStat = fs.statSync(filePath); + let uploadedFilePath = path.join(uploadDir, expectedFileNameOnFileSystem); + + request( + server.setup(options) + ) + .post('/upload/single') + .attach('testFile', filePath) + .expect((res)=>{ + res.body.uploadDir = ''; + res.body.uploadPath = ''; + }) + .expect(200, { + name: expectedFileNameOnFileSystem, + md5: fileHash, + size: fileStat.size, + uploadDir: '', + uploadPath: '' + }) + .end(function(err) { + if (err) { + return done(err); + } + fs.stat(uploadedFilePath, done); + }); + } + describe('Testing [safeFileNames w/ useTempFiles] option to ensure:', function() { + it('Does nothing to your filename when disabled.', function(done) { + const fileUploadOptions = { + safeFileNames: false, + useTempFiles: true, + tempFileDir: '/tmp/' + }; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'my$Invalid#fileName.png123'; + executeFileUploadTestWalk( + fileUploadOptions, + actualFileName, + expectedFileName, + done + ); + }); + it('Is disabled by default.', function(done) { + const fileUploadOptions = { + useTempFiles: true, + tempFileDir: '/tmp/' + }; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'my$Invalid#fileName.png123'; + executeFileUploadTestWalk( + fileUploadOptions, + actualFileName, + expectedFileName, + done + ); + }); + + it( + 'Strips away all non-alphanumeric characters (excluding hyphens/underscores) when enabled.', + function(done) { + const fileUploadOptions = { + safeFileNames: true, + useTempFiles: true, + tempFileDir: '/tmp/' + }; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileNamepng123'; + executeFileUploadTestWalk( + fileUploadOptions, + actualFileName, + expectedFileName, + done + ); + }); + + it( + 'Accepts a regex for stripping (decidedly) "invalid" characters from filename.', + function(done) { + const fileUploadOptions = { + safeFileNames: /[$#]/g, + useTempFiles: true, + tempFileDir: '/tmp/' + }; + const actualFileName = 'my$Invalid#fileName.png123'; + const expectedFileName = 'myInvalidfileName.png123'; + executeFileUploadTestWalk( + fileUploadOptions, + actualFileName, + expectedFileName, + done + ); + }); + }); +}); diff --git a/www2/node_modules/express-fileupload/test/uploadtimer.spec.js b/www2/node_modules/express-fileupload/test/uploadtimer.spec.js new file mode 100644 index 0000000..9b91ce6 --- /dev/null +++ b/www2/node_modules/express-fileupload/test/uploadtimer.spec.js @@ -0,0 +1,41 @@ +'use strict'; + +const assert = require('assert'); +const UploadTimer = require('../lib/uploadtimer'); + +describe('uploadTimer: Test UploadTimer class', () => { + + it('It runs a callback function after specified timeout.', (done) => { + const uploadTimer = new UploadTimer(500, done); + uploadTimer.set(); + }); + + it('set method returns true if timeout specified.', () => { + const uploadTimer = new UploadTimer(500); + assert.equal(uploadTimer.set(), true); + uploadTimer.clear(); + }); + + it('set method returns false if timeout has not specified.', () => { + const uploadTimer = new UploadTimer(); + assert.equal(uploadTimer.set(), false); + }); + + it('set method returns false if zero timeout has specified.', () => { + const uploadTimer = new UploadTimer(0); + assert.equal(uploadTimer.set(), false); + }); + + it('set method returns false if timer allready set.', () => { + const uploadTimer = new UploadTimer(500); + uploadTimer.set(); + assert.equal(uploadTimer.set(), false); + uploadTimer.clear(); + }); + + it('refresh method returns false if timer has not been set/initialized.', () => { + const uploadTimer = new UploadTimer(500); + assert.equal(uploadTimer.refresh(), false); + }); + +}); diff --git a/www2/node_modules/express-fileupload/test/utilities.spec.js b/www2/node_modules/express-fileupload/test/utilities.spec.js new file mode 100644 index 0000000..b68fd9d --- /dev/null +++ b/www2/node_modules/express-fileupload/test/utilities.spec.js @@ -0,0 +1,503 @@ +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); +const md5 = require('md5'); +const server = require('./server'); +const fileDir = server.fileDir; +const uploadDir = server.uploadDir; +const { + debugLog, + isFunc, + errorFunc, + getTempFilename, + buildOptions, + buildFields, + checkAndMakeDir, + deleteFile, + copyFile, + moveFile, + saveBufferToFile, + parseFileName, + uriDecodeFileName, + isSafeFromPollution +} = require('../lib/utilities'); + +const mockFile = 'basketball.png'; +const mockBuffer = fs.readFileSync(path.join(fileDir, mockFile)); +const mockHash = md5(mockBuffer); + +const mockFileMove = 'car.png'; +const mockBufferMove = fs.readFileSync(path.join(fileDir, mockFileMove)); +const mockHashMove = md5(mockBufferMove); + +describe('utilities: Test of the utilities functions', function() { + //debugLog tests + describe('Test debugLog function', () => { + + let testMessage = 'Test message'; + + it('debugLog returns false if no options passed', () => { + assert.equal(debugLog(null, testMessage), false); + }); + + it('debugLog returns false if option debug is false or logger is not set', () => { + assert.equal(debugLog({debug: false}, testMessage), false); + assert.equal(debugLog({debug: true, logger: undefined}, testMessage), false); + assert.equal(debugLog({debug: true, logger: {}}, testMessage), false); + }); + + it('debugLog returns true if option debug is true and logger is set', () => { + assert.equal(debugLog({debug: true, logger: console}, testMessage), true); + }); + + it('supports a custom logger', () => { + const calls = []; + const logger = { + log: (...args) => calls.push(args) + }; + debugLog({debug: true, logger}, testMessage); + assert.equal(calls.length, 1); + assert.deepEqual(calls[0], [`Express-file-upload: ${testMessage}`]); + }); + + }); + //isFunc tests + describe('Test isFunc function', () => { + + it('isFunc returns true if function passed', () => assert.equal(isFunc(()=>{}), true)); + + it('isFunc returns false if null passed', function() { + assert.equal(isFunc(null), false); + }); + + it('isFunc returns false if undefined passed', function() { + assert.equal(isFunc(undefined), false); + }); + + it('isFunc returns false if object passed', function() { + assert.equal(isFunc({}), false); + }); + + it('isFunc returns false if array passed', function() { + assert.equal(isFunc([]), false); + }); + }); + //errorFunc tests + describe('Test errorFunc function', () => { + + const resolve = () => 'success'; + const reject = () => 'error'; + + it('errorFunc returns resolve if reject function has not been passed', () => { + let result = errorFunc(resolve); + assert.equal(result(), 'success'); + }); + + it('errorFunc returns reject if reject function has been passed', () => { + let result = errorFunc(resolve, reject); + assert.equal(result(), 'error'); + }); + + }); + //getTempFilename tests + describe('Test getTempFilename function', () => { + + const nameRegexp = /tmp-\d{1,5}-\d{1,}/; + + it('getTempFilename result matches regexp /tmp-d{1,5}-d{1,}/', () => { + + let errCounter = 0; + let tempName = ''; + for (var i = 0; i < 65537; i++) { + tempName = getTempFilename(); + if (!nameRegexp.test(tempName)) errCounter ++; + } + + assert.equal(errCounter, 0); + }); + + it('getTempFilename current and previous results are not equal', () => { + + let errCounter = 0; + let tempName = ''; + let previousName = ''; + for (var i = 0; i < 65537; i++) { + previousName = tempName; + tempName = getTempFilename(); + if (previousName === tempName) errCounter ++; + } + + assert.equal(errCounter, 0); + }); + + }); + //parseFileName + describe('Test parseFileName function', () => { + + it('Does nothing to your filename when disabled.', () => { + const opts = {safeFileNames: false}; + const name = 'my$Invalid#fileName.png123'; + const expected = 'my$Invalid#fileName.png123'; + let result = parseFileName(opts, name); + assert.equal(result, expected); + }); + + it('Cuts of file name length if it more then 255 chars.', () => { + const name = 'a'.repeat(300); + const result = parseFileName({}, name); + assert.equal(result.length, 255); + }); + + it( + 'Strips away all non-alphanumeric characters (excluding hyphens/underscores) when enabled.', + () => { + const opts = {safeFileNames: true}; + const name = 'my$Invalid#fileName.png123'; + const expected = 'myInvalidfileNamepng123'; + let result = parseFileName(opts, name); + assert.equal(result, expected); + }); + + it( + 'Strips away all non-alphanumeric chars when preserveExtension: true for a name without dots', + () => { + const opts = {safeFileNames: true, preserveExtension: true}; + const name = 'my$Invalid#fileName'; + const expected = 'myInvalidfileName'; + let result = parseFileName(opts, name); + assert.equal(result, expected); + }); + + it('Accepts a regex for stripping (decidedly) "invalid" characters from filename.', () => { + const opts = {safeFileNames: /[$#]/g}; + const name = 'my$Invalid#fileName.png123'; + const expected = 'myInvalidfileName.png123'; + let result = parseFileName(opts, name); + assert.equal(result, expected); + }); + + it( + 'Returns correct filename if name contains dots characters and preserveExtension: true.', + () => { + const opts = {safeFileNames: true, preserveExtension: true}; + const name = 'basket.ball.png'; + const expected = 'basketball.png'; + let result = parseFileName(opts, name); + assert.equal(result, expected); + }); + + it('Returns a temporary file name if name argument is empty.', () => { + const opts = {safeFileNames: false}; + const result = parseFileName(opts); + assert.equal(typeof result, 'string'); + }); + + }); + //buildOptions tests + describe('Test buildOptions function', () => { + + const source = { option1: '1', option2: '2' }; + const sourceAddon = { option3: '3'}; + const expected = { option1: '1', option2: '2' }; + const expectedAddon = { option1: '1', option2: '2', option3: '3'}; + + it('buildOptions returns and equal object to the object which was paased', () => { + let result = buildOptions(source); + assert.deepStrictEqual(result, source); + }); + + it('buildOptions doesnt add non object or null arguments to the result', () => { + let result = buildOptions(source, 2, '3', null); + assert.deepStrictEqual(result, expected); + }); + + it('buildOptions adds value to the result from the several source argumets', () => { + let result = buildOptions(source, sourceAddon); + assert.deepStrictEqual(result, expectedAddon); + }); + + }); + //buildFields tests + describe('Test buildFields function', () => { + + it('buildFields does nothing if null value has been passed', () => { + let fields = null; + fields = buildFields(fields, 'test', null); + assert.equal(fields, null); + }); + + }); + //checkAndMakeDir tests + describe('Test checkAndMakeDir function', () => { + // + it('checkAndMakeDir returns false if upload options object was not set', () => { + assert.equal(checkAndMakeDir(), false); + }); + // + it('checkAndMakeDir returns false if upload option createParentPath was not set', () => { + assert.equal(checkAndMakeDir({}), false); + }); + // + it('checkAndMakeDir returns false if filePath was not set', () => { + assert.equal(checkAndMakeDir({createParentPath: true}), false); + }); + // + it('checkAndMakeDir return true if path to the file already exists', ()=>{ + let dir = path.join(uploadDir, 'testfile'); + assert.equal(checkAndMakeDir({createParentPath: true}, dir), true); + }); + // + it('checkAndMakeDir creates a dir if path to the file not exists', ()=>{ + let dir = path.join(uploadDir, 'testfolder', 'testfile'); + assert.equal(checkAndMakeDir({createParentPath: true}, dir), true); + }); + // + it('checkAndMakeDir creates a dir recursively if path to the file not exists', ()=>{ + let dir = path.join(uploadDir, 'testfolder', 'testsubfolder', 'testfile'); + assert.equal(checkAndMakeDir({createParentPath: true}, dir), true); + }); + }); + + describe('Test moveFile function', function() { + beforeEach(() => server.clearUploadsDir()); + + it('Should rename a file and check a hash', function(done) { + const srcPath = path.join(fileDir, mockFileMove); + const dstPath = path.join(uploadDir, mockFileMove); + + moveFile(srcPath, dstPath, function(err, renamed) { + if (err) { + return done(err); + } + fs.stat(dstPath, (err) => { + if (err) { + return done(err); + } + // Match source and destination files hash. + const fileBuffer = fs.readFileSync(dstPath); + const fileHash = md5(fileBuffer); + if (fileHash !== mockHashMove) { + return done(new Error('Hashes do not match')); + } + // Check that source file was deleted. + fs.stat(srcPath, (err) => { + if (err) { + return done(renamed ? null : new Error('Source file was not renamed')); + } + done(new Error('Source file was not deleted')); + }); + }); + }); + }); + }); + + //saveBufferToFile tests + describe('Test saveBufferToFile function', function(){ + beforeEach(() => server.clearUploadsDir()); + + it('Save buffer to a file', function(done) { + let filePath = path.join(uploadDir, mockFile); + saveBufferToFile(mockBuffer, filePath, function(err){ + if (err) { + return done(err); + } + fs.stat(filePath, done); + }); + }); + + it('Failed if not a buffer passed', function(done) { + let filePath = path.join(uploadDir, mockFile); + saveBufferToFile(undefined, filePath, function(err){ + if (err) { + return done(); + } + }); + }); + + it('Failed if wrong path passed', function(done) { + let filePath = ''; + saveBufferToFile(mockFile, filePath, function(err){ + if (err) { + return done(); + } + }); + }); + }); + + describe('Test deleteFile function', function(){ + beforeEach(() => server.clearUploadsDir()); + + it('Failed if nonexistent file passed', function(done){ + let filePath = path.join(uploadDir, getTempFilename()); + + deleteFile(filePath, function(err){ + if (err) { + return done(); + } + }); + }); + + it('Delete a file', function(done){ + let srcPath = path.join(fileDir, mockFile); + let dstPath = path.join(uploadDir, getTempFilename()); + // copy a file + copyFile(srcPath, dstPath, function(err){ + if (err) { + return done(err); + } + fs.stat(dstPath, (err)=>{ + if (err) { + return done(err); + } + // delete a file + deleteFile(dstPath, function(err){ + if (err) { + return done(err); + } + fs.stat(dstPath, (err)=> { + return err ? done() : done(new Error('File was not deleted')); + }); + }); + }); + }); + }); + + }); + + describe('Test copyFile function', function() { + beforeEach(() => server.clearUploadsDir()); + + it('Copy a file and check a hash', function(done) { + let srcPath = path.join(fileDir, mockFile); + let dstPath = path.join(uploadDir, mockFile); + + copyFile(srcPath, dstPath, function(err){ + if (err) { + return done(err); + } + fs.stat(dstPath, (err)=>{ + if (err){ + return done(err); + } + // Match source and destination files hash. + let fileBuffer = fs.readFileSync(dstPath); + let fileHash = md5(fileBuffer); + return fileHash === mockHash ? done() : done(new Error('Hashes do not match')); + }); + }); + }); + + it('Failed if wrong source file path passed', function(done){ + let srcPath = path.join(fileDir, 'unknown'); + let dstPath = path.join(uploadDir, mockFile); + + copyFile(srcPath, dstPath, function(err){ + if (err) { + return done(); + } + }); + }); + + it('Failed if wrong destination file path passed', function(done){ + let srcPath = path.join(fileDir, 'unknown'); + let dstPath = path.join('unknown', 'unknown'); + + copyFile(srcPath, dstPath, function(err){ + if (err) { + return done(); + } + }); + }); + }); + + describe('Test uriDecodeFileName function', function() { + const testData = [ + { enc: 'test%22filename', dec: 'test"filename' }, + { enc: 'test%60filename', dec: 'test`filename' }, + { enc: '%3Fx%3Dtest%22filename', dec: '?x=test"filename'}, + { enc: 'bug_bounty_upload_%91%91and%92.txt', dec: 'bug_bounty_upload_and.txt'} + ]; + + // Test decoding if uriDecodeFileNames: true. + testData.forEach((testName) => { + const opts = { uriDecodeFileNames: true }; + it(`Return ${testName.dec} for input ${testName.enc} if uriDecodeFileNames: true`, () => { + assert.equal(uriDecodeFileName(opts, testName.enc), testName.dec); + }); + }); + + // Test decoding if uriDecodeFileNames: false. + testData.forEach((testName) => { + const opts = { uriDecodeFileNames: false }; + it(`Return ${testName.enc} for input ${testName.enc} if uriDecodeFileNames: false`, () => { + assert.equal(uriDecodeFileName(opts, testName.enc), testName.enc); + }); + }); + }); + + describe('Test for no prototype pollution in buildFields', function() { + const prototypeFields = [ + { name: '__proto__', data: {} }, + { name: 'constructor', data: {} }, + { name: 'toString', data: {} } + ]; + + const nonPrototypeFields = [ + { name: 'a', data: {} }, + { name: 'b', data: {} } + ]; + + let fieldObject = undefined; + [...prototypeFields, ...nonPrototypeFields].forEach((field) => { + fieldObject = buildFields(fieldObject, field.name, field.data); + }); + + it(`Has ${nonPrototypeFields.length} keys`, () => { + assert.equal(Object.keys(fieldObject).length, nonPrototypeFields.length); + }); + + it(`Has null as its prototype`, () => { + assert.equal(Object.getPrototypeOf(fieldObject), null); + }); + + prototypeFields.forEach((field) => { + it(`${field.name} property is not an array`, () => { + // Note, Array.isArray is an insufficient test due to it returning false + // for Objects with an array prototype. + assert.equal(fieldObject[field.name] instanceof Array, false); + }); + }); + }); + + describe('Test for correct detection of prototype pollution', function() { + const validInsertions = [ + { base: {}, key: 'a' }, + { base: { a: 1 }, key: 'a' }, + { base: { __proto__: { a: 1 } }, key: 'a' }, + { base: [1], key: 0 }, + { base: { __proto__: [1] }, key: 0 } + ]; + + const invalidInsertions = [ + { base: {}, key: '__proto__' }, + { base: {}, key: 'constructor' }, + { base: [1], key: '__proto__' }, + { base: [1], key: 'length' }, + { base: { __proto__: [1] }, key: 'length' } + ]; + + validInsertions.forEach((insertion) => { + it(`Key ${insertion.key} should be valid for ${JSON.stringify(insertion.base)}`, () => { + assert.equal(isSafeFromPollution(insertion.base, insertion.key), true); + }); + }); + + invalidInsertions.forEach((insertion) => { + it(`Key ${insertion.key} should not be valid for ${JSON.stringify(insertion.base)}`, () => { + assert.equal(isSafeFromPollution(insertion.base, insertion.key), false); + }); + }); + }); +}); diff --git a/www/node_modules/express-session/HISTORY.md b/www2/node_modules/express-session/HISTORY.md similarity index 100% rename from www/node_modules/express-session/HISTORY.md rename to www2/node_modules/express-session/HISTORY.md diff --git a/www/node_modules/express-session/LICENSE b/www2/node_modules/express-session/LICENSE similarity index 100% rename from www/node_modules/express-session/LICENSE rename to www2/node_modules/express-session/LICENSE diff --git a/www/node_modules/express-session/README.md b/www2/node_modules/express-session/README.md similarity index 100% rename from www/node_modules/express-session/README.md rename to www2/node_modules/express-session/README.md diff --git a/www/node_modules/express-session/index.js b/www2/node_modules/express-session/index.js similarity index 100% rename from www/node_modules/express-session/index.js rename to www2/node_modules/express-session/index.js diff --git a/www/node_modules/express-session/node_modules/cookie-signature/History.md b/www2/node_modules/express-session/node_modules/cookie-signature/History.md similarity index 100% rename from www/node_modules/express-session/node_modules/cookie-signature/History.md rename to www2/node_modules/express-session/node_modules/cookie-signature/History.md diff --git a/www/node_modules/express-session/node_modules/cookie-signature/Readme.md b/www2/node_modules/express-session/node_modules/cookie-signature/Readme.md similarity index 100% rename from www/node_modules/express-session/node_modules/cookie-signature/Readme.md rename to www2/node_modules/express-session/node_modules/cookie-signature/Readme.md diff --git a/www/node_modules/express-session/node_modules/cookie-signature/index.js b/www2/node_modules/express-session/node_modules/cookie-signature/index.js similarity index 100% rename from www/node_modules/express-session/node_modules/cookie-signature/index.js rename to www2/node_modules/express-session/node_modules/cookie-signature/index.js diff --git a/www/node_modules/express-session/node_modules/cookie-signature/package.json b/www2/node_modules/express-session/node_modules/cookie-signature/package.json similarity index 100% rename from www/node_modules/express-session/node_modules/cookie-signature/package.json rename to www2/node_modules/express-session/node_modules/cookie-signature/package.json diff --git a/www/node_modules/express-session/package.json b/www2/node_modules/express-session/package.json similarity index 100% rename from www/node_modules/express-session/package.json rename to www2/node_modules/express-session/package.json diff --git a/www/node_modules/express-session/session/cookie.js b/www2/node_modules/express-session/session/cookie.js similarity index 100% rename from www/node_modules/express-session/session/cookie.js rename to www2/node_modules/express-session/session/cookie.js diff --git a/www/node_modules/express-session/session/memory.js b/www2/node_modules/express-session/session/memory.js similarity index 100% rename from www/node_modules/express-session/session/memory.js rename to www2/node_modules/express-session/session/memory.js diff --git a/www/node_modules/express-session/session/session.js b/www2/node_modules/express-session/session/session.js similarity index 100% rename from www/node_modules/express-session/session/session.js rename to www2/node_modules/express-session/session/session.js diff --git a/www/node_modules/express-session/session/store.js b/www2/node_modules/express-session/session/store.js similarity index 100% rename from www/node_modules/express-session/session/store.js rename to www2/node_modules/express-session/session/store.js diff --git a/www/node_modules/express/History.md b/www2/node_modules/express/History.md similarity index 100% rename from www/node_modules/express/History.md rename to www2/node_modules/express/History.md diff --git a/www/node_modules/express/LICENSE b/www2/node_modules/express/LICENSE similarity index 100% rename from www/node_modules/express/LICENSE rename to www2/node_modules/express/LICENSE diff --git a/www/node_modules/express/Readme.md b/www2/node_modules/express/Readme.md similarity index 100% rename from www/node_modules/express/Readme.md rename to www2/node_modules/express/Readme.md diff --git a/www/node_modules/express/index.js b/www2/node_modules/express/index.js similarity index 100% rename from www/node_modules/express/index.js rename to www2/node_modules/express/index.js diff --git a/www/node_modules/express/lib/application.js b/www2/node_modules/express/lib/application.js similarity index 100% rename from www/node_modules/express/lib/application.js rename to www2/node_modules/express/lib/application.js diff --git a/www/node_modules/express/lib/express.js b/www2/node_modules/express/lib/express.js similarity index 100% rename from www/node_modules/express/lib/express.js rename to www2/node_modules/express/lib/express.js diff --git a/www/node_modules/express/lib/middleware/init.js b/www2/node_modules/express/lib/middleware/init.js similarity index 100% rename from www/node_modules/express/lib/middleware/init.js rename to www2/node_modules/express/lib/middleware/init.js diff --git a/www/node_modules/express/lib/middleware/query.js b/www2/node_modules/express/lib/middleware/query.js similarity index 100% rename from www/node_modules/express/lib/middleware/query.js rename to www2/node_modules/express/lib/middleware/query.js diff --git a/www/node_modules/express/lib/request.js b/www2/node_modules/express/lib/request.js similarity index 100% rename from www/node_modules/express/lib/request.js rename to www2/node_modules/express/lib/request.js diff --git a/www/node_modules/express/lib/response.js b/www2/node_modules/express/lib/response.js similarity index 100% rename from www/node_modules/express/lib/response.js rename to www2/node_modules/express/lib/response.js diff --git a/www/node_modules/express/lib/router/index.js b/www2/node_modules/express/lib/router/index.js similarity index 100% rename from www/node_modules/express/lib/router/index.js rename to www2/node_modules/express/lib/router/index.js diff --git a/www/node_modules/express/lib/router/layer.js b/www2/node_modules/express/lib/router/layer.js similarity index 100% rename from www/node_modules/express/lib/router/layer.js rename to www2/node_modules/express/lib/router/layer.js diff --git a/www/node_modules/express/lib/router/route.js b/www2/node_modules/express/lib/router/route.js similarity index 100% rename from www/node_modules/express/lib/router/route.js rename to www2/node_modules/express/lib/router/route.js diff --git a/www/node_modules/express/lib/utils.js b/www2/node_modules/express/lib/utils.js similarity index 100% rename from www/node_modules/express/lib/utils.js rename to www2/node_modules/express/lib/utils.js diff --git a/www/node_modules/express/lib/view.js b/www2/node_modules/express/lib/view.js similarity index 100% rename from www/node_modules/express/lib/view.js rename to www2/node_modules/express/lib/view.js diff --git a/www/node_modules/express/package.json b/www2/node_modules/express/package.json similarity index 100% rename from www/node_modules/express/package.json rename to www2/node_modules/express/package.json diff --git a/www/node_modules/finalhandler/HISTORY.md b/www2/node_modules/finalhandler/HISTORY.md similarity index 100% rename from www/node_modules/finalhandler/HISTORY.md rename to www2/node_modules/finalhandler/HISTORY.md diff --git a/www/node_modules/finalhandler/LICENSE b/www2/node_modules/finalhandler/LICENSE similarity index 100% rename from www/node_modules/finalhandler/LICENSE rename to www2/node_modules/finalhandler/LICENSE diff --git a/www/node_modules/finalhandler/README.md b/www2/node_modules/finalhandler/README.md similarity index 100% rename from www/node_modules/finalhandler/README.md rename to www2/node_modules/finalhandler/README.md diff --git a/www/node_modules/finalhandler/SECURITY.md b/www2/node_modules/finalhandler/SECURITY.md similarity index 100% rename from www/node_modules/finalhandler/SECURITY.md rename to www2/node_modules/finalhandler/SECURITY.md diff --git a/www/node_modules/finalhandler/index.js b/www2/node_modules/finalhandler/index.js similarity index 100% rename from www/node_modules/finalhandler/index.js rename to www2/node_modules/finalhandler/index.js diff --git a/www/node_modules/finalhandler/package.json b/www2/node_modules/finalhandler/package.json similarity index 100% rename from www/node_modules/finalhandler/package.json rename to www2/node_modules/finalhandler/package.json diff --git a/www/node_modules/forwarded/HISTORY.md b/www2/node_modules/forwarded/HISTORY.md similarity index 100% rename from www/node_modules/forwarded/HISTORY.md rename to www2/node_modules/forwarded/HISTORY.md diff --git a/www/node_modules/forwarded/LICENSE b/www2/node_modules/forwarded/LICENSE similarity index 100% rename from www/node_modules/forwarded/LICENSE rename to www2/node_modules/forwarded/LICENSE diff --git a/www/node_modules/forwarded/README.md b/www2/node_modules/forwarded/README.md similarity index 100% rename from www/node_modules/forwarded/README.md rename to www2/node_modules/forwarded/README.md diff --git a/www/node_modules/forwarded/index.js b/www2/node_modules/forwarded/index.js similarity index 100% rename from www/node_modules/forwarded/index.js rename to www2/node_modules/forwarded/index.js diff --git a/www/node_modules/forwarded/package.json b/www2/node_modules/forwarded/package.json similarity index 100% rename from www/node_modules/forwarded/package.json rename to www2/node_modules/forwarded/package.json diff --git a/www/node_modules/fresh/HISTORY.md b/www2/node_modules/fresh/HISTORY.md similarity index 100% rename from www/node_modules/fresh/HISTORY.md rename to www2/node_modules/fresh/HISTORY.md diff --git a/www/node_modules/fresh/LICENSE b/www2/node_modules/fresh/LICENSE similarity index 100% rename from www/node_modules/fresh/LICENSE rename to www2/node_modules/fresh/LICENSE diff --git a/www/node_modules/fresh/README.md b/www2/node_modules/fresh/README.md similarity index 100% rename from www/node_modules/fresh/README.md rename to www2/node_modules/fresh/README.md diff --git a/www/node_modules/fresh/index.js b/www2/node_modules/fresh/index.js similarity index 100% rename from www/node_modules/fresh/index.js rename to www2/node_modules/fresh/index.js diff --git a/www/node_modules/fresh/package.json b/www2/node_modules/fresh/package.json similarity index 100% rename from www/node_modules/fresh/package.json rename to www2/node_modules/fresh/package.json diff --git a/www/node_modules/function-bind/.eslintrc b/www2/node_modules/function-bind/.eslintrc similarity index 100% rename from www/node_modules/function-bind/.eslintrc rename to www2/node_modules/function-bind/.eslintrc diff --git a/www/node_modules/function-bind/.github/FUNDING.yml b/www2/node_modules/function-bind/.github/FUNDING.yml similarity index 100% rename from www/node_modules/function-bind/.github/FUNDING.yml rename to www2/node_modules/function-bind/.github/FUNDING.yml diff --git a/www/node_modules/function-bind/.github/SECURITY.md b/www2/node_modules/function-bind/.github/SECURITY.md similarity index 100% rename from www/node_modules/function-bind/.github/SECURITY.md rename to www2/node_modules/function-bind/.github/SECURITY.md diff --git a/www/node_modules/function-bind/.nycrc b/www2/node_modules/function-bind/.nycrc similarity index 100% rename from www/node_modules/function-bind/.nycrc rename to www2/node_modules/function-bind/.nycrc diff --git a/www/node_modules/function-bind/CHANGELOG.md b/www2/node_modules/function-bind/CHANGELOG.md similarity index 100% rename from www/node_modules/function-bind/CHANGELOG.md rename to www2/node_modules/function-bind/CHANGELOG.md diff --git a/www/node_modules/function-bind/LICENSE b/www2/node_modules/function-bind/LICENSE similarity index 100% rename from www/node_modules/function-bind/LICENSE rename to www2/node_modules/function-bind/LICENSE diff --git a/www/node_modules/function-bind/README.md b/www2/node_modules/function-bind/README.md similarity index 100% rename from www/node_modules/function-bind/README.md rename to www2/node_modules/function-bind/README.md diff --git a/www/node_modules/function-bind/implementation.js b/www2/node_modules/function-bind/implementation.js similarity index 100% rename from www/node_modules/function-bind/implementation.js rename to www2/node_modules/function-bind/implementation.js diff --git a/www/node_modules/function-bind/index.js b/www2/node_modules/function-bind/index.js similarity index 100% rename from www/node_modules/function-bind/index.js rename to www2/node_modules/function-bind/index.js diff --git a/www/node_modules/function-bind/package.json b/www2/node_modules/function-bind/package.json similarity index 100% rename from www/node_modules/function-bind/package.json rename to www2/node_modules/function-bind/package.json diff --git a/www/node_modules/function-bind/test/.eslintrc b/www2/node_modules/function-bind/test/.eslintrc similarity index 100% rename from www/node_modules/function-bind/test/.eslintrc rename to www2/node_modules/function-bind/test/.eslintrc diff --git a/www/node_modules/function-bind/test/index.js b/www2/node_modules/function-bind/test/index.js similarity index 100% rename from www/node_modules/function-bind/test/index.js rename to www2/node_modules/function-bind/test/index.js diff --git a/www/node_modules/get-intrinsic/.eslintrc b/www2/node_modules/get-intrinsic/.eslintrc similarity index 100% rename from www/node_modules/get-intrinsic/.eslintrc rename to www2/node_modules/get-intrinsic/.eslintrc diff --git a/www/node_modules/get-intrinsic/.github/FUNDING.yml b/www2/node_modules/get-intrinsic/.github/FUNDING.yml similarity index 100% rename from www/node_modules/get-intrinsic/.github/FUNDING.yml rename to www2/node_modules/get-intrinsic/.github/FUNDING.yml diff --git a/www/node_modules/get-intrinsic/.nycrc b/www2/node_modules/get-intrinsic/.nycrc similarity index 100% rename from www/node_modules/get-intrinsic/.nycrc rename to www2/node_modules/get-intrinsic/.nycrc diff --git a/www/node_modules/get-intrinsic/CHANGELOG.md b/www2/node_modules/get-intrinsic/CHANGELOG.md similarity index 100% rename from www/node_modules/get-intrinsic/CHANGELOG.md rename to www2/node_modules/get-intrinsic/CHANGELOG.md diff --git a/www/node_modules/get-intrinsic/LICENSE b/www2/node_modules/get-intrinsic/LICENSE similarity index 100% rename from www/node_modules/get-intrinsic/LICENSE rename to www2/node_modules/get-intrinsic/LICENSE diff --git a/www/node_modules/get-intrinsic/README.md b/www2/node_modules/get-intrinsic/README.md similarity index 100% rename from www/node_modules/get-intrinsic/README.md rename to www2/node_modules/get-intrinsic/README.md diff --git a/www/node_modules/get-intrinsic/index.js b/www2/node_modules/get-intrinsic/index.js similarity index 100% rename from www/node_modules/get-intrinsic/index.js rename to www2/node_modules/get-intrinsic/index.js diff --git a/www/node_modules/get-intrinsic/package.json b/www2/node_modules/get-intrinsic/package.json similarity index 100% rename from www/node_modules/get-intrinsic/package.json rename to www2/node_modules/get-intrinsic/package.json diff --git a/www/node_modules/get-intrinsic/test/GetIntrinsic.js b/www2/node_modules/get-intrinsic/test/GetIntrinsic.js similarity index 100% rename from www/node_modules/get-intrinsic/test/GetIntrinsic.js rename to www2/node_modules/get-intrinsic/test/GetIntrinsic.js diff --git a/www/node_modules/gopd/.eslintrc b/www2/node_modules/gopd/.eslintrc similarity index 100% rename from www/node_modules/gopd/.eslintrc rename to www2/node_modules/gopd/.eslintrc diff --git a/www/node_modules/gopd/.github/FUNDING.yml b/www2/node_modules/gopd/.github/FUNDING.yml similarity index 100% rename from www/node_modules/gopd/.github/FUNDING.yml rename to www2/node_modules/gopd/.github/FUNDING.yml diff --git a/www/node_modules/gopd/CHANGELOG.md b/www2/node_modules/gopd/CHANGELOG.md similarity index 100% rename from www/node_modules/gopd/CHANGELOG.md rename to www2/node_modules/gopd/CHANGELOG.md diff --git a/www/node_modules/gopd/LICENSE b/www2/node_modules/gopd/LICENSE similarity index 100% rename from www/node_modules/gopd/LICENSE rename to www2/node_modules/gopd/LICENSE diff --git a/www/node_modules/gopd/README.md b/www2/node_modules/gopd/README.md similarity index 100% rename from www/node_modules/gopd/README.md rename to www2/node_modules/gopd/README.md diff --git a/www/node_modules/gopd/index.js b/www2/node_modules/gopd/index.js similarity index 100% rename from www/node_modules/gopd/index.js rename to www2/node_modules/gopd/index.js diff --git a/www/node_modules/gopd/package.json b/www2/node_modules/gopd/package.json similarity index 100% rename from www/node_modules/gopd/package.json rename to www2/node_modules/gopd/package.json diff --git a/www/node_modules/gopd/test/index.js b/www2/node_modules/gopd/test/index.js similarity index 100% rename from www/node_modules/gopd/test/index.js rename to www2/node_modules/gopd/test/index.js diff --git a/www/node_modules/has-property-descriptors/.eslintrc b/www2/node_modules/has-property-descriptors/.eslintrc similarity index 100% rename from www/node_modules/has-property-descriptors/.eslintrc rename to www2/node_modules/has-property-descriptors/.eslintrc diff --git a/www/node_modules/has-property-descriptors/.github/FUNDING.yml b/www2/node_modules/has-property-descriptors/.github/FUNDING.yml similarity index 100% rename from www/node_modules/has-property-descriptors/.github/FUNDING.yml rename to www2/node_modules/has-property-descriptors/.github/FUNDING.yml diff --git a/www/node_modules/has-property-descriptors/.nycrc b/www2/node_modules/has-property-descriptors/.nycrc similarity index 100% rename from www/node_modules/has-property-descriptors/.nycrc rename to www2/node_modules/has-property-descriptors/.nycrc diff --git a/www/node_modules/has-property-descriptors/CHANGELOG.md b/www2/node_modules/has-property-descriptors/CHANGELOG.md similarity index 100% rename from www/node_modules/has-property-descriptors/CHANGELOG.md rename to www2/node_modules/has-property-descriptors/CHANGELOG.md diff --git a/www/node_modules/has-property-descriptors/LICENSE b/www2/node_modules/has-property-descriptors/LICENSE similarity index 100% rename from www/node_modules/has-property-descriptors/LICENSE rename to www2/node_modules/has-property-descriptors/LICENSE diff --git a/www/node_modules/has-property-descriptors/README.md b/www2/node_modules/has-property-descriptors/README.md similarity index 100% rename from www/node_modules/has-property-descriptors/README.md rename to www2/node_modules/has-property-descriptors/README.md diff --git a/www/node_modules/has-property-descriptors/index.js b/www2/node_modules/has-property-descriptors/index.js similarity index 100% rename from www/node_modules/has-property-descriptors/index.js rename to www2/node_modules/has-property-descriptors/index.js diff --git a/www/node_modules/has-property-descriptors/package.json b/www2/node_modules/has-property-descriptors/package.json similarity index 100% rename from www/node_modules/has-property-descriptors/package.json rename to www2/node_modules/has-property-descriptors/package.json diff --git a/www/node_modules/has-property-descriptors/test/index.js b/www2/node_modules/has-property-descriptors/test/index.js similarity index 100% rename from www/node_modules/has-property-descriptors/test/index.js rename to www2/node_modules/has-property-descriptors/test/index.js diff --git a/www/node_modules/has-proto/.eslintrc b/www2/node_modules/has-proto/.eslintrc similarity index 100% rename from www/node_modules/has-proto/.eslintrc rename to www2/node_modules/has-proto/.eslintrc diff --git a/www/node_modules/has-proto/.github/FUNDING.yml b/www2/node_modules/has-proto/.github/FUNDING.yml similarity index 100% rename from www/node_modules/has-proto/.github/FUNDING.yml rename to www2/node_modules/has-proto/.github/FUNDING.yml diff --git a/www/node_modules/has-proto/CHANGELOG.md b/www2/node_modules/has-proto/CHANGELOG.md similarity index 100% rename from www/node_modules/has-proto/CHANGELOG.md rename to www2/node_modules/has-proto/CHANGELOG.md diff --git a/www/node_modules/has-proto/LICENSE b/www2/node_modules/has-proto/LICENSE similarity index 100% rename from www/node_modules/has-proto/LICENSE rename to www2/node_modules/has-proto/LICENSE diff --git a/www/node_modules/has-proto/README.md b/www2/node_modules/has-proto/README.md similarity index 100% rename from www/node_modules/has-proto/README.md rename to www2/node_modules/has-proto/README.md diff --git a/www/node_modules/has-proto/index.d.ts b/www2/node_modules/has-proto/index.d.ts similarity index 100% rename from www/node_modules/has-proto/index.d.ts rename to www2/node_modules/has-proto/index.d.ts diff --git a/www/node_modules/has-proto/index.js b/www2/node_modules/has-proto/index.js similarity index 100% rename from www/node_modules/has-proto/index.js rename to www2/node_modules/has-proto/index.js diff --git a/www/node_modules/has-proto/package.json b/www2/node_modules/has-proto/package.json similarity index 100% rename from www/node_modules/has-proto/package.json rename to www2/node_modules/has-proto/package.json diff --git a/www/node_modules/has-proto/test/index.js b/www2/node_modules/has-proto/test/index.js similarity index 100% rename from www/node_modules/has-proto/test/index.js rename to www2/node_modules/has-proto/test/index.js diff --git a/www/node_modules/has-proto/tsconfig.json b/www2/node_modules/has-proto/tsconfig.json similarity index 100% rename from www/node_modules/has-proto/tsconfig.json rename to www2/node_modules/has-proto/tsconfig.json diff --git a/www/node_modules/has-symbols/.eslintrc b/www2/node_modules/has-symbols/.eslintrc similarity index 100% rename from www/node_modules/has-symbols/.eslintrc rename to www2/node_modules/has-symbols/.eslintrc diff --git a/www/node_modules/has-symbols/.github/FUNDING.yml b/www2/node_modules/has-symbols/.github/FUNDING.yml similarity index 100% rename from www/node_modules/has-symbols/.github/FUNDING.yml rename to www2/node_modules/has-symbols/.github/FUNDING.yml diff --git a/www/node_modules/has-symbols/.nycrc b/www2/node_modules/has-symbols/.nycrc similarity index 100% rename from www/node_modules/has-symbols/.nycrc rename to www2/node_modules/has-symbols/.nycrc diff --git a/www/node_modules/has-symbols/CHANGELOG.md b/www2/node_modules/has-symbols/CHANGELOG.md similarity index 100% rename from www/node_modules/has-symbols/CHANGELOG.md rename to www2/node_modules/has-symbols/CHANGELOG.md diff --git a/www/node_modules/has-symbols/LICENSE b/www2/node_modules/has-symbols/LICENSE similarity index 100% rename from www/node_modules/has-symbols/LICENSE rename to www2/node_modules/has-symbols/LICENSE diff --git a/www/node_modules/has-symbols/README.md b/www2/node_modules/has-symbols/README.md similarity index 100% rename from www/node_modules/has-symbols/README.md rename to www2/node_modules/has-symbols/README.md diff --git a/www/node_modules/has-symbols/index.js b/www2/node_modules/has-symbols/index.js similarity index 100% rename from www/node_modules/has-symbols/index.js rename to www2/node_modules/has-symbols/index.js diff --git a/www/node_modules/has-symbols/package.json b/www2/node_modules/has-symbols/package.json similarity index 100% rename from www/node_modules/has-symbols/package.json rename to www2/node_modules/has-symbols/package.json diff --git a/www/node_modules/has-symbols/shams.js b/www2/node_modules/has-symbols/shams.js similarity index 100% rename from www/node_modules/has-symbols/shams.js rename to www2/node_modules/has-symbols/shams.js diff --git a/www/node_modules/has-symbols/test/index.js b/www2/node_modules/has-symbols/test/index.js similarity index 100% rename from www/node_modules/has-symbols/test/index.js rename to www2/node_modules/has-symbols/test/index.js diff --git a/www/node_modules/has-symbols/test/shams/core-js.js b/www2/node_modules/has-symbols/test/shams/core-js.js similarity index 100% rename from www/node_modules/has-symbols/test/shams/core-js.js rename to www2/node_modules/has-symbols/test/shams/core-js.js diff --git a/www/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/www2/node_modules/has-symbols/test/shams/get-own-property-symbols.js similarity index 100% rename from www/node_modules/has-symbols/test/shams/get-own-property-symbols.js rename to www2/node_modules/has-symbols/test/shams/get-own-property-symbols.js diff --git a/www/node_modules/has-symbols/test/tests.js b/www2/node_modules/has-symbols/test/tests.js similarity index 100% rename from www/node_modules/has-symbols/test/tests.js rename to www2/node_modules/has-symbols/test/tests.js diff --git a/www/node_modules/hasown/.eslintrc b/www2/node_modules/hasown/.eslintrc similarity index 100% rename from www/node_modules/hasown/.eslintrc rename to www2/node_modules/hasown/.eslintrc diff --git a/www/node_modules/hasown/.github/FUNDING.yml b/www2/node_modules/hasown/.github/FUNDING.yml similarity index 100% rename from www/node_modules/hasown/.github/FUNDING.yml rename to www2/node_modules/hasown/.github/FUNDING.yml diff --git a/www/node_modules/hasown/.nycrc b/www2/node_modules/hasown/.nycrc similarity index 100% rename from www/node_modules/hasown/.nycrc rename to www2/node_modules/hasown/.nycrc diff --git a/www/node_modules/hasown/CHANGELOG.md b/www2/node_modules/hasown/CHANGELOG.md similarity index 100% rename from www/node_modules/hasown/CHANGELOG.md rename to www2/node_modules/hasown/CHANGELOG.md diff --git a/www/node_modules/hasown/LICENSE b/www2/node_modules/hasown/LICENSE similarity index 100% rename from www/node_modules/hasown/LICENSE rename to www2/node_modules/hasown/LICENSE diff --git a/www/node_modules/hasown/README.md b/www2/node_modules/hasown/README.md similarity index 100% rename from www/node_modules/hasown/README.md rename to www2/node_modules/hasown/README.md diff --git a/www/node_modules/hasown/index.d.ts b/www2/node_modules/hasown/index.d.ts similarity index 100% rename from www/node_modules/hasown/index.d.ts rename to www2/node_modules/hasown/index.d.ts diff --git a/www/node_modules/hasown/index.js b/www2/node_modules/hasown/index.js similarity index 100% rename from www/node_modules/hasown/index.js rename to www2/node_modules/hasown/index.js diff --git a/www/node_modules/hasown/package.json b/www2/node_modules/hasown/package.json similarity index 100% rename from www/node_modules/hasown/package.json rename to www2/node_modules/hasown/package.json diff --git a/www/node_modules/hasown/tsconfig.json b/www2/node_modules/hasown/tsconfig.json similarity index 100% rename from www/node_modules/hasown/tsconfig.json rename to www2/node_modules/hasown/tsconfig.json diff --git a/www/node_modules/http-errors/HISTORY.md b/www2/node_modules/http-errors/HISTORY.md similarity index 100% rename from www/node_modules/http-errors/HISTORY.md rename to www2/node_modules/http-errors/HISTORY.md diff --git a/www/node_modules/http-errors/LICENSE b/www2/node_modules/http-errors/LICENSE similarity index 100% rename from www/node_modules/http-errors/LICENSE rename to www2/node_modules/http-errors/LICENSE diff --git a/www/node_modules/http-errors/README.md b/www2/node_modules/http-errors/README.md similarity index 100% rename from www/node_modules/http-errors/README.md rename to www2/node_modules/http-errors/README.md diff --git a/www/node_modules/http-errors/index.js b/www2/node_modules/http-errors/index.js similarity index 100% rename from www/node_modules/http-errors/index.js rename to www2/node_modules/http-errors/index.js diff --git a/www/node_modules/http-errors/package.json b/www2/node_modules/http-errors/package.json similarity index 100% rename from www/node_modules/http-errors/package.json rename to www2/node_modules/http-errors/package.json diff --git a/www/node_modules/iconv-lite/Changelog.md b/www2/node_modules/iconv-lite/Changelog.md similarity index 100% rename from www/node_modules/iconv-lite/Changelog.md rename to www2/node_modules/iconv-lite/Changelog.md diff --git a/www/node_modules/iconv-lite/LICENSE b/www2/node_modules/iconv-lite/LICENSE similarity index 100% rename from www/node_modules/iconv-lite/LICENSE rename to www2/node_modules/iconv-lite/LICENSE diff --git a/www/node_modules/iconv-lite/README.md b/www2/node_modules/iconv-lite/README.md similarity index 100% rename from www/node_modules/iconv-lite/README.md rename to www2/node_modules/iconv-lite/README.md diff --git a/www/node_modules/iconv-lite/encodings/dbcs-codec.js b/www2/node_modules/iconv-lite/encodings/dbcs-codec.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/dbcs-codec.js rename to www2/node_modules/iconv-lite/encodings/dbcs-codec.js diff --git a/www/node_modules/iconv-lite/encodings/dbcs-data.js b/www2/node_modules/iconv-lite/encodings/dbcs-data.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/dbcs-data.js rename to www2/node_modules/iconv-lite/encodings/dbcs-data.js diff --git a/www/node_modules/iconv-lite/encodings/index.js b/www2/node_modules/iconv-lite/encodings/index.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/index.js rename to www2/node_modules/iconv-lite/encodings/index.js diff --git a/www/node_modules/iconv-lite/encodings/internal.js b/www2/node_modules/iconv-lite/encodings/internal.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/internal.js rename to www2/node_modules/iconv-lite/encodings/internal.js diff --git a/www/node_modules/iconv-lite/encodings/sbcs-codec.js b/www2/node_modules/iconv-lite/encodings/sbcs-codec.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/sbcs-codec.js rename to www2/node_modules/iconv-lite/encodings/sbcs-codec.js diff --git a/www/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/www2/node_modules/iconv-lite/encodings/sbcs-data-generated.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/sbcs-data-generated.js rename to www2/node_modules/iconv-lite/encodings/sbcs-data-generated.js diff --git a/www/node_modules/iconv-lite/encodings/sbcs-data.js b/www2/node_modules/iconv-lite/encodings/sbcs-data.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/sbcs-data.js rename to www2/node_modules/iconv-lite/encodings/sbcs-data.js diff --git a/www/node_modules/iconv-lite/encodings/tables/big5-added.json b/www2/node_modules/iconv-lite/encodings/tables/big5-added.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/big5-added.json rename to www2/node_modules/iconv-lite/encodings/tables/big5-added.json diff --git a/www/node_modules/iconv-lite/encodings/tables/cp936.json b/www2/node_modules/iconv-lite/encodings/tables/cp936.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/cp936.json rename to www2/node_modules/iconv-lite/encodings/tables/cp936.json diff --git a/www/node_modules/iconv-lite/encodings/tables/cp949.json b/www2/node_modules/iconv-lite/encodings/tables/cp949.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/cp949.json rename to www2/node_modules/iconv-lite/encodings/tables/cp949.json diff --git a/www/node_modules/iconv-lite/encodings/tables/cp950.json b/www2/node_modules/iconv-lite/encodings/tables/cp950.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/cp950.json rename to www2/node_modules/iconv-lite/encodings/tables/cp950.json diff --git a/www/node_modules/iconv-lite/encodings/tables/eucjp.json b/www2/node_modules/iconv-lite/encodings/tables/eucjp.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/eucjp.json rename to www2/node_modules/iconv-lite/encodings/tables/eucjp.json diff --git a/www/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/www2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json rename to www2/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json diff --git a/www/node_modules/iconv-lite/encodings/tables/gbk-added.json b/www2/node_modules/iconv-lite/encodings/tables/gbk-added.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/gbk-added.json rename to www2/node_modules/iconv-lite/encodings/tables/gbk-added.json diff --git a/www/node_modules/iconv-lite/encodings/tables/shiftjis.json b/www2/node_modules/iconv-lite/encodings/tables/shiftjis.json similarity index 100% rename from www/node_modules/iconv-lite/encodings/tables/shiftjis.json rename to www2/node_modules/iconv-lite/encodings/tables/shiftjis.json diff --git a/www/node_modules/iconv-lite/encodings/utf16.js b/www2/node_modules/iconv-lite/encodings/utf16.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/utf16.js rename to www2/node_modules/iconv-lite/encodings/utf16.js diff --git a/www/node_modules/iconv-lite/encodings/utf7.js b/www2/node_modules/iconv-lite/encodings/utf7.js similarity index 100% rename from www/node_modules/iconv-lite/encodings/utf7.js rename to www2/node_modules/iconv-lite/encodings/utf7.js diff --git a/www/node_modules/iconv-lite/lib/bom-handling.js b/www2/node_modules/iconv-lite/lib/bom-handling.js similarity index 100% rename from www/node_modules/iconv-lite/lib/bom-handling.js rename to www2/node_modules/iconv-lite/lib/bom-handling.js diff --git a/www/node_modules/iconv-lite/lib/extend-node.js b/www2/node_modules/iconv-lite/lib/extend-node.js similarity index 100% rename from www/node_modules/iconv-lite/lib/extend-node.js rename to www2/node_modules/iconv-lite/lib/extend-node.js diff --git a/www/node_modules/iconv-lite/lib/index.d.ts b/www2/node_modules/iconv-lite/lib/index.d.ts similarity index 100% rename from www/node_modules/iconv-lite/lib/index.d.ts rename to www2/node_modules/iconv-lite/lib/index.d.ts diff --git a/www/node_modules/iconv-lite/lib/index.js b/www2/node_modules/iconv-lite/lib/index.js similarity index 100% rename from www/node_modules/iconv-lite/lib/index.js rename to www2/node_modules/iconv-lite/lib/index.js diff --git a/www/node_modules/iconv-lite/lib/streams.js b/www2/node_modules/iconv-lite/lib/streams.js similarity index 100% rename from www/node_modules/iconv-lite/lib/streams.js rename to www2/node_modules/iconv-lite/lib/streams.js diff --git a/www/node_modules/iconv-lite/package.json b/www2/node_modules/iconv-lite/package.json similarity index 100% rename from www/node_modules/iconv-lite/package.json rename to www2/node_modules/iconv-lite/package.json diff --git a/www/node_modules/inherits/LICENSE b/www2/node_modules/inherits/LICENSE similarity index 100% rename from www/node_modules/inherits/LICENSE rename to www2/node_modules/inherits/LICENSE diff --git a/www/node_modules/inherits/README.md b/www2/node_modules/inherits/README.md similarity index 100% rename from www/node_modules/inherits/README.md rename to www2/node_modules/inherits/README.md diff --git a/www/node_modules/inherits/inherits.js b/www2/node_modules/inherits/inherits.js similarity index 100% rename from www/node_modules/inherits/inherits.js rename to www2/node_modules/inherits/inherits.js diff --git a/www/node_modules/inherits/inherits_browser.js b/www2/node_modules/inherits/inherits_browser.js similarity index 100% rename from www/node_modules/inherits/inherits_browser.js rename to www2/node_modules/inherits/inherits_browser.js diff --git a/www/node_modules/inherits/package.json b/www2/node_modules/inherits/package.json similarity index 100% rename from www/node_modules/inherits/package.json rename to www2/node_modules/inherits/package.json diff --git a/www/node_modules/ipaddr.js/LICENSE b/www2/node_modules/ipaddr.js/LICENSE similarity index 100% rename from www/node_modules/ipaddr.js/LICENSE rename to www2/node_modules/ipaddr.js/LICENSE diff --git a/www/node_modules/ipaddr.js/README.md b/www2/node_modules/ipaddr.js/README.md similarity index 100% rename from www/node_modules/ipaddr.js/README.md rename to www2/node_modules/ipaddr.js/README.md diff --git a/www/node_modules/ipaddr.js/ipaddr.min.js b/www2/node_modules/ipaddr.js/ipaddr.min.js similarity index 100% rename from www/node_modules/ipaddr.js/ipaddr.min.js rename to www2/node_modules/ipaddr.js/ipaddr.min.js diff --git a/www/node_modules/ipaddr.js/lib/ipaddr.js b/www2/node_modules/ipaddr.js/lib/ipaddr.js similarity index 100% rename from www/node_modules/ipaddr.js/lib/ipaddr.js rename to www2/node_modules/ipaddr.js/lib/ipaddr.js diff --git a/www/node_modules/ipaddr.js/lib/ipaddr.js.d.ts b/www2/node_modules/ipaddr.js/lib/ipaddr.js.d.ts similarity index 100% rename from www/node_modules/ipaddr.js/lib/ipaddr.js.d.ts rename to www2/node_modules/ipaddr.js/lib/ipaddr.js.d.ts diff --git a/www/node_modules/ipaddr.js/package.json b/www2/node_modules/ipaddr.js/package.json similarity index 100% rename from www/node_modules/ipaddr.js/package.json rename to www2/node_modules/ipaddr.js/package.json diff --git a/www/node_modules/isarray/.npmignore b/www2/node_modules/isarray/.npmignore similarity index 100% rename from www/node_modules/isarray/.npmignore rename to www2/node_modules/isarray/.npmignore diff --git a/www/node_modules/isarray/.travis.yml b/www2/node_modules/isarray/.travis.yml similarity index 100% rename from www/node_modules/isarray/.travis.yml rename to www2/node_modules/isarray/.travis.yml diff --git a/www/node_modules/isarray/Makefile b/www2/node_modules/isarray/Makefile similarity index 100% rename from www/node_modules/isarray/Makefile rename to www2/node_modules/isarray/Makefile diff --git a/www/node_modules/isarray/README.md b/www2/node_modules/isarray/README.md similarity index 100% rename from www/node_modules/isarray/README.md rename to www2/node_modules/isarray/README.md diff --git a/www/node_modules/isarray/component.json b/www2/node_modules/isarray/component.json similarity index 100% rename from www/node_modules/isarray/component.json rename to www2/node_modules/isarray/component.json diff --git a/www/node_modules/isarray/index.js b/www2/node_modules/isarray/index.js similarity index 100% rename from www/node_modules/isarray/index.js rename to www2/node_modules/isarray/index.js diff --git a/www/node_modules/isarray/package.json b/www2/node_modules/isarray/package.json similarity index 100% rename from www/node_modules/isarray/package.json rename to www2/node_modules/isarray/package.json diff --git a/www/node_modules/isarray/test.js b/www2/node_modules/isarray/test.js similarity index 100% rename from www/node_modules/isarray/test.js rename to www2/node_modules/isarray/test.js diff --git a/www/node_modules/media-typer/HISTORY.md b/www2/node_modules/media-typer/HISTORY.md similarity index 100% rename from www/node_modules/media-typer/HISTORY.md rename to www2/node_modules/media-typer/HISTORY.md diff --git a/www/node_modules/media-typer/LICENSE b/www2/node_modules/media-typer/LICENSE similarity index 100% rename from www/node_modules/media-typer/LICENSE rename to www2/node_modules/media-typer/LICENSE diff --git a/www/node_modules/media-typer/README.md b/www2/node_modules/media-typer/README.md similarity index 100% rename from www/node_modules/media-typer/README.md rename to www2/node_modules/media-typer/README.md diff --git a/www/node_modules/media-typer/index.js b/www2/node_modules/media-typer/index.js similarity index 100% rename from www/node_modules/media-typer/index.js rename to www2/node_modules/media-typer/index.js diff --git a/www/node_modules/media-typer/package.json b/www2/node_modules/media-typer/package.json similarity index 100% rename from www/node_modules/media-typer/package.json rename to www2/node_modules/media-typer/package.json diff --git a/www/node_modules/merge-descriptors/HISTORY.md b/www2/node_modules/merge-descriptors/HISTORY.md similarity index 100% rename from www/node_modules/merge-descriptors/HISTORY.md rename to www2/node_modules/merge-descriptors/HISTORY.md diff --git a/www/node_modules/merge-descriptors/LICENSE b/www2/node_modules/merge-descriptors/LICENSE similarity index 100% rename from www/node_modules/merge-descriptors/LICENSE rename to www2/node_modules/merge-descriptors/LICENSE diff --git a/www/node_modules/merge-descriptors/README.md b/www2/node_modules/merge-descriptors/README.md similarity index 100% rename from www/node_modules/merge-descriptors/README.md rename to www2/node_modules/merge-descriptors/README.md diff --git a/www/node_modules/merge-descriptors/index.js b/www2/node_modules/merge-descriptors/index.js similarity index 100% rename from www/node_modules/merge-descriptors/index.js rename to www2/node_modules/merge-descriptors/index.js diff --git a/www/node_modules/merge-descriptors/package.json b/www2/node_modules/merge-descriptors/package.json similarity index 100% rename from www/node_modules/merge-descriptors/package.json rename to www2/node_modules/merge-descriptors/package.json diff --git a/www/node_modules/methods/HISTORY.md b/www2/node_modules/methods/HISTORY.md similarity index 100% rename from www/node_modules/methods/HISTORY.md rename to www2/node_modules/methods/HISTORY.md diff --git a/www/node_modules/methods/LICENSE b/www2/node_modules/methods/LICENSE similarity index 100% rename from www/node_modules/methods/LICENSE rename to www2/node_modules/methods/LICENSE diff --git a/www/node_modules/methods/README.md b/www2/node_modules/methods/README.md similarity index 100% rename from www/node_modules/methods/README.md rename to www2/node_modules/methods/README.md diff --git a/www/node_modules/methods/index.js b/www2/node_modules/methods/index.js similarity index 100% rename from www/node_modules/methods/index.js rename to www2/node_modules/methods/index.js diff --git a/www/node_modules/methods/package.json b/www2/node_modules/methods/package.json similarity index 100% rename from www/node_modules/methods/package.json rename to www2/node_modules/methods/package.json diff --git a/www/node_modules/mime-db/HISTORY.md b/www2/node_modules/mime-db/HISTORY.md similarity index 100% rename from www/node_modules/mime-db/HISTORY.md rename to www2/node_modules/mime-db/HISTORY.md diff --git a/www/node_modules/mime-db/LICENSE b/www2/node_modules/mime-db/LICENSE similarity index 100% rename from www/node_modules/mime-db/LICENSE rename to www2/node_modules/mime-db/LICENSE diff --git a/www/node_modules/mime-db/README.md b/www2/node_modules/mime-db/README.md similarity index 100% rename from www/node_modules/mime-db/README.md rename to www2/node_modules/mime-db/README.md diff --git a/www/node_modules/mime-db/db.json b/www2/node_modules/mime-db/db.json similarity index 100% rename from www/node_modules/mime-db/db.json rename to www2/node_modules/mime-db/db.json diff --git a/www/node_modules/mime-db/index.js b/www2/node_modules/mime-db/index.js similarity index 100% rename from www/node_modules/mime-db/index.js rename to www2/node_modules/mime-db/index.js diff --git a/www/node_modules/mime-db/package.json b/www2/node_modules/mime-db/package.json similarity index 100% rename from www/node_modules/mime-db/package.json rename to www2/node_modules/mime-db/package.json diff --git a/www/node_modules/mime-types/HISTORY.md b/www2/node_modules/mime-types/HISTORY.md similarity index 100% rename from www/node_modules/mime-types/HISTORY.md rename to www2/node_modules/mime-types/HISTORY.md diff --git a/www/node_modules/mime-types/LICENSE b/www2/node_modules/mime-types/LICENSE similarity index 100% rename from www/node_modules/mime-types/LICENSE rename to www2/node_modules/mime-types/LICENSE diff --git a/www/node_modules/mime-types/README.md b/www2/node_modules/mime-types/README.md similarity index 100% rename from www/node_modules/mime-types/README.md rename to www2/node_modules/mime-types/README.md diff --git a/www/node_modules/mime-types/index.js b/www2/node_modules/mime-types/index.js similarity index 100% rename from www/node_modules/mime-types/index.js rename to www2/node_modules/mime-types/index.js diff --git a/www/node_modules/mime-types/package.json b/www2/node_modules/mime-types/package.json similarity index 100% rename from www/node_modules/mime-types/package.json rename to www2/node_modules/mime-types/package.json diff --git a/www/node_modules/mime/.npmignore b/www2/node_modules/mime/.npmignore similarity index 100% rename from www/node_modules/mime/.npmignore rename to www2/node_modules/mime/.npmignore diff --git a/www/node_modules/mime/CHANGELOG.md b/www2/node_modules/mime/CHANGELOG.md similarity index 100% rename from www/node_modules/mime/CHANGELOG.md rename to www2/node_modules/mime/CHANGELOG.md diff --git a/www/node_modules/mime/LICENSE b/www2/node_modules/mime/LICENSE similarity index 100% rename from www/node_modules/mime/LICENSE rename to www2/node_modules/mime/LICENSE diff --git a/www/node_modules/mime/README.md b/www2/node_modules/mime/README.md similarity index 100% rename from www/node_modules/mime/README.md rename to www2/node_modules/mime/README.md diff --git a/www/node_modules/mime/cli.js b/www2/node_modules/mime/cli.js similarity index 100% rename from www/node_modules/mime/cli.js rename to www2/node_modules/mime/cli.js diff --git a/www/node_modules/mime/mime.js b/www2/node_modules/mime/mime.js similarity index 100% rename from www/node_modules/mime/mime.js rename to www2/node_modules/mime/mime.js diff --git a/www/node_modules/mime/package.json b/www2/node_modules/mime/package.json similarity index 100% rename from www/node_modules/mime/package.json rename to www2/node_modules/mime/package.json diff --git a/www/node_modules/mime/src/build.js b/www2/node_modules/mime/src/build.js similarity index 100% rename from www/node_modules/mime/src/build.js rename to www2/node_modules/mime/src/build.js diff --git a/www/node_modules/mime/src/test.js b/www2/node_modules/mime/src/test.js similarity index 100% rename from www/node_modules/mime/src/test.js rename to www2/node_modules/mime/src/test.js diff --git a/www/node_modules/mime/types.json b/www2/node_modules/mime/types.json similarity index 100% rename from www/node_modules/mime/types.json rename to www2/node_modules/mime/types.json diff --git a/www/node_modules/minimist/.eslintrc b/www2/node_modules/minimist/.eslintrc similarity index 100% rename from www/node_modules/minimist/.eslintrc rename to www2/node_modules/minimist/.eslintrc diff --git a/www/node_modules/minimist/.github/FUNDING.yml b/www2/node_modules/minimist/.github/FUNDING.yml similarity index 100% rename from www/node_modules/minimist/.github/FUNDING.yml rename to www2/node_modules/minimist/.github/FUNDING.yml diff --git a/www/node_modules/minimist/.nycrc b/www2/node_modules/minimist/.nycrc similarity index 100% rename from www/node_modules/minimist/.nycrc rename to www2/node_modules/minimist/.nycrc diff --git a/www/node_modules/minimist/CHANGELOG.md b/www2/node_modules/minimist/CHANGELOG.md similarity index 100% rename from www/node_modules/minimist/CHANGELOG.md rename to www2/node_modules/minimist/CHANGELOG.md diff --git a/www/node_modules/minimist/LICENSE b/www2/node_modules/minimist/LICENSE similarity index 100% rename from www/node_modules/minimist/LICENSE rename to www2/node_modules/minimist/LICENSE diff --git a/www/node_modules/minimist/README.md b/www2/node_modules/minimist/README.md similarity index 100% rename from www/node_modules/minimist/README.md rename to www2/node_modules/minimist/README.md diff --git a/www/node_modules/minimist/example/parse.js b/www2/node_modules/minimist/example/parse.js similarity index 100% rename from www/node_modules/minimist/example/parse.js rename to www2/node_modules/minimist/example/parse.js diff --git a/www/node_modules/minimist/index.js b/www2/node_modules/minimist/index.js similarity index 100% rename from www/node_modules/minimist/index.js rename to www2/node_modules/minimist/index.js diff --git a/www/node_modules/minimist/package.json b/www2/node_modules/minimist/package.json similarity index 100% rename from www/node_modules/minimist/package.json rename to www2/node_modules/minimist/package.json diff --git a/www/node_modules/minimist/test/all_bool.js b/www2/node_modules/minimist/test/all_bool.js similarity index 100% rename from www/node_modules/minimist/test/all_bool.js rename to www2/node_modules/minimist/test/all_bool.js diff --git a/www/node_modules/minimist/test/bool.js b/www2/node_modules/minimist/test/bool.js similarity index 100% rename from www/node_modules/minimist/test/bool.js rename to www2/node_modules/minimist/test/bool.js diff --git a/www/node_modules/minimist/test/dash.js b/www2/node_modules/minimist/test/dash.js similarity index 100% rename from www/node_modules/minimist/test/dash.js rename to www2/node_modules/minimist/test/dash.js diff --git a/www/node_modules/minimist/test/default_bool.js b/www2/node_modules/minimist/test/default_bool.js similarity index 100% rename from www/node_modules/minimist/test/default_bool.js rename to www2/node_modules/minimist/test/default_bool.js diff --git a/www/node_modules/minimist/test/dotted.js b/www2/node_modules/minimist/test/dotted.js similarity index 100% rename from www/node_modules/minimist/test/dotted.js rename to www2/node_modules/minimist/test/dotted.js diff --git a/www/node_modules/minimist/test/kv_short.js b/www2/node_modules/minimist/test/kv_short.js similarity index 100% rename from www/node_modules/minimist/test/kv_short.js rename to www2/node_modules/minimist/test/kv_short.js diff --git a/www/node_modules/minimist/test/long.js b/www2/node_modules/minimist/test/long.js similarity index 100% rename from www/node_modules/minimist/test/long.js rename to www2/node_modules/minimist/test/long.js diff --git a/www/node_modules/minimist/test/num.js b/www2/node_modules/minimist/test/num.js similarity index 100% rename from www/node_modules/minimist/test/num.js rename to www2/node_modules/minimist/test/num.js diff --git a/www/node_modules/minimist/test/parse.js b/www2/node_modules/minimist/test/parse.js similarity index 100% rename from www/node_modules/minimist/test/parse.js rename to www2/node_modules/minimist/test/parse.js diff --git a/www/node_modules/minimist/test/parse_modified.js b/www2/node_modules/minimist/test/parse_modified.js similarity index 100% rename from www/node_modules/minimist/test/parse_modified.js rename to www2/node_modules/minimist/test/parse_modified.js diff --git a/www/node_modules/minimist/test/proto.js b/www2/node_modules/minimist/test/proto.js similarity index 100% rename from www/node_modules/minimist/test/proto.js rename to www2/node_modules/minimist/test/proto.js diff --git a/www/node_modules/minimist/test/short.js b/www2/node_modules/minimist/test/short.js similarity index 100% rename from www/node_modules/minimist/test/short.js rename to www2/node_modules/minimist/test/short.js diff --git a/www/node_modules/minimist/test/stop_early.js b/www2/node_modules/minimist/test/stop_early.js similarity index 100% rename from www/node_modules/minimist/test/stop_early.js rename to www2/node_modules/minimist/test/stop_early.js diff --git a/www/node_modules/minimist/test/unknown.js b/www2/node_modules/minimist/test/unknown.js similarity index 100% rename from www/node_modules/minimist/test/unknown.js rename to www2/node_modules/minimist/test/unknown.js diff --git a/www/node_modules/minimist/test/whitespace.js b/www2/node_modules/minimist/test/whitespace.js similarity index 100% rename from www/node_modules/minimist/test/whitespace.js rename to www2/node_modules/minimist/test/whitespace.js diff --git a/www/node_modules/mkdirp/LICENSE b/www2/node_modules/mkdirp/LICENSE similarity index 100% rename from www/node_modules/mkdirp/LICENSE rename to www2/node_modules/mkdirp/LICENSE diff --git a/www/node_modules/mkdirp/bin/cmd.js b/www2/node_modules/mkdirp/bin/cmd.js similarity index 100% rename from www/node_modules/mkdirp/bin/cmd.js rename to www2/node_modules/mkdirp/bin/cmd.js diff --git a/www/node_modules/mkdirp/bin/usage.txt b/www2/node_modules/mkdirp/bin/usage.txt similarity index 100% rename from www/node_modules/mkdirp/bin/usage.txt rename to www2/node_modules/mkdirp/bin/usage.txt diff --git a/www/node_modules/mkdirp/index.js b/www2/node_modules/mkdirp/index.js similarity index 100% rename from www/node_modules/mkdirp/index.js rename to www2/node_modules/mkdirp/index.js diff --git a/www/node_modules/mkdirp/package.json b/www2/node_modules/mkdirp/package.json similarity index 100% rename from www/node_modules/mkdirp/package.json rename to www2/node_modules/mkdirp/package.json diff --git a/www/node_modules/mkdirp/readme.markdown b/www2/node_modules/mkdirp/readme.markdown similarity index 100% rename from www/node_modules/mkdirp/readme.markdown rename to www2/node_modules/mkdirp/readme.markdown diff --git a/www/node_modules/ms/index.js b/www2/node_modules/ms/index.js similarity index 100% rename from www/node_modules/ms/index.js rename to www2/node_modules/ms/index.js diff --git a/www/node_modules/ms/license.md b/www2/node_modules/ms/license.md similarity index 100% rename from www/node_modules/ms/license.md rename to www2/node_modules/ms/license.md diff --git a/www/node_modules/ms/package.json b/www2/node_modules/ms/package.json similarity index 100% rename from www/node_modules/ms/package.json rename to www2/node_modules/ms/package.json diff --git a/www/node_modules/ms/readme.md b/www2/node_modules/ms/readme.md similarity index 100% rename from www/node_modules/ms/readme.md rename to www2/node_modules/ms/readme.md diff --git a/www/node_modules/multer/LICENSE b/www2/node_modules/multer/LICENSE similarity index 100% rename from www/node_modules/multer/LICENSE rename to www2/node_modules/multer/LICENSE diff --git a/www/node_modules/multer/README.md b/www2/node_modules/multer/README.md similarity index 100% rename from www/node_modules/multer/README.md rename to www2/node_modules/multer/README.md diff --git a/www/node_modules/multer/index.js b/www2/node_modules/multer/index.js similarity index 100% rename from www/node_modules/multer/index.js rename to www2/node_modules/multer/index.js diff --git a/www/node_modules/multer/lib/counter.js b/www2/node_modules/multer/lib/counter.js similarity index 100% rename from www/node_modules/multer/lib/counter.js rename to www2/node_modules/multer/lib/counter.js diff --git a/www/node_modules/multer/lib/file-appender.js b/www2/node_modules/multer/lib/file-appender.js similarity index 100% rename from www/node_modules/multer/lib/file-appender.js rename to www2/node_modules/multer/lib/file-appender.js diff --git a/www/node_modules/multer/lib/make-middleware.js b/www2/node_modules/multer/lib/make-middleware.js similarity index 100% rename from www/node_modules/multer/lib/make-middleware.js rename to www2/node_modules/multer/lib/make-middleware.js diff --git a/www/node_modules/multer/lib/multer-error.js b/www2/node_modules/multer/lib/multer-error.js similarity index 100% rename from www/node_modules/multer/lib/multer-error.js rename to www2/node_modules/multer/lib/multer-error.js diff --git a/www/node_modules/multer/lib/remove-uploaded-files.js b/www2/node_modules/multer/lib/remove-uploaded-files.js similarity index 100% rename from www/node_modules/multer/lib/remove-uploaded-files.js rename to www2/node_modules/multer/lib/remove-uploaded-files.js diff --git a/www/node_modules/multer/package.json b/www2/node_modules/multer/package.json similarity index 100% rename from www/node_modules/multer/package.json rename to www2/node_modules/multer/package.json diff --git a/www/node_modules/multer/storage/disk.js b/www2/node_modules/multer/storage/disk.js similarity index 100% rename from www/node_modules/multer/storage/disk.js rename to www2/node_modules/multer/storage/disk.js diff --git a/www/node_modules/multer/storage/memory.js b/www2/node_modules/multer/storage/memory.js similarity index 100% rename from www/node_modules/multer/storage/memory.js rename to www2/node_modules/multer/storage/memory.js diff --git a/www/node_modules/mysql/Changes.md b/www2/node_modules/mysql/Changes.md similarity index 100% rename from www/node_modules/mysql/Changes.md rename to www2/node_modules/mysql/Changes.md diff --git a/www/node_modules/mysql/License b/www2/node_modules/mysql/License similarity index 100% rename from www/node_modules/mysql/License rename to www2/node_modules/mysql/License diff --git a/www/node_modules/mysql/Readme.md b/www2/node_modules/mysql/Readme.md similarity index 100% rename from www/node_modules/mysql/Readme.md rename to www2/node_modules/mysql/Readme.md diff --git a/www/node_modules/mysql/index.js b/www2/node_modules/mysql/index.js similarity index 100% rename from www/node_modules/mysql/index.js rename to www2/node_modules/mysql/index.js diff --git a/www/node_modules/mysql/lib/Connection.js b/www2/node_modules/mysql/lib/Connection.js similarity index 100% rename from www/node_modules/mysql/lib/Connection.js rename to www2/node_modules/mysql/lib/Connection.js diff --git a/www/node_modules/mysql/lib/ConnectionConfig.js b/www2/node_modules/mysql/lib/ConnectionConfig.js similarity index 100% rename from www/node_modules/mysql/lib/ConnectionConfig.js rename to www2/node_modules/mysql/lib/ConnectionConfig.js diff --git a/www/node_modules/mysql/lib/Pool.js b/www2/node_modules/mysql/lib/Pool.js similarity index 100% rename from www/node_modules/mysql/lib/Pool.js rename to www2/node_modules/mysql/lib/Pool.js diff --git a/www/node_modules/mysql/lib/PoolCluster.js b/www2/node_modules/mysql/lib/PoolCluster.js similarity index 100% rename from www/node_modules/mysql/lib/PoolCluster.js rename to www2/node_modules/mysql/lib/PoolCluster.js diff --git a/www/node_modules/mysql/lib/PoolConfig.js b/www2/node_modules/mysql/lib/PoolConfig.js similarity index 100% rename from www/node_modules/mysql/lib/PoolConfig.js rename to www2/node_modules/mysql/lib/PoolConfig.js diff --git a/www/node_modules/mysql/lib/PoolConnection.js b/www2/node_modules/mysql/lib/PoolConnection.js similarity index 100% rename from www/node_modules/mysql/lib/PoolConnection.js rename to www2/node_modules/mysql/lib/PoolConnection.js diff --git a/www/node_modules/mysql/lib/PoolNamespace.js b/www2/node_modules/mysql/lib/PoolNamespace.js similarity index 100% rename from www/node_modules/mysql/lib/PoolNamespace.js rename to www2/node_modules/mysql/lib/PoolNamespace.js diff --git a/www/node_modules/mysql/lib/PoolSelector.js b/www2/node_modules/mysql/lib/PoolSelector.js similarity index 100% rename from www/node_modules/mysql/lib/PoolSelector.js rename to www2/node_modules/mysql/lib/PoolSelector.js diff --git a/www/node_modules/mysql/lib/protocol/Auth.js b/www2/node_modules/mysql/lib/protocol/Auth.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/Auth.js rename to www2/node_modules/mysql/lib/protocol/Auth.js diff --git a/www/node_modules/mysql/lib/protocol/BufferList.js b/www2/node_modules/mysql/lib/protocol/BufferList.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/BufferList.js rename to www2/node_modules/mysql/lib/protocol/BufferList.js diff --git a/www/node_modules/mysql/lib/protocol/PacketHeader.js b/www2/node_modules/mysql/lib/protocol/PacketHeader.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/PacketHeader.js rename to www2/node_modules/mysql/lib/protocol/PacketHeader.js diff --git a/www/node_modules/mysql/lib/protocol/PacketWriter.js b/www2/node_modules/mysql/lib/protocol/PacketWriter.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/PacketWriter.js rename to www2/node_modules/mysql/lib/protocol/PacketWriter.js diff --git a/www/node_modules/mysql/lib/protocol/Parser.js b/www2/node_modules/mysql/lib/protocol/Parser.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/Parser.js rename to www2/node_modules/mysql/lib/protocol/Parser.js diff --git a/www/node_modules/mysql/lib/protocol/Protocol.js b/www2/node_modules/mysql/lib/protocol/Protocol.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/Protocol.js rename to www2/node_modules/mysql/lib/protocol/Protocol.js diff --git a/www/node_modules/mysql/lib/protocol/ResultSet.js b/www2/node_modules/mysql/lib/protocol/ResultSet.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/ResultSet.js rename to www2/node_modules/mysql/lib/protocol/ResultSet.js diff --git a/www/node_modules/mysql/lib/protocol/SqlString.js b/www2/node_modules/mysql/lib/protocol/SqlString.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/SqlString.js rename to www2/node_modules/mysql/lib/protocol/SqlString.js diff --git a/www/node_modules/mysql/lib/protocol/Timer.js b/www2/node_modules/mysql/lib/protocol/Timer.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/Timer.js rename to www2/node_modules/mysql/lib/protocol/Timer.js diff --git a/www/node_modules/mysql/lib/protocol/constants/charsets.js b/www2/node_modules/mysql/lib/protocol/constants/charsets.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/charsets.js rename to www2/node_modules/mysql/lib/protocol/constants/charsets.js diff --git a/www/node_modules/mysql/lib/protocol/constants/client.js b/www2/node_modules/mysql/lib/protocol/constants/client.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/client.js rename to www2/node_modules/mysql/lib/protocol/constants/client.js diff --git a/www/node_modules/mysql/lib/protocol/constants/errors.js b/www2/node_modules/mysql/lib/protocol/constants/errors.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/errors.js rename to www2/node_modules/mysql/lib/protocol/constants/errors.js diff --git a/www/node_modules/mysql/lib/protocol/constants/field_flags.js b/www2/node_modules/mysql/lib/protocol/constants/field_flags.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/field_flags.js rename to www2/node_modules/mysql/lib/protocol/constants/field_flags.js diff --git a/www/node_modules/mysql/lib/protocol/constants/server_status.js b/www2/node_modules/mysql/lib/protocol/constants/server_status.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/server_status.js rename to www2/node_modules/mysql/lib/protocol/constants/server_status.js diff --git a/www/node_modules/mysql/lib/protocol/constants/ssl_profiles.js b/www2/node_modules/mysql/lib/protocol/constants/ssl_profiles.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/ssl_profiles.js rename to www2/node_modules/mysql/lib/protocol/constants/ssl_profiles.js diff --git a/www/node_modules/mysql/lib/protocol/constants/types.js b/www2/node_modules/mysql/lib/protocol/constants/types.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/constants/types.js rename to www2/node_modules/mysql/lib/protocol/constants/types.js diff --git a/www/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js b/www2/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/AuthSwitchRequestPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js b/www2/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js rename to www2/node_modules/mysql/lib/protocol/packets/AuthSwitchResponsePacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ClientAuthenticationPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ComChangeUserPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ComPingPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ComPingPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ComPingPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ComPingPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ComQueryPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ComQuitPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ComStatisticsPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/EmptyPacket.js b/www2/node_modules/mysql/lib/protocol/packets/EmptyPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/EmptyPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/EmptyPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/EofPacket.js b/www2/node_modules/mysql/lib/protocol/packets/EofPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/EofPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/EofPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ErrorPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ErrorPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ErrorPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ErrorPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/Field.js b/www2/node_modules/mysql/lib/protocol/packets/Field.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/Field.js rename to www2/node_modules/mysql/lib/protocol/packets/Field.js diff --git a/www/node_modules/mysql/lib/protocol/packets/FieldPacket.js b/www2/node_modules/mysql/lib/protocol/packets/FieldPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/FieldPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/FieldPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js b/www2/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/HandshakeInitializationPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js b/www2/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js rename to www2/node_modules/mysql/lib/protocol/packets/LocalDataFilePacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js b/www2/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/LocalInfileRequestPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/OkPacket.js b/www2/node_modules/mysql/lib/protocol/packets/OkPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/OkPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/OkPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js b/www2/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/OldPasswordPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js b/www2/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/ResultSetHeaderPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/RowDataPacket.js b/www2/node_modules/mysql/lib/protocol/packets/RowDataPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/RowDataPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/RowDataPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js b/www2/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/SSLRequestPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js b/www2/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/StatisticsPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js b/www2/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js rename to www2/node_modules/mysql/lib/protocol/packets/UseOldPasswordPacket.js diff --git a/www/node_modules/mysql/lib/protocol/packets/index.js b/www2/node_modules/mysql/lib/protocol/packets/index.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/packets/index.js rename to www2/node_modules/mysql/lib/protocol/packets/index.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/ChangeUser.js b/www2/node_modules/mysql/lib/protocol/sequences/ChangeUser.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/ChangeUser.js rename to www2/node_modules/mysql/lib/protocol/sequences/ChangeUser.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Handshake.js b/www2/node_modules/mysql/lib/protocol/sequences/Handshake.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Handshake.js rename to www2/node_modules/mysql/lib/protocol/sequences/Handshake.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Ping.js b/www2/node_modules/mysql/lib/protocol/sequences/Ping.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Ping.js rename to www2/node_modules/mysql/lib/protocol/sequences/Ping.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Query.js b/www2/node_modules/mysql/lib/protocol/sequences/Query.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Query.js rename to www2/node_modules/mysql/lib/protocol/sequences/Query.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Quit.js b/www2/node_modules/mysql/lib/protocol/sequences/Quit.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Quit.js rename to www2/node_modules/mysql/lib/protocol/sequences/Quit.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Sequence.js b/www2/node_modules/mysql/lib/protocol/sequences/Sequence.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Sequence.js rename to www2/node_modules/mysql/lib/protocol/sequences/Sequence.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/Statistics.js b/www2/node_modules/mysql/lib/protocol/sequences/Statistics.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/Statistics.js rename to www2/node_modules/mysql/lib/protocol/sequences/Statistics.js diff --git a/www/node_modules/mysql/lib/protocol/sequences/index.js b/www2/node_modules/mysql/lib/protocol/sequences/index.js similarity index 100% rename from www/node_modules/mysql/lib/protocol/sequences/index.js rename to www2/node_modules/mysql/lib/protocol/sequences/index.js diff --git a/www/node_modules/mysql/node_modules/safe-buffer/LICENSE b/www2/node_modules/mysql/node_modules/safe-buffer/LICENSE similarity index 100% rename from www/node_modules/mysql/node_modules/safe-buffer/LICENSE rename to www2/node_modules/mysql/node_modules/safe-buffer/LICENSE diff --git a/www/node_modules/mysql/node_modules/safe-buffer/README.md b/www2/node_modules/mysql/node_modules/safe-buffer/README.md similarity index 100% rename from www/node_modules/mysql/node_modules/safe-buffer/README.md rename to www2/node_modules/mysql/node_modules/safe-buffer/README.md diff --git a/www/node_modules/mysql/node_modules/safe-buffer/index.d.ts b/www2/node_modules/mysql/node_modules/safe-buffer/index.d.ts similarity index 100% rename from www/node_modules/mysql/node_modules/safe-buffer/index.d.ts rename to www2/node_modules/mysql/node_modules/safe-buffer/index.d.ts diff --git a/www/node_modules/mysql/node_modules/safe-buffer/index.js b/www2/node_modules/mysql/node_modules/safe-buffer/index.js similarity index 100% rename from www/node_modules/mysql/node_modules/safe-buffer/index.js rename to www2/node_modules/mysql/node_modules/safe-buffer/index.js diff --git a/www/node_modules/mysql/node_modules/safe-buffer/package.json b/www2/node_modules/mysql/node_modules/safe-buffer/package.json similarity index 100% rename from www/node_modules/mysql/node_modules/safe-buffer/package.json rename to www2/node_modules/mysql/node_modules/safe-buffer/package.json diff --git a/www/node_modules/mysql/package.json b/www2/node_modules/mysql/package.json similarity index 100% rename from www/node_modules/mysql/package.json rename to www2/node_modules/mysql/package.json diff --git a/www/node_modules/negotiator/HISTORY.md b/www2/node_modules/negotiator/HISTORY.md similarity index 100% rename from www/node_modules/negotiator/HISTORY.md rename to www2/node_modules/negotiator/HISTORY.md diff --git a/www/node_modules/negotiator/LICENSE b/www2/node_modules/negotiator/LICENSE similarity index 100% rename from www/node_modules/negotiator/LICENSE rename to www2/node_modules/negotiator/LICENSE diff --git a/www/node_modules/negotiator/README.md b/www2/node_modules/negotiator/README.md similarity index 100% rename from www/node_modules/negotiator/README.md rename to www2/node_modules/negotiator/README.md diff --git a/www/node_modules/negotiator/index.js b/www2/node_modules/negotiator/index.js similarity index 100% rename from www/node_modules/negotiator/index.js rename to www2/node_modules/negotiator/index.js diff --git a/www/node_modules/negotiator/lib/charset.js b/www2/node_modules/negotiator/lib/charset.js similarity index 100% rename from www/node_modules/negotiator/lib/charset.js rename to www2/node_modules/negotiator/lib/charset.js diff --git a/www/node_modules/negotiator/lib/encoding.js b/www2/node_modules/negotiator/lib/encoding.js similarity index 100% rename from www/node_modules/negotiator/lib/encoding.js rename to www2/node_modules/negotiator/lib/encoding.js diff --git a/www/node_modules/negotiator/lib/language.js b/www2/node_modules/negotiator/lib/language.js similarity index 100% rename from www/node_modules/negotiator/lib/language.js rename to www2/node_modules/negotiator/lib/language.js diff --git a/www/node_modules/negotiator/lib/mediaType.js b/www2/node_modules/negotiator/lib/mediaType.js similarity index 100% rename from www/node_modules/negotiator/lib/mediaType.js rename to www2/node_modules/negotiator/lib/mediaType.js diff --git a/www/node_modules/negotiator/package.json b/www2/node_modules/negotiator/package.json similarity index 100% rename from www/node_modules/negotiator/package.json rename to www2/node_modules/negotiator/package.json diff --git a/www/node_modules/object-assign/index.js b/www2/node_modules/object-assign/index.js similarity index 100% rename from www/node_modules/object-assign/index.js rename to www2/node_modules/object-assign/index.js diff --git a/www/node_modules/object-assign/license b/www2/node_modules/object-assign/license similarity index 100% rename from www/node_modules/object-assign/license rename to www2/node_modules/object-assign/license diff --git a/www/node_modules/object-assign/package.json b/www2/node_modules/object-assign/package.json similarity index 100% rename from www/node_modules/object-assign/package.json rename to www2/node_modules/object-assign/package.json diff --git a/www/node_modules/object-assign/readme.md b/www2/node_modules/object-assign/readme.md similarity index 100% rename from www/node_modules/object-assign/readme.md rename to www2/node_modules/object-assign/readme.md diff --git a/www/node_modules/object-inspect/.eslintrc b/www2/node_modules/object-inspect/.eslintrc similarity index 100% rename from www/node_modules/object-inspect/.eslintrc rename to www2/node_modules/object-inspect/.eslintrc diff --git a/www/node_modules/object-inspect/.github/FUNDING.yml b/www2/node_modules/object-inspect/.github/FUNDING.yml similarity index 100% rename from www/node_modules/object-inspect/.github/FUNDING.yml rename to www2/node_modules/object-inspect/.github/FUNDING.yml diff --git a/www/node_modules/object-inspect/.nycrc b/www2/node_modules/object-inspect/.nycrc similarity index 100% rename from www/node_modules/object-inspect/.nycrc rename to www2/node_modules/object-inspect/.nycrc diff --git a/www/node_modules/object-inspect/CHANGELOG.md b/www2/node_modules/object-inspect/CHANGELOG.md similarity index 100% rename from www/node_modules/object-inspect/CHANGELOG.md rename to www2/node_modules/object-inspect/CHANGELOG.md diff --git a/www/node_modules/object-inspect/LICENSE b/www2/node_modules/object-inspect/LICENSE similarity index 100% rename from www/node_modules/object-inspect/LICENSE rename to www2/node_modules/object-inspect/LICENSE diff --git a/www/node_modules/object-inspect/example/all.js b/www2/node_modules/object-inspect/example/all.js similarity index 100% rename from www/node_modules/object-inspect/example/all.js rename to www2/node_modules/object-inspect/example/all.js diff --git a/www/node_modules/object-inspect/example/circular.js b/www2/node_modules/object-inspect/example/circular.js similarity index 100% rename from www/node_modules/object-inspect/example/circular.js rename to www2/node_modules/object-inspect/example/circular.js diff --git a/www/node_modules/object-inspect/example/fn.js b/www2/node_modules/object-inspect/example/fn.js similarity index 100% rename from www/node_modules/object-inspect/example/fn.js rename to www2/node_modules/object-inspect/example/fn.js diff --git a/www/node_modules/object-inspect/example/inspect.js b/www2/node_modules/object-inspect/example/inspect.js similarity index 100% rename from www/node_modules/object-inspect/example/inspect.js rename to www2/node_modules/object-inspect/example/inspect.js diff --git a/www/node_modules/object-inspect/index.js b/www2/node_modules/object-inspect/index.js similarity index 100% rename from www/node_modules/object-inspect/index.js rename to www2/node_modules/object-inspect/index.js diff --git a/www/node_modules/object-inspect/package-support.json b/www2/node_modules/object-inspect/package-support.json similarity index 100% rename from www/node_modules/object-inspect/package-support.json rename to www2/node_modules/object-inspect/package-support.json diff --git a/www/node_modules/object-inspect/package.json b/www2/node_modules/object-inspect/package.json similarity index 100% rename from www/node_modules/object-inspect/package.json rename to www2/node_modules/object-inspect/package.json diff --git a/www/node_modules/object-inspect/readme.markdown b/www2/node_modules/object-inspect/readme.markdown similarity index 100% rename from www/node_modules/object-inspect/readme.markdown rename to www2/node_modules/object-inspect/readme.markdown diff --git a/www/node_modules/object-inspect/test-core-js.js b/www2/node_modules/object-inspect/test-core-js.js similarity index 100% rename from www/node_modules/object-inspect/test-core-js.js rename to www2/node_modules/object-inspect/test-core-js.js diff --git a/www/node_modules/object-inspect/test/bigint.js b/www2/node_modules/object-inspect/test/bigint.js similarity index 100% rename from www/node_modules/object-inspect/test/bigint.js rename to www2/node_modules/object-inspect/test/bigint.js diff --git a/www/node_modules/object-inspect/test/browser/dom.js b/www2/node_modules/object-inspect/test/browser/dom.js similarity index 100% rename from www/node_modules/object-inspect/test/browser/dom.js rename to www2/node_modules/object-inspect/test/browser/dom.js diff --git a/www/node_modules/object-inspect/test/circular.js b/www2/node_modules/object-inspect/test/circular.js similarity index 100% rename from www/node_modules/object-inspect/test/circular.js rename to www2/node_modules/object-inspect/test/circular.js diff --git a/www/node_modules/object-inspect/test/deep.js b/www2/node_modules/object-inspect/test/deep.js similarity index 100% rename from www/node_modules/object-inspect/test/deep.js rename to www2/node_modules/object-inspect/test/deep.js diff --git a/www/node_modules/object-inspect/test/element.js b/www2/node_modules/object-inspect/test/element.js similarity index 100% rename from www/node_modules/object-inspect/test/element.js rename to www2/node_modules/object-inspect/test/element.js diff --git a/www/node_modules/object-inspect/test/err.js b/www2/node_modules/object-inspect/test/err.js similarity index 100% rename from www/node_modules/object-inspect/test/err.js rename to www2/node_modules/object-inspect/test/err.js diff --git a/www/node_modules/object-inspect/test/fakes.js b/www2/node_modules/object-inspect/test/fakes.js similarity index 100% rename from www/node_modules/object-inspect/test/fakes.js rename to www2/node_modules/object-inspect/test/fakes.js diff --git a/www/node_modules/object-inspect/test/fn.js b/www2/node_modules/object-inspect/test/fn.js similarity index 100% rename from www/node_modules/object-inspect/test/fn.js rename to www2/node_modules/object-inspect/test/fn.js diff --git a/www/node_modules/object-inspect/test/global.js b/www2/node_modules/object-inspect/test/global.js similarity index 100% rename from www/node_modules/object-inspect/test/global.js rename to www2/node_modules/object-inspect/test/global.js diff --git a/www/node_modules/object-inspect/test/has.js b/www2/node_modules/object-inspect/test/has.js similarity index 100% rename from www/node_modules/object-inspect/test/has.js rename to www2/node_modules/object-inspect/test/has.js diff --git a/www/node_modules/object-inspect/test/holes.js b/www2/node_modules/object-inspect/test/holes.js similarity index 100% rename from www/node_modules/object-inspect/test/holes.js rename to www2/node_modules/object-inspect/test/holes.js diff --git a/www/node_modules/object-inspect/test/indent-option.js b/www2/node_modules/object-inspect/test/indent-option.js similarity index 100% rename from www/node_modules/object-inspect/test/indent-option.js rename to www2/node_modules/object-inspect/test/indent-option.js diff --git a/www/node_modules/object-inspect/test/inspect.js b/www2/node_modules/object-inspect/test/inspect.js similarity index 100% rename from www/node_modules/object-inspect/test/inspect.js rename to www2/node_modules/object-inspect/test/inspect.js diff --git a/www/node_modules/object-inspect/test/lowbyte.js b/www2/node_modules/object-inspect/test/lowbyte.js similarity index 100% rename from www/node_modules/object-inspect/test/lowbyte.js rename to www2/node_modules/object-inspect/test/lowbyte.js diff --git a/www/node_modules/object-inspect/test/number.js b/www2/node_modules/object-inspect/test/number.js similarity index 100% rename from www/node_modules/object-inspect/test/number.js rename to www2/node_modules/object-inspect/test/number.js diff --git a/www/node_modules/object-inspect/test/quoteStyle.js b/www2/node_modules/object-inspect/test/quoteStyle.js similarity index 100% rename from www/node_modules/object-inspect/test/quoteStyle.js rename to www2/node_modules/object-inspect/test/quoteStyle.js diff --git a/www/node_modules/object-inspect/test/toStringTag.js b/www2/node_modules/object-inspect/test/toStringTag.js similarity index 100% rename from www/node_modules/object-inspect/test/toStringTag.js rename to www2/node_modules/object-inspect/test/toStringTag.js diff --git a/www/node_modules/object-inspect/test/undef.js b/www2/node_modules/object-inspect/test/undef.js similarity index 100% rename from www/node_modules/object-inspect/test/undef.js rename to www2/node_modules/object-inspect/test/undef.js diff --git a/www/node_modules/object-inspect/test/values.js b/www2/node_modules/object-inspect/test/values.js similarity index 100% rename from www/node_modules/object-inspect/test/values.js rename to www2/node_modules/object-inspect/test/values.js diff --git a/www/node_modules/object-inspect/util.inspect.js b/www2/node_modules/object-inspect/util.inspect.js similarity index 100% rename from www/node_modules/object-inspect/util.inspect.js rename to www2/node_modules/object-inspect/util.inspect.js diff --git a/www/node_modules/on-finished/HISTORY.md b/www2/node_modules/on-finished/HISTORY.md similarity index 100% rename from www/node_modules/on-finished/HISTORY.md rename to www2/node_modules/on-finished/HISTORY.md diff --git a/www/node_modules/on-finished/LICENSE b/www2/node_modules/on-finished/LICENSE similarity index 100% rename from www/node_modules/on-finished/LICENSE rename to www2/node_modules/on-finished/LICENSE diff --git a/www/node_modules/on-finished/README.md b/www2/node_modules/on-finished/README.md similarity index 100% rename from www/node_modules/on-finished/README.md rename to www2/node_modules/on-finished/README.md diff --git a/www/node_modules/on-finished/index.js b/www2/node_modules/on-finished/index.js similarity index 100% rename from www/node_modules/on-finished/index.js rename to www2/node_modules/on-finished/index.js diff --git a/www/node_modules/on-finished/package.json b/www2/node_modules/on-finished/package.json similarity index 100% rename from www/node_modules/on-finished/package.json rename to www2/node_modules/on-finished/package.json diff --git a/www/node_modules/on-headers/HISTORY.md b/www2/node_modules/on-headers/HISTORY.md similarity index 100% rename from www/node_modules/on-headers/HISTORY.md rename to www2/node_modules/on-headers/HISTORY.md diff --git a/www/node_modules/on-headers/LICENSE b/www2/node_modules/on-headers/LICENSE similarity index 100% rename from www/node_modules/on-headers/LICENSE rename to www2/node_modules/on-headers/LICENSE diff --git a/www/node_modules/on-headers/README.md b/www2/node_modules/on-headers/README.md similarity index 100% rename from www/node_modules/on-headers/README.md rename to www2/node_modules/on-headers/README.md diff --git a/www/node_modules/on-headers/index.js b/www2/node_modules/on-headers/index.js similarity index 100% rename from www/node_modules/on-headers/index.js rename to www2/node_modules/on-headers/index.js diff --git a/www/node_modules/on-headers/package.json b/www2/node_modules/on-headers/package.json similarity index 100% rename from www/node_modules/on-headers/package.json rename to www2/node_modules/on-headers/package.json diff --git a/www/node_modules/parseurl/HISTORY.md b/www2/node_modules/parseurl/HISTORY.md similarity index 100% rename from www/node_modules/parseurl/HISTORY.md rename to www2/node_modules/parseurl/HISTORY.md diff --git a/www/node_modules/parseurl/LICENSE b/www2/node_modules/parseurl/LICENSE similarity index 100% rename from www/node_modules/parseurl/LICENSE rename to www2/node_modules/parseurl/LICENSE diff --git a/www/node_modules/parseurl/README.md b/www2/node_modules/parseurl/README.md similarity index 100% rename from www/node_modules/parseurl/README.md rename to www2/node_modules/parseurl/README.md diff --git a/www/node_modules/parseurl/index.js b/www2/node_modules/parseurl/index.js similarity index 100% rename from www/node_modules/parseurl/index.js rename to www2/node_modules/parseurl/index.js diff --git a/www/node_modules/parseurl/package.json b/www2/node_modules/parseurl/package.json similarity index 100% rename from www/node_modules/parseurl/package.json rename to www2/node_modules/parseurl/package.json diff --git a/www/node_modules/path-to-regexp/History.md b/www2/node_modules/path-to-regexp/History.md similarity index 100% rename from www/node_modules/path-to-regexp/History.md rename to www2/node_modules/path-to-regexp/History.md diff --git a/www/node_modules/path-to-regexp/LICENSE b/www2/node_modules/path-to-regexp/LICENSE similarity index 100% rename from www/node_modules/path-to-regexp/LICENSE rename to www2/node_modules/path-to-regexp/LICENSE diff --git a/www/node_modules/path-to-regexp/Readme.md b/www2/node_modules/path-to-regexp/Readme.md similarity index 100% rename from www/node_modules/path-to-regexp/Readme.md rename to www2/node_modules/path-to-regexp/Readme.md diff --git a/www/node_modules/path-to-regexp/index.js b/www2/node_modules/path-to-regexp/index.js similarity index 100% rename from www/node_modules/path-to-regexp/index.js rename to www2/node_modules/path-to-regexp/index.js diff --git a/www/node_modules/path-to-regexp/package.json b/www2/node_modules/path-to-regexp/package.json similarity index 100% rename from www/node_modules/path-to-regexp/package.json rename to www2/node_modules/path-to-regexp/package.json diff --git a/www/node_modules/process-nextick-args/index.js b/www2/node_modules/process-nextick-args/index.js similarity index 100% rename from www/node_modules/process-nextick-args/index.js rename to www2/node_modules/process-nextick-args/index.js diff --git a/www/node_modules/process-nextick-args/license.md b/www2/node_modules/process-nextick-args/license.md similarity index 100% rename from www/node_modules/process-nextick-args/license.md rename to www2/node_modules/process-nextick-args/license.md diff --git a/www/node_modules/process-nextick-args/package.json b/www2/node_modules/process-nextick-args/package.json similarity index 100% rename from www/node_modules/process-nextick-args/package.json rename to www2/node_modules/process-nextick-args/package.json diff --git a/www/node_modules/process-nextick-args/readme.md b/www2/node_modules/process-nextick-args/readme.md similarity index 100% rename from www/node_modules/process-nextick-args/readme.md rename to www2/node_modules/process-nextick-args/readme.md diff --git a/www/node_modules/proxy-addr/HISTORY.md b/www2/node_modules/proxy-addr/HISTORY.md similarity index 100% rename from www/node_modules/proxy-addr/HISTORY.md rename to www2/node_modules/proxy-addr/HISTORY.md diff --git a/www/node_modules/proxy-addr/LICENSE b/www2/node_modules/proxy-addr/LICENSE similarity index 100% rename from www/node_modules/proxy-addr/LICENSE rename to www2/node_modules/proxy-addr/LICENSE diff --git a/www/node_modules/proxy-addr/README.md b/www2/node_modules/proxy-addr/README.md similarity index 100% rename from www/node_modules/proxy-addr/README.md rename to www2/node_modules/proxy-addr/README.md diff --git a/www/node_modules/proxy-addr/index.js b/www2/node_modules/proxy-addr/index.js similarity index 100% rename from www/node_modules/proxy-addr/index.js rename to www2/node_modules/proxy-addr/index.js diff --git a/www/node_modules/proxy-addr/package.json b/www2/node_modules/proxy-addr/package.json similarity index 100% rename from www/node_modules/proxy-addr/package.json rename to www2/node_modules/proxy-addr/package.json diff --git a/www/node_modules/qs/.editorconfig b/www2/node_modules/qs/.editorconfig similarity index 100% rename from www/node_modules/qs/.editorconfig rename to www2/node_modules/qs/.editorconfig diff --git a/www/node_modules/qs/.eslintrc b/www2/node_modules/qs/.eslintrc similarity index 100% rename from www/node_modules/qs/.eslintrc rename to www2/node_modules/qs/.eslintrc diff --git a/www/node_modules/qs/.github/FUNDING.yml b/www2/node_modules/qs/.github/FUNDING.yml similarity index 100% rename from www/node_modules/qs/.github/FUNDING.yml rename to www2/node_modules/qs/.github/FUNDING.yml diff --git a/www/node_modules/qs/.nycrc b/www2/node_modules/qs/.nycrc similarity index 100% rename from www/node_modules/qs/.nycrc rename to www2/node_modules/qs/.nycrc diff --git a/www/node_modules/qs/CHANGELOG.md b/www2/node_modules/qs/CHANGELOG.md similarity index 100% rename from www/node_modules/qs/CHANGELOG.md rename to www2/node_modules/qs/CHANGELOG.md diff --git a/www/node_modules/qs/LICENSE.md b/www2/node_modules/qs/LICENSE.md similarity index 100% rename from www/node_modules/qs/LICENSE.md rename to www2/node_modules/qs/LICENSE.md diff --git a/www/node_modules/qs/README.md b/www2/node_modules/qs/README.md similarity index 100% rename from www/node_modules/qs/README.md rename to www2/node_modules/qs/README.md diff --git a/www/node_modules/qs/dist/qs.js b/www2/node_modules/qs/dist/qs.js similarity index 100% rename from www/node_modules/qs/dist/qs.js rename to www2/node_modules/qs/dist/qs.js diff --git a/www/node_modules/qs/lib/formats.js b/www2/node_modules/qs/lib/formats.js similarity index 100% rename from www/node_modules/qs/lib/formats.js rename to www2/node_modules/qs/lib/formats.js diff --git a/www/node_modules/qs/lib/index.js b/www2/node_modules/qs/lib/index.js similarity index 100% rename from www/node_modules/qs/lib/index.js rename to www2/node_modules/qs/lib/index.js diff --git a/www/node_modules/qs/lib/parse.js b/www2/node_modules/qs/lib/parse.js similarity index 100% rename from www/node_modules/qs/lib/parse.js rename to www2/node_modules/qs/lib/parse.js diff --git a/www/node_modules/qs/lib/stringify.js b/www2/node_modules/qs/lib/stringify.js similarity index 100% rename from www/node_modules/qs/lib/stringify.js rename to www2/node_modules/qs/lib/stringify.js diff --git a/www/node_modules/qs/lib/utils.js b/www2/node_modules/qs/lib/utils.js similarity index 100% rename from www/node_modules/qs/lib/utils.js rename to www2/node_modules/qs/lib/utils.js diff --git a/www/node_modules/qs/package.json b/www2/node_modules/qs/package.json similarity index 100% rename from www/node_modules/qs/package.json rename to www2/node_modules/qs/package.json diff --git a/www/node_modules/qs/test/parse.js b/www2/node_modules/qs/test/parse.js similarity index 100% rename from www/node_modules/qs/test/parse.js rename to www2/node_modules/qs/test/parse.js diff --git a/www/node_modules/qs/test/stringify.js b/www2/node_modules/qs/test/stringify.js similarity index 100% rename from www/node_modules/qs/test/stringify.js rename to www2/node_modules/qs/test/stringify.js diff --git a/www/node_modules/qs/test/utils.js b/www2/node_modules/qs/test/utils.js similarity index 100% rename from www/node_modules/qs/test/utils.js rename to www2/node_modules/qs/test/utils.js diff --git a/www/node_modules/random-bytes/HISTORY.md b/www2/node_modules/random-bytes/HISTORY.md similarity index 100% rename from www/node_modules/random-bytes/HISTORY.md rename to www2/node_modules/random-bytes/HISTORY.md diff --git a/www/node_modules/random-bytes/LICENSE b/www2/node_modules/random-bytes/LICENSE similarity index 100% rename from www/node_modules/random-bytes/LICENSE rename to www2/node_modules/random-bytes/LICENSE diff --git a/www/node_modules/random-bytes/README.md b/www2/node_modules/random-bytes/README.md similarity index 100% rename from www/node_modules/random-bytes/README.md rename to www2/node_modules/random-bytes/README.md diff --git a/www/node_modules/random-bytes/index.js b/www2/node_modules/random-bytes/index.js similarity index 100% rename from www/node_modules/random-bytes/index.js rename to www2/node_modules/random-bytes/index.js diff --git a/www/node_modules/random-bytes/package.json b/www2/node_modules/random-bytes/package.json similarity index 100% rename from www/node_modules/random-bytes/package.json rename to www2/node_modules/random-bytes/package.json diff --git a/www/node_modules/range-parser/HISTORY.md b/www2/node_modules/range-parser/HISTORY.md similarity index 100% rename from www/node_modules/range-parser/HISTORY.md rename to www2/node_modules/range-parser/HISTORY.md diff --git a/www/node_modules/range-parser/LICENSE b/www2/node_modules/range-parser/LICENSE similarity index 100% rename from www/node_modules/range-parser/LICENSE rename to www2/node_modules/range-parser/LICENSE diff --git a/www/node_modules/range-parser/README.md b/www2/node_modules/range-parser/README.md similarity index 100% rename from www/node_modules/range-parser/README.md rename to www2/node_modules/range-parser/README.md diff --git a/www/node_modules/range-parser/index.js b/www2/node_modules/range-parser/index.js similarity index 100% rename from www/node_modules/range-parser/index.js rename to www2/node_modules/range-parser/index.js diff --git a/www/node_modules/range-parser/package.json b/www2/node_modules/range-parser/package.json similarity index 100% rename from www/node_modules/range-parser/package.json rename to www2/node_modules/range-parser/package.json diff --git a/www/node_modules/raw-body/HISTORY.md b/www2/node_modules/raw-body/HISTORY.md similarity index 100% rename from www/node_modules/raw-body/HISTORY.md rename to www2/node_modules/raw-body/HISTORY.md diff --git a/www/node_modules/raw-body/LICENSE b/www2/node_modules/raw-body/LICENSE similarity index 100% rename from www/node_modules/raw-body/LICENSE rename to www2/node_modules/raw-body/LICENSE diff --git a/www/node_modules/raw-body/README.md b/www2/node_modules/raw-body/README.md similarity index 100% rename from www/node_modules/raw-body/README.md rename to www2/node_modules/raw-body/README.md diff --git a/www/node_modules/raw-body/SECURITY.md b/www2/node_modules/raw-body/SECURITY.md similarity index 100% rename from www/node_modules/raw-body/SECURITY.md rename to www2/node_modules/raw-body/SECURITY.md diff --git a/www/node_modules/raw-body/index.d.ts b/www2/node_modules/raw-body/index.d.ts similarity index 100% rename from www/node_modules/raw-body/index.d.ts rename to www2/node_modules/raw-body/index.d.ts diff --git a/www/node_modules/raw-body/index.js b/www2/node_modules/raw-body/index.js similarity index 100% rename from www/node_modules/raw-body/index.js rename to www2/node_modules/raw-body/index.js diff --git a/www/node_modules/raw-body/package.json b/www2/node_modules/raw-body/package.json similarity index 100% rename from www/node_modules/raw-body/package.json rename to www2/node_modules/raw-body/package.json diff --git a/www/node_modules/readable-stream/.travis.yml b/www2/node_modules/readable-stream/.travis.yml similarity index 100% rename from www/node_modules/readable-stream/.travis.yml rename to www2/node_modules/readable-stream/.travis.yml diff --git a/www/node_modules/readable-stream/CONTRIBUTING.md b/www2/node_modules/readable-stream/CONTRIBUTING.md similarity index 100% rename from www/node_modules/readable-stream/CONTRIBUTING.md rename to www2/node_modules/readable-stream/CONTRIBUTING.md diff --git a/www/node_modules/readable-stream/GOVERNANCE.md b/www2/node_modules/readable-stream/GOVERNANCE.md similarity index 100% rename from www/node_modules/readable-stream/GOVERNANCE.md rename to www2/node_modules/readable-stream/GOVERNANCE.md diff --git a/www/node_modules/readable-stream/LICENSE b/www2/node_modules/readable-stream/LICENSE similarity index 100% rename from www/node_modules/readable-stream/LICENSE rename to www2/node_modules/readable-stream/LICENSE diff --git a/www/node_modules/readable-stream/README.md b/www2/node_modules/readable-stream/README.md similarity index 100% rename from www/node_modules/readable-stream/README.md rename to www2/node_modules/readable-stream/README.md diff --git a/www/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/www2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md similarity index 100% rename from www/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md rename to www2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md diff --git a/www/node_modules/readable-stream/duplex-browser.js b/www2/node_modules/readable-stream/duplex-browser.js similarity index 100% rename from www/node_modules/readable-stream/duplex-browser.js rename to www2/node_modules/readable-stream/duplex-browser.js diff --git a/www/node_modules/readable-stream/duplex.js b/www2/node_modules/readable-stream/duplex.js similarity index 100% rename from www/node_modules/readable-stream/duplex.js rename to www2/node_modules/readable-stream/duplex.js diff --git a/www/node_modules/readable-stream/lib/_stream_duplex.js b/www2/node_modules/readable-stream/lib/_stream_duplex.js similarity index 100% rename from www/node_modules/readable-stream/lib/_stream_duplex.js rename to www2/node_modules/readable-stream/lib/_stream_duplex.js diff --git a/www/node_modules/readable-stream/lib/_stream_passthrough.js b/www2/node_modules/readable-stream/lib/_stream_passthrough.js similarity index 100% rename from www/node_modules/readable-stream/lib/_stream_passthrough.js rename to www2/node_modules/readable-stream/lib/_stream_passthrough.js diff --git a/www/node_modules/readable-stream/lib/_stream_readable.js b/www2/node_modules/readable-stream/lib/_stream_readable.js similarity index 100% rename from www/node_modules/readable-stream/lib/_stream_readable.js rename to www2/node_modules/readable-stream/lib/_stream_readable.js diff --git a/www/node_modules/readable-stream/lib/_stream_transform.js b/www2/node_modules/readable-stream/lib/_stream_transform.js similarity index 100% rename from www/node_modules/readable-stream/lib/_stream_transform.js rename to www2/node_modules/readable-stream/lib/_stream_transform.js diff --git a/www/node_modules/readable-stream/lib/_stream_writable.js b/www2/node_modules/readable-stream/lib/_stream_writable.js similarity index 100% rename from www/node_modules/readable-stream/lib/_stream_writable.js rename to www2/node_modules/readable-stream/lib/_stream_writable.js diff --git a/www/node_modules/readable-stream/lib/internal/streams/BufferList.js b/www2/node_modules/readable-stream/lib/internal/streams/BufferList.js similarity index 100% rename from www/node_modules/readable-stream/lib/internal/streams/BufferList.js rename to www2/node_modules/readable-stream/lib/internal/streams/BufferList.js diff --git a/www/node_modules/readable-stream/lib/internal/streams/destroy.js b/www2/node_modules/readable-stream/lib/internal/streams/destroy.js similarity index 100% rename from www/node_modules/readable-stream/lib/internal/streams/destroy.js rename to www2/node_modules/readable-stream/lib/internal/streams/destroy.js diff --git a/www/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/www2/node_modules/readable-stream/lib/internal/streams/stream-browser.js similarity index 100% rename from www/node_modules/readable-stream/lib/internal/streams/stream-browser.js rename to www2/node_modules/readable-stream/lib/internal/streams/stream-browser.js diff --git a/www/node_modules/readable-stream/lib/internal/streams/stream.js b/www2/node_modules/readable-stream/lib/internal/streams/stream.js similarity index 100% rename from www/node_modules/readable-stream/lib/internal/streams/stream.js rename to www2/node_modules/readable-stream/lib/internal/streams/stream.js diff --git a/www/node_modules/readable-stream/node_modules/safe-buffer/LICENSE b/www2/node_modules/readable-stream/node_modules/safe-buffer/LICENSE similarity index 100% rename from www/node_modules/readable-stream/node_modules/safe-buffer/LICENSE rename to www2/node_modules/readable-stream/node_modules/safe-buffer/LICENSE diff --git a/www/node_modules/readable-stream/node_modules/safe-buffer/README.md b/www2/node_modules/readable-stream/node_modules/safe-buffer/README.md similarity index 100% rename from www/node_modules/readable-stream/node_modules/safe-buffer/README.md rename to www2/node_modules/readable-stream/node_modules/safe-buffer/README.md diff --git a/www/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts b/www2/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts similarity index 100% rename from www/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts rename to www2/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts diff --git a/www/node_modules/readable-stream/node_modules/safe-buffer/index.js b/www2/node_modules/readable-stream/node_modules/safe-buffer/index.js similarity index 100% rename from www/node_modules/readable-stream/node_modules/safe-buffer/index.js rename to www2/node_modules/readable-stream/node_modules/safe-buffer/index.js diff --git a/www/node_modules/readable-stream/node_modules/safe-buffer/package.json b/www2/node_modules/readable-stream/node_modules/safe-buffer/package.json similarity index 100% rename from www/node_modules/readable-stream/node_modules/safe-buffer/package.json rename to www2/node_modules/readable-stream/node_modules/safe-buffer/package.json diff --git a/www/node_modules/readable-stream/package.json b/www2/node_modules/readable-stream/package.json similarity index 100% rename from www/node_modules/readable-stream/package.json rename to www2/node_modules/readable-stream/package.json diff --git a/www/node_modules/readable-stream/passthrough.js b/www2/node_modules/readable-stream/passthrough.js similarity index 100% rename from www/node_modules/readable-stream/passthrough.js rename to www2/node_modules/readable-stream/passthrough.js diff --git a/www/node_modules/readable-stream/readable-browser.js b/www2/node_modules/readable-stream/readable-browser.js similarity index 100% rename from www/node_modules/readable-stream/readable-browser.js rename to www2/node_modules/readable-stream/readable-browser.js diff --git a/www/node_modules/readable-stream/readable.js b/www2/node_modules/readable-stream/readable.js similarity index 100% rename from www/node_modules/readable-stream/readable.js rename to www2/node_modules/readable-stream/readable.js diff --git a/www/node_modules/readable-stream/transform.js b/www2/node_modules/readable-stream/transform.js similarity index 100% rename from www/node_modules/readable-stream/transform.js rename to www2/node_modules/readable-stream/transform.js diff --git a/www/node_modules/readable-stream/writable-browser.js b/www2/node_modules/readable-stream/writable-browser.js similarity index 100% rename from www/node_modules/readable-stream/writable-browser.js rename to www2/node_modules/readable-stream/writable-browser.js diff --git a/www/node_modules/readable-stream/writable.js b/www2/node_modules/readable-stream/writable.js similarity index 100% rename from www/node_modules/readable-stream/writable.js rename to www2/node_modules/readable-stream/writable.js diff --git a/www/node_modules/safe-buffer/LICENSE b/www2/node_modules/safe-buffer/LICENSE similarity index 100% rename from www/node_modules/safe-buffer/LICENSE rename to www2/node_modules/safe-buffer/LICENSE diff --git a/www/node_modules/safe-buffer/README.md b/www2/node_modules/safe-buffer/README.md similarity index 100% rename from www/node_modules/safe-buffer/README.md rename to www2/node_modules/safe-buffer/README.md diff --git a/www/node_modules/safe-buffer/index.d.ts b/www2/node_modules/safe-buffer/index.d.ts similarity index 100% rename from www/node_modules/safe-buffer/index.d.ts rename to www2/node_modules/safe-buffer/index.d.ts diff --git a/www/node_modules/safe-buffer/index.js b/www2/node_modules/safe-buffer/index.js similarity index 100% rename from www/node_modules/safe-buffer/index.js rename to www2/node_modules/safe-buffer/index.js diff --git a/www/node_modules/safe-buffer/package.json b/www2/node_modules/safe-buffer/package.json similarity index 100% rename from www/node_modules/safe-buffer/package.json rename to www2/node_modules/safe-buffer/package.json diff --git a/www/node_modules/safer-buffer/LICENSE b/www2/node_modules/safer-buffer/LICENSE similarity index 100% rename from www/node_modules/safer-buffer/LICENSE rename to www2/node_modules/safer-buffer/LICENSE diff --git a/www/node_modules/safer-buffer/Porting-Buffer.md b/www2/node_modules/safer-buffer/Porting-Buffer.md similarity index 100% rename from www/node_modules/safer-buffer/Porting-Buffer.md rename to www2/node_modules/safer-buffer/Porting-Buffer.md diff --git a/www/node_modules/safer-buffer/Readme.md b/www2/node_modules/safer-buffer/Readme.md similarity index 100% rename from www/node_modules/safer-buffer/Readme.md rename to www2/node_modules/safer-buffer/Readme.md diff --git a/www/node_modules/safer-buffer/dangerous.js b/www2/node_modules/safer-buffer/dangerous.js similarity index 100% rename from www/node_modules/safer-buffer/dangerous.js rename to www2/node_modules/safer-buffer/dangerous.js diff --git a/www/node_modules/safer-buffer/package.json b/www2/node_modules/safer-buffer/package.json similarity index 100% rename from www/node_modules/safer-buffer/package.json rename to www2/node_modules/safer-buffer/package.json diff --git a/www/node_modules/safer-buffer/safer.js b/www2/node_modules/safer-buffer/safer.js similarity index 100% rename from www/node_modules/safer-buffer/safer.js rename to www2/node_modules/safer-buffer/safer.js diff --git a/www/node_modules/safer-buffer/tests.js b/www2/node_modules/safer-buffer/tests.js similarity index 100% rename from www/node_modules/safer-buffer/tests.js rename to www2/node_modules/safer-buffer/tests.js diff --git a/www/node_modules/send/HISTORY.md b/www2/node_modules/send/HISTORY.md similarity index 100% rename from www/node_modules/send/HISTORY.md rename to www2/node_modules/send/HISTORY.md diff --git a/www/node_modules/send/LICENSE b/www2/node_modules/send/LICENSE similarity index 100% rename from www/node_modules/send/LICENSE rename to www2/node_modules/send/LICENSE diff --git a/www/node_modules/send/README.md b/www2/node_modules/send/README.md similarity index 100% rename from www/node_modules/send/README.md rename to www2/node_modules/send/README.md diff --git a/www/node_modules/send/SECURITY.md b/www2/node_modules/send/SECURITY.md similarity index 100% rename from www/node_modules/send/SECURITY.md rename to www2/node_modules/send/SECURITY.md diff --git a/www/node_modules/send/index.js b/www2/node_modules/send/index.js similarity index 100% rename from www/node_modules/send/index.js rename to www2/node_modules/send/index.js diff --git a/www/node_modules/send/node_modules/ms/index.js b/www2/node_modules/send/node_modules/ms/index.js similarity index 100% rename from www/node_modules/send/node_modules/ms/index.js rename to www2/node_modules/send/node_modules/ms/index.js diff --git a/www/node_modules/send/node_modules/ms/license.md b/www2/node_modules/send/node_modules/ms/license.md similarity index 100% rename from www/node_modules/send/node_modules/ms/license.md rename to www2/node_modules/send/node_modules/ms/license.md diff --git a/www/node_modules/send/node_modules/ms/package.json b/www2/node_modules/send/node_modules/ms/package.json similarity index 100% rename from www/node_modules/send/node_modules/ms/package.json rename to www2/node_modules/send/node_modules/ms/package.json diff --git a/www/node_modules/send/node_modules/ms/readme.md b/www2/node_modules/send/node_modules/ms/readme.md similarity index 100% rename from www/node_modules/send/node_modules/ms/readme.md rename to www2/node_modules/send/node_modules/ms/readme.md diff --git a/www/node_modules/send/package.json b/www2/node_modules/send/package.json similarity index 100% rename from www/node_modules/send/package.json rename to www2/node_modules/send/package.json diff --git a/www/node_modules/serve-static/HISTORY.md b/www2/node_modules/serve-static/HISTORY.md similarity index 100% rename from www/node_modules/serve-static/HISTORY.md rename to www2/node_modules/serve-static/HISTORY.md diff --git a/www/node_modules/serve-static/LICENSE b/www2/node_modules/serve-static/LICENSE similarity index 100% rename from www/node_modules/serve-static/LICENSE rename to www2/node_modules/serve-static/LICENSE diff --git a/www/node_modules/serve-static/README.md b/www2/node_modules/serve-static/README.md similarity index 100% rename from www/node_modules/serve-static/README.md rename to www2/node_modules/serve-static/README.md diff --git a/www/node_modules/serve-static/index.js b/www2/node_modules/serve-static/index.js similarity index 100% rename from www/node_modules/serve-static/index.js rename to www2/node_modules/serve-static/index.js diff --git a/www/node_modules/serve-static/package.json b/www2/node_modules/serve-static/package.json similarity index 100% rename from www/node_modules/serve-static/package.json rename to www2/node_modules/serve-static/package.json diff --git a/www/node_modules/set-function-length/.eslintrc b/www2/node_modules/set-function-length/.eslintrc similarity index 100% rename from www/node_modules/set-function-length/.eslintrc rename to www2/node_modules/set-function-length/.eslintrc diff --git a/www/node_modules/set-function-length/.github/FUNDING.yml b/www2/node_modules/set-function-length/.github/FUNDING.yml similarity index 100% rename from www/node_modules/set-function-length/.github/FUNDING.yml rename to www2/node_modules/set-function-length/.github/FUNDING.yml diff --git a/www/node_modules/set-function-length/.nycrc b/www2/node_modules/set-function-length/.nycrc similarity index 100% rename from www/node_modules/set-function-length/.nycrc rename to www2/node_modules/set-function-length/.nycrc diff --git a/www/node_modules/set-function-length/CHANGELOG.md b/www2/node_modules/set-function-length/CHANGELOG.md similarity index 100% rename from www/node_modules/set-function-length/CHANGELOG.md rename to www2/node_modules/set-function-length/CHANGELOG.md diff --git a/www/node_modules/set-function-length/LICENSE b/www2/node_modules/set-function-length/LICENSE similarity index 100% rename from www/node_modules/set-function-length/LICENSE rename to www2/node_modules/set-function-length/LICENSE diff --git a/www/node_modules/set-function-length/README.md b/www2/node_modules/set-function-length/README.md similarity index 100% rename from www/node_modules/set-function-length/README.md rename to www2/node_modules/set-function-length/README.md diff --git a/www/node_modules/set-function-length/env.d.ts b/www2/node_modules/set-function-length/env.d.ts similarity index 100% rename from www/node_modules/set-function-length/env.d.ts rename to www2/node_modules/set-function-length/env.d.ts diff --git a/www/node_modules/set-function-length/env.js b/www2/node_modules/set-function-length/env.js similarity index 100% rename from www/node_modules/set-function-length/env.js rename to www2/node_modules/set-function-length/env.js diff --git a/www/node_modules/set-function-length/index.d.ts b/www2/node_modules/set-function-length/index.d.ts similarity index 100% rename from www/node_modules/set-function-length/index.d.ts rename to www2/node_modules/set-function-length/index.d.ts diff --git a/www/node_modules/set-function-length/index.js b/www2/node_modules/set-function-length/index.js similarity index 100% rename from www/node_modules/set-function-length/index.js rename to www2/node_modules/set-function-length/index.js diff --git a/www/node_modules/set-function-length/package.json b/www2/node_modules/set-function-length/package.json similarity index 100% rename from www/node_modules/set-function-length/package.json rename to www2/node_modules/set-function-length/package.json diff --git a/www/node_modules/set-function-length/tsconfig.json b/www2/node_modules/set-function-length/tsconfig.json similarity index 100% rename from www/node_modules/set-function-length/tsconfig.json rename to www2/node_modules/set-function-length/tsconfig.json diff --git a/www/node_modules/setprototypeof/LICENSE b/www2/node_modules/setprototypeof/LICENSE similarity index 100% rename from www/node_modules/setprototypeof/LICENSE rename to www2/node_modules/setprototypeof/LICENSE diff --git a/www/node_modules/setprototypeof/README.md b/www2/node_modules/setprototypeof/README.md similarity index 100% rename from www/node_modules/setprototypeof/README.md rename to www2/node_modules/setprototypeof/README.md diff --git a/www/node_modules/setprototypeof/index.d.ts b/www2/node_modules/setprototypeof/index.d.ts similarity index 100% rename from www/node_modules/setprototypeof/index.d.ts rename to www2/node_modules/setprototypeof/index.d.ts diff --git a/www/node_modules/setprototypeof/index.js b/www2/node_modules/setprototypeof/index.js similarity index 100% rename from www/node_modules/setprototypeof/index.js rename to www2/node_modules/setprototypeof/index.js diff --git a/www/node_modules/setprototypeof/package.json b/www2/node_modules/setprototypeof/package.json similarity index 100% rename from www/node_modules/setprototypeof/package.json rename to www2/node_modules/setprototypeof/package.json diff --git a/www/node_modules/setprototypeof/test/index.js b/www2/node_modules/setprototypeof/test/index.js similarity index 100% rename from www/node_modules/setprototypeof/test/index.js rename to www2/node_modules/setprototypeof/test/index.js diff --git a/www/node_modules/side-channel/.editorconfig b/www2/node_modules/side-channel/.editorconfig similarity index 100% rename from www/node_modules/side-channel/.editorconfig rename to www2/node_modules/side-channel/.editorconfig diff --git a/www/node_modules/side-channel/.eslintrc b/www2/node_modules/side-channel/.eslintrc similarity index 100% rename from www/node_modules/side-channel/.eslintrc rename to www2/node_modules/side-channel/.eslintrc diff --git a/www/node_modules/side-channel/.github/FUNDING.yml b/www2/node_modules/side-channel/.github/FUNDING.yml similarity index 100% rename from www/node_modules/side-channel/.github/FUNDING.yml rename to www2/node_modules/side-channel/.github/FUNDING.yml diff --git a/www/node_modules/side-channel/.nycrc b/www2/node_modules/side-channel/.nycrc similarity index 100% rename from www/node_modules/side-channel/.nycrc rename to www2/node_modules/side-channel/.nycrc diff --git a/www/node_modules/side-channel/CHANGELOG.md b/www2/node_modules/side-channel/CHANGELOG.md similarity index 100% rename from www/node_modules/side-channel/CHANGELOG.md rename to www2/node_modules/side-channel/CHANGELOG.md diff --git a/www/node_modules/side-channel/LICENSE b/www2/node_modules/side-channel/LICENSE similarity index 100% rename from www/node_modules/side-channel/LICENSE rename to www2/node_modules/side-channel/LICENSE diff --git a/www/node_modules/side-channel/README.md b/www2/node_modules/side-channel/README.md similarity index 100% rename from www/node_modules/side-channel/README.md rename to www2/node_modules/side-channel/README.md diff --git a/www/node_modules/side-channel/index.d.ts b/www2/node_modules/side-channel/index.d.ts similarity index 100% rename from www/node_modules/side-channel/index.d.ts rename to www2/node_modules/side-channel/index.d.ts diff --git a/www/node_modules/side-channel/index.js b/www2/node_modules/side-channel/index.js similarity index 100% rename from www/node_modules/side-channel/index.js rename to www2/node_modules/side-channel/index.js diff --git a/www/node_modules/side-channel/package.json b/www2/node_modules/side-channel/package.json similarity index 100% rename from www/node_modules/side-channel/package.json rename to www2/node_modules/side-channel/package.json diff --git a/www/node_modules/side-channel/test/index.js b/www2/node_modules/side-channel/test/index.js similarity index 100% rename from www/node_modules/side-channel/test/index.js rename to www2/node_modules/side-channel/test/index.js diff --git a/www/node_modules/side-channel/tsconfig.json b/www2/node_modules/side-channel/tsconfig.json similarity index 100% rename from www/node_modules/side-channel/tsconfig.json rename to www2/node_modules/side-channel/tsconfig.json diff --git a/www/node_modules/sqlstring/HISTORY.md b/www2/node_modules/sqlstring/HISTORY.md similarity index 100% rename from www/node_modules/sqlstring/HISTORY.md rename to www2/node_modules/sqlstring/HISTORY.md diff --git a/www/node_modules/sqlstring/LICENSE b/www2/node_modules/sqlstring/LICENSE similarity index 100% rename from www/node_modules/sqlstring/LICENSE rename to www2/node_modules/sqlstring/LICENSE diff --git a/www/node_modules/sqlstring/README.md b/www2/node_modules/sqlstring/README.md similarity index 100% rename from www/node_modules/sqlstring/README.md rename to www2/node_modules/sqlstring/README.md diff --git a/www/node_modules/sqlstring/index.js b/www2/node_modules/sqlstring/index.js similarity index 100% rename from www/node_modules/sqlstring/index.js rename to www2/node_modules/sqlstring/index.js diff --git a/www/node_modules/sqlstring/lib/SqlString.js b/www2/node_modules/sqlstring/lib/SqlString.js similarity index 100% rename from www/node_modules/sqlstring/lib/SqlString.js rename to www2/node_modules/sqlstring/lib/SqlString.js diff --git a/www/node_modules/sqlstring/package.json b/www2/node_modules/sqlstring/package.json similarity index 100% rename from www/node_modules/sqlstring/package.json rename to www2/node_modules/sqlstring/package.json diff --git a/www/node_modules/statuses/HISTORY.md b/www2/node_modules/statuses/HISTORY.md similarity index 100% rename from www/node_modules/statuses/HISTORY.md rename to www2/node_modules/statuses/HISTORY.md diff --git a/www/node_modules/statuses/LICENSE b/www2/node_modules/statuses/LICENSE similarity index 100% rename from www/node_modules/statuses/LICENSE rename to www2/node_modules/statuses/LICENSE diff --git a/www/node_modules/statuses/README.md b/www2/node_modules/statuses/README.md similarity index 100% rename from www/node_modules/statuses/README.md rename to www2/node_modules/statuses/README.md diff --git a/www/node_modules/statuses/codes.json b/www2/node_modules/statuses/codes.json similarity index 100% rename from www/node_modules/statuses/codes.json rename to www2/node_modules/statuses/codes.json diff --git a/www/node_modules/statuses/index.js b/www2/node_modules/statuses/index.js similarity index 100% rename from www/node_modules/statuses/index.js rename to www2/node_modules/statuses/index.js diff --git a/www/node_modules/statuses/package.json b/www2/node_modules/statuses/package.json similarity index 100% rename from www/node_modules/statuses/package.json rename to www2/node_modules/statuses/package.json diff --git a/www/node_modules/streamsearch/.eslintrc.js b/www2/node_modules/streamsearch/.eslintrc.js similarity index 100% rename from www/node_modules/streamsearch/.eslintrc.js rename to www2/node_modules/streamsearch/.eslintrc.js diff --git a/www/node_modules/streamsearch/.github/workflows/ci.yml b/www2/node_modules/streamsearch/.github/workflows/ci.yml similarity index 100% rename from www/node_modules/streamsearch/.github/workflows/ci.yml rename to www2/node_modules/streamsearch/.github/workflows/ci.yml diff --git a/www/node_modules/streamsearch/.github/workflows/lint.yml b/www2/node_modules/streamsearch/.github/workflows/lint.yml similarity index 100% rename from www/node_modules/streamsearch/.github/workflows/lint.yml rename to www2/node_modules/streamsearch/.github/workflows/lint.yml diff --git a/www/node_modules/streamsearch/LICENSE b/www2/node_modules/streamsearch/LICENSE similarity index 100% rename from www/node_modules/streamsearch/LICENSE rename to www2/node_modules/streamsearch/LICENSE diff --git a/www/node_modules/streamsearch/README.md b/www2/node_modules/streamsearch/README.md similarity index 100% rename from www/node_modules/streamsearch/README.md rename to www2/node_modules/streamsearch/README.md diff --git a/www/node_modules/streamsearch/lib/sbmh.js b/www2/node_modules/streamsearch/lib/sbmh.js similarity index 100% rename from www/node_modules/streamsearch/lib/sbmh.js rename to www2/node_modules/streamsearch/lib/sbmh.js diff --git a/www/node_modules/streamsearch/package.json b/www2/node_modules/streamsearch/package.json similarity index 100% rename from www/node_modules/streamsearch/package.json rename to www2/node_modules/streamsearch/package.json diff --git a/www/node_modules/streamsearch/test/test.js b/www2/node_modules/streamsearch/test/test.js similarity index 100% rename from www/node_modules/streamsearch/test/test.js rename to www2/node_modules/streamsearch/test/test.js diff --git a/www/node_modules/string_decoder/.travis.yml b/www2/node_modules/string_decoder/.travis.yml similarity index 100% rename from www/node_modules/string_decoder/.travis.yml rename to www2/node_modules/string_decoder/.travis.yml diff --git a/www/node_modules/string_decoder/LICENSE b/www2/node_modules/string_decoder/LICENSE similarity index 100% rename from www/node_modules/string_decoder/LICENSE rename to www2/node_modules/string_decoder/LICENSE diff --git a/www/node_modules/string_decoder/README.md b/www2/node_modules/string_decoder/README.md similarity index 100% rename from www/node_modules/string_decoder/README.md rename to www2/node_modules/string_decoder/README.md diff --git a/www/node_modules/string_decoder/lib/string_decoder.js b/www2/node_modules/string_decoder/lib/string_decoder.js similarity index 100% rename from www/node_modules/string_decoder/lib/string_decoder.js rename to www2/node_modules/string_decoder/lib/string_decoder.js diff --git a/www/node_modules/string_decoder/node_modules/safe-buffer/LICENSE b/www2/node_modules/string_decoder/node_modules/safe-buffer/LICENSE similarity index 100% rename from www/node_modules/string_decoder/node_modules/safe-buffer/LICENSE rename to www2/node_modules/string_decoder/node_modules/safe-buffer/LICENSE diff --git a/www/node_modules/string_decoder/node_modules/safe-buffer/README.md b/www2/node_modules/string_decoder/node_modules/safe-buffer/README.md similarity index 100% rename from www/node_modules/string_decoder/node_modules/safe-buffer/README.md rename to www2/node_modules/string_decoder/node_modules/safe-buffer/README.md diff --git a/www/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts b/www2/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts similarity index 100% rename from www/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts rename to www2/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts diff --git a/www/node_modules/string_decoder/node_modules/safe-buffer/index.js b/www2/node_modules/string_decoder/node_modules/safe-buffer/index.js similarity index 100% rename from www/node_modules/string_decoder/node_modules/safe-buffer/index.js rename to www2/node_modules/string_decoder/node_modules/safe-buffer/index.js diff --git a/www/node_modules/string_decoder/node_modules/safe-buffer/package.json b/www2/node_modules/string_decoder/node_modules/safe-buffer/package.json similarity index 100% rename from www/node_modules/string_decoder/node_modules/safe-buffer/package.json rename to www2/node_modules/string_decoder/node_modules/safe-buffer/package.json diff --git a/www/node_modules/string_decoder/package.json b/www2/node_modules/string_decoder/package.json similarity index 100% rename from www/node_modules/string_decoder/package.json rename to www2/node_modules/string_decoder/package.json diff --git a/www/node_modules/toidentifier/HISTORY.md b/www2/node_modules/toidentifier/HISTORY.md similarity index 100% rename from www/node_modules/toidentifier/HISTORY.md rename to www2/node_modules/toidentifier/HISTORY.md diff --git a/www/node_modules/toidentifier/LICENSE b/www2/node_modules/toidentifier/LICENSE similarity index 100% rename from www/node_modules/toidentifier/LICENSE rename to www2/node_modules/toidentifier/LICENSE diff --git a/www/node_modules/toidentifier/README.md b/www2/node_modules/toidentifier/README.md similarity index 100% rename from www/node_modules/toidentifier/README.md rename to www2/node_modules/toidentifier/README.md diff --git a/www/node_modules/toidentifier/index.js b/www2/node_modules/toidentifier/index.js similarity index 100% rename from www/node_modules/toidentifier/index.js rename to www2/node_modules/toidentifier/index.js diff --git a/www/node_modules/toidentifier/package.json b/www2/node_modules/toidentifier/package.json similarity index 100% rename from www/node_modules/toidentifier/package.json rename to www2/node_modules/toidentifier/package.json diff --git a/www/node_modules/type-is/HISTORY.md b/www2/node_modules/type-is/HISTORY.md similarity index 100% rename from www/node_modules/type-is/HISTORY.md rename to www2/node_modules/type-is/HISTORY.md diff --git a/www/node_modules/type-is/LICENSE b/www2/node_modules/type-is/LICENSE similarity index 100% rename from www/node_modules/type-is/LICENSE rename to www2/node_modules/type-is/LICENSE diff --git a/www/node_modules/type-is/README.md b/www2/node_modules/type-is/README.md similarity index 100% rename from www/node_modules/type-is/README.md rename to www2/node_modules/type-is/README.md diff --git a/www/node_modules/type-is/index.js b/www2/node_modules/type-is/index.js similarity index 100% rename from www/node_modules/type-is/index.js rename to www2/node_modules/type-is/index.js diff --git a/www/node_modules/type-is/package.json b/www2/node_modules/type-is/package.json similarity index 100% rename from www/node_modules/type-is/package.json rename to www2/node_modules/type-is/package.json diff --git a/www/node_modules/typedarray/.travis.yml b/www2/node_modules/typedarray/.travis.yml similarity index 100% rename from www/node_modules/typedarray/.travis.yml rename to www2/node_modules/typedarray/.travis.yml diff --git a/www/node_modules/typedarray/LICENSE b/www2/node_modules/typedarray/LICENSE similarity index 100% rename from www/node_modules/typedarray/LICENSE rename to www2/node_modules/typedarray/LICENSE diff --git a/www/node_modules/typedarray/example/tarray.js b/www2/node_modules/typedarray/example/tarray.js similarity index 100% rename from www/node_modules/typedarray/example/tarray.js rename to www2/node_modules/typedarray/example/tarray.js diff --git a/www/node_modules/typedarray/index.js b/www2/node_modules/typedarray/index.js similarity index 100% rename from www/node_modules/typedarray/index.js rename to www2/node_modules/typedarray/index.js diff --git a/www/node_modules/typedarray/package.json b/www2/node_modules/typedarray/package.json similarity index 100% rename from www/node_modules/typedarray/package.json rename to www2/node_modules/typedarray/package.json diff --git a/www/node_modules/typedarray/readme.markdown b/www2/node_modules/typedarray/readme.markdown similarity index 100% rename from www/node_modules/typedarray/readme.markdown rename to www2/node_modules/typedarray/readme.markdown diff --git a/www/node_modules/typedarray/test/server/undef_globals.js b/www2/node_modules/typedarray/test/server/undef_globals.js similarity index 100% rename from www/node_modules/typedarray/test/server/undef_globals.js rename to www2/node_modules/typedarray/test/server/undef_globals.js diff --git a/www/node_modules/typedarray/test/tarray.js b/www2/node_modules/typedarray/test/tarray.js similarity index 100% rename from www/node_modules/typedarray/test/tarray.js rename to www2/node_modules/typedarray/test/tarray.js diff --git a/www/node_modules/uid-safe/HISTORY.md b/www2/node_modules/uid-safe/HISTORY.md similarity index 100% rename from www/node_modules/uid-safe/HISTORY.md rename to www2/node_modules/uid-safe/HISTORY.md diff --git a/www/node_modules/uid-safe/LICENSE b/www2/node_modules/uid-safe/LICENSE similarity index 100% rename from www/node_modules/uid-safe/LICENSE rename to www2/node_modules/uid-safe/LICENSE diff --git a/www/node_modules/uid-safe/README.md b/www2/node_modules/uid-safe/README.md similarity index 100% rename from www/node_modules/uid-safe/README.md rename to www2/node_modules/uid-safe/README.md diff --git a/www/node_modules/uid-safe/index.js b/www2/node_modules/uid-safe/index.js similarity index 100% rename from www/node_modules/uid-safe/index.js rename to www2/node_modules/uid-safe/index.js diff --git a/www/node_modules/uid-safe/package.json b/www2/node_modules/uid-safe/package.json similarity index 100% rename from www/node_modules/uid-safe/package.json rename to www2/node_modules/uid-safe/package.json diff --git a/www/node_modules/unpipe/HISTORY.md b/www2/node_modules/unpipe/HISTORY.md similarity index 100% rename from www/node_modules/unpipe/HISTORY.md rename to www2/node_modules/unpipe/HISTORY.md diff --git a/www/node_modules/unpipe/LICENSE b/www2/node_modules/unpipe/LICENSE similarity index 100% rename from www/node_modules/unpipe/LICENSE rename to www2/node_modules/unpipe/LICENSE diff --git a/www/node_modules/unpipe/README.md b/www2/node_modules/unpipe/README.md similarity index 100% rename from www/node_modules/unpipe/README.md rename to www2/node_modules/unpipe/README.md diff --git a/www/node_modules/unpipe/index.js b/www2/node_modules/unpipe/index.js similarity index 100% rename from www/node_modules/unpipe/index.js rename to www2/node_modules/unpipe/index.js diff --git a/www/node_modules/unpipe/package.json b/www2/node_modules/unpipe/package.json similarity index 100% rename from www/node_modules/unpipe/package.json rename to www2/node_modules/unpipe/package.json diff --git a/www/node_modules/util-deprecate/History.md b/www2/node_modules/util-deprecate/History.md similarity index 100% rename from www/node_modules/util-deprecate/History.md rename to www2/node_modules/util-deprecate/History.md diff --git a/www/node_modules/util-deprecate/LICENSE b/www2/node_modules/util-deprecate/LICENSE similarity index 100% rename from www/node_modules/util-deprecate/LICENSE rename to www2/node_modules/util-deprecate/LICENSE diff --git a/www/node_modules/util-deprecate/README.md b/www2/node_modules/util-deprecate/README.md similarity index 100% rename from www/node_modules/util-deprecate/README.md rename to www2/node_modules/util-deprecate/README.md diff --git a/www/node_modules/util-deprecate/browser.js b/www2/node_modules/util-deprecate/browser.js similarity index 100% rename from www/node_modules/util-deprecate/browser.js rename to www2/node_modules/util-deprecate/browser.js diff --git a/www/node_modules/util-deprecate/node.js b/www2/node_modules/util-deprecate/node.js similarity index 100% rename from www/node_modules/util-deprecate/node.js rename to www2/node_modules/util-deprecate/node.js diff --git a/www/node_modules/util-deprecate/package.json b/www2/node_modules/util-deprecate/package.json similarity index 100% rename from www/node_modules/util-deprecate/package.json rename to www2/node_modules/util-deprecate/package.json diff --git a/www/node_modules/utils-merge/.npmignore b/www2/node_modules/utils-merge/.npmignore similarity index 100% rename from www/node_modules/utils-merge/.npmignore rename to www2/node_modules/utils-merge/.npmignore diff --git a/www/node_modules/utils-merge/LICENSE b/www2/node_modules/utils-merge/LICENSE similarity index 100% rename from www/node_modules/utils-merge/LICENSE rename to www2/node_modules/utils-merge/LICENSE diff --git a/www/node_modules/utils-merge/README.md b/www2/node_modules/utils-merge/README.md similarity index 100% rename from www/node_modules/utils-merge/README.md rename to www2/node_modules/utils-merge/README.md diff --git a/www/node_modules/utils-merge/index.js b/www2/node_modules/utils-merge/index.js similarity index 100% rename from www/node_modules/utils-merge/index.js rename to www2/node_modules/utils-merge/index.js diff --git a/www/node_modules/utils-merge/package.json b/www2/node_modules/utils-merge/package.json similarity index 100% rename from www/node_modules/utils-merge/package.json rename to www2/node_modules/utils-merge/package.json diff --git a/www/node_modules/vary/HISTORY.md b/www2/node_modules/vary/HISTORY.md similarity index 100% rename from www/node_modules/vary/HISTORY.md rename to www2/node_modules/vary/HISTORY.md diff --git a/www/node_modules/vary/LICENSE b/www2/node_modules/vary/LICENSE similarity index 100% rename from www/node_modules/vary/LICENSE rename to www2/node_modules/vary/LICENSE diff --git a/www/node_modules/vary/README.md b/www2/node_modules/vary/README.md similarity index 100% rename from www/node_modules/vary/README.md rename to www2/node_modules/vary/README.md diff --git a/www/node_modules/vary/index.js b/www2/node_modules/vary/index.js similarity index 100% rename from www/node_modules/vary/index.js rename to www2/node_modules/vary/index.js diff --git a/www/node_modules/vary/package.json b/www2/node_modules/vary/package.json similarity index 100% rename from www/node_modules/vary/package.json rename to www2/node_modules/vary/package.json diff --git a/www/node_modules/xtend/.jshintrc b/www2/node_modules/xtend/.jshintrc similarity index 100% rename from www/node_modules/xtend/.jshintrc rename to www2/node_modules/xtend/.jshintrc diff --git a/www/node_modules/xtend/LICENSE b/www2/node_modules/xtend/LICENSE similarity index 100% rename from www/node_modules/xtend/LICENSE rename to www2/node_modules/xtend/LICENSE diff --git a/www/node_modules/xtend/README.md b/www2/node_modules/xtend/README.md similarity index 100% rename from www/node_modules/xtend/README.md rename to www2/node_modules/xtend/README.md diff --git a/www/node_modules/xtend/immutable.js b/www2/node_modules/xtend/immutable.js similarity index 100% rename from www/node_modules/xtend/immutable.js rename to www2/node_modules/xtend/immutable.js diff --git a/www/node_modules/xtend/mutable.js b/www2/node_modules/xtend/mutable.js similarity index 100% rename from www/node_modules/xtend/mutable.js rename to www2/node_modules/xtend/mutable.js diff --git a/www/node_modules/xtend/package.json b/www2/node_modules/xtend/package.json similarity index 100% rename from www/node_modules/xtend/package.json rename to www2/node_modules/xtend/package.json diff --git a/www/node_modules/xtend/test.js b/www2/node_modules/xtend/test.js similarity index 100% rename from www/node_modules/xtend/test.js rename to www2/node_modules/xtend/test.js diff --git a/www/package-lock.json b/www2/package-lock.json similarity index 97% rename from www/package-lock.json rename to www2/package-lock.json index e11919c..1754865 100644 --- a/www/package-lock.json +++ b/www2/package-lock.json @@ -1,12 +1,14 @@ { - "name": "www", + "name": "www2", "lockfileVersion": 3, "requires": true, "packages": { "": { "dependencies": { "body-parser": "^1.20.2", + "cors": "^2.8.5", "express": "^4.19.2", + "express-fileupload": "^1.5.0", "express-session": "^1.18.0", "multer": "^1.4.5-lts.1", "mysql": "^2.18.1" @@ -158,6 +160,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -285,6 +299,17 @@ "node": ">= 0.10.0" } }, + "node_modules/express-fileupload": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.5.0.tgz", + "integrity": "sha512-jSW3w9evqM37VWkEPkL2Ck5wUo2a8qa03MH+Ou/0ZSTpNlQFBvSLjU12k2nYcHhaMPv4JVvv6+Ac1OuLgUZb7w==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/express-session": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.0.tgz", diff --git a/www/package.json b/www2/package.json similarity index 54% rename from www/package.json rename to www2/package.json index 5119d48..9e87e97 100644 --- a/www/package.json +++ b/www2/package.json @@ -1,7 +1,13 @@ { + "scripts": { + "start": "nodemon main.js", + "start2": "nodemon main2.js" + }, "dependencies": { "body-parser": "^1.20.2", + "cors": "^2.8.5", "express": "^4.19.2", + "express-fileupload": "^1.5.0", "express-session": "^1.18.0", "multer": "^1.4.5-lts.1", "mysql": "^2.18.1" diff --git a/www/sql/mailrecords.sql b/www2/sql/mailrecords.sql similarity index 85% rename from www/sql/mailrecords.sql rename to www2/sql/mailrecords.sql index eb1cabc..f13c3e3 100644 --- a/www/sql/mailrecords.sql +++ b/www2/sql/mailrecords.sql @@ -34,9 +34,21 @@ CREATE TABLE `mail` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +DROP TABLE IF EXISTS `images`; + +CREATE TABLE images ( + id INT AUTO_INCREMENT PRIMARY KEY, + username varchar(1000), + name VARCHAR(255) NOT NULL, + path VARCHAR(255) NOT NULL, + hash VARCHAR(255) NOT NULL, + UNIQUE KEY unique_hash (hash) +); diff --git a/www2/static/Untitled-1.html b/www2/static/Untitled-1.html new file mode 100644 index 0000000..8fe0fa8 --- /dev/null +++ b/www2/static/Untitled-1.html @@ -0,0 +1,33 @@ + + + + 文件上传示例 + + + +
+ + +
+ +
+ + + + + \ No newline at end of file diff --git a/www/static/form.html b/www2/static/form.html similarity index 95% rename from www/static/form.html rename to www2/static/form.html index 45b431c..cc86475 100644 --- a/www/static/form.html +++ b/www2/static/form.html @@ -2,7 +2,7 @@ - 创建用户 + 创建账户 + + + + + + + + +

欢迎您,尊敬的

+

欢迎访问识别系统!

+ + +
+
识别查询
+
后台管理
+
+ + + + + + +

联系我们

+

如有任何关于系统的疑问或建议,请联系我们:

+
+ 电子邮件:aa893824054@163.com
+ 电话:184-7635-1355 +
+ + + + + \ No newline at end of file diff --git a/www/test.js b/www2/test.js similarity index 100% rename from www/test.js rename to www2/test.js diff --git a/www2/uploads/1.jpg b/www2/uploads/1.jpg new file mode 100644 index 0000000..ad07db7 Binary files /dev/null and b/www2/uploads/1.jpg differ diff --git a/www2/uploads/1720487843718.jpg b/www2/uploads/1720487843718.jpg new file mode 100644 index 0000000..707329a Binary files /dev/null and b/www2/uploads/1720487843718.jpg differ diff --git a/www2/uploads/20240707203524.png b/www2/uploads/20240707203524.png new file mode 100644 index 0000000..9a8a2c3 Binary files /dev/null and b/www2/uploads/20240707203524.png differ diff --git a/www2/uploads/5.PNG b/www2/uploads/5.PNG new file mode 100644 index 0000000..00abfad Binary files /dev/null and b/www2/uploads/5.PNG differ diff --git a/www2/uploads/Zombatar_1.jpg b/www2/uploads/Zombatar_1.jpg new file mode 100644 index 0000000..5a52b02 Binary files /dev/null and b/www2/uploads/Zombatar_1.jpg differ diff --git a/www2/uploads/zh1112211121u.png b/www2/uploads/zh1112211121u.png new file mode 100644 index 0000000..1bd5381 Binary files /dev/null and b/www2/uploads/zh1112211121u.png differ diff --git a/www2/uploads/zh1112221u.png b/www2/uploads/zh1112221u.png new file mode 100644 index 0000000..88f81a9 Binary files /dev/null and b/www2/uploads/zh1112221u.png differ diff --git a/www2/uploads/zh111u.jpg b/www2/uploads/zh111u.jpg new file mode 100644 index 0000000..9603542 Binary files /dev/null and b/www2/uploads/zh111u.jpg differ