This commit is contained in:
tezlm 2022-03-31 23:29:22 -07:00
parent 4dac540f62
commit 40fc5d30f2
7 changed files with 156 additions and 1 deletions

View file

@ -1,4 +1,4 @@
/assets/ resources for the site itself /assets/ resources for the site itself
/media/ images, videos, music, and other cool stuff i found /media/ images, videos, music, and other cool stuff i found. most of this is not mine, but gathered from multiple sources.
/public/ random things that i have made public /public/ random things that i have made public
/git/ my git repositories, coming soon! /git/ my git repositories, coming soon!

View file

@ -36,6 +36,8 @@ module.exports = (app, dir, log) => {
// secure the things // secure the things
app.get("/private/*", authorize(process.env.SECURE_USER, process.env.SECURE_PASS)); app.get("/private/*", authorize(process.env.SECURE_USER, process.env.SECURE_PASS));
app.get("/private/", authorize(process.env.SECURE_USER, process.env.SECURE_PASS)); app.get("/private/", authorize(process.env.SECURE_USER, process.env.SECURE_PASS));
app.all("/upload", authorize(process.env.SECURE_USER, process.env.SECURE_PASS));
app.all("/upload/", authorize(process.env.SECURE_USER, process.env.SECURE_PASS));
app.get("/restrict/", authorize(process.env.RESTRICT_USER, process.env.RESTRICT_PASS)); app.get("/restrict/", authorize(process.env.RESTRICT_USER, process.env.RESTRICT_PASS));
app.get("/restrict/*", authorize(process.env.RESTRICT_USER, process.env.RESTRICT_PASS)); app.get("/restrict/*", authorize(process.env.RESTRICT_USER, process.env.RESTRICT_PASS));
} }

View file

@ -13,5 +13,8 @@ module.exports = (app, dir, log) => {
app.get("/unlist", redir("/unlist/"), file("/unlist/unlist.html")); app.get("/unlist", redir("/unlist/"), file("/unlist/unlist.html"));
app.get("/cinny", redir("/cinny/"), file("/cinny/index.html")); app.get("/cinny", redir("/cinny/"), file("/cinny/index.html"));
app.get("/xterm", file("/xterm.html")); app.get("/xterm", file("/xterm.html"));
app.get("/upload", file("/private/upload.html"));
app.get("/~skybldev", redir("https://skybldev.eu.org/"));
}; };

17
modules/07-upload.js Normal file
View file

@ -0,0 +1,17 @@
const multer = require("multer");
const path = require("path");
module.exports = (app, dir, log) => {
const storage = multer.diskStorage({
destination: (_, file, call) => call(null, path.join(dir, "uploads/")),
filename: (_, file, call) => call(null, file.originalname),
});
const upload = multer({ storage });
app.post("/upload", upload.single("file"), (req, res) => {
log.info(`uploaded ${req.file.originalname}, size ${req.file.size}`);
res.end(`uploaded ${req.file.originalname}, size ${req.file.size}`);
});
};

View file

@ -17,6 +17,7 @@
"lru-cache": "^7.7.1", "lru-cache": "^7.7.1",
"markdown-it": "^12.3.2", "markdown-it": "^12.3.2",
"markdown-it-image-figures": "^2.0.0", "markdown-it-image-figures": "^2.0.0",
"multer": "^1.4.4",
"mustache": "^4.2.0", "mustache": "^4.2.0",
"mustache-express": "^1.3.2", "mustache-express": "^1.3.2",
"node-os-utils": "^1.3.6", "node-os-utils": "^1.3.6",

View file

