do not init plugins that are disabled
This commit is contained in:
@@ -104,7 +104,7 @@ async function loadPlugin(domain, pluginDir) {
|
||||
|
||||
// Check if plugin is disabled (after system plugin override)
|
||||
if (config.enabled === false) {
|
||||
logInfo('PluginHandler', `Plugin ${domain} is disabled in config.json, skipping load`);
|
||||
logInfo('PluginHandler', `Plugin ${domain} is disabled in config.json, skipping initialization completely (no hyperdb, no channels, nothing)`);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -446,12 +446,12 @@ async function discoverInternalDomains() {
|
||||
const config = loadPluginConfig(pluginDir);
|
||||
// If plugin has valid config and is enabled, it's an internal domain
|
||||
if (config && config.name && config.version) {
|
||||
// Only register domain if plugin is enabled
|
||||
if (config.enabled !== false) {
|
||||
// Only register domain if plugin is enabled (default true, explicitly check for false)
|
||||
if (config.enabled === false) {
|
||||
logDebug('PluginHandler', `Plugin ${domain} is disabled in config.json, not registering as internal domain`);
|
||||
} else {
|
||||
internalDomains.add(domain);
|
||||
logDebug('PluginHandler', `Discovered internal domain from plugin: ${domain}`);
|
||||
} else {
|
||||
logDebug('PluginHandler', `Plugin ${domain} is disabled, not registering as internal domain`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -509,10 +509,10 @@ async function getAllPluginDomainsFromDisk() {
|
||||
const config = loadPluginConfig(pluginDir);
|
||||
if (config && config.name && config.version) {
|
||||
// Only add domain if plugin is enabled
|
||||
if (config.enabled !== false) {
|
||||
domains.add(domain);
|
||||
if (config.enabled === false) {
|
||||
logDebug('PluginHandler', `Plugin ${domain} is disabled in config.json, not including in plugin domains list`);
|
||||
} else {
|
||||
logDebug('PluginHandler', `Plugin ${domain} is disabled, not including in plugin domains list`);
|
||||
domains.add(domain);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "File Drop",
|
||||
"version": "1.0.4",
|
||||
"domain": "file.drop",
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"description": "Temporary 24-hour file storage with shareable links",
|
||||
"author": "P2NS",
|
||||
"license": "MIT",
|
||||
@@ -17,14 +17,46 @@
|
||||
"name": "files",
|
||||
"compact": true,
|
||||
"fields": [
|
||||
{ "name": "id", "type": "string", "required": true },
|
||||
{ "name": "filename", "type": "string", "required": true },
|
||||
{ "name": "size", "type": "uint", "required": true },
|
||||
{ "name": "mimeType", "type": "string", "required": true },
|
||||
{ "name": "driveKey", "type": "string", "required": true },
|
||||
{ "name": "destroyOnDownload", "type": "bool", "required": false },
|
||||
{ "name": "uploadedAt", "type": "uint", "required": true },
|
||||
{ "name": "expiresAt", "type": "uint", "required": true }
|
||||
{
|
||||
"name": "id",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "filename",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "size",
|
||||
"type": "uint",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "mimeType",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "driveKey",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "destroyOnDownload",
|
||||
"type": "bool",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "uploadedAt",
|
||||
"type": "uint",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "expiresAt",
|
||||
"type": "uint",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -33,7 +65,9 @@
|
||||
{
|
||||
"name": "files",
|
||||
"schema": "@filedrop/files",
|
||||
"key": ["id"]
|
||||
"key": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
@@ -41,9 +75,10 @@
|
||||
"name": "files-by-expiry",
|
||||
"collection": "@filedrop/files",
|
||||
"unique": false,
|
||||
"key": ["expiresAt"]
|
||||
"key": [
|
||||
"expiresAt"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user