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

[Request] API functions to add and remove custom directories to be served by decky loader web server on port 1337 #548

Open
3 tasks done
ebenbruyns opened this issue Oct 17, 2023 · 0 comments
Labels
feature request a request for a feature, no guarantee of addition

Comments

@ebenbruyns
Copy link

Please confirm

  • I have searched existing issues
  • This issue is not a duplicate of an existing one
  • This is not a request for a plugin

Feature Request Description

Could you please implement a couple of methods on the decky_loader api that we can access from the plugin to allow developers to add a new route to the decky loader server. I want to serve up static content like images and PDFs to be made available in my plugin.

Further Description

decky_plugin.loader.register_path(route_path, local_path)
decky_plugin.loader..unregister_route(route_path)

or something to that effect. I'll leave the implementation details up to the team, this is just a suggestion to get started and is by no means a prescription.

The route should be nested inside the plugin's route similar to how the assets are done:

web.get("/plugins/{plugin_name}/assets/{path:.*}", self.handle_plugin_frontend_assets)

except for a custom path that gets supplied from the plugin itself.

From looking at the code the simplest thing would be to pass a reference into the plugin when it gets loaded to a backend object that contains these methods that could patch this into the backend/loader.py server. I'm not sure if python supports interfaces or virtual classes but that would be the mechanism I'd be looking at using to expose only a limited set of functions or methods to the developer. If this is done properly it will lay the foundation for communication to the plugin manager from plugins and potentially cross plugin communication in the future.

While it might be simple to spin up a simple web server in the plugin, this is going to become a problem very quickly if every plugin does this, if there's 50 plugins doing this there will be 50 web servers and 50 different open ports.

@ebenbruyns ebenbruyns added the feature request a request for a feature, no guarantee of addition label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request a request for a feature, no guarantee of addition
Projects
Status: Under Consideration
Development

No branches or pull requests

1 participant