diff --git a/cdn/package.json b/cdn/package.json
index 2b2866cb..f7438109 100644
--- a/cdn/package.json
+++ b/cdn/package.json
@@ -21,38 +21,27 @@
},
"homepage": "https://github.com/fosscord/fosscord-server#readme",
"devDependencies": {
- "@ovos-media/ts-transform-paths": "^1.7.18-1",
- "@types/amqplib": "^0.8.1",
"@types/body-parser": "^1.19.0",
- "@types/btoa": "^1.2.3",
"@types/dotenv": "^8.2.0",
"@types/express": "^4.17.12",
- "@types/fs-extra": "^9.0.12",
- "@types/jsonwebtoken": "^8.5.0",
"@types/multer": "^1.4.7",
- "@types/node": "^18.0.6",
- "ts-patch": "^2.0.1"
+ "@types/node": "^18.0.6"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.36.1",
- "@aws-sdk/node-http-handler": "^3.36.0",
"@fosscord/util": "file:../util",
+ "@types/node-fetch": "^2.6.2",
"body-parser": "^1.19.0",
- "btoa": "^1.2.1",
"dotenv": "^16.0.1",
"exif-be-gone": "^1.2.0",
"express": "^4.17.1",
- "express-async-errors": "^3.1.1",
"file-type": "^17.1.2",
- "form-data": "^4.0.0",
- "fs-extra": "^10.0.0",
"image-size": "^1.0.0",
"jest": "^28.1.3",
- "lambert-db": "^1.2.3",
"lambert-server": "^1.2.12",
- "missing-native-js-functions": "^1.2.17",
"multer": "^1.4.5-lts.1",
- "nanocolors": "^0.2.12",
+ "node-fetch": "^2.6.7",
+ "picocolors": "^1.0.0",
"supertest": "^6.1.6",
"typescript": "^4.1.2"
},
diff --git a/cdn/src/routes/attachments.ts b/cdn/src/routes/attachments.ts
index 2aed752e..3e04fe76 100644
--- a/cdn/src/routes/attachments.ts
+++ b/cdn/src/routes/attachments.ts
@@ -2,7 +2,7 @@ import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@fosscord/util";
import { storage } from "../util/Storage";
import FileType from "file-type";
-import { HTTPError } from "lambert-server";
+import { HTTPError } from "@fosscord/util";
import { multer } from "../util/multer";
import imageSize from "image-size";
diff --git a/cdn/src/routes/avatars.ts b/cdn/src/routes/avatars.ts
index 3b521cc3..bbdf42cc 100644
--- a/cdn/src/routes/avatars.ts
+++ b/cdn/src/routes/avatars.ts
@@ -2,7 +2,7 @@ import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@fosscord/util";
import { storage } from "../util/Storage";
import FileType from "file-type";
-import { HTTPError } from "lambert-server";
+import { HTTPError } from "@fosscord/util";
import crypto from "crypto";
import { multer } from "../util/multer";
diff --git a/cdn/src/routes/external.ts b/cdn/src/routes/external.ts
index ed44c905..cf02f645 100644
--- a/cdn/src/routes/external.ts
+++ b/cdn/src/routes/external.ts
@@ -1,10 +1,9 @@
import { Router, Response, Request } from "express";
import fetch from "node-fetch";
-import { HTTPError } from "lambert-server";
-import { Snowflake } from "@fosscord/util";
+import { HTTPError } from "@fosscord/util";
+import { Snowflake, Config } from "@fosscord/util";
import { storage } from "../util/Storage";
import FileType from "file-type";
-import { Config } from "@fosscord/util";
// TODO: somehow handle the deletion of images posted to the /external route
diff --git a/cdn/src/routes/role-icons.ts b/cdn/src/routes/role-icons.ts
index a850db88..dd96c90e 100644
--- a/cdn/src/routes/role-icons.ts
+++ b/cdn/src/routes/role-icons.ts
@@ -2,7 +2,7 @@ import { Router, Response, Request } from "express";
import { Config, Snowflake } from "@fosscord/util";
import { storage } from "../util/Storage";
import FileType from "file-type";
-import { HTTPError } from "lambert-server";
+import { HTTPError } from "@fosscord/util";
import crypto from "crypto";
import { multer } from "../util/multer";
diff --git a/cdn/src/util/FileStorage.ts b/cdn/src/util/FileStorage.ts
index 376ce007..ed007abb 100644
--- a/cdn/src/util/FileStorage.ts
+++ b/cdn/src/util/FileStorage.ts
@@ -1,8 +1,7 @@
import { Storage } from "./Storage";
import fs from "fs";
-import fse from "fs-extra";
+//import fse from "fs-extra";
import { join, relative, dirname } from "path";
-import "missing-native-js-functions";
import { Readable } from "stream";
import ExifTransformer = require("exif-be-gone");
@@ -36,7 +35,8 @@ export class FileStorage implements Storage {
async set(path: string, value: any) {
path = getPath(path);
- fse.ensureDirSync(dirname(path));
+ //fse.ensureDirSync(dirname(path));
+ fs.mkdirSync(dirname(path), {recursive: true});
value = Readable.from(value);
const cleaned_file = fs.createWriteStream(path);
diff --git a/cdn/src/util/Storage.ts b/cdn/src/util/Storage.ts
index 89dd5634..728804a0 100644
--- a/cdn/src/util/Storage.ts
+++ b/cdn/src/util/Storage.ts
@@ -1,6 +1,7 @@
import { FileStorage } from "./FileStorage";
import path from "path";
-import fse from "fs-extra";
+//import fse from "fs-extra";
+import fs from "fs";
import { bgCyan, black } from "picocolors";
import { S3 } from "@aws-sdk/client-s3";
import { S3Storage } from "./S3Storage";
@@ -22,7 +23,8 @@ if (process.env.STORAGE_PROVIDER === "file" || !process.env.STORAGE_PROVIDER) {
location = path.join(process.cwd(), "files");
}
console.log(`[CDN] storage location: ${bgCyan(`${black(location)}`)}`);
- fse.ensureDirSync(location);
+ //fse.ensureDirSync(location);
+ fs.mkdirSync(location, {recursive: true});
process.env.STORAGE_LOCATION = location;
storage = new FileStorage();
diff --git a/cdn/tsconfig.json b/cdn/tsconfig.json
index 1ad037c6..94cc7b58 100644
--- a/cdn/tsconfig.json
+++ b/cdn/tsconfig.json
@@ -4,7 +4,7 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
- "incremental": true /* Enable incremental compilation */,
+ "incremental": false /* Enable incremental compilation */,
"target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"lib": [
|