Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ass/commit/c9905eb127918a1135d77418c0ea7ede900039df You should set ROOT_URL correctly, otherwise the web may not work correctly.

feat: added file hashing

pull/243/head
Josh Moore 2 years ago
parent f245f06647
commit c9905eb127

@ -1,6 +1,7 @@
import fs from 'fs-extra';
import bb from 'express-busboy';
import { Router } from 'express';
import crypto from 'crypto';
import { log } from '../log';
import { UserConfig } from '../UserConfig';
import { random } from '../generators';
@ -51,6 +52,9 @@ router.post('/', async (req, res) => {
// Get the file size
const fileSize = (await fs.stat(bbFile.file)).size;
// Get the hash
const sha256 = crypto.createHash('sha256').update(await fs.readFile(bbFile.file)).digest('base64');
// * Move the file
if (!s3) await fs.move(bbFile.file, destination);
else await uploadFileS3(await fs.readFile(bbFile.file), bbFile.mimetype, fileKey);

Loading…
Cancel
Save