Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MC greater than 0.9.7 plugin arch fixes #3143

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

ryanblenis
Copy link
Contributor

@ryanblenis ryanblenis commented Sep 20, 2021

Hey Ylian! It's been a while as I've taken to other projects lately, but I was getting quite a few issues posted on my plugins project pages regarding incompatibilities as of late.

  1. It appears mongodb got bumped up and we needed to change the ObjectID to ObjectId for compatibility.

  2. It looks like you did some dependency cleanup and rimraf is no longer available (used to rm -rf plugin folders upon deletion)

Note that I'm not certain of the current project requirements / minimal versions supported, but I replaced the rimraf call with fs.rmdirSync which I believe has supported the recursive option since node v12.10

Please let me know if I need to make any other adjustments for compatibility. Thank you!

This should fix the inability to delete / install plugins since 0.9.7

Copy link

@RJ087 RJ087 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Ryan I am able to add plugins and delete them now. The issue I am having now with scripttask is that its not letting me add or delete folders or even add scripts.

@ryanblenis
Copy link
Contributor Author

Thanks, Ryan I am able to add plugins and delete them now. The issue I am having now with scripttask is that its not letting me add or delete folders or even add scripts.

I assume you added this PR already without waiting for a release from Ylian? I was holding back plugin update pushes to my repos until this was integrated into the main project. But if you're editing the files on your own, you can look for the following and replace it in the scripttask plugin:

FIND in db.js

formatId = require('mongodb').ObjectID;

REPLACE WITH:

          if (typeof require('mongodb').ObjectID == 'function') {
              formatId = require('mongodb').ObjectID;
          } else {
              formatId = require('mongodb').ObjectId;
          }

and that should make you whole again until public updates are released.

@RJ087
Copy link

RJ087 commented Sep 21, 2021

Got it, Thanks!

@Ylianst
Copy link
Owner

Ylianst commented Sep 21, 2021

Arg. I am on vacation until October 6th. At which point, I will accept and publish this immediately. Excellent pull request.

@Ylianst
Copy link
Owner

Ylianst commented Oct 7, 2021

Thanks. I just pulled the change, will be in MeshCentral v0.9.29.

@mikecole79
Copy link

I have updated to 0.9.29 and the problem described in ryanblenis/MeshCentral-ScriptTask#19 still exists.

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.

None yet

4 participants