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

[GSoC 2024] Plugin Manager Dialog #3358

Open
veermetri05 opened this issue May 14, 2024 · 2 comments
Open

[GSoC 2024] Plugin Manager Dialog #3358

veermetri05 opened this issue May 14, 2024 · 2 comments
Labels
GSoC Gsoc Idea/Proposal Plugins

Comments

@veermetri05
Copy link
Contributor

veermetri05 commented May 14, 2024

Synfig already has support for executing plugins through Python Scripts. But the users are required to manually place the scripts in the plugin directory and thus increases friction for adoption of plugins.
A plugin manager dialog would allow the users to install, uninstall and hide/show the plugins. Through this interface the user need not to manually place the Python script, but instead just choose a Plugin installation file and let Synfig take care of it.

Benefits

Benefits for end users:

  • Make it convenient to install and uninstall plugins
  • Make it possible to update a plugin
  • Show/hide or enable/disable a plugin
  • Manage plugin related configuration through the Plugin Manager Dialog
  • Be able to learn more about the plugin (providing external links)

Benefits for Plugin Developers:

  • Be able to easily share their plugin to end users
  • Get user preferences through Plugin Manager Dialog
  • Be able to provide updates to a plugin, while maintaining user preferences
  • Make it easy to share your plugins through Git (remote repository)

Deliverables

GUI Deliverables:

  • A GUI for listing and managing plugins in Synfig (as shown below)
    image
    image

  • A GUI for managing Plugin Configuration
    image

Based on the information in the image, here is the markdown format for the documentation for developers:

Documentation for developers

  • How to package your plugin
  • How to get input user configuration
  • How to provide description about plugin to users
  • How to specify link
  • Define a default configuration file

Documentation for users

  • How to install a plugin (by loading zip file)
  • How to update a plugin
  • How to load a configuration file
  • How to uninstall a plugin
  • Categorise plugins into sections/categories to how in GUI
  • Export configuration file
  • Import configuration file
  • Reset configuration file
  • View folder in native File Explorer
  • How to view official website of Plugin Manufacturer

Project Details:

Plugin Manager

Project Implementation

The main part of the project implementation is to build a Plugin Manager interface where users have a GUI through which they will install and uninstall plugins, and be able to set any configuration for the plugin. This includes adding a Dialog Box with multiple tabs.

It will have 2 parts:

1. Plugin Manager

With this a user should be able to perform following operations:

  • Install a plugin from (zip) file
  • Uninstall a already installed plugin
  • Reset configuration to default
  • Install a plugin from Synfig's Plugin Directory Service

2. Plugin Configuration Window

With the configuration management window a user should be able to modify the configuration file of a plugin.

What is a configuration file?

This will be a XML/JSON defined file where developers could define preferences which user can choose from. Those chosen preferences will then be passed to the plugin through command line arguments.

Note: This feature might seem same as #2996, though they are very much similar in nature. The difference would be these preferences/configurations are choices that the user doesn't often change or in other words it should be used to define the behaviour of a plugin, rather than getting input for that one time execution.

This feature isn't replacement for #2996, but an additional feature for Plugin.

Defining the specifications for zip file

Right now the plugin is located in the Plugins Directory. Each plugin has a separate directory with a plugin.xml file which gives information about the plugin (plugin’s metadata). Containing name and which python program to execute. Also metadata about the plugin become possible due to #2996.
After discussing with the community we could come to a final file format specification for Synfig. Here are my ideas regarding specifications for Synfig Plugin

  1. Use a new file extension .sipz (Synfig Plugin Zip)
    Which would be just a zip file but giving it would be better to give it a new file name extension so that we can uniquely identify this as a Synfig Plugin and not just any ordinary zip file. Doing this will be beneficial for the security of users too. If it were just a zip file people would easily figure it out and they may set up and distribute malicious plugins. Thus using a new file extension would increase friction.

  2. Defining the structure of plugins
    We would need to define proper structure for the Plugin Directory

    1. It must contain “plugin.xml”
    2. It must contain “default_config.xml”
    3. At Least one executable program, etc

These rules will be checked while installation of a plugin, if a ‘sipz’ doesn’t
meet the requirements Synfig should reject the plugin and discard the installation.

Plugin Repository

This is a repository on a trusted server (maintained by Synfig). The idea for implementing the Plugin Repository is to maintain a list of plugins (in XML/JSON format) on a trusted server. This would contain following things:

  1. Name of Plugin
  2. Path to plugin
  3. Name of Author
  4. Link to Plugin page (containing documentation about the plugin, also useful if plugin’s link is not available).

Here, “Path to plugin” can be either of below

  1. Path to zip file (hosted by author, it is responsibility of the author to maintain
    availability of the file)
  2. Path to Git Repository of Plugin (the “main”/”master” directory should always
    be production ready)

All the validation should also be performed on plugins downloaded from Plugin Repository. If required we could also add more security measures like adding “SHA256” to the plugin repository and once downloaded from the link we could verify its integrity.

References:
Proposal: Proposal for Plugin Manager Dialog (350 hrs)
#2996
https://forums.synfig.org/t/how-to-distribute-plugins/13907
Ideas List — Synfig developers docs documentation


The above content is from my proposal. Soon, I will create a task list and share additional resources, which I will keep updating. Thank you Synfig community for this giving me this opportunity.

@rodolforg
Copy link
Contributor

I suggest to add at least two more metadata to plugin description:

  • minimum Synfig version (maybe maximum too if known)
  • minimum Python version (maybe ma too if known)

@BobSynfig BobSynfig changed the title [GSoC 2024] Plugin Manager Dialouge [GSoC 2024] Plugin Manager Dialog May 20, 2024
@BobSynfig BobSynfig added GSoC Gsoc Idea/Proposal Plugins labels May 20, 2024
@veermetri05
Copy link
Contributor Author

@rodolforg , thanks for the suggestion.

I am running a little later than my schedule. I will cover it up within this week.
Firstly let's begin by defining proper specifications and requirements for Plugin.

Defining a Plugin (from docs)
The Plugins feature allows users to run custom Python scripts directly from the Synfig Studio menu. Each script takes the .sif file as the first argument and will modify its contents in some way. After script execution finished, the file is automatically reopened back in Synfig Studio.

Structure of plugin

Plugin directory structure:

  • plugin.xml
  • default_config.xml
  • main.py

A new file format: .sipz (Synfig Plugin Zipped)
This is a zipped file containing the above files (will include more specific details, once I have a clear understanding of underlying working) (Ref: zstreambuf.cpp)

Here's an overview of how the installation will work.
Accept the sipz file.
Extract the content.
Check for the required files
Check if the required files are valid.
If everything is valid, then move the content to the plugins directory.

Community: Give me guidance and suggestions regarding this.
I will take a look at the code and start experimenting.

Questions that I need feedback from the community.

Where to access Plugin Manager Dialog?
Some possible options are:

  1. From preferences (a new tab named "Plugins")
  2. From the Plug-Ins Menu

I think we should go with the Plug-Ins menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC Gsoc Idea/Proposal Plugins
Projects
None yet
Development

No branches or pull requests

3 participants