Storing plugin versions in the database

  • Would it make sense to store the plugin versions in the database? Currently, only the plugin name is saved:

    > db.objects.find({ _key: 'plugins:active' })
    { "_id" : ObjectId("5c01945f24783cf614b4d40b"), "_key" : "plugins:active", "value" : "nodebb-widget-essentials", "score" : 3 }
    { "_id" : ObjectId("5c01945d24783cf614b4d095"), "_key" : "plugins:active", "value" : "nodebb-theme-persona", "score" : 0 }

    For context, the Cloudron NodeBB package does not save the node_modules as part of the backups (as plugin code is source code after all which is immutable). What we do is to install the required npm modules using the output of "nodebb plugins". This has worked well since a long time but recently we hit a issue where restoring an old nodebb installation resulted in the installation of a new plugin version and thus breaking the installation.

    Problem can be fixed if plugin version was stashed in the database. This way, we can then do npm install <plugin@version>.

    Thanks! (wasn't sure if this belonged to github or here, so trying this first).

  • Global Moderator

    Versions are not stored in the database, but should be stored in package.json as of a few versions ago.

  • @PitaJ Do you mean package.json of the plugins?

  • Global Moderator

    No I mean the package.json in the main nodebb directory.

Log in to reply

Suggested Topics

| |