diff --git a/client/package-lock.json b/client/package-lock.json index 9f6d2596..2c95fc9e 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "1.0.0", + "version": "1.1.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/client/package.json b/client/package.json index 0a81bd02..3247ff46 100644 --- a/client/package.json +++ b/client/package.json @@ -9,7 +9,7 @@ "start": "nuxt start", "generate": "nuxt generate" }, - "author": "", + "author": "advplyr", "license": "ISC", "dependencies": { "@nuxtjs/axios": "^5.13.6", diff --git a/package-lock.json b/package-lock.json index 9730a19e..097d9d74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "1.1.7", + "version": "1.1.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c5152ef3..8d3e54b7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "node index.js", "start": "node index.js", - "prod": "NODE_ENV=production node index.js" + "client": "cd client && npm install --production && npm run generate", + "prod": "npm run client && npm install && node prod.js" }, "author": "advplyr", "license": "ISC", @@ -29,4 +30,4 @@ "watcher": "^1.2.0" }, "devDependencies": {} -} \ No newline at end of file +} diff --git a/prod.js b/prod.js new file mode 100644 index 00000000..0fd3a918 --- /dev/null +++ b/prod.js @@ -0,0 +1,16 @@ +const Path = require('path') +process.env.TOKEN_SECRET = '09f26e402586e2faa8da4c98a35f1b20d6b033c6097befa8be3486a829587fe2f90a832bd3ff9d42710a4da095a2ce285b009f0c3730cd9b8e1af3eb84df6611' +process.env.NODE_ENV = 'production' + +const server = require('./server/Server') +global.appRoot = __dirname + +const PORT = process.env.PORT || 3333 +const CONFIG_PATH = process.env.CONFIG_PATH || Path.resolve('config') +const AUDIOBOOK_PATH = process.env.AUDIOBOOK_PATH || Path.resolve('audiobooks') +const METADATA_PATH = process.env.METADATA_PATH || Path.resolve('metadata') + +console.log('Config', CONFIG_PATH, METADATA_PATH, AUDIOBOOK_PATH) + +const Server = new server(PORT, CONFIG_PATH, METADATA_PATH, AUDIOBOOK_PATH) +Server.start() diff --git a/server/utils/downloadWorker.js b/server/utils/downloadWorker.js index 582da708..f59a26a4 100644 --- a/server/utils/downloadWorker.js +++ b/server/utils/downloadWorker.js @@ -1,6 +1,6 @@ const Ffmpeg = require('fluent-ffmpeg') -if (process.env.NODE_ENV !== 'production') { +if (process.env.FFMPEG_PATH) { Ffmpeg.setFfmpegPath(process.env.FFMPEG_PATH) }