Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Plugins #8
base: main
Are you sure you want to change the base?
Plugins #8
Changes from 5 commits
1f2b50b
4b88bf5
d1acc83
18dc550
31b17e3
c58c536
8d645e4
7b54dbf
cbca68c
686d0b9
ae503df
73cbcfd
5963ecb
22e4aef
208ca51
cbf1293
8191727
47d4e07
1ab9906
36a2e4f
2686c6b
ca648b9
8f3f589
cbc1783
1939905
8f3a62f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally since the code will be linked into lemmy, any plugin code is automatically AGPL. This means that an instance that has custom plugins must (theoretically) share the code for those plugins with its users. This should probably be mentioned in the docs (and here).
This is similar to Blender, where Blender having a GPL license is often confusing to plugin authors, who usually sell their plugins (but then also need to provide the code publicly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue about this: extism/extism#804
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer from extism was also very vague, so I assume that we as maintainers can decide which licensing restrictions apply to plugins. Ive added a section specifying that plugins can use any license including proprietary, otherwise it would not be possible to integrate with proprietary libraries like ios/android push notifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't most FCM libraries MIT? Proprietary licenses on API libraries would create havok with enterprise adoption.
While I agree that extism's response says to allow anything (that is my understanding as well, and while I'm also not a lawyer, I have helped author licenses), I personally prefer the Blender method.
Lemmy could get trapped into a closed-source ecosystem if one plugin gets really popular. For instance, what if BlueSky builds a proprietary pre-compiled connector and a large instance begins using it, and thus all others follow?
Perhaps this is OK by maintainers since it is the spirit of free and open, but myself, an N of one, isn't a fan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elaborated on the licensing: extism/extism#804 (comment)
Any GPL 3.0 compatible code can be included in a plugin, see: https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
And any GPL 3.0 code (and "GPL 2.0 and later" code can be treated as such) can be included in an AGPL 3 license (though plain GPL 2.0 can't), see: https://www.gnu.org/licenses/gpl-3.0.html#section13 / https://www.gnu.org/licenses/agpl-3.0.html#section13
I don't think a plugin will be able to use code under an incompatible license, a non-free license or a proprietary license and I think the plugin will have to be licensed as AGPL 3.0 itself (or maybe as GPL 3.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phiresky The difference here is AGPL vs GPL. They both allow selling the code but they differ in when the source code needs to be made available – AGPL requiring anyone interacting with the software over a network to be offered the source code.
People buying a Blender plugin are legally allowed to request the source code and to spread it, but not everyone that uses what they build using Blender.
Anyone running a Lemmy server needs to offer all the code of their Lemmy server to anyone requesting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why for a similarly modularized piece of software, we have chosen LGPL so modules can be either free or proprietary as the integrator sees fit. Then it's sufficient to provide the object code of the proprietary library as long as it can be ran/linked after making your changes to the published source in FOSS modules or the FOSS core and recompiling the whole thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you are right, the SDKs for push notifications which I found (Google Firebase and Microsoft Azure) are under Apache license. So I changed the section to allow any OSI-approved open source license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something that might be a problem is plugins and their dependencies can't be GPL unless they use the same GPL version as Lemmy, since Lemmy doesn't specify "or later" (LemmyNet/lemmy#5133). Unless plugins are somehow implemented in a way that GPL doesn't interpret as linking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dullbananas The general conclusion by most others than me here seems to be that there are no such GPL limitations for plugins :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we define the concept of plugin metadata from the start. Each plugin could be annotated by one or more of the following fields, inspired by apt (see also: other package managers):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note about metadata near the beginning under File Structure. Though I want to keep it simple with only a few fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically it would be great if it was possible to externalize core code into plugins - both for separation of concerns, as well as to ensure the plugin structure is performant and complete. Practically it might be too much effort and for many things impossible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once people start writing plugins, I could see it going in the opposite direction. A plugin becomes so popular that most instances use it, that we realize its an important enough feature that we should add it into lemmy core. That way everyone could use it without having to host a variety of plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also makes sense, added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts on how login plugins would work under this? For instance OIDC connectors (with overriding server usernames).
I admit I'm slightly biased here being on the FedID.me team and trying to bring federated and distributed credentials into existence ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends what those plugins need to do exactly. If they need extra database tables and api endpoints like LemmyNet/lemmy#4881 then it would be quite complicated. I definitely want to leave such things out of the initial implementation, and keep it simple for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, no API endpoints per-se, but likely something DB related to connect the local username to the OpenID identifier, similar to how Mastodon does it. (We just started experimenting with a FedID implementation with Mastodon via OIDC now.)
It's possible this information could be saved externally for Lemmy, so I'll start considering that.