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

Allow installing plugins declaratively #6548

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Infinidoge
Copy link

@Infinidoge Infinidoge commented Aug 16, 2024

Description

Implements the ability for PeerTube to self-install plugins that are declared upfront in a file, checking the file on startup to install/uninstall/update accordingly. The format for the declarative_plugins.json file is as such:

{
  "npm-name-here": {
    "pluginPath": "path/to/plugin/directory",
    // OR
    "version": "yarn.add.compatible-version",
    
    "extraArgs": "--extra --arguments --passed --to --yarn",
    "preInstall": "command run before calling yarn",
    "postInstall": "command run after calling yarn"
  }
}

This design makes it very flexible for different ways of handling installing/uninstaling, with the only thing left out being a way to specify a different command to install a plugin with (such as using npm instead of yarn). Since Yarn is the foundation for plugin management internally, I decided to leave that out in this implementation.

I am not a seasoned TypeScript developer by any stretch of the imagination, so please let me know wherever the code can be improved.

TODO:

  • Add usage to documentation
  • Add unit test

Related issues

Resolves #6428

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this PR does not update server code
  • 🙋 no, because I need help

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.

Declarative plugin management
1 participant