MCPcopy
hub / github.com/advplyr/audiobookshelf / initializeServer

Method initializeServer

server/Server.js:431–440  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

429 }
430
431 async initializeServer(req, res) {
432 Logger.info(`[Server] Initializing new server`)
433 const newRoot = req.body.newRoot
434 const rootUsername = newRoot.username || 'root'
435 const rootPash = newRoot.password ? await this.auth.localAuthStrategy.hashPassword(newRoot.password) : ''
436 if (!rootPash) Logger.warn(`[Server] Creating root user with no password`)
437 await Database.createRootUser(rootUsername, rootPash, this.auth)
438
439 res.sendStatus(200)
440 }
441
442 /**
443 * Remove user media progress for items that no longer exist & remove seriesHideFrom that no longer exist

Callers 1

startMethod · 0.95

Calls 4

hashPasswordMethod · 0.80
infoMethod · 0.65
warnMethod · 0.65
createRootUserMethod · 0.45

Tested by

no test coverage detected