Fix:Setting file ownership for /config and /metadata/logs #584

This commit is contained in:
advplyr 2022-12-15 17:30:45 -06:00
parent 793cc989de
commit d130dd6d5e
4 changed files with 43 additions and 23 deletions

View file

@ -2,6 +2,7 @@ const Path = require('path')
const njodb = require('./libs/njodb')
const Logger = require('./Logger')
const { version } = require('../package.json')
const filePerms = require('./utils/filePerms')
const LibraryItem = require('./objects/LibraryItem')
const User = require('./objects/user/User')
const Collection = require('./objects/Collection')
@ -131,6 +132,9 @@ class Db {
async init() {
await this.load()
// Set file ownership for all files created by db
await filePerms.setDefault(global.ConfigPath, true)
if (!this.serverSettings) { // Create first load server settings
this.serverSettings = new ServerSettings()
await this.insertEntity('settings', this.serverSettings)