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

Adds support for plugins #3645

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

jhmaverick
Copy link
Contributor

This feature will allow developers to create their own features for Hestia without having to create a fork and change the source code.

Features:

  • Plugins can be used to add new pages to the web panel and scripts to Hestia's bin directory;
  • Installation can be done using Github repositories, zips or local directories (From the panel it is only possible to install using Github repositories);
  • Each plugin can have hooks that will be called in its lifecycle in Hestia (when installing, enabling, disabling and uninstalling);

Changes to Hestia:

  • Adds new scripts to manage plugins via command line;
  • Web interface for managing plugins;
  • Adds actions and filters to the panel to allow plugins to change Hestia's default behavior;
  • Adds new rendering functions to allow plugins to load templates outside of Hestia's template directory;

Plugin Example

Copy link
Member

@jaapmarcus jaapmarcus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jq should be already instead by default as it is an dependency set 10 months ago. So it should never been installed. Also during updates it self you can't never run apt install as it will break the update process...

773db54

The main issue how are we going to handle upgrades in the future. If we introduce a feature that has the same name as /bin/plugin-script has it might create conflicts that are impossible to solve without user intervention making auto upgrades impossible.

It needs to be properly tested...

install/upgrade/versions/1.8.0.sh Outdated Show resolved Hide resolved
web/templates/pages/list_plugin.php Outdated Show resolved Hide resolved
web/templates/pages/list_plugin.php Outdated Show resolved Hide resolved
@jaapmarcus
Copy link
Member

Drone will fail btw have setup ipv6 that Hestia currently doesn't support for other branches testing...

* Changes the installer so that only scripts prefixed with "v-plugin-" are added to the bin directory;
* Looks for script conflicts when installing a plugin;
* Adds translation for texts on the listing page.
@jhmaverick
Copy link
Contributor Author

I fixed these issues and for the scripts, I added a check so that they are added in the bin directory only if they start with the "v-plugin-" prefix, this should prevent future Hestia scripts from conflicting with plugin scripts. I also added an installation check to prevent the plugin from being installed if one of your scripts conflicts with the script of another plugin already installed.

@jaapmarcus jaapmarcus self-requested a review June 1, 2023 23:09
* Validates Plugin URL
* Fix active page check in menus
* Fix help menu link
@Steveorevo
Copy link
Contributor

Steveorevo commented Jun 28, 2023

You might want to check out my pluginable project for some other ideas. There is a bunch of notable plugins I've authored to use it. I think one item to consider is the "WordPress-like" filter that allows not just adding additional pages; but amending existing pages. I.e. the VSCode plugin adds an icon for each web domain to get it's own unique project editor, the MailCatcher plugin adds a MailCatcher button to the edit_web screen, etc.

@jhmaverick
Copy link
Contributor Author

I have already added to this feature a system of filters and actions very similar to that of wordpress, but for now it is only being used for menus, css and js. But the community can apply it in other places as needed.

@Fameing
Copy link

Fameing commented Aug 11, 2023

Hi All, will there be any further moves in this direction?

@jhmaverick
Copy link
Contributor Author

Since the last interaction, I haven't received any further updates on whether the feature will be accepted or not. However, they did mention this pull request in an issue, so I believe they must be at least considering incorporating it into the project.

@Anuril
Copy link
Contributor

Anuril commented Apr 3, 2024

This looks very good to me, and I'd love for it to proceed. @jaapmarcus - What can we do to complete testing?

@jhmaverick - For sure it would be great if drone would build it correctly - as well as if the updated code from mainwould be incorporated. I understand that updating the PR with main will take some work due to the nature of the changes you implemented, but I'm willing to put some time into testing and would like to see this in the next minor release for hestia.

@Anuril Anuril mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants