Skip to content

fix(db): detect MongoDB mode + guard getConfigFilePath removed in 1.2.5 - #16

Open
claytontavaresdan wants to merge 1 commit into
ryanblenis:masterfrom
claytontavaresdan:fix/mongodb-mode-125
Open

claytontavaresdan wants to merge 1 commit into
ryanblenis:masterfrom
claytontavaresdan:fix/mongodb-mode-125

Conversation

@claytontavaresdan

Copy link
Copy Markdown

Summary / Resumo

EN: Plugin fails on MeshCentral 1.2.5 + MongoDB mode. Root cause: the Mongo branch was gated behind meshserver.args.mongodb (not populated in plugin load context) and the NeDB fallback called meshserver.getConfigFilePath(...) which was removed in 1.2.5.

PT: Plugin quebra no MeshCentral 1.2.5 + modo MongoDB. Causa: o branch Mongo era protegido por meshserver.args.mongodb (não populado no contexto de plugin) e o fallback NeDB chamava meshserver.getConfigFilePath(...) removido no 1.2.5.

Fix / Correção

  • Detect Mongo via meshserver.args.mongodb || meshserver.parent?.args?.mongodb
  • Guard getConfigFilePath with typeof === 'function', fallback to path.join(dataPath, ...)

Fixes #15

…Central 1.2.5)

On MeshCentral 1.2.5 running in MongoDB mode, the plugin failed because:
1. The Mongo branch was gated behind meshserver.args.mongodb, which is
   not populated in the plugin load context (only the core's own db.js
   gets it). Now falls back to meshserver.parent.args.mongodb.
2. The NeDB fallback called meshserver.getConfigFilePath(...), a method
   removed in 1.2.5, causing a TypeError. Now guarded with a typeof
   check and falls back to path.join(dataPath, ...).

Fixes ryanblenis#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin fails on MeshCentral 1.2.5 + MongoDB mode — getConfigFilePath removed / args.mongodb not detected

1 participant