diff --git a/Dockerfile b/Dockerfile index a53fb49..ccdb977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM node:latest RUN apt-get update && apt-get upgrade -y WORKDIR /dunestorm/nubian -COPY src /dunestorm/nubian +COPY package.json /dunestorm/nubian/ +COPY src /dunestorm/nubian/src RUN npm i CMD ["npm","start"] # EXPOSE PORTS -EXPOSE 4001 +EXPOSE 52001 diff --git a/src/package.json b/package.json similarity index 93% rename from src/package.json rename to package.json index 425517e..3c8e4be 100644 --- a/src/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Dunemask Web server", "main": "server.js", "scripts": { - "start": "node server.js --no-warnings", + "start": "node src/server.js --no-warnings", "test-server": "nodemon src/server.js" }, "repository": { diff --git a/src/api/storage.js b/src/api/storage.js index a4d6ecb..fbd4908 100644 --- a/src/api/storage.js +++ b/src/api/storage.js @@ -11,11 +11,14 @@ const AdmZip = require("adm-zip"); const Pharaoh = require("../egypt/pharaoh"); const desertConfig = require("../egypt/desert_config.json"); const config = require("../config.json"); +// Create the desert if it doesn't exist +if (!fexists(desertConfig.desertPath)) mkdir(desertConfig.desertPath); //Constants const fileStorage = new Pharaoh( resolvePath(desertConfig.desertPath), desertConfig.schema ); + const zipDir = resolvePath(config.Storage.ZipPath); function addFile(fileData) { fileStorage.addEntry(fileData.fileUuid, "files", fileData); diff --git a/src/config.json b/src/config.json index 383a53e..2df670c 100644 --- a/src/config.json +++ b/src/config.json @@ -10,11 +10,11 @@ "ZipDownloadExpire": 720000 }, "Server": { - "Port": 4000, + "Port": 52001, "Debug": false, "BodyLimit": "5mb", "ZipRemovalInterval": 1800000, "jwtHeader": "authorization", - "authServer": "http://localhost:4001/api/user/data" + "authServer": "http://cairo.dunestorm.net:52000/api/user/data" } } diff --git a/src/egypt/desert_config.json b/src/egypt/desert_config.json index 3574469..5dc7f0c 100644 --- a/src/egypt/desert_config.json +++ b/src/egypt/desert_config.json @@ -1,5 +1,5 @@ { - "desertPath": "desert/", + "desertPath": "src/desert/", "schema": { "files": { "tokenList": "abcdefghijklmnopqrstuvwxyz0123456789",