mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-19 03:15:58 +02:00
Fix: set downloaded/uploaded cover owner and permissions and if creating intitial config/metadata directories at startup then set owner of those #394
This commit is contained in:
@@ -10,6 +10,7 @@ const { version } = require('../package.json')
|
||||
|
||||
// Utils
|
||||
const dbMigration = require('./utils/dbMigration')
|
||||
const filePerms = require('./utils/filePerms')
|
||||
const Logger = require('./Logger')
|
||||
|
||||
// Classes
|
||||
@@ -46,9 +47,18 @@ class Server {
|
||||
global.MetadataPath = global.MetadataPath.replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
fs.ensureDirSync(global.ConfigPath, 0o774)
|
||||
fs.ensureDirSync(global.MetadataPath, 0o774)
|
||||
fs.ensureDirSync(global.AudiobookPath, 0o774)
|
||||
if (!fs.pathExistsSync(global.ConfigPath)) {
|
||||
fs.mkdirSync(global.ConfigPath)
|
||||
filePerms.setDefaultDirSync(global.ConfigPath, false)
|
||||
}
|
||||
if (!fs.pathExistsSync(global.MetadataPath)) {
|
||||
fs.mkdirSync(global.MetadataPath)
|
||||
filePerms.setDefaultDirSync(global.MetadataPath, false)
|
||||
}
|
||||
if (!fs.pathExistsSync(global.AudiobookPath)) {
|
||||
fs.mkdirSync(global.AudiobookPath)
|
||||
filePerms.setDefaultDirSync(global.AudiobookPath, false)
|
||||
}
|
||||
|
||||
this.db = new Db()
|
||||
this.watcher = new Watcher()
|
||||
|
Reference in New Issue
Block a user