@ -9,6 +9,7 @@ specifiers:
lru-cache: ^7.7.1 lru-cache: ^7.7.1
markdown-it: ^12.3.2 markdown-it: ^12.3.2
markdown-it-image-figures: ^2.0.0 markdown-it-image-figures: ^2.0.0
multer: ^1.4.4
mustache: ^4.2.0 mustache: ^4.2.0
mustache-express: ^1.3.2 mustache-express: ^1.3.2
node-os-utils: ^1.3.6 node-os-utils: ^1.3.6
@ -25,6 +26,7 @@ dependencies:
lru-cache: 7.7.1 lru-cache: 7.7.1
markdown-it: 12.3.2 markdown-it: 12.3.2
markdown-it-image-figures: 2.0.0_markdown-it@12.3.2 markdown-it-image-figures: 2.0.0_markdown-it@12.3.2
multer: 1.4.4
mustache: 4.2.0 mustache: 4.2.0
mustache-express: 1.3.2 mustache-express: 1.3.2
node-os-utils: 1.3.6 node-os-utils: 1.3.6
@ -42,6 +44,10 @@ packages:
negotiator: 0.6.3 negotiator: 0.6.3
dev: false dev: false
/append-field/1.0.0:
resolution: {integrity: sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=}
dev: false
/argparse/2.0.1: /argparse/2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
dev: false dev: false
@ -70,6 +76,18 @@ packages:
type-is: 1.6.18 type-is: 1.6.18
dev: false dev: false
/buffer-from/1.1.2:
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
dev: false
/busboy/0.2.14:
resolution: {integrity: sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=}
engines: {node: '>=0.8.0'}
dependencies:
dicer: 0.2.5
readable-stream: 1.1.14
dev: false
/bytes/3.0.0: /bytes/3.0.0:
resolution: {integrity: sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=} resolution: {integrity: sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
@ -100,6 +118,16 @@ packages:
vary: 1.1.2 vary: 1.1.2
dev: false dev: false
/concat-stream/1.6.2:
resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
engines: {'0': node >= 0.8}
dependencies:
buffer-from: 1.1.2
inherits: 2.0.4
readable-stream: 2.3.7
typedarray: 0.0.6
dev: false
/content-disposition/0.5.4: /content-disposition/0.5.4:
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
@ -121,6 +149,10 @@ packages:
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
dev: false dev: false
/core-util-is/1.0.3:
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
dev: false
/debug/2.6.9: /debug/2.6.9:
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
dependencies: dependencies:
@ -136,6 +168,14 @@ packages:
resolution: {integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=} resolution: {integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=}
dev: false dev: false
/dicer/0.2.5:
resolution: {integrity: sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=}
engines: {node: '>=0.8.0'}
dependencies:
readable-stream: 1.1.14
streamsearch: 0.1.2
dev: false
/dotenv/16.0.0: /dotenv/16.0.0:
resolution: {integrity: sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==} resolution: {integrity: sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==}
engines: {node: '>=12'} engines: {node: '>=12'}
@ -281,6 +321,14 @@ packages:
fast-xml-parser: 3.21.1 fast-xml-parser: 3.21.1
dev: false dev: false
/isarray/0.0.1:
resolution: {integrity: sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=}
dev: false
/isarray/1.0.0:
resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=}
dev: false
/linkify-it/3.0.3: /linkify-it/3.0.3:
resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==}
dependencies: dependencies:
@ -355,6 +403,17 @@ packages:
hasBin: true hasBin: true
dev: false dev: false
/minimist/1.2.6:
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
dev: false
/mkdirp/0.5.6:
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
hasBin: true
dependencies:
minimist: 1.2.6
dev: false
/ms/2.0.0: /ms/2.0.0:
resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=}
dev: false dev: false
@ -363,6 +422,20 @@ packages:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
dev: false dev: false
/multer/1.4.4:
resolution: {integrity: sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw==}
engines: {node: '>= 0.10.0'}
dependencies:
append-field: 1.0.0
busboy: 0.2.14
concat-stream: 1.6.2
mkdirp: 0.5.6
object-assign: 4.1.1
on-finished: 2.3.0
type-is: 1.6.18
xtend: 4.0.2
dev: false
/mustache-express/1.3.2: /mustache-express/1.3.2:
resolution: {integrity: sha512-yAdGHctEq9ubUH7h9O6Z6kW35fwfE+7LpW/TBrcfVibZuiVRHDcK8DEydgiU5nlJmJUY5VC3jv2lzaPUL+Arkw==} resolution: {integrity: sha512-yAdGHctEq9ubUH7h9O6Z6kW35fwfE+7LpW/TBrcfVibZuiVRHDcK8DEydgiU5nlJmJUY5VC3jv2lzaPUL+Arkw==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -397,6 +470,11 @@ packages:
nan: 2.15.0 nan: 2.15.0
dev: false dev: false
/object-assign/4.1.1:
resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=}
engines: {node: '>=0.10.0'}
dev: false
/on-finished/2.3.0: /on-finished/2.3.0:
resolution: {integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=} resolution: {integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
@ -418,6 +496,10 @@ packages:
resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=} resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=}
dev: false dev: false
/process-nextick-args/2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
dev: false
/proxy-addr/2.0.7: /proxy-addr/2.0.7:
resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==}
engines: {node: '>= 0.10'} engines: {node: '>= 0.10'}
@ -446,6 +528,27 @@ packages:
unpipe: 1.0.0 unpipe: 1.0.0
dev: false dev: false
/readable-stream/1.1.14:
resolution: {integrity: sha1-fPTFTvZI44EwhMY23SB54WbAgdk=}
dependencies:
core-util-is: 1.0.3
inherits: 2.0.4
isarray: 0.0.1
string_decoder: 0.10.31
dev: false
/readable-stream/2.3.7:
resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==}
dependencies:
core-util-is: 1.0.3
inherits: 2.0.4
isarray: 1.0.0
process-nextick-args: 2.0.1
safe-buffer: 5.1.2
string_decoder: 1.1.1
util-deprecate: 1.0.2
dev: false
/safe-buffer/5.1.2: /safe-buffer/5.1.2:
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
dev: false dev: false
@ -496,6 +599,21 @@ packages:
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
dev: false dev: false
/streamsearch/0.1.2:
resolution: {integrity: sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=}
engines: {node: '>=0.8.0'}
dev: false
/string_decoder/0.10.31:
resolution: {integrity: sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=}
dev: false
/string_decoder/1.1.1:
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
dependencies:
safe-buffer: 5.1.2
dev: false
/strnum/1.0.5: /strnum/1.0.5:
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
dev: false dev: false
@ -513,6 +631,10 @@ packages:
mime-types: 2.1.35 mime-types: 2.1.35
dev: false dev: false
/typedarray/0.0.6:
resolution: {integrity: sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=}
dev: false
/uc.micro/1.0.6: /uc.micro/1.0.6:
resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==}
dev: false dev: false
@ -522,6 +644,10 @@ packages:
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
dev: false dev: false
/util-deprecate/1.0.2:
resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
dev: false
/utils-merge/1.0.1: /utils-merge/1.0.1:
resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=}
engines: {node: '>= 0.4.0'} engines: {node: '>= 0.4.0'}
@ -545,6 +671,11 @@ packages:
optional: true optional: true
dev: false dev: false
/xtend/4.0.2:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
dev: false
/xterm-addon-attach/0.6.0_xterm@4.18.0: /xterm-addon-attach/0.6.0_xterm@4.18.0:
resolution: {integrity: sha512-Mo8r3HTjI/EZfczVCwRU6jh438B4WLXxdFO86OB7bx0jGhwh2GdF4ifx/rP+OB+Cb2vmLhhVIZ00/7x3YSP3dg==} resolution: {integrity: sha512-Mo8r3HTjI/EZfczVCwRU6jh438B4WLXxdFO86OB7bx0jGhwh2GdF4ifx/rP+OB+Cb2vmLhhVIZ00/7x3YSP3dg==}
peerDependencies: peerDependencies:

1
uploads Symbolic link
View file

@ -0,0 +1 @@
/home/zestylemonade/uploads