Исправления из-за нарушения авторских прав
This commit is contained in:
@@ -18,7 +18,8 @@ module.exports = {
|
||||
|
||||
useExternalBookConverter: false,
|
||||
acceptFileExt: '.fb2, .fb3, .html, .txt, .zip, .bz2, .gz, .rar, .epub, .mobi, .rtf, .doc, .docx, .pdf, .djvu, .jpg, .jpeg, .png',
|
||||
webConfigParams: ['name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'bucEnabled', 'branch', 'networkLibraryLink'],
|
||||
restricted: {},
|
||||
webConfigParams: ['name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'bucEnabled', 'branch', 'networkLibraryLink', 'restricted'],
|
||||
|
||||
jembaDb: [
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ class ConfigManager {
|
||||
|
||||
await fs.ensureDir(config.dataDir);
|
||||
this._userConfigFile = `${config.dataDir}/config.json`;
|
||||
this._restrictedFile = `${config.dataDir}/restricted.json`;
|
||||
this._config = config;
|
||||
|
||||
this.inited = true;
|
||||
@@ -75,6 +76,10 @@ class ConfigManager {
|
||||
return this._userConfigFile;
|
||||
}
|
||||
|
||||
get restrictedFile() {
|
||||
return this._restrictedFile;
|
||||
}
|
||||
|
||||
set userConfigFile(value) {
|
||||
if (value)
|
||||
this._userConfigFile = value;
|
||||
@@ -100,6 +105,12 @@ class ConfigManager {
|
||||
} else {
|
||||
await this.save();
|
||||
}
|
||||
|
||||
if (await fs.pathExists(this.restrictedFile)) {
|
||||
const data = JSON.parse(await fs.readFile(this.restrictedFile, 'utf8'));
|
||||
|
||||
this.config = {restricted: data};
|
||||
}
|
||||
} catch(e) {
|
||||
throw new Error(`Error while loading "${this.userConfigFile}": ${e.message}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user