-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Adding the basics of a plugin system (WIP) #269
base: master
Are you sure you want to change the base?
Conversation
We are able to detect valid plugins and call teir init method. pumpkin_plugin contains a sample plugin. Functinality needs to be documented.
I came across Hyperlight and I think this might be the way to go for a plugin system.
Visit the Hyperlight repo for more information. Since a goal of the project is security, I think hyperlight could help safely load plugins and execute them. Looking at the README, it seems like Hyperlight is pretty easy to use and doesn't require unsafe rust. It should also be pretty easy to create a wrapper crate around hyperlight for plugins to use. DrawbacksSeems like this project is active and these drawbacks might not be valid over time.
|
It could be implemented, but with the MacOS hypervisor, you can only have 1 hypervisor running per process... If you don't want to click the link:
You could probably abuse this by spawning a process per plugin, but I don't feel right when I hear "spawn a process for each plugin so we use a hypervisor to virtualize the plugin"... |
Hello. I'm against using an .zip or similar archives to package a Plugin with multiple binaries for all Operating Systems.
The Solution i would use is to just put in the compiled Plugin binaries into the Plugins folder and then Check if the current Platform can load these Plugins. To address @neeleshpoli
Yes, Not using a Runtime does give Plugins developers more access to the machine, Which can results in some Security concerns. Hover there are ways to limit the permissions. One example would be to use |
In reply to @Snowiiii
My Idea, with one universal archive, was to remove complexity on the using site of plugins. Because in my mind, the one developing Plugins is more experienced with what is needed for different architectures to work, then the Kid randomly downloading TNT Pranks with their friends. I see how it makes the final plugin more bloated, though. Regarding a microVM, I took a brief look at the proposed package but very quickly came to the resolution, that it only complicates a streamlined process and adds indirection, removing the benefit of rusts powerful type system and borrow checker. I am also of the opinion that it is not our responsibility to ensure others can't expose a plugin. I agree that we should put measures in place for hardening the process, but never should we sacrifice other aspects of a fast and easy to use API for that. |
Why not just use .rlib |
Doesn't rlib have an unstable ABI? Also, it seems like it's very difficult to use .rlib files directly in code |
Why not lock out the pr*priet*ry plugins and execute the source code instead of the binary? |
I think will be good use all options: |
.rlib can't be used as it being a statically link library type as far as I am aware |
|
Plugin developers will just write a small source-available part of the code purely to load their proprietary binary that does the bulk of the plugin's work :( I don't think there's much we can do to avoid people from writing proprietary plugins |
This is not a good idea, since plugins need to be compiled on every server now before they are executed (assuming the plugins are coded in rust). This means every server owner would need to install rust and cargo, and the necessary toolchains. This introduces a level of complexity that server owners shouldn't have to deal with. I understand you might dislike proprietary software, but ultimately, it's the decision of the plugin developer to make it open source or proprietary and the decision of server owners on whether they trust a proprietary plugin or not. |
Solution: 1,000 more Open Source things instead of those 1,000 others just being proprietary plugins. |
Actually, you could still use binaries anyways but just change the license to AGPL and it would be illegal under US copyright to make it proprietary, can't just open source a "proxy" plugin that allows you to interact with the plugin interface under AGPL and then use it in a proprietary plugin, as you have to either keep it AGPL or stop interacting with it entirely. |
I don't think we have the necessary resources to chase down copyright issues. Even Bukkit is GPL yet plenty of plugins developed for it are closed source, DRM, etc. Bukkit was basically the only server people were using back then, and still chose not to fight plugins clearly breaching GPL. AGPL in particular is a fantastic license though it won't work for Pumpkin. To my understanding it would require server owners to share the source code of any changes they made to Pumpkin + all of the plugins they're using. It'll scare away big servers from using Pumpkin, and the rest will just ignore the license completely.
+1. The only time I would agree with a source-distribution solution would be with scripting languages, e.g., Lua, which are always distributed in source form anyways
This is why I'm all for some type of plugin system that runs in a VM. Gives the server admins some safety from some malicious or poorly written plugins. There have also been cases where plugins claim git repo is their source code but actually distributes a malicious binary with slightly altered code. |
GPL worked for Bukkit, GPL could work for us, but the only difference between AGPL and GPL is that AGPL counts network use as distribution. Also, I don't think plugins are counted as modifications.
|
being FOSS definitely worked great for Bukkit – but I don't think the GPL's legal requirements are being adhered to, so it may as well be effectively MIT |
Is there a discussion about forbidding closed sourced Plugins ?. Or what is this licensing talk about ?. Plugin developers should be able to decide their own if they want to publish the source code or not. I have also high interest making a Plugin Marketplace for Pumpkin, There developers can Publish free but also paid plugins. For Paid plugins it only makes sense to have them closed source |
Pretty much forbidding closed source plugins. |
We are able to detect valid plugins and call their init method. pumpkin_plugin contains a sample plugin.
Functionality needs to be documented.
More to come. Open for discussion.
Description
Testing
Checklist
Things need to be done before this Pull Request can be merged.
cargo clippy