MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.33k stars 395 forks source link

🚀 | Runtime plugin manager #1995

Open deimi opened 1 year ago

deimi commented 1 year ago

Feature Description

Adding plugins (respectively plugin code) via jukebox.yaml during runtime without having the plugin in the upstream project.

What functionality would you like to see in your phoniebox?

At the moment the only ways to get a custom plugin running is

In order to make it easier to develop new plugins it would be very handy to have something like plugin manager feature. Furthermore it would also decrease the amount of work for the upstream project maintainers as they won't need to maintain/review all possible plugins anymore.

How do you envision the feature to work from a users perspective?

The user just needs provide his plugin code via a public git repo (Github, Gitlab, Bitbucket, self hosted,...). Then he adds the url to his (or any other) plugin git repo to the `jukebox.yaml' which then gets loaded at startup.

Further information that might help

As the plugin system of future3 is already very flexible by just loading the configured plugins from the component directory at startup, it could be rather easy that the core component not just loads the plugins, but also depending on the config makes several git checkout/pull ahead of loading. A solution like this would also mean that there would not be the need for any centralized server like in pypi, npm, etc.

Example config:

modules:
  named:
    # Do not change the order!
    publishing: publishing
    volume: volume
    jingle: jingle
    jingle.alsawave: jingle.alsawave
    jingle.jinglemp3: jingle.jinglemp3
    player: playermpd
    cards: rfid.cards
    rfid: rfid.reader
    timers: timers
    host: hostif.linux
    bluetooth_audio_buttons: controls.bluetooth_audio_buttons
    gpio: gpio.gpioz.plugin
  others:
    - music_cover_art
    - misc
  manager:
    my_foo:
      git_url: github.com:deimi/my_foo_plugin.git
      branch: patch1
deimi commented 1 year ago

Don't know if there are already some ideas/concepts for this around on your side.
I think this would also be a rather simple solution for a powerful plugin manager